If pseudocode in VCE Maths Methods looks like a computing subject that wandered into the wrong classroom, you're not alone. Algorithms written in pseudocode became part of VCE Mathematics with the current study design, which began in 2023. Many students meet it in class, then aren't sure how much it matters or how to approach a question that uses it.
The good news: you don't need to know a programming language. Pseudocode in Methods is a short, structured way of writing out the steps of a method you already learn, such as finding a root or estimating an area. If you can follow a recipe and keep track of numbers, you can learn to read it.
This guide is for Year 11 and Year 12 Methods students and their parents. It covers the VCAA conventions, where pseudocode shows up in the course, three worked examples with trace tables, and the mistakes that cost marks.
The short version
- Pseudocode is plain, step-by-step instructions using a few set keywords, such as if, for, while and print.
- In Methods it describes numerical methods you already study: bisection, Newton's method, the trapezium rule, probability simulations and simple optimisation.
- VCAA's own sample questions mostly ask you to trace an algorithm (work out what it does, step by step) or say what it prints, not write a program from scratch.
- The skill that wins marks is careful bookkeeping: a trace table, one row per step.
- It's in the study design. The Units 1&2 key knowledge includes "key elements of algorithm design … including the use of pseudocode", along with the bisection method (Unit 1) and Newton's method (Unit 2). VCAA's pseudocode page also lists Newton's method for other functions in Units 3&4, the trapezium method, probability simulations and optimisation.
- It has appeared in the exam. The 2025 Methods Exam 2 included a multiple-choice question asking which values a short while loop prints. The same paper had a trapezium rule question and a two-step Newton's method question. Newton's method also appeared in the 2023 Exam 2.
- It's a small amount to learn. There are about six keywords and one rule for loops. Once those make sense, most questions come down to careful step-by-step tracking.
- It helps with topics you're examined on anyway. Writing out Newton's method or the trapezium rule as steps makes the method itself clearer, even in questions with no pseudocode.
- Sequencing: steps happen in order, one line at a time.
- Decision-making: an if statement chooses between two paths.
- Repetition: a for or while loop repeats steps.
- Representation: writing it all down clearly, which is what pseudocode is.
- Off-by-one loops: treating `for i from 1 to 5` as running 4 times. It runs 5 times.
- Using a value too early: updating x and then using the new x in a line that should have used the old one.
- Testing a while condition halfway through a pass. It's only checked at the top.
- Mixing up > and ≥. At the boundary value, these send the algorithm down different paths.
- Rounding at every step. Keep full values in the table and round only the final answer.
- Swapping the bisection update. If f(a) × f(c) < 0, the root is between a and c, so b changes, not a.
- Q1: x = 3 prints 9. The condition is x > 3, and 3 > 3 is false, so the else branch runs and y = 3². x = 4 prints 7, from 2 × 4 − 1.
- Q2: prints 81, 4. The trace: n goes 1 → 3 → 9 → 27 → 81 while count goes 0 → 1 → 2 → 3 → 4. When n = 81, the condition n < 50 is false, so the loop stops.
- Q3: prints 54, from 4 + 9 + 16 + 25. The loop starts at k = 2 and includes k = 5.
- Q4: prints 1, 4, 3, 16, 5, 36. Odd values print as they are; even values print squared.
- Q5: prints 14. g(2) = 4, so a = 4. Then g(4) = 10, so b = 10, and a + b = 14.
- E1: the loop adds 0 to 9, giving 45 instead of 55. Fix: `for i from 1 to 10`.
- E2: x never changes, so the loop never ends. Fix: add `x ← x / 2` inside the loop. The corrected algorithm prints 5 (20, 10, 5, 2.5 and 1.25 are all at least 1; then x = 0.625).
- E3: a score of exactly 50 prints "not yet". Fix: `if score ≥ 50 then`.
- E4: the updates are swapped. If f(a) × f(c) < 0, the root lies between a and c, so it should be `b ← c`, and `a ← c` in the else branch.
- E5: the function never returns a value. Fix: add `return y` as the function's last line. It then prints 10.
- Small groups of no more than 4 students, fully online, with two 1.5-hour classes a week
- A free 45-minute diagnostic assessment before starting, done without a calculator, followed by a written report on strengths and gaps
- CAS calculator practice built into lessons
- Topic notes before every session and homework after it
- Monthly written progress reports, plus an extra 1-hour session each month for questions
Is it worth learning pseudocode for the exam if your school hasn't taught it?
Yes. It takes a few hours to learn, it's part of the course, and it has already appeared on the end-of-year exam.
Schools cover algorithms in different ways, and some fit them into other topics or leave them until later. If yours hasn't covered it yet, the sections below are enough to get started. Two or three short practice questions a week, for a few weeks, is plenty.
What pseudocode is, and why it's in Methods
Pseudocode is a way of writing an algorithm, a set of steps that solves a problem, in structured plain English instead of a real programming language. Nothing needs to run on a computer. The point is that every step is exact, so anyone following it gets the same answer.
The study design describes algorithms through four building blocks. Every pseudocode question uses some mix of them:
VCAA includes this as part of computational thinking: breaking a problem into steps, spotting patterns, and turning a method into an algorithm. In Methods, that means describing numerical methods precisely enough that they could be programmed, including the ones you might run on a CAS calculator.
The VCAA conventions to know
VCAA publishes the conventions it uses for VCE Mathematics. Learn these and you can read any algorithm in the course.
| What it does | How it's written | Watch out for |
|---|---|---|
| Store a value | `x ← 5` | Read the arrow as "becomes". `x ← x + 1` means "add 1 to x". |
| Take an input | In the algorithm's name, or `input` | |
| Show a result | `print x` | Each `print` inside a loop runs every time round, so it can print several values. |
| Make a decision | `if` condition `then` … `else` … `end if` | Only one branch runs. Check the condition with the current values. |
| Repeat a set number of times | `for i from 1 to n` … `end for` | The range is inclusive: `from 1 to 3` runs for i = 1, 2 and 3. |
| Repeat while something is true | `while` condition … `end while` | The condition is checked before each pass. If it's false at the start, the loop never runs. |
| Define a function | `define f(x)` … `return` value | A function only runs when it's used, such as `f(2)`. |
Here's a small example that uses most of them:
``` define f(x) return x² − 4 total ← 0 for i from 1 to 4 if f(i) > 0 then total ← total + f(i) end if end for print total ```
It adds up f(i) only when it's positive. f(1) = −3 and f(2) = 0 are skipped, then f(3) = 5 and f(4) = 12 are added, so it prints 17.
Where pseudocode shows up in Methods
Pseudocode in Methods is always tied to a mathematical method. These are the ones VCAA lists.
| Algorithm | What it does | Where it sits |
|---|---|---|
| Bisection method | Halves an interval again and again to close in on a root | Unit 1 |
| Newton's method | Uses tangent lines to home in on a root | Unit 2 for polynomials; Units 3&4 for other functions |
| Trapezium method | Estimates the area under a curve using trapeziums | Integration |
| Probability simulation | Repeats a random trial many times to estimate a probability or average | Probability |
| Optimisation search | Checks many values to find the best one, such as the largest area | Applications |
Worked example 1: the bisection method
Task: estimate the positive root of f(x) = x² − 2 (that is, √2) between 1 and 2, stopping when the interval is no wider than 2 × 0.05 = 0.1.
``` define f(x) return x² − 2 a ← 1 b ← 2 t ← 0.05 c ← (a + b) / 2 if f(a) × f(b) > 0 then print "Incorrect initial guesses" else while b − a > 2t if f(a) × f(c) < 0 then b ← c else a ← c end if c ← (a + b) / 2 end while print c end if ```
The first check is f(1) × f(2) = (−1)(2) = −2. That's not greater than 0, so the guesses are fine and the loop starts with c = 1.5. The key idea: if f(a) and f(c) have opposite signs, the root lies between a and c, so b moves in to c. Otherwise a moves up to c.
| Pass | a | b | c | f(a) | f(c) | f(a) × f(c) | Update |
|---|---|---|---|---|---|---|---|
| 1 | 1 | 2 | 1.5 | −1 | 0.25 | negative | b ← 1.5 |
| 2 | 1 | 1.5 | 1.25 | −1 | −0.4375 | positive | a ← 1.25 |
| 3 | 1.25 | 1.5 | 1.375 | −0.4375 | −0.1094 | positive | a ← 1.375 |
| 4 | 1.375 | 1.5 | 1.4375 | −0.1094 | 0.0664 | negative | b ← 1.4375 |
Worked example 2: Newton's method
Task: estimate the root of f(x) = x³ − 2x − 5, starting from x = 2, using three steps of Newton's method.
Each step replaces x with x − f(x) / f′(x). That's where the tangent at x crosses the x-axis. Here f′(x) = 3x² − 2.
``` define f(x) return x³ − 2x − 5 define df(x) return 3x² − 2 x ← 2 for i from 1 to 3 x ← x − f(x) / df(x) print x end for ```
Because `print x` sits inside the loop, the algorithm prints three values, one per step.
| i | x at start | f(x) | f′(x) | New x (printed) |
|---|---|---|---|---|
| 1 | 2 | −1 | 10 | 2.1 |
| 2 | 2.1 | 0.061 | 11.23 | 2.0946 (4 d.p.) |
| 3 | 2.0946 | 0.0002 | 11.1616 | 2.0946 (4 d.p.) |
One warning the exams like to test: if f′(x) = 0 at some step, the tangent is horizontal and the formula breaks, because you'd be dividing by zero. That happens at turning points.
Worked example 3: the trapezium rule
Task: estimate the area under y = x² from x = 0 to x = 2 using 4 trapeziums.
``` define f(x) return x² a ← 0 b ← 2 n ← 4 h ← (b − a) / n sum ← 0 left ← a right ← a + h for i from 1 to n sum ← sum + (f(left) + f(right)) / 2 × h left ← left + h right ← right + h end for print sum ```
The width of each strip is h = (2 − 0) / 4 = 0.5. Each pass adds one trapezium: the average of the two heights times the width.
| i | left | right | Strip area | sum |
|---|---|---|---|---|
| 1 | 0 | 0.5 | (0 + 0.25) / 2 × 0.5 = 0.0625 | 0.0625 |
| 2 | 0.5 | 1 | (0.25 + 1) / 2 × 0.5 = 0.3125 | 0.375 |
| 3 | 1 | 1.5 | (1 + 2.25) / 2 × 0.5 = 0.8125 | 1.1875 |
| 4 | 1.5 | 2 | (2.25 + 4) / 2 × 0.5 = 1.5625 | 2.75 |
How to desk check an algorithm in an exam
Desk checking means running an algorithm by hand, line by line, recording every value in a trace table. It's the most reliable way to answer "what does this print?" questions.
1. Set up a table with one column per variable, plus columns for any condition being tested and for anything printed. 2. Write the starting values in the first row. 3. Work line by line. A line with ← changes only the variable on its left. Everything else stays the same. 4. For loops: write the loop counter's value on every pass, and remember the range includes both ends. 5. While loops: test the condition at the top, before each pass. As soon as it's false, jump to the line after `end while`. 6. Record every print. If `print` is inside a loop, there will usually be several outputs.
Mistakes that cost marks
Practice questions: desk checking and error finding
Try these before looking at the answers at the end of this section. Use a trace table for each one.
Desk checking: what does it print?
Q1 (if-else). What is printed when x = 3? What about x = 4?
``` input x if x > 3 then y ← 2x − 1 else y ← x² end if print y ```
Q2 (while loop). What is printed?
``` n ← 1 count ← 0 while n < 50 n ← 3n count ← count + 1 end while print n, count ```
Q3 (for loop). What is printed?
``` s ← 0 for k from 2 to 5 s ← s + k² end for print s ```
Q4 (for loop with if-else). List everything printed, in order.
``` for i from 1 to 6 if i is even then print i² else print i end if end for ```
Q5 (function). What is printed?
``` define g(x) return 3x − 2 a ← g(2) b ← g(a) print a + b ```
Error finding: what's wrong, and how would you fix it?
E1 (for loop). This is meant to add the whole numbers from 1 to 10.
``` total ← 0 for i from 0 to 9 total ← total + i end for print total ```
E2 (while loop). This is meant to count how many times 20 can be halved before it drops below 1.
``` x ← 20 steps ← 0 while x ≥ 1 steps ← steps + 1 end while print steps ```
E3 (if-else). This is meant to print "pass" for a score of 50 or more, and "not yet" otherwise.
``` input score if score > 50 then print "pass" else print "not yet" end if ```
E4 (if-else in bisection). This update step is meant to keep the root inside the interval from a to b.
``` if f(a) × f(c) < 0 then a ← c else b ← c end if ```
E5 (function). This is meant to print h(3), where h(x) = x² + 1.
``` define h(x) y ← x² + 1 print h(3) ```
Answers
How Numerion Academy helps
Numerion's VCE Maths Methods program works through the study design in small online groups, including numerical methods, pseudocode and CAS calculator skills.
Book a Free Assessment to see where your child stands at the start of Year 12, and what to focus on first.
