Random Numbers

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to previous page   go to home page   hear noise   go to next page

Answer:

Each number 1 through 6 is equally likely.

Random Numbers

game spinner

A single die can be regarded as a random number generator, where a single number is selected from a range (1 through 6) and each number is equally likely. The same is true for a second throw of the die. The outcome of the first throw does not affect the outcome of the second throw (or any other throw).

If you throw a die many times, you will get a sequence of random numbers. Since each number is equally likely, you would expect each number to occur about as often as any other number. For example, if you threw the die 60 times, you would expect to see about 10 of each number. However, it would be unusual to see exactly 10 of each number. The die does not "remember" its previous outcomes and does nothing to catch up with numbers thay may have fallen short.

QUESTION 2:

A game spinner (say) has 12 divisions, numbered one through twelve. Which number is most likely?