created: 07/31/07; revised 10/22/08
Programs frequently need random numbers.
A card game uses random numbers to create a shuffled deck of cards.
A dice game uses random numbers to simulate a throw.
Many activities in the real world (such as traffic on a highway system)
appear to be random, and a program that models them uses random numbers.
This chapter discusses the
Random class that comes with Java.
Random numbers, probability, and statistics are important for testing, for modeling the world, and for general understanding of the universe. Computer science degree programs usually require a course in these subjects.
What number is most likely outcome for a throw of a fair die?