What Is the Probability that Probability Is Correct? Can a Computer Generate Random Numbers Accurately?
CSEF · 2006 Mathematics & Software
Overview
Objectives/Goals My first objective was to see whether a computer using Java#s Math.random method can generate numbers as evenly as in real life events and as predicted by theoretical probability. My second objective was to see how sample size affects the distribution of random numbers. Methods/Materials I wrote two Java programs which used Math.random to generate random numbers that simulated real world events, flipping a coin and rolling a die. First, I simulated flipping a coin 1000 times and rolling a die 3600 times. I then flipped a coin and rolled a die the same number of times. I did two additional tests for my second objective. I flipped a coin ten times and rolled a die 36 times and modified the Java program to simulate a coin being flipped 10 and 100,000 times and a die being rolled 36 and 360,000 times. Lastly, I graphed and compared the data to reach my conclusions. Results The random number generator produced values whose percentages where closer to the expected theoretical percentage then when I physically rolled a die or flipped a coin. Also, in both the real life and computer randomness test, the larger sample sizes created values closer to the expected percentage. Conclusions/Discussion My conclusion is that the Math.random method can produce random numbers as accurately distributed as real life events. They are not true random numbers though since the random numbers produced are dependent on the seed value used to start the random number generator. I also concluded that when using both Math.random and real life randomness, the larger the sample size, the closer to the expected percentage the results will be.
Summary statement
My project was about determining if computers can generate random numbers as well as real world events and how sample size affects the number distribution.
Help received
Dad helped write Java programs.
Competition history
- CSEF 2006
Resources
Related projects
CSEF · 2006
Can a Computer Accurately Simulate Rolling Dice?
CSEF · 2013
The Randomness of Humans and Computers
CSEF · 2008
Generating Random Numbers
CSEF · 2005
Numbers, Numbers, Numbers
CSEF · 2002
What're the Odds? A Lesson in Probability
CSEF · 2007
Pseudo-Random Numbers
CSEF · 2007
Flip of a Coin, Roll of a Die, Turn of a Door: Is It Fair? A Study on Probabilities
CSEF · 2005
Looking Out for Number One: Do Random Number Generators Follow Benford's Law?
Closest projects by meaning, across every fair and year in the corpus.
Browse more like this
Source: California Science & Engineering Fair public projects