Software Engineering › How to answer › Drawing › and simplify a decision tree
How to draw and simplify a decision tree
The examined skill is simplifying a tree: remove tests that don’t change the outcome, but keep every outcome the same. From NESA material
What it looks like in the real exam
From NESA material 2025 sample 2025 NESA sample exam, Q20B (3 marks): “The decision tree can be simplified without compromising its logic. Redraw the decision tree to reduce the number of branches.” 2025 familiarisation 2025 NESA familiarisation exam, Q7B (3 marks, same task) and 2025 NESA familiarisation exam, Q7A (1 mark: read the Buy/Not Buy outcomes for three car scenarios).
2025 NESA sample exam, Q20B · 3 marks
Official marking criteria
- 3 marks: Draws a correctly simplified decision tree.
- 2 marks: Simplified tree with most of the logic.
- 1 mark: Some understanding of the requirement.
Notes
Open this question page · some of the NESA wording or answer is an image or is unpublished, as noted
Reasoned The trees and the MG answers are images, so I cannot reproduce them. The technique note in the bank is: merge branches that lead to the same outcome regardless of the answer to a question (remove redundant tests), keeping every original outcome unchanged.
From course notes Course grid: Decision tree is worth about 3 marks in the school’s exam-style grid (target band 4–5).
The notation
| Item | How to draw it |
|---|---|
| Decision node | A box or diamond with a question |
| Branches | Lines from the node, one per answer (Yes/No), each labelled |
| Leaf | A final outcome (Buy / Don’t buy) at the end of a branch |
From NESA material “Each internal node tests a condition, branches are outcomes and leaves are decisions or predictions.”
Method for simplifying
- Read the question and the tree. List every path from the top to a leaf as a rule (“Price under $1000, has warranty → Buy”). From course notes
- Look for a question whose two answers lead to the same outcome (both branches of one node end in the same leaf, or the same subtree). That question changes nothing. From NESA material
- Delete that node and connect its parent branch straight to the shared outcome. From NESA material
- Repeat until each remaining question changes at least one outcome. General advice
- Check by testing: pick two or three example inputs and run each through the old and new tree. They must give identical answers. General advice
- Label all branches and leaves in the new tree. From course notes
Worked example (original)
Original practice Before: an original tree that decides whether to buy a laptop.
Spot the redundancy: both answers to “Has warranty?” lead to Buy, so the test changes nothing. Remove it.
After:
Check: price under $1000 with a warranty → Buy (before and after); price under $1000 without a warranty → Buy (before and after); over $1000 with a student discount → Buy; over $1000 without → Don’t buy. All four match.
Markers’ checklist
- Fewer branches than the original.
- Every original outcome still gives the same result (test it).
- Every node has a question; every branch is labelled; every path ends in a leaf.
- No removed test that actually mattered.
- Same wording for the outcomes as the original.
Common mistakes
- General advice Removing a question that does change an outcome (the answer changes).
- General advice Simplifying but forgetting to relabel the branches.
- General advice Keeping the redundant test and just redrawing it.
- General advice Merging leaves that look the same but belong to different questions.
Time per mark
Derived The paper averages 1.75 minutes per mark (140 minutes ÷ 80 marks), so a 3-mark drawing question is about 5.3 minutes in total. General advice Suggested split: 1 minute reading and planning, most of the time drawing, and the last minute checking labels against the checklist. Drawing in an online tool is slower than on paper, so practise with the tool on NESA’s familiarisation site.
Practice (3 prompts, with answers)
Item 1 · umbrella
Tree: “Is it raining?” Yes → “Do you have a hat?” (Yes → Take umbrella, No → Take umbrella); No → Leave it. Simplify.
Show the answer
Answer: “Do you have a hat?” gives the same outcome either way, so remove it: “Is it raining?” Yes → Take umbrella; No → Leave it. Original practice
Item 2 · read the tree
Using the “after” tree above, what is the outcome for a $1500 item with no student discount?
Show the answer
Don’t buy (price not under $1000 → no discount → Don’t buy). Original practice
Item 3 · draw from rules
Draw a decision tree for: Display “Free entry” if age is under 5; “Child” if 5 to 17; “Adult” otherwise.
Show the answer
Model answer: “Age under 5?” Yes → Free entry; No → “Age under 18?” Yes → Child; No → Adult. Two questions, three leaves. Original practice
Terms, flashcards and past questions
Key terms for this page: Decision tree
Flashcards · All key terms · Learn step by step · All past questions · Multiple-choice bank · Mock exam
Past questions used on this page:
← How to draw a class diagramHow to draw an entity relationship diagram (ERD) →