3 trams are coming every 10, 15 and 15 minutes. On average, how long do I have to wait for any tram to come?

There are (at least) three reasonable probability models for this problem: (a) the Poisson process model (see heropup's answer), (b) the assumption that the trams arrive on time according to a scheme known to the user (for examples see PhiNotPi's and user1008646's answers), and (c) the assumption that the trams arrive on time with unknown but equidistributed phases. In the following I shall treat model (c).

Model (c) is equivalent to the following: A random point $P=(X,Y,Z)$ is chosen in the block $$B:=\{(x,y,z)\>|\>0\leq x\leq15,\ 0\leq y\leq 15,\ 0\leq z\leq 10\}\ .$$ The waiting time $T$ is then given by $T=\min\{X,Y,Z\}$. The points $P$ with waiting time between $t$ and $t+dt$ are lying in the union of three rectangular panels of thickness $dt$ and having a distance $t$ from the planes $x=0$, $y=0$, and $z=0$ respectively. The area of the two vertical panels is $(10-t)(15-t)$, and the area of the horizontal one is $(15-t)(15-t)$. It follows that the probability distribution function $f_T$ of the waiting time is given by $$f_T(t)={1\over2250}(525-80t+3t^2)\qquad(0\leq t\leq10)\ .$$ From this we obtain the expected waiting time as $$E(T)=\int_0^{10} t\>f_T(t)\ dt={85\over27}\ .$$


EDIT: When in doubt, simulate!

I wrote the following Mathematica program (it gets the job done, but I'm somewhat a Mathematica novice).

a = {};
Do[b = RandomReal[]*15; c = RandomReal[]*15; 
 a = Append[a, 
   ContraharmonicMean[
    Differences[Sort[{0, 10, 20, 30, b, b + 15, c, c + 15}]]/
     2]], {100000}]
Print[Mean[a]]
Print[StandardDeviation[a]]

Basically, it creates a random offset for the two 15-minute trams, calculates the length of the intervals and wait time, and finds the weighted average. It then repeats this $100000$ times.

The results were $3.147327637397844$ for the mean and $0.33480521158615867$ for the standard deviation. The $95\%$ confidence interval is (if I did by math correctly) about $3.145,3.149$. (Note that this was the average wait time, so the average interval is twice this.)

EDIT: An attempt to simulate to find the minimum average resulted in $2.66667$. This agrees perfectly with user1008646's answer, which I believe gives one type of ideal schedule.


Original answer:

I'm making the assumption that the trams all start together, like so:

1: @.........@.........@.........@.........@.........@.........@
2: @..............@..............@..............@..............@
3: @..............@..............@..............@..............@
   time->

From this, we can see that there is a repeating pattern composed of two 10-minute gaps and two 5-minute gaps.

The 10-minute gaps give an average wait time of 5 minutes, while the 5-minute gaps give an average wait time of 2.5 minutes. You are twice as likely to be stuck in a 10-minute gap than in a 5-minute gap, so the weighted average is:

$$5 \times \frac{2}3 + 2.5 \times \frac{1}3 = \frac{25}6$$

So the average wait time is about 4 minutes 10 seconds.

If the trams have a staggered start, then the average wait would be shorter.


A statistical method is to model the random arrival time of the trains as three Poisson processes. Thus, the interarrival times of each train are IID exponential random variables $X_1$, $X_2$, $X_3$ with means $\mu_1$, $\mu_2$, $\mu_3$. The random waiting time until the first train's arrival is the minimum (first) order statistic $X_{(1)}$. We see that this has probability distribution $$F_{X_{(1)}}(x) = \Pr[X_{(1)} \le x] = 1 - \prod_{i=1}^3 \Pr[X_i > x] = 1 - e^{-Kx},$$ where $K = \mu_1^{-1} + \mu_2^{-1} + \mu_3^{-1}.$ Thus the minimum order statistic is also exponential with mean $1/K$, hence the mean arrival time of the first train is $1/(\mu_1^{-1} + \mu_2^{-1} + \mu_3^{-1})$. For $\mu_1 = 10$, $\mu_2 = 15$, $\mu_3 = 15$, we immediately get ${\rm E}[X_{(1)}] = \frac{30}{7}$.

Moreover, we can see that the sum of $n$ independent (homogeneous) Poisson processes with rates $\lambda_1, \lambda_2, \ldots, \lambda_n$ is itself a Poisson process with rate equal to the sum of the individual rates. So, the mean waiting time for the next event is $\left( \sum_{i=1}^n \lambda_i \right)^{\!\!-1}.$