I want to follow the approach from Christian Blatter here
using "the assumption that the trams arrive on time with unknown but equidistributed phases. In the following I shall treat model". However, my theoretical result do not match my simulation result.
A random point $P=(X,Y)$ is chosen in the block $$B:=\{(x,y)\>|\>0\leq x\leq5,\ 0\leq y\leq 10,\}\ .$$ The waiting time $T$ is then given by $T=\min\{X,Y\}$.
The points $P$ with waiting time between $t$ and $t+dt$ is a panel of thickness $dt$ and having a distance $t$ from the planes $x=0$ and $y=0$. (Here the union of pairwise buses is one because there are only two buses.) The area of the panel is $(10-t)(5-t)$.
Therefore, the pdf $f_T$ of the waiting time is given by $$f_T(t)={1 \over 5 \cdot 10}(5-t) \cdot (10-t) \qquad(0\leq t\leq5)\ .$$ $$f_T(t)={1 \over 50}(50-15t+t^2) \qquad(0\leq t\leq5)\ .$$
From this we obtain the expected waiting time as $$E(T)=\int_0^{5} t \cdot f_T(t) dt= \int_0^{5} \frac{1}{50}[50t-15t^2+t^3] = \frac{1}{50}[50/2t^2-15/3t^3+1/4t^4)]^{5}_0 = 3.125.$$
However, from my simulation I get around 2.09, I guess that is 25/12:
I did a R simulation with the assumptions that buses arrive promptly every 5 and 10 minutes, respectively. However, the interval time among buses is fixed with uniformly distributed starting times. I simulate buses between [0,10000] minutes and the guy arriving at the bus stop at time t in [50,9950] and check the minimum time to next bus (which arrives first out of 2).
upperbound <- 10000
waitVector <- vector()
nbRuns <- 10000
for(count1 in 1:nbRuns) {
seq1 <- 10*runif(1) + seq(from=0,to=upperbound,by=10)
seq2 <- 5*runif(1) + seq(from=0,to=upperbound,by=5) # uniformly distributed, but fixed distance among both buses
seq3 <- sort(c(seq1,seq2))
arrivalTime <- runif(n=1,min=50,max=(upperbound-50))
minSeq <- seq3 - arrivalTime
minSeq <- minSeq[minSeq > 0] # cant catch bus who left before I arrived
minTime <- min(minSeq)
waitVector <- c(waitVector,minTime)
}
minAvgWaitTime <- mean(waitVector)
print(range(waitVector))
print(paste("Minimum avg wait time base on ",nbRuns," simulations is: ",minAvgWaitTime,sep=""))