Imagine that I am working in a fire station. For the truck to leave, I need all my firefighters. They receive their alarm at the same time. Their time to come to the station can be modelled as a random normal variable having the average $\mu_i$ and standard deviation $\sigma_i$.

Is it possible from those values to determine the average waiting time for the truck to leave and its standard deviation?

Edit on 15/05:

I tried to compute it the following (wrong) way: I can compute the probability that each variable is greater than another one $P(A-B>0) = 1-CDF(0;\mu_A - \mu_b; \sqrt{\sigma_A ^2 + \sigma_B ^2})$. Next step I do is to compute this for every possible pair. I then compute the probability that a given variable is the maximum value $P(max = A) = P(A-B>0) \times P(A-C>0) \times ...$.

From there, I thought that I could determine the average time to wait as $P(max = A) \times \mu_A + P(max = B) \times B + ...$.

This is wrong because if all random variable are equals, the sum of all $P(max = .)$ is not 1.

I don't know what is wrong exactly, but I get the feeling that I may have to take into account the fact that two variable can be equal to each other. But in such case, I don't have a real intuition on how this should be taken into account.

  • $\begingroup$ Note that a random normal variable might get negative values. A rectified normal variable might be better to model the problem. But anyway, are you asking your question for a specific distribution, or for any kind of distribution ? $\endgroup$ – AshOfFire May 14 '18 at 9:14
  • $\begingroup$ Indeed, a rectified normal variable models the problem better $\endgroup$ – B.Vanhamme May 14 '18 at 10:12

One generic solution would consist in running a significant amount of simulations and calculate the resulting averages and standard deviations of your experiments.

Example with R code and three rectified normal distributions.

sim <- data.frame(apply(data.frame(a = rnorm(100000,3,1), # simulate normal distributions
                                   b = rnorm(100000,5,2), 
                                   c = rnorm(100000,6,4)), 2, 
                                   function(x) ifelse(x > 0, x, 0))) # rectify
sim$final <- apply(sim, 1, max) # final results corresponds to last arrival
# 7.395576
# 2.75843

Obviously, you will need to run this simulation a couple of times to get a reliable estimation of average/standard deviation.

  • $\begingroup$ This is indeed a nice pragmatic solution. However, it is too computationally expensive for my case. $\endgroup$ – B.Vanhamme May 14 '18 at 10:15
  • $\begingroup$ Really ? This script did not even take a second on a 8GB RAM machine. $\endgroup$ – AshOfFire May 14 '18 at 10:23
  • $\begingroup$ This problem will rise extremely often and therefore, the faster the solution, the better. $\endgroup$ – B.Vanhamme May 14 '18 at 11:10
  • $\begingroup$ This feels like a job for the weibull. Since the truck can’t leave until full, it’s an extreme value distribution. $\endgroup$ – HEITZ May 14 '18 at 22:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.