💻ap computer science a review

Probability comparison

Written by the Fiveable Content Team • Last updated August 2025
Verified for the 2027 exam
Verified for the 2027 examWritten by the Fiveable Content Team • Last updated August 2025

Definition

A conditional statement that divides the range of a random value to implement a specific probability outcome, such as comparing Math.random() to 0.05 to create a 5% chance event.

AP course connection

Topic 2.3: 2.3 If Statements and Control Flow

Unit 2

"Probability comparison" also found in: