GenerateRandomSearch

Binomial Experiment Simulator

Twenty coin tosses give ten heads on average — but how often do you actually get ten, and how often fifteen? Running it once tells you nothing. Running it four thousand times draws the answer as a shape, and the shape is the thing worth understanding. This repeats a fixed run of trials as many times as you like and shows where the counts pile up, with the theoretical mean and spread printed beside the observed ones so you can see how close a finite experiment gets.

What this generator does

Simulates the whole experiment repeatedly and histograms the results. The theoretical mean is the number of trials times the success probability, and the theoretical spread is the square root of n times p times one minus p — both printed next to what actually happened, because the difference between them is the thing being demonstrated.

How to use this tool

  1. Set how many trials make up one experiment and the chance each succeeds.
  2. Choose how many times to repeat the whole thing.
  3. Run it, then compare the observed mean against the theoretical one.
  4. Increase the repetitions and watch the gap close.

Understanding the controls

Trials per repetition
How many attempts make up one experiment. Twenty coin tosses is one experiment; the distribution is over many of those.
Chance of success
The probability a single trial succeeds. At 50% the shape is symmetric; away from it the distribution leans.
Repetitions
How many times the whole experiment runs. Ten gives a ragged shape, ten thousand a smooth one — and watching that change is instructive.
Seed
Any word reproduces the same run exactly, which is what a worked example needs.

Common use cases

  • Seeing why an unusual run of results is not automatically suspicious
  • Teaching the binomial distribution from data rather than a formula
  • Checking how often an outcome as extreme as yours occurs by chance
  • Showing that more repetitions tighten the estimate but not the distribution
  • Building intuition before reaching for a significance test

How this generator works

Each repetition performs the trials one at a time and counts successes, then the counts are histogrammed. Nothing is approximated: the simulation is a real repeated experiment rather than a draw from a fitted curve, which is why the observed figures wander around the theory instead of matching it.

Randomness and fairness

The counts are genuinely random, so two runs differ. The theoretical figures never do. Without a seed the draw uses the browser's cryptographically secure generator; with a seed a small deterministic one, which is reproducible and therefore explicitly not cryptographically secure.

For how randomness is produced across the whole site, see how Generate Random works.

Limitations and good to know

  • It simulates independent trials with a fixed probability. Real trials are often neither independent nor fixed.
  • Very large trial counts with tiny probabilities are better handled by the Poisson simulator, which is what it approximates.
  • The histogram bins are chosen automatically and are not adjustable.
  • Runs are not stored, so use a seed for anything you want to show twice.

Privacy and your data

The simulation runs entirely in your browser. No settings, seeds or generated counts are transmitted or kept between visits.