## Probability distributions show up everywhere in science

A good example of them can be found in classical physics, in the case of a ball being dropped off a cliff. The problem is set up such that there is a camera placed to the side of the cliff which is programmed to take pictures at a random time during the ball’s descent.

### Where is the ball most likely to be in the photo?

Well, if we imagine the experiment repeated an arbitrary number of times, then intuitively the ball is more likely to appear
higher up the cliff than closer to ground level because we know that it accelerates as it falls toward the ground, meaning
that the lower the ball is, the faster it will be moving and the less time it will spend in any given area. It turns out that
the answer to our problem is that the *expectation value* of the distance travelled by the ball in the photo is ^{1}⁄_{3} times the
height of the cliff. The simulation below - which you may run by pressing the play button - confirms this as it performs the
experiment many times, indicating the position of the ball captured by the camera with a yellow ghost ball upon each iteration.
The program will print the average distance of the yellow balls from the top when it is finished running.

We can derive this result analytically by doing the following, which is good practice for quantum physics and any other field
that involves probability distributions. First we need an expression for the probability of finding the ball in the finite range
`$x+dx$`

: this is known as the probability density function. In this case, it is (quite intuitively) the amount of time spent in
this range divided by the total time of the journey (the fall), `$\frac{dt}{T}$`

. In other words,

Now, using classical physics, we can solve for T. Let’s call the height of the cliff H. Assuming, the initial velocity is 0,

Substituting into our equation for the probability density, we can find the explicit form of the probability density function.

In the end, we want an equation for the probability density function in terms of x. We know `$dx/dt$`

is the speed of the ball,
which is given by `$dx/dt = v = gt$`

, where `$t = \sqrt{\frac{2x}{g}}$`

, so substituting for t and plugging into our
equation for the probability density function we get

To get the probability of the ball being in a location from A to B, we integrate `$P(x)$`

with respect to x using A and B as
the integration limits. However, to obtain the average observed value of x, we integrate x over the whole range of possible x values
and weigh each value of x with its corresponding probability. The limits of this integration are 0 and the height of the cliff
since beyond these limits the probability of the ball being there is 0. (This is a classical description for the time being: in
quantum mechanics this intuitive assumption isn’t true.) In other words,

So, as expected, the average distance travelled by the ball before the photo is taken is 1/3rd the height of the cliff, so its position is more likely to be closer to the top than to the bottom of the cliff in the photo, which is confirmed by the python simulation above.