Mathematics · Simulator 047
Choose a probability distribution (normal, binomial, Poisson, exponential, uniform), set its parameters, and draw random samples. Watch the histogram fill in and settle onto the theoretical shape as the sample grows.
Class 11–12CollegeClass 12 Maths: Probability
The histogram is scaled to a density (or probability for discrete distributions), so it can be compared directly with the theoretical curve. Sample statistics wander for small samples and converge as the sample grows (the law of large numbers). Samples use a seeded generator, so a run can be reproduced exactly.
Normal samples use the Box–Muller method; binomial and Poisson use direct simulation for modest parameters.
A call centre gets on average 3 calls per minute. What is the probability of no calls in a given minute, and what is the average gap between calls?
Calls per minute are Poisson(3): P(0) = e⁻³ ≈ 4.98%. The gaps are exponential with λ = 3 per minute, so the mean gap is 1/3 minute, 20 seconds. Check both with the Poisson and exponential settings.
Binomial: 20 multiple-choice guesses with a 0.3 chance each. Mean = np = 6, variance = np(1 − p) = 4.2, SD ≈ 2.05. The chance of getting none right is 0.7²⁰ ≈ 0.08%.
Poisson: a shop gets on average 3 customers a minute. P(0 in a minute) = e⁻³ ≈ 5%; P(exactly 2) = e⁻³ × 3² / 2! ≈ 22%.
Exponential: the waiting time between those customers averages 1/3 minute, 20 seconds.
Normal: heights with μ = 170 cm and σ = 10 cm. About 68% lie between 160 and 180 cm, 95% between 150 and 190, so only about 2.5% are taller than 190 cm.
Choose Binomial with n = 20, p = 0.3 and check that the sample mean settles near 6.
Binomial counts successes in a fixed number of yes/no trials, like heads in 20 tosses. Poisson counts rare events in a fixed time or space with no fixed maximum, like calls per hour.
For a normal distribution about 68% of values are within one standard deviation of the mean, 95% within two and 99.7% within three.
It is a sum of many independent yes/no trials, and by the central limit theorem sums of many independent pieces approach a bell curve. With n = 100, p = 0.5 it is almost exactly normal.