Worked solution from the System Software Paper 3 Advanced Theory booklet, Part 2 of 2.
Write any two of these:
RPN is an unambiguous way of writing an expression [1]
It is read from left to right [1]
It needs no brackets
It needs no rules of precedence (no BODMAS)
Only two of these points can score (2 marks).
Name the structure, then give a reason:
A stack [1]
Operands are pushed on, and when an operator is read the top two are popped in the reverse order to how they were pushed [1]
A binary tree also scores for the structure, with the reason that tree traversal lets both infix and postfix be evaluated.
Do the brackets first: (a – b) gives a b –, (a + c) gives a c +. Multiply them, then divide by 7.
Write: a b - a c + * 7 / [1]
Work along the RPN, joining the last two items with each operator: a b / gives a / b; then * 4; then a b + gives (a + b); then the final – joins them.
Write: a / b * 4 - (a + b) [1]
Rewrite the RPN as infix and put in the values.
Correct structure: (a + b) / (c / d) [1]
Correct substitution: (17 + 3) / (48 / 12) [1]
= 20 / 4 = 5
▶ Topic lesson
A lesson on this topic · by Craig'n'Dave. Tap the picture to open it on YouTube.
Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.