Skip to main content
AP CSP course

C47 · Topic 3.16 · 40 minutes · AAP-3.F

Model a queue with explicit assumptions

By the end you can:

  • State a queue model’s event order and assumptions.
  • Trace arrivals, service and remaining demand.
  • Explain one consequential omitted feature.

Before this lesson: topics 3.8, 3.15.

Simulation
A model that imitates selected features of a process.
Assumption
A condition treated as true by the model that may simplify reality.

Understand

A simulation represents selected features of a real process so that we can investigate questions without every real-world cost or risk. It deliberately omits details. Its results apply only as far as its assumptions support.

Our queue model starts empty. At each tick, new arrivals join, then up to the service capacity leave. No one abandons the queue and capacity stays constant. Changing event order changes results; document the order rather than hiding it.

Worked example

Arrivals[3,0,4,1]; capacity 2 per tick. Queue starts 0. Arrivals happen before service.

  1. Tick 1:0+3=3 waiting, serve 2, queue 1.
  2. Tick 2:1+0=1, serve 1, queue 0.
  3. Tick 3:0+4=4, serve 2, queue 2.
  4. Tick 4:2+1=3, serve 2, queue 1. Seven served; one remains.

Explore each concept

Choose a concept, change its inputs and follow the explanation. Each example models the stated rule or scenario; completing it is practice rather than evidence of mastery.

  • Abstraction and omitted factors
  • Arrivals before or after service
  • Controlled comparison and variability
Open this example on its own

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 explore: Simulation assumptions and event order
  1. Arrivals per tick (0–100; max 8)3,0,4Waiting
  2. Capacity per tick (0–10)2Waiting
  3. Event orderarrivals-firstWaiting

Ready to explore: Simulation assumptions and event order

Why: Change an input, predict the first effect, then advance one step.

Try this: Change one input or choose another listed case. Predict the effect, reset and compare the states and governing rule.

Step through and experiment

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 13,0,4,1Waiting
  2. Input 22Waiting

Ready to experiment

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

Try this: Try capacity 0 and an empty arrivals list. Try a busy tick followed by zero arrivals.

Check a misconception

Claim: A simulation includes every detail because it runs on a computer.

It models chosen rules. Human behaviour, changing capacity or inaccurate inputs can make its predictions differ from reality.

Guided practice

Trace the same arrivals with capacity 3. Give the end-of-tick queues and total served.

Work with a partner. Make a prediction, compare your reasoning, then identify the rule that supports your answer.

Independent transfer

A real service desk closes after tick 4. Explain why reporting only total served could conceal a problem.

Exit check

Name one omitted feature that could change a real queue result.

Write your reasoning before comparing with a classmate. If your teacher assigned this task, submit it through My classes to save your work and receive feedback.

Check yourself

  1. Question 1 of 2Under arrivals-before-service, an empty queue gets 5 arrivals and capacity 3. How many remain after the tick?

    Select one answer.

  2. Question 2 of 2Which TWO actions strengthen interpretation of a simulation?

    Select exactly two answers (0 of 2 selected).

Your practice so far

Check an answer to see its rationale.

Teacher guidance and scoring