Skip to main content
AP CSP course

F20 · Topic 3.17

Growth laboratory

Compare exact operation counts for stated loop models as input grows; use the results to distinguish polynomial growth, practical limits and heuristics.

1. Predict first

Predict the effect of doubling n from 8 to 16 on n, n² and 2ⁿ.

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 18Waiting

Ready to experiment

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

Try this: Compare n=4, 8 and 16. Read exact labels when a small bar becomes hard to see.

2. Build your procedure

Write one linear and one quadratic loop and identify the counted body operation. Explain why two separate loops are not equivalent to nested loops.

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
n4linear 4; quadratic 16; exponential 16Equal small counts do not establish equal growth.
n88;64;256Separate the curves.
n1616;256;65,536Exponential growth dominates asn increases.

4. Explain and reflect

Why does this count table not predict seconds on every machine?

Model limits: Counts are calculated formulas for bounded input sizes, not timings and not execution of arbitrary student algorithms.

Teacher guidance and scoring