Here is the original with a copy of the histogram.
The following curve was applied to this image to bring it back to what it would have looked like before the camera applied its gamma correction.
This has made the image a lot darker with the histogram bunched up to the left.
The key part to note here is that the majority of the available levels above in the histogram are used in the brighter part of the image, this part of the histogram that is in the right half. This means that there is less available for the darker tones to work with that are all scrunched up on the left, this leads to lesser sampling which will introduce artificial effects such as noise.
By applying the following curve we are emulating the processing of the camera to the linear image. This has restored the image to something near the original, but during the process has introduced additional noise in the areas that it has boosted, notably the shadows.
Although these changes were made with a 16 bit resolution an interesting point to note that is not mentioned in the notes is that the number of samples on the left (shadows) is now significantly reduced, and will therefore inherently introduce unwanted effects.