Each section gives the method step by step, the course conventions, a worked example taken from the tutorials or the sample exam (checked against the official answers), and the mistakes the wrong options are built from. Practise each part with the guided quiz; question numbers are given at the end of each card.
Friday 6 November 2026, 9:30 am. Three hours, closed book, in person. Bring a scientific calculator, a pencil and an eraser; scratch paper is provided.
24 multiple-choice questions
Topic
Questions
Typical tasks
State-space search
5
Expansion sequences, Q contents at step n, paths, heuristics
CSP
2
Assignment sequences for BT, BT-FC, BT-FC-DVO; propagated domains
Games
4
Node values, (α, β) at a node, static evaluation counts
Fuzzy logic
4
Memberships, rule weights, crisp output, formulas
Neural networks
5
Outputs, δ values, weight updates, error measures
Propositional logic
4
Parenthesising, translation, CNF, resolution
That is about 7 minutes per question. Most are hand simulations, so the time goes into the working, not the reading. Options a–d are close variants built from common mistakes, and option e is "None of the choices is correct", which can be the right answer.
Answer formats used in the sample exam
A* expansion sequence: f-cost then state, hyphen-separated: 10S-6A-9D-8F-…-14G
Q contents: (4 EFDAS)(2 DAS)(10 CS), each path written backwards from its head state
CSP assignments: V1R-V2B-V2G, one item per attempted assignment
Alpha-beta: an (α, β) pair such as (5, +infinity)
Topic 1 · 5 exam questions
State-space search
Every search algorithm in the course is the same loop over a queue Q. They differ only in which path they take out of Q, where they put new paths, and which list (if any) they keep.
The simple search algorithm
A search node is a path, written from its most recent state back to the start: (D A S) means S → A → D. Its head (here D) is the state it has reached.
Initialise Q with the single path (S). With a visited list, set Visited = {S}.
If Q is empty, fail. Otherwise pick a path N from Q (the algorithm decides which).
If the head of N is the goal, return N.
Remove N from Q.
Find the descendants of N's head (with a visited list, only those not yet visited) and make the one-step extensions of N. Never extend a path back to a state already on it.
Add the extensions to Q (the algorithm decides where). With a visited list, mark the new states as visited.
Go to step 2.
Visited list versus expanded list
Visited list (any-path searches): a state is marked when it is first added to Q and is never added again.
Strict expanded list (UCS and A*): a state is marked when it is expanded. A path removed from Q whose head is already expanded is discarded and not counted. Children already on the expanded list are not added.
The table method
Write every simulation as a table with columns Step, Dequeued, Q (Enqueued) and Visited or Expanded list. Step 0 holds only (S). Exam questions such as "what is in Q at step 3" are read straight off this table.
When is the goal found?
The course states the goal test at step 3, when a path is removed from Q, so G appears at the end of the expansion sequence. The slides note that any-path searches could stop when G is added; if a question says so, follow it. UCS and A* must always test on removal, or they lose optimality.
Search trees
The tutorial graph used throughout this section (Tutorials 1 and 4):
Undirected. Tutorial 4 costs: every link 1, except S–C = 10. Heuristic shown as Tutorial 1 / Tutorial 4 values.
Put S at the root.
Under each node, list its neighbours in alphabetical order from left to right (or the order the question gives, such as N, E, S, W for mazes).
Leave out any neighbour already on the branch from the root. This avoids loops; it does not remove repeated states on other branches.
Stop a branch at G or when it has no new neighbours.
For this graph, S has children A, B, C; A has D; B has D; C has H; and D under A has children B, E, F. The same state (D, E, F) appears on several branches. That is what an algorithm without a visited list explores.
DFS without a visited list: S-A-D-B-E-F-F-E-B-D-A-E-F-F-E-C-H-I-J-G, 20 expansions, max Q 5 (the tutorial answer).
DFS with a visited list: S-A-D-E-F-B-C-H-I-J-G, 11 expansions, max Q 4.
Best-first with a visited list (h: S 10, A 5, B 8, C 6, D 7, E 6, F 5, H 3, I 2, J 1): Q holds (5AS)(8BS)(6CS) after step 1, written with h values. Sequence S-A-C-H-I-J-G, 7 expansions, max Q 3.
Common mistakes
Adding children in the wrong order. DFS puts the alphabetically first child at the very front.
Marking states as visited when they are expanded rather than when they are added.
Forgetting that a dead end is still an expansion. It appears in the sequence.
For best-first, sorting by g or f. It uses h only.
Take the path with the lowest cost so far, g. The costs here are Tutorial 4's: every link costs 1 except S–C, which costs 10.
pick N∈Qming(N)
Tie rule from Tutorial 4
New paths go to the front of Q, in alphabetical order of their head state. When several paths have the same cost, take the one nearest the front. This rule reproduces the Tutorial 4 answer key exactly.
The exam-format slides add: "if you have ties in heuristic searching, use alphabetical order to break ties". When a question states its own tie rule, follow it.
Without an expanded list
Every loop-free path stays in Q, so states can be expanded many times:
Write the Q column the way the exam's "Enqueued" column does: the paths in the order they sit in Q, new ones at the front. You still remove the cheapest.
Step
Dequeued
Enqueued (whole Q)
Expanded
0
(0S)
1
(0 S)
(1 AS) (1 BS) (10 CS)
S
2
(1 AS)
(2 DAS) (1 BS) (10 CS)
S A
3
(1 BS)
(2 DBS) (2 DAS) (10 CS)
S A B
4
(2 DBS)
(3 EDBS) (3 FDBS) (2 DAS) (10 CS)
+ D
(2 DAS)
discarded: D already expanded
5–6
(3 EDBS), (3 FDBS)
(4 FEDBS) (10 CS), then (10 CS)
+ E F
7–10
(10 CS) … (13 JIHCS)
(14 GJIHCS)
+ C H I J
11
(14 GJIHCS)
goal
Matches the exam-format slide
Step 3's Enqueued column, (2 DBS) (2 DAS) (10 CS), is exactly the highlighted answer to question 2 on the "Preparation for the Finals" slides. That slide labels the question A*, but its numbers are path costs g, so read which value the options use.
Remove the path with the lowest f = g + h, and write each path with its f value. This is the Tutorial 4 graph with h: S 10, A 5, B 11, C 1, D 7, E 6, F 5, H 3, I 2, J 1, G 0. Its answer is the highlighted option to question 1 on the exam-format slides.
Notice that f went down from 9 (D) to 8 (F). That happens when the heuristic is not consistent: h(D) = 7 but h(F) = 5 one step away. A* still finds the optimal path here, but the f values are not monotone.
Common mistakes
Writing h or g in the sequence instead of f. Option c of the sample question uses 4A instead of 6A.
Leaving out a state that was expanded but is not on the final path (B and E here).
Removing (14 BDAS) from Q because B is in Q elsewhere. Only the expanded list blocks a path.
Admissible: h(n) never exceeds the true cheapest cost from n to the goal. A* without an expanded list is then optimal.
Consistent: for every link n → n′, h(n) ≤ cost(n, n′) + h(n′). Needed for A* with a strict expanded list. Consistent implies admissible.
Admissible heuristics do not have to be straight-line distance. Any underestimate works.
8-puzzle: sum of Manhattan distances
For each tile 1 to 8 (never the blank), add the number of rows plus columns between where it is and where it belongs.
Start
72456831
Goal
12345678
Tiles 1 to 8: 3 + 1 + 2 + 2 + 2 + 3 + 3 + 2 = 18. The misplaced-tiles heuristic for the same start counts 8. Manhattan is always at least as large and so guides A* better.
The robot pays for distance and for turning: a 90° right turn adds 2, a 90° left turn adds 3. So a link's cost depends on which way the robot is facing when it arrives.
Note the starting heading.
For each link on a path, find the new heading. Same heading: no extra cost. One step clockwise (N→E→S→W→N): right turn, +2. One step anticlockwise: left turn, +3.
Add the length of the link.
Carry the new heading forward along that branch of the search tree. Different branches reach the same node with different headings.
Link
Heading before → after
Turn
Cost
S → C
east → south
right +2
2 + 2 = 4
C → D
south → east
left +3
3 + 4 = 7
D → A
east → north
left +3
3 + 2 = 5
A → B
north → east
right +2
2 + 2 = 4
B → G
east → south
right +2
2 + 2 = 4
Result
Path S-C-D-A-B-G costs 4 + 7 + 5 + 4 + 4 = 24 energy units for a distance of only 12.
Quick left/right check
Imagine sitting in the robot. Facing south, east is on your left. Facing north, east is on your right. Turn your scratch paper if it helps.
All examples below use the sample exam's checkerboard: squares 1, 2, 3 on the top row and 4, 5 beneath 1 and 2. Adjacent squares must differ. Domain of 5 = {B}; all others {R, B}.
Formulation and the constraint graph
Variables: the squares (or regions). Values: the colours. Domains: the allowed colours for each.
Constraints: one arc for each pair that must differ.
Board
12345
Arcs: 1–2, 2–3, 1–4, 2–5, 4–5
Variable 2 has the most constraints (3).
Full constraint propagation (arc consistency)
Put every arc on a to-do list.
For an arc X–Y, delete from X's domain any value with no different value left in Y's domain (and the same for Y).
If a domain shrinks, re-check every arc touching that variable.
Stop when nothing changes. An empty domain means there is no solution.
Checkerboard result
5 = {B} forces 2 = {R} and 4 = {R}. Then 1 = {B} (from 2 and 4) and 3 = {B} (from 2). Every domain ends with one value: 1B 2R 3B 4R 5B.
Arc-by-arc questions (Tutorial 9)
When the question lists the arcs in a fixed order, process them in exactly that order and report both domains after each arc. Changes carry forward. Write domains as letters with spaces (R B) and none for empty.
Most constrained variable: next, assign the variable with the fewest values left in its current domain.
Break ties by the variable involved in the most constraints with unassigned variables, then by the order given (or lowest number). State the rule you used if the question does not.
Least constraining value: try first the value that removes the fewest options from neighbours.
Checkerboard with BT-FC and DVO (sample exam 2.5)
5 has one value: 5B → D2 = {R}, D4 = {R}. 2 and 4 both have one value; 2 wins the tie: 2R → D1 = {B}, D3 = {B}. Then 1B, 3B, 4R.
5B-2R-1B-3B-4R: 5 attempts, no backtracking.
Tutorial 9's B.3 answer uses DVO without forward checking: it starts with D (domain {B}), then C, and needs 12 steps because nothing prunes the later domains.
"Right to left" means the same algorithm with every node's children taken in reverse order. Redraw the tree mirrored if that helps.
Pruning never changes the root value, only the number of static evaluations.
Best case: when the strongest move is searched first at every node, alpha-beta evaluates roughly bd/2 leaves instead of bd. Worst case: no pruning at all.
A cut can happen after the last child, in which case nothing is saved.
The rising leg is the line through (a, 0) and (b, 1): slope 1/(b − a), so y = (x − a)/(b − a). The falling leg goes through (c, 1) and (d, 0): slope 1/(c − d), so y = (x − d)/(c − d). Check each at its endpoints: 0 at a, 1 at b; 1 at c, 0 at d.
Reading the course tables
In the Tutorial 7 table, the left shoulder NEG lists a = b = 0 and only c, d matter; the right shoulder POS lists c = d = 0 and only a, b matter. The zeros are placeholders, not breakpoints.
Rules are numbered down each column: W1–W3 under x = N, W4–W6 under ZE, W7–W9 under P.
Rule 2 reads: IF x is N AND y is M THEN output is NS.
Weight = min(μx, μy). Max would be Zadeh OR; product is a different AND.
Tutorial 7: W1 = min(0.30, 0.50) = 0.30, W2 = 0.30, W4 = min(0.70, 0.50) = 0.50, W5 = 0.50. Every other weight is 0 because one of its memberships is 0.
The worked example is Tutorial 8a: inputs x = 1, y = 0, target z = 1, every weight 0.1, η = 2, sigmoid everywhere, a bias input of 1 into both h and z, and x and y also wired straight to z.
Output node: netz = 1(0.1) + 0(0.1) + 0.5498(0.1) + 1(0.1) [bias] = 0.2550, so Oz = 0.5634.
Rounding rule from the tutorial answers
Round each intermediate result to 4 decimal places and carry the rounded value forward. Give final weights to the precision the options use (often 2 decimals).
Calculator check
sig(0) = 0.5 and sig(0.2) = 0.5498. If you get anything else, check you typed e−0.2, not e0.2.
Tutorial 8a computes δh with Whz = 0.2181, the value just updated. The sample exam does the same ("the weights Wj1k1… have been updated already"). With old weights you can even get the wrong sign.
A bias is just another input whose output is always 1. Its weight updates by η·δ every time.
A link from an input that is 0 never changes on that pattern.
In Tutorial 8a's layout, the inputs feed the output node directly as well as through h, so netz has four terms. Count the arrows into each node before you start.
"No bias nodes are used" (Tutorial 8b, sample exam) means leave the bias term out entirely.
Error measures
SSE=21p∑k∑(Tk−Ok)2RMSE=P⋅K∑p∑k(Tk−Ok)2
For each pattern table, fill in the (Tk − Ok)² row.
Add every square over all patterns and all output nodes.
SSE: halve the total. The sample answer (SSE = 0.27 from a total of 0.54) shows the course includes the ½.
RMSE: divide the total by the number of patterns × outputs (here 3 × 3 = 9) and take the square root: √(0.54/9) = 0.24.
Check your lecture slides
RMSE definitions vary between textbooks. If the slides use a different divisor, use theirs; the method is the same.
Convert every axiom to clauses (CNF) and number them.
Add the negation of what you want to prove.
Resolve two clauses that contain a complementary pair (P and ~P): the result is everything else from both clauses. Remove exactly one pair per step.
Number each new clause and note its parents.
When you derive the empty clause, the goal is proved.
Worked: Tutorial 10, prove ~P
#
Clause
From
1
~P v Q v S
axiom
2
~S
axiom
3
~Q v X
axiom
4
~X
axiom
5
P
negated goal
6
Q v S
1, 5
7
Q
6, 2
8
X
7, 3
9
empty clause
8, 4
Common mistakes
Adding the goal instead of its negation.
Cancelling two pairs at once: (~P v Q) with (P v ~Q) gives Q v ~Q, a useless tautology, not the empty clause.
Getting the sign wrong: ~R with ~P v R leaves ~P.
Theorem proving: Adams, Brown and Clark
Make each suspect's statements conditional on their innocence (A = Adams is innocent, and so on), add the general knowledge rules, and encode "exactly one is guilty" as A v B, A v C, B v C. Then test each suspect: assuming Brown innocent gives ~X and ~Y, which forces ~A and ~C, contradicting A v C. So Brown is guilty.
Search: Which list (none, visited, expanded)? Where do new paths go? What breaks ties? Is the goal tested on removal? Did you include G and every dead end?
CSP: Fixed or dynamic order? Did you list failed attempts? With FC, did you check every unassigned neighbour for a wipe-out?
Games: Is each child's initial (α, β) the parent's current pair? Left to right or right to left? Did you count only evaluated leaves?
Fuzzy: Which trapezoid type is each set? Min for AND? Rules numbered down the columns? Divided by the sum of the weights?
Neural nets: 4 decimal places at each step? Sigmoid at every node? Updated Wjk for the hidden δ? η included? Bias input 1?
Logic: Negated the goal? One complementary pair per resolution? De Morgan flipped every sign?
If your answer is not listed, recheck once, then choose "None of the choices is correct".