Dry Runs, Tracing & Logic Control: Creating Accurate Tracing Tables Under Exam Conditions (Copy)
Creating Accurate Tracing Tables Under Exam Conditions (Cambridge Standard – O Level 2210 + IGCSE 0478)
Why Tracing Tables Are A High-Yield Area In Paper 2
- Tracing tables are used by Cambridge to test:
- True understanding of algorithm execution
- Control flow through loops and selection
- Accurate handling of variables, arrays, and flags
- They appear in:
- Short structured questions
- Section B logic-based questions
- Pre-release material follow-up questions
- These are method-mark heavy:
- Even if the final answer is wrong, correct tracing earns marks
- Under exam pressure, most mistakes occur due to:
- Poor table structure
- Skipping steps
- Guessing instead of executing line-by-line
What Cambridge Means By An “Accurate” Tracing Table
An accurate tracing table must:
- Follow the algorithm exactly as written
- Show:
- Correct sequence of execution
- Correct variable updates
- Correct stopping condition
- Reflect:
- Updated values immediately after assignment
- Match:
- Cambridge pseudocode semantics (inclusive FOR, explicit WHILE conditions)
Non-Negotiable Rule Before You Start Tracing
- Never start tracing until you have:
- Identified all variables that change
- Identified the loop type and bounds
- Identified every OUTPUT statement
- Rushing into tracing without setup:
- Is the number one cause of lost marks
Step 1: Identify What Must Be In The Tracing Table
Mandatory Columns (Case-Dependent)
You only include columns for values that change or matter.
Typical columns:
- Loop index (i, index, pos)
- Key variables (total, count, max, min, found)
- Current array element (array[i] or temp)
- Condition result (TRUE/FALSE) when helpful
- Output (only when OUTPUT occurs inside loop)
Examiner Expectation
- No unnecessary columns
- No missing critical variables
- Clean, readable structure
Step 2: Always Write Initial Values Before The First Iteration
- Cambridge expects:
- Initial values to be applied before the first loop iteration
- If initial values are missing:
- The entire trace collapses logically
Example:
- total ← 0
- count ← 0
These must be written before row 1 of the table.
Written and Compiled By Sir Hunain Zia (AYLOTI), World Record Holder With 154 Total A Grades, 7 Distinctions and 11 World Records For Educate A Change O Level And IGCSE Computer Science Full Scale Course
Step 3: Tracing FOR Loops Accurately
Cambridge FOR Loop Rules
- Start value is included
- End value is included
- Index changes automatically
- You never manually increment the FOR index
Example Algorithm
- total ← 0
- FOR i ← 1 TO 4
- total ← total + values[i]
- ENDFOR
Correct Tracing Table
| i | values[i] | total |
|---|---|---|
| 1 | 5 | 5 |
| 2 | 3 | 8 |
| 3 | 7 | 15 |
| 4 | 2 | 17 |
Examiner Traps
- Stopping at i = 3
- Starting at i = 0
- Adding values after loop instead of inside loop
Step 4: Tracing IF Statements Inside Loops
Algorithm Pattern
- count ← 0
- FOR i ← 1 TO 5
- IF values[i] > 10 THEN
- count ← count + 1
- ENDIF
- IF values[i] > 10 THEN
- ENDFOR
Tracing Table (Condition-Aware)
| i | values[i] | values[i] > 10 | count |
|---|---|---|---|
| 1 | 8 | FALSE | 0 |
| 2 | 12 | TRUE | 1 |
| 3 | 15 | TRUE | 2 |
| 4 | 4 | FALSE | 2 |
| 5 | 11 | TRUE | 3 |
Examiner Focus
- count only updates when condition is TRUE
- FALSE rows must not change count
Written and Compiled By Sir Hunain Zia (AYLOTI), World Record Holder With 154 Total A Grades, 7 Distinctions and 11 World Records For Educate A Change O Level And IGCSE Computer Science Full Scale Course
Step 5: Tracing WHILE Loops (Highest Error Rate)
Why WHILE Loops Are Dangerous
- Loop termination depends on:
- Logical conditions
- Students often:
- Miss the final iteration
- Continue after condition becomes FALSE
Algorithm Pattern
- index ← 1
- found ← FALSE
- WHILE index <= 5 AND found = FALSE DO
- IF values[index] = target THEN
- found ← TRUE
- ELSE
- index ← index + 1
- ENDIF
- IF values[index] = target THEN
- ENDWHILE
Tracing Table (Target = 7)
| index | values[index] | found (before) | found (after) | index (after) |
|---|---|---|---|---|
| 1 | 3 | FALSE | FALSE | 2 |
| 2 | 6 | FALSE | FALSE | 3 |
| 3 | 7 | FALSE | TRUE | 3 |
Examiner Traps
- Incrementing index after found becomes TRUE
- Continuing loop when found = TRUE
- Ignoring AND condition
Step 6: Tracing Arrays That Are Updated During Execution
Key Rule
- Once an array value is updated:
- That new value is used for all future steps
Algorithm Pattern
- FOR i ← 1 TO 4
- IF values[i] < 10 THEN
- values[i] ← 10
- ENDIF
- IF values[i] < 10 THEN
- ENDFOR
Initial values:
- [6, 15, 8, 20]
Step-By-Step Update
| i | values before | values after |
|---|---|---|
| 1 | 6 | 10 |
| 2 | 15 | 15 |
| 3 | 8 | 10 |
| 4 | 20 | 20 |
Final array:
- [10, 15, 10, 20]
Examiner Trap
- Using original values after they have been modified
Written and Compiled By Sir Hunain Zia (AYLOTI), World Record Holder With 154 Total A Grades, 7 Distinctions and 11 World Records For Educate A Change O Level And IGCSE Computer Science Full Scale Course
Step 7: Tracing OUTPUT Statements Correctly
Output Outside Loops
- Only final values are output
Example:
- OUTPUT total
Output Inside Loops
- Each iteration may produce output
Example:
- FOR i ← 1 TO 3
- OUTPUT values[i]
- ENDFOR
Outputs (in order):
- values[1]
- values[2]
- values[3]
Examiner Trap
- Writing only the last output
- Ignoring output order
Step 8: How To Present Tracing Tables Under Exam Time Pressure
Best Layout Strategy
- Use:
- Clear column headings
- Straight rows
- Do NOT:
- Scribble values randomly
- Skip rows
- Compress steps
Time-Saving Rule
- If a variable never changes:
- Do not include it as a column
- Focus on:
- Variables that update
Step 9: Common Tracing Errors That Lose Easy Marks
- Forgetting initial values
- Incorrect loop bounds
- Treating FOR end as exclusive
- Updating variables when condition is FALSE
- Continuing WHILE loops too long
- Using wrong array index
- Recording outputs incorrectly
Written and Compiled By Sir Hunain Zia (AYLOTI), World Record Holder With 154 Total A Grades, 7 Distinctions and 11 World Records For Educate A Change O Level And IGCSE Computer Science Full Scale Course
Step 10: Examiner Checklist (Use This Mentally Before Submitting)
- Did I include all changing variables?
- Did I apply initial values before looping?
- Did I respect loop bounds exactly?
- Did I stop WHILE loops at the correct time?
- Did I update values immediately after assignment?
- Did I record outputs in correct order?
Best-Practice Strategy For Full Marks
- Rewrite the array with indices first
- Build the table before calculating
- Execute line-by-line, not mentally
- Mark TRUE/FALSE explicitly for conditions
- Treat updated values as permanent
- Never skip iterations
Final Quality Checklist
- Table structure is clear
- All iterations shown
- No skipped steps
- Logic follows pseudocode order
- Outputs match execution sequence
Final Lock-In Rules
- Tracing is execution, not estimation
- Arrays require strict index discipline
- Loop boundaries are inclusive
- Updated values affect future steps
- Clean tracing tables = guaranteed Paper 2 marks
