In this Demonstration, you can set the number of coin flips per trial to 5,
10 or 20, and the number of heads is recorded. Set the total number of
trials (from 1 to 10,000) with a button. When the probability of heads is
50%, the distribution closely resembles a normal distribution as the number
of trials and the number of coin flips per trial increase. As the sample
size increases, the distribution more closely resembles a true binomial
distribution. Make a weighted coin by changing the probability of landing
on heads using the slider; 0% means the coin always lands on tails and 100%
means the coin always lands on heads. Click "flip coins" to generate a new
set of coin flips. Use buttons to view a bar chart of the coin flips, the
probability distribution (also known as the probability mass function), or
the binomial distribution. The probability mass function is the number of
flips in a trial that resulted in x heads divided by the number of
flips.
×
Details
To generate the bar graph, first a list is made of 100 possible outcomes. A
"1" in the list means heads and a "0" means tails. If the probability of
flipping heads is 50%, then the list contains 50 ones and 50 zeros. If the
probability of flipping heads is 70%, then the list contains 70 ones and 30
zeros. Numbers are then randomly selected from the list. If 5 is selected
for "coin flips per trial," then a number is selected from the list five
times, and these numbers are summed. For example, for five flips in a
trial, if the random numbers selected from the list are 1, 0, 0, 1, 1, then
the number of heads in that trial is three. This process is repeated for
each trial.
×
About
This simulation was created in the
Department
of Chemical and Biological Engineering at University of Colorado
Boulder for LearnChemE.com by John L. Falconer using Claude AI. It
is a JavaScript/HTML5 implementation of a
Mathematica simulation by Adam J.
Johnston, Rachael L. Baumann, and John L. Falconer. It was prepared with
financial support from the National Science Foundation (DUE 2336987 and
2336988). Address any
questions or comments to LearnChemE@gmail.com.
⚠️ Simulation Under ReviewThis content is still being reviewed for quality and accuracy and may be updated in the future. Feel free to send us feedback.