# Thread: Expected number of bounces

1. ## Expected number of bounces

Say we have the following scenario:

A ball is bouncing forth and back between two parallel walls, located at a distance from each other so that the ball (which is always moving parallel to the normal of the walls) will have to travel one meter to get from one wall to the other. In each bounce the ball will get a new speed by the wall it is bouncing on, which is uniformly distributed between 0 and 1 meter per second. The velocity is of course directed against the other wall from where the ball is located.

At time $t_0$ the ball bounces against one of the walls. What is the expected number of bounces the ball will make after $t_0$ if the ball is stopped after ten seconds?

2. Let N be the number of bounces.

Then N is such that $X_1+\dots+X_{N-1}<10$ and $X_1+\dots+X_N>10$, where $X_i$ denotes the speed at which the ball travelled before the i-th bounce.
(In particular, $X_i$ are iid and following a uniform distribution over (0,1))

Does it help ? I must say I don't have much time, and haven't finished the problem yet, so I hope you can do some things with that.

3. Originally Posted by Moo
... where $X_i$ denotes the distance (or the speed, they're the same number) the ball travelled.
No they are not the same, the distance it travels is always 1 [m], while the speed is uniformly distributed between 0 and 1 [m/s].

4. Sorry, I edited. I hope it's clearer...

5. I have made some work with this problem, and this is what I have found.

We will first define the function E(t), as the expected number of bounces after t seconds. Of course, $E(t) = 0,\text{ if }t \leq 1,$ since 1 second is the least amount of time the ball can take to travel from one wall to the other. But what about if t > 1?

Suppose that we call the speed of the ball s. The time $\Delta t$ it takes for the ball to travel between the two walls is 1/s. If $\Delta t < t$, then the ball will reach the other wall and bounce on it. $\Delta t < t$ in turn yields that s > 1/t. If s < 1/t, the ball will not bounce even once. But if s is between 1/t and 1, it will bounce, and the expected number of bounces after that bounce will be $E(t-\Delta t)$ (since $t-\Delta t$ is the time the ball has left), making the expected total number bounces $1+E(t-\Delta t)=1+E(t-1/s)$.

Let's define the functin E(t, s) to be the expected number of bounces after t seconds, if we know that the initial speed will be s. We then have:

$E(t,s)=\left\{\begin{array}{ll}
0,&\text{if }t<1\text{ or }s < 1/t\\
1+E(t-1/s),&\text{otherwise}
\end{array}\right.$

Also, since s is uniformly distributed between 0 and 1, we can conclude that $E(t)=\int_0^1 E(t,s)ds,$ wich gives (by substitution):

$E(t)=\left\{\begin{array}{ll}
0,&\text{if }t<1\\ \\
\displaystyle{\int_{1/t}^1 (1+E(t-1/s))ds},&\text{otherwise}
\end{array}\right.$

which can be rewritten as

$E(t)=\left\{\begin{array}{ll}
0,&\text{if }t<1\\ \\
\displaystyle{1-\frac{1}{t}+\int_{1/t}^1 E(t-1/s)ds},&\text{otherwise}
\end{array}\right.$

This is not a very nice function. Although E will be continuous, it's derivative won't be continuous since after t=1. It's second derivative won't be continuous since after t=2, etc. The best shot is probably to approximate the function numerically. It may also be possible to solve it separatelly for $n < t \leq n+1$, and iterate n over the natural numbers. I doubt it works very well for large n though, since each expression builds on all n-1 previous expressions for E, and will probably look very bad just after a few iterations.

6. Originally Posted by Moo
Sorry, I edited. I hope it's clearer...
One of the first things you should check when you have put up an equation and you are not really sure whether it holds or not, is if the two sides have matching units. In your case, $X_i$ represents a speed [m/s] while the number 10 represents a time interval [s], you therefore have a unit mismatch and you can't compare the two sides.