[Math] Train arrival probability

probability

I must (probably) solve a problem of similar kind in order to enter university in my country:

In a train station, between 8 and 10 in morning [why this time in the morning? Looks like a useless information to me], arrive on average 2 trains in a 20 minutes interval.
Determine the probability that in 20 minutes:

a) No trains arrive;

b) Exactly one train arrives;

c) At most 4 trains arrive

z) [Added by me out of curiosity, not part of the original problem] How much must you wait on average before a train arrives?

I can solve this via computer simulation, getting the answers, respectively:

a) 0.13425

b) 0.27142

c) 0.94793

z) 597.64011 (seconds)

Sadly in the exam no programmable electronic device is allowed, I can only use non-programmable calculator, how to solve this problem by Mathematical reasoning instead of simulation?

Here you can get the computer simulation and the problem statement in the original language (Italian)

Best Answer

Assume that the trains arrive completely independently of one another (this implies, for instance, that one train arriving within a specific second doesn't exclude another train arriving at the same second, and therefore, theoretically, any number of trains can arrive within any given second). In that case, what we have is a so-called Poisson process.

To get there, let's start with your second-division. If the trains truly cannot arrive within the same second, but are otherwise independent, then we can just look at the $1200$ $1$-second intervals in a $20$-minute period, and ask whether a train arrived or not. This would then give us a binomial distribution, with $n = 1200$, and expected value of $2$. That means that $p$, the probability of "success" (i.e. "a train arriving") for every given second is $\frac{2}{1200} = \frac{1}{600}$. For instance, our calculations for (b) would be $$ P(1\text{ train}) = \binom{1200}1\left(\frac{1}{600}\right)^1\left(\frac{599}{600}\right)^{1199} $$ and in general, for $k$ trains we get $$ P(k\text{ trains}) = \binom{1200}k\left(\frac{1}{600}\right)^k\left(\frac{599}{600}\right)^{1200 - k} $$ Now, let's divide it even smaller. Say we divide it into milliseconds instead. Then we have new binomial distribution with $n = 1\,200\,000$ and still with expectation value $2$, which means that our new $p$ becomes $\frac{1}{600\,000}$. Now the probability of exactly one train arriving becomes $$ P(1\text{ train}) = \binom{1\,200\,000}1\left(\frac{1}{600\,000}\right)^1 \left(\frac{599\,999}{600\,000}\right)^{1\,199\,999} $$ and in general, for $k$ trains $$ P(k\text{ trains}) = \binom{1\,200\,000}k\left(\frac{1}{600\,000}\right)^k \left(\frac{599\,999}{600\,000}\right)^{1\,200\,000-k} $$ Continuing this way, we can, with a small leap of faith, see that the true distribution if the trains are completely independent from one another, is $$ P(k \text{ trains}) = \lim_{n \to \infty}\binom{n}{k}\left(\frac{2}{n}\right)^k\left(1-\frac{2}{n}\right)^{n-k} $$ This turns out to become $\dfrac{2^k\cdot e^{-2}}{k!}$, which is a simple enough formula that you can calculate it with most calculators. This is called the Poisson distribution (note that the $2$ that is raised to the $k$-th power and the $2$ in the exponential both come from the $2$ trains you expect within a $20$-minute period).