Skip to main content
AP CSP course

F06 · Topic 2.3 · 2.4

School transport data inquiry

Clean a documented synthetic trip table, compare cleaning policies and qualify a transport claim. Work from the metadata before calculating.

1. Predict first

Rows are A/walk 12, B/bus 18, C/bus 24, C/bus 24 duplicate, D/walk missing, E/bus 48 minutes. One row per trip is intended. Predict the valid count, overall mean and bus mean after deduplication and excluding missing times.

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 1deduplicateWaiting
  2. Input 2excludeWaiting

Ready to experiment

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

Try this: Change only one cleaning policy. Which numerator or denominator changes?

2. Build your procedure

Write a cleaning log and a procedure that deduplicates by trip ID, excludes missing time from numerical summaries and computes count, sum and means. Explain what is lost by excluding a row.

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
Deduplicate; exclude missing4 valid rows; overall 25.5; bus 30The intended analytical policy.
Keep duplicate; exclude missing5 valid rows; overall 25.2; bus 28.5The duplicate changes weights.
Deduplicate; missing as 05 rows; overall 20.4; bus 30Inventing a zero lowers the mean.

4. Explain and reflect

Does a longer bus mean prove taking the bus causes longer travel for a student? Name an additional variable and a better-qualified claim.

Model limits: A small fixed synthetic dataset. This is not real transport evidence, and policy comparisons do not establish causal effects.

Teacher guidance and scoring