2.6

Random Numbers

AP Computer Science A

Math.random() review

The Random class

Key Random methods

Random integers in a range (both approaches)

Working through examples

Coin flip simulator

Dice game

Random password generator

Common AP exam patterns

Pattern 1: Random element from an array

Pattern 2: Probability simulation

Pattern 3: Random within specific set

AP Exam Tips

Common Mistakes

Key Vocabulary