← ACI vault · solved paper · mid-sem (regular)

ACI — mid-sem paper, fully solved.

aci solved-paper AIMLCZG557 mid-sem

The full Artificial & Computational Intelligence mid-semester (regular) paper, every question worked end-to-end. Each question is in a box, and the full solution is one click away in a collapsible panel — open only what you want to test yourself on. At the end there is a makeup-exam study guide: the makeup paper tests the same concepts, so revise the ideas, not the numbers.

How to use this. Read each question in the box first and try it on paper. Then expand “Show worked solution” to check your method and final answer. Final answers are marked in accent colour. Marks per question are shown as a badge.

Q1 — Agents: acting humanly vs acting rationally 3 marks

A company deploys an AI-based interview bot, Sana. Sana speaks fluently, asks follow-up questions, evaluates facial expressions, scores candidates, and recommends hiring decisions. The HR managers say “This removes human bias.” Analyze this system using the ideas of acting humanly and acting rationally. Is behaving like a human interviewer enough to call the system intelligent? Identify at least two risks of using such an AI system in hiring.

Show worked solution

Acting humanly (Turing-test view). Sana imitates a human: fluent speech, natural follow-ups, reading facial expressions. By this yardstick it “passes” as human-like. But acting humanly only measures resemblance to humans, not correctness.

Acting rationally (rational-agent view). The real question is whether Sana maximises a well-defined performance measure — hiring the best-suited candidate fairly, given its percepts. Speaking fluently and looking human do not guarantee the decisions are rational or correct.

Is human-like behaviour enough? No. Imitating a human interviewer (passing a Turing-style test) does not make a system intelligent in the engineering sense. Intelligence here = making rational, justifiable decisions. The claim “removes human bias” is also false: a learned model inherits bias from its training data, so it can encode bias while appearing neutral.

At least two risks.

  1. Bias & discrimination. Facial-expression and speech scoring can systematically disadvantage candidates by ethnicity, accent, disability, or neurodivergence — bias learned from historical hiring data.
  2. Lack of transparency / accountability. A black-box recommendation is hard to explain or contest, raising legal and ethical problems (who is responsible for a wrong rejection?).
  3. (Extra) Privacy of biometric/facial data, and candidates gaming superficial cues the model rewards.

Q2 — PEAS & task environment 3 marks

Design a smart hospital service robot that delivers medicines, transports diagnostic samples, guides patients, and monitors restricted zones. It must run continuously in crowded corridors, prioritize emergencies, avoid collisions, and securely handle sensitive medical data. (A) Give the PEAS description. (B) Identify the dimensions of the task environment with a short justification for each (≤30 words each).

Show worked solution

(A) PEAS.

ElementDescription
PerformanceOn-time delivery, zero collisions, emergencies served first, secure data handling, patient satisfaction, energy/uptime.
EnvironmentHospital corridors, wards, patients, staff, other robots, restricted zones — crowded, dynamic, partially observable.
ActuatorsWheels/motors, robotic arm/gripper, lockable secure compartment, display + speaker, alarm/siren.
SensorsCameras, LIDAR/ultrasonic proximity, RFID/barcode reader, microphone, indoor localization, battery/temperature sensors.

(B) Task-environment dimensions.

DimensionValue & why
ObservabilityPartially observable — sensors see only nearby corridor, not the whole hospital.
AgentsMulti-agent — shares space with people and other robots.
DeterminismStochastic — people/obstacles move unpredictably.
Episodic?Sequential — current moves affect future routing and battery.
DynamicsDynamic — world changes while the robot is deciding.
ValuesContinuous — positions, speeds, and time are continuous.

(Also known map but partially unknown dynamics of people.)

Q3 — A* search & Greedy Best-First 4 marks

(A) Apply A* on the given graph (start S, goal G; edge costs on edges, heuristic h in each node; ties broken alphabetically) and show all steps. (B) Babloo says “Greedy Best-First Search is always smart because it picks the node closest to the goal.” Prove or disprove.

Show worked solution

Graph data. Heuristics: S=9, A=8, B=6, C=7, D=4, E=6, F=3, G=0. Edges (directed, cost): S→A 1, S→B 5, A→C 3, A→D 4, A→B 2, C→B 4, C→F 5, B→D 3, B→E 3, D→F 6, E→D 6, E→G 10, F→G 5.

(A) A* with \(f(n)=g(n)+h(n)\). Track the best g per node.

StepExpandFrontier after (node: g, f)
1S (f=9)A: g1,f9 · B: g5,f11
2A (f=9)B updated g3,f9 · D: g5,f9 · C: g4,f11
3B (f=9, tie B<D)D stays g5,f9 · C: g4,f11 · E: g6,f12
4D (f=9)C: g4,f11 · E: g6,f12 · F: g11,f14
5C (f=11)F updated g9,f12 · E: g6,f12
6E (f=12, tie E<F)F: g9,f12 · G: g16,f16
7F (f=12)G updated g14,f14
8G (f=14) → goal

Expansion order: S, A, B, D, C, E, F, G.
Optimal path: S → A → C → F → G, cost 1+3+5+5 = 14. (Checks: S-A-D-F-G = 16, S-A-B-D-F-G = 17, so 14 is least-cost.)

(B) Disprove. Greedy Best-First uses only \(h(n)\) and ignores cost so far \(g(n)\), so it is neither optimal nor complete. On this very graph, greedy from S picks the lowest-h neighbour each time: S→B(6)→D(4)→F(3)→G(0), cost 5+3+6+5 = 19 — worse than A*’s 14. So “closest to goal” is not always smart; the heuristic can be misled. Babloo is wrong.

Q4 — Search tree, g(n) and h(n) on a grid 4 marks

A rescue drone starts at S1 = A1 and must reach EXIT = D5, collecting medical kits/food packets, avoiding blocked cells, using MoveUp/Down/Left/Right. (A) Draw the search tree up to Level-2 (initial = Level-0). (B) Compute \(g(n)\) and \(h(n)\) for all generated nodes. Cost rules: normal +1, smoke extra +12, medical kit −8, food packet −4. Heuristic \(H(n)=\) Manhattan(pos, EXIT) + RemainingSupplies + AdjacentSmokeZones.

Show worked solution

Grid (rows A–E = 1–5, cols 1–5; EXIT = D5):

S1·SmokeKit
··Food·
·Smoke··
Kit·FoodSmokeEXIT
····

(A) Search tree. From A1, only valid moves are Right→A2 and Down→B1 (up/left off-grid).

Level-0: A1
Level-1: A2 (right), B1 (down)
Level-2: from A2 → A3 (right); from B1 → C1 (down). [returns to parent A1 omitted]

(A2→Down = B2 blocked; B1→Right = B2 blocked — both pruned.)

(B) Costs & heuristics. Total supplies on board at start = 4 (kits A4, D1; food B4, D3). None of A2/B1/A3/C1 are supply cells, so RemainingSupplies = 4 throughout. Smoke cells: A3, C2, D4.

Nodeg(n)Manhattan to D5RemSuppliesAdjSmokeh(n)f = g+h
A107401111
A21641 (A3)1112
B116401011
A3 (smoke)1+13 = 14540923
C11+1 = 2541 (C2)1012

Smoke entry cost = normal +1 plus extra +12 = 13, so A3’s g = 1 (A2) + 13 = 14. The cheapest-looking frontier node is B1/C1 — the drone should head down, not into the smoke.

Q5 — CoDeepNEAT improvement 3 marks

A CoDeepNEAT-evolved image classifier reaches only 60% accuracy after 50 generations. Suggest modifications and justify (<70 words).

Show worked solution

Increase population size and generations for a wider blueprint/module search; add regularisation (dropout, batch-norm) and data augmentation to cut overfitting; train each candidate longer before scoring so fitness reflects true capacity; enrich the module search space (skip/residual connections, larger filters); and tune mutation/crossover rates plus weight inheritance. 60% suggests under-trained or too-small a search space, not a hopeless architecture. (~60 words)

Q6 — Pattern databases for Rubik’s Cube 4.5 marks

Explain how the Rubik’s Cube can be solved using a pattern database for heuristic generation: what patterns are stored, how the database is generated, the heuristic, and how it guides search to the solved state.

Show worked solution

What patterns are stored. A subset (abstraction) of the cube’s pieces — e.g. the positions+orientations of the 8 corner cubies (corner DB), or chosen groups of edge cubies (edge DBs). Each entry is one configuration of that sub-set, ignoring the other pieces.

How the database is generated. Run a backward breadth-first search from the solved state over the abstracted (projected) state space. For every reachable pattern, record the minimum number of moves needed to solve that sub-problem. Store these in a lookup table indexed by the pattern.

The heuristic. For a real cube state, project it to the pattern and look up the stored cost: \(h(s)=\) min moves to solve that sub-set. This is an admissible, consistent lower bound, because solving the whole cube needs at least as many moves as solving any sub-set. Multiple disjoint DBs are combined by taking the maximum (or summing if additive/disjoint).

How it guides search. Plugged into IDA*/A*, the admissible h prunes branches whose \(f=g+h\) exceeds the bound, focusing exploration toward the solved cube. Korf used corner + edge pattern databases to solve the cube optimally, cutting the search from astronomically many nodes to a feasible number.

Q7 — Genetic Algorithm, one iteration 4.5 marks

Smart-hostel appliance scheduling with a GA. A chromosome = one daily control schedule; each gene = <Time Slot, AC Temp, Fan Speed, Light, Water Heater>. Hard constraints get high penalty, soft constraints low penalty. Show the 1st iteration: 2 parents, 2 children, roulette-wheel selection and one-point crossover. Show all steps.

Show worked solution

Fitness numbers aren’t fixed by the question, so here is a fully worked illustrative run (state your assumptions in the exam). Lower penalty ⇒ higher fitness; use \(\text{fitness}=1/(1+\text{penalty})\).

Step 1 — initial population (4 chromosomes, each 4 genes = slots S1..S4):

ChromosomeGenes (AC°C / fan / light / heater per slot)PenaltyFitness 1/(1+p)
C126/2/ON/ON · OFF/OFF/OFF/OFF · 27/3/OFF/OFF · 25/2/ON/OFF40.20
C224/3/ON/ON · 25/1/OFF/OFF · 26/2/ON/OFF · 24/2/ON/OFF90.10
C328/1/OFF/OFF · 27/1/OFF/OFF · 28/1/OFF/OFF · 26/1/ON/OFF10.50
C416/3/ON/ON · 30/3/ON/ON · 17/3/ON/ON · 31/3/ON/ON19 (hard viol.)0.05

Step 2 — roulette-wheel selection. Total fitness = 0.20+0.10+0.50+0.05 = 0.85. Selection probabilities: C1 = 0.235, C2 = 0.118, C3 = 0.588, C4 = 0.059. Spinning the wheel twice, the high-fitness C3 and C1 are selected as the two parents (C4 almost never survives — it violates hard constraints).

Step 3 — one-point crossover between Parent1 = C3 and Parent2 = C1, crossover point after gene 2:

P1 = [g1C3 g2C3 | g3C3 g4C3]
P2 = [g1C1 g2C1 | g3C1 g4C1]
Child1 = [g1C3 g2C3 | g3C1 g4C1] = 28/1/OFF/OFF · 27/1/OFF/OFF · 27/3/OFF/OFF · 25/2/ON/OFF
Child2 = [g1C1 g2C1 | g3C3 g4C3] = 26/2/ON/ON · OFF/OFF/OFF/OFF · 28/1/OFF/OFF · 26/1/ON/OFF

Step 4 — (optional) mutation: flip one gene with small probability, e.g. Child2 slot-1 heater ON→OFF during peak tariff. Step 5 — evaluate children’s penalties and form the next generation. End of iteration 1.

Q8 — Alpha-Beta pruning extremes 4 marks

A game tree: root = maximizer, second level = minimizer, with nine leaves \(x_1..x_9\) (three MIN nodes, three leaves each). (a) Fill the leaves so alpha-beta does no pruning (show why). (b) Fill them for maximum pruning (show steps). (c) When does alpha-beta beat minimax in time complexity?

Show worked solution

Tree: root MAX over three MIN nodes M1(x1,x2,x3), M2(x4,x5,x6), M3(x7,x8,x9).

(a) No pruning. Leaves left→right: 3, 5, 8,   6, 7, 2,   9, 10, 1.
M1 has α=−∞ so all three leaves are examined → v(M1)=min(3,5,8)=3, α=3. At M2 a MIN node prunes only if a leaf ≤ α=3 before the last leaf; here x4=6>3, x5=7>3, so no cutoff until x6 (the last leaf) → all examined, v(M2)=2. At M3, α stays 3; x7=9>3, x8=10>3 → no cutoff before last leaf x9 → all examined. No node is ever pruned.

(b) Maximum pruning. Leaves: 8, 8, 8,   2, –, –,   2, –, – (e.g. 8,8,8,2,9,9,2,9,9).
M1 evaluated fully (α=−∞) → v(M1)=8, α=8. At M2, first leaf x4=2 ≤ α=8 → β-cutoff, prune x5,x6. At M3, first leaf x7=2 ≤ α=8 → prune x8,x9. Only 5 of 9 leaves examined; x5,x6,x8,x9 pruned — the maximum possible (M1’s three leaves are unavoidable).

(c) When is alpha-beta faster? With good move ordering (best successors examined first), alpha-beta explores \(O(b^{d/2})\) nodes vs minimax’s \(O(b^{d})\) — effective branching factor \(\sqrt{b}\), letting it search roughly twice as deep for the same cost. In the worst ordering it degrades to minimax \(O(b^{d})\). So it wins whenever pruning actually occurs (ordering is not adversarial).


Makeup exam — what to study study guide

The makeup mid-sem covers the same concepts with different numbers/scenarios. Master the method for each topic below and you can answer any reskin of these questions.

Concept (revise this)Tested inWhat to be able to do
Four views of AI; rational agentQ1Contrast acting/thinking × humanly/rationally; argue why human-like ≠ intelligent; list bias/transparency/privacy risks.
PEAS & environment dimensionsQ2Write PEAS for any agent; classify the 6 environment axes with one-line justifications.
A* searchQ3A, Q4Run A* with f=g+h, maintain frontier, break ties alphabetically, recover optimal path; build a search tree and compute g/h per node.
Greedy Best-First / informed search limitsQ3BExplain why greedy (h only) is non-optimal & incomplete; give a counter-example.
Heuristics & pattern databasesQ4, Q6Define admissible/consistent heuristics; explain pattern-DB generation via backward BFS and how it bounds the search.
Evolutionary methods (CoDeepNEAT, GA)Q5, Q7Diagnose/improve neuro-evolution; run one GA generation: fitness → roulette selection → one-point crossover → mutation.
Adversarial search / alpha-betaQ8Construct leaf values for no-pruning vs max-pruning; state best/worst-case complexity and the role of move ordering.
Fast revision path: open the ACI cheatsheet for the formulas, the formula sheet for search complexities, then re-drill A* and alpha-beta on the question bank.
← ACI vault ACI cheatsheet →
© cvam — written in plaintext, served warm