Mathematically, you can solve this problem using expected values. This demonstration showcases solving it using Monte Carlo simulation. The simulation lets you see the number of hours until freedom is reached for the specified number of simulation trials. The red dot on the histogram indicates the average number of hours. As the number of trials increases, the mean of the simulation results converges to the theoretical value (9.5 for the probabilities defined in the problem). You can also explore the option of the doors having equal probability and changing the number of hours for each tunnel.

]]>Users can select the minimum and maximum parameter values for the uniform distribution. By definition, the minimum is less than the maximum. The sample probability distribution is compared to the theoretical uniform distribution as you increase the sample size. In general, as the sample size increases, the more closely the sample distribution matches the theoretical distribution. The red dot shows the mean value for the theoretical distribution. The blue dot shows the mean value for the sampled distribution—they overlap when the distributions are close.

]]>If you were to flip a coin 10,000 times, you would expect the number of heads to be approximately equal to the number of tails when using a fair coin. The absolute difference plot can show quite large differences in absolute terms, , as the number of tosses increases. In comparison, the relative difference plot shows that in relative terms, , the difference converges to zero.

]]>In the demonstration, a user can select the minimum, mode, and maximum parameter values for the triangular distribution. By definition, the minimum < mode < maximum. The sample probability distribution is compared to the theoretical distribution as a user increases the sample size. In general, as the sample size increases, the more closely the sample distribution matches the theoretical distribution. The red dot shows the mean value for the theoretical distribution.

]]>