# Can we use average simulation results to predict an event with randomness?

The subject is quite ambiguous. Let me use an example to clarify.

For example, we have a patient booking schedule for a doctor, which specifies the schedule time for patients. There are so many randomness to affect how this day goes, such as patient arriving early/late, unexpected long visits, etc. Our goal is to predict the final ending time (the leave time for last patient).

Let's say we designed a simulation tool by considering all those randomness and we run this tool 100 iterations. In this way, we get a 100x1 vector a = [a1, a2, a3,..., a100], each of which is the returning ending time result for that simulation iteration.

The question is: what is our predict for ending time? I first though we should take the mean or median for this vector. Then I realized most likely I am wrong since a result for example [16, 16, 16, 17] will get a mean of 16.25 and I think in this case 16 should be the answer. Perhaps the answer is just the result occurs most in these 100 iterations, but how to mathematically formulate this? Thanks.

• What is wrong with a mean of $16.25$? For the purpose of scheduling, however, we might want to know the $90$th percentile ending time, or perhaps the $95$th percentile. If you go by median, half the time you will leave later than you planned, perhaps much later. How can you make dinner plans if half the time you will be too late? – David K Oct 18 '18 at 4:47
• As for the simulation tool, that is an often-used technique called Monte Carlo analysis. – David K Oct 18 '18 at 4:52
• @DavidK The prediction should project the ending time that has the largest probability. 3 out of 4 times it ends with 16 so the final result should also be 16. – MIMIGA Oct 18 '18 at 5:20
• Consider the waiting time for a bus that arrives after $X$ minutes, where $X$ has a geometric distribution with parameter $1/10.$ The waiting time with the largest probability is $1$ minute, but there's a $90\%$ chance you have to wait longer, and the mean waiting time is $10$ minutes. Would you still want the answer to be $1$? – David K Oct 18 '18 at 11:48
• If you must give a single number as the "predicted" ending time, there are many choices. Which one you choose will depend on what you want to do with the information. It is possible that "largest probability" is the correct answer, but you have to know why it's the correct answer, otherwise there's a good chance it's the wrong answer. If you want people to help you choose, you should give more background on what you need the answer for. – David K Oct 18 '18 at 11:51