Skip to main content
AP CSP course

F18 · Topic 3.15

Exact chance versus a trial stream

Enumerate a finite random range and compare its exact probability with a supplied, reproducible trial stream. Explain why the observed frequency can differ.

1. Predict first

For integers 1…10 and success≤3, predict the exact probability and expected successes in 20 independent trials.

Change it · step through · explain

Change an input, predict what will happen, then advance one step. Read why the state changes, reset and experiment. This fixed teaching model does not save progress or award XP.

Ready · Make a prediction

Ready to experiment
  1. Input 13Waiting

Ready to experiment

Why: Predict the first change, then advance one step.

Try this: Try thresholds 0 and 10. The supplied stream is deterministic, not randomly regenerated.

2. Build your procedure

Write a 20-trial simulator that counts successes for RANDOM(1,10)≤3 and displays successes/20. Specify initialization and loop placement.

Use AP CSP pseudocode, a language you know, or precise plain language. Your code is not executed here. Use the classroom assignment to save your response.

3. Check boundaries

Public worked tests for the fixed model
InputExpectedWhy this case
Range 1…10, threshold 33 successful values of 10; probability 0.3Inclusive range.
Range 1…10, threshold 00 of10Impossible event.
Range 1…10, threshold 1010 of10Certain event.

4. Explain and reflect

The fixed stream has four successes in ten entries. Does this invalidate the theoretical 3/10 probability?

Model limits: The supplied stream is deterministic for reproducibility. It demonstrates counting, not independent random sampling or secure randomness.

Teacher guidance and scoring