Russell & Norvig β AI: A Modern Approach
Inspired by a warm conversation with Prof. R K Mishra & Prof. Devender Singh, IIT BHU
Find the gold β¨, grab it, and climb out at [1,1] alive. Maximize your score.
| Percept | Means |
|---|---|
| π’ Stench | Wumpus is in an adjacent cell (up/down/left/right) |
| π¨ Breeze | A pit is in an adjacent cell |
| β¨ Glitter | Gold is in this cell β use Grab! |
| Bump | You walked into a wall (no movement) |
| π― Scream | Your arrow killed the Wumpus |
| Event | Points |
|---|---|
| Grab gold + climb out at [1,1] | +1000 |
| Death (pit or Wumpus) | β1000 |
| Each action | β1 |
| Shooting the arrow | β10 |
| Input | Action |
|---|---|
| β button / Arrow Up / W | Move up (face up) |
| β button / Arrow Down / S | Move down (face down) |
| β button / Arrow Left / A | Move left (face left) |
| β button / Arrow Right / D | Move right (face right) |
| Swipe on touchscreen | Move in swipe direction |
| Input | Action |
|---|---|
| β© Q button / Q key | Turn left (counter-clockwise) |
| E βͺ button / E key | Turn right (clockwise) |
Turning costs β1 point (it's an action). Use this to aim your arrow before shooting!
| Input | Action |
|---|---|
| β Grab / G key | Pick up gold (if in current cell) |
| πΉ Shoot / F key | Fire arrow in facing direction (straight line) |
| π§ Climb / C key | Climb out β only works at [1,1] |
| π New | Start a new game |
| Symbol | Meaning |
|---|---|
| π§βπβ‘ π§βπβ¬ π§βπβ¬ π§βπβ¬ | You (explorer + arrow shows facing direction) |
| πΉ | Wumpus (revealed on death/game end) |
| π³οΈ | Pit (revealed on death/game end) |
| β¨ | Gold |
| β | KB inferred: cell is safe |
| β | Unknown β cannot determine safety |
| β οΈ | Dead Wumpus (killed by your arrow) |
| PEAS | Wumpus World |
|---|---|
| Performance | +1000 gold & escape, β1000 death, β1/action, β10 arrow |
| Environment | 4Γ4 (or NΓN) grid cave with pits, wumpus, gold |
| Actuators | Forward, TurnLeft, TurnRight, Grab, Shoot, Climb |
| Sensors | Stench, Breeze, Glitter, Bump, Scream |
| Property | Value |
|---|---|
| Observable | Partially β only current cell percepts |
| Deterministic | Yes in Classic; No in Stochastic mode |
| Episodic / Sequential | Sequential β past actions affect future |
| Static / Dynamic | Static β world doesn't change while agent thinks |
| Discrete / Continuous | Discrete |
| Single / Multi-agent | Single agent (Wumpus is environment, not agent) |
β Play Classic mode to observe all these properties firsthand.
β Open the "Knowledge Base" panel above the grid to see this in action!
Key idea: encode percepts as propositions and use inference rules.
"No breeze at [1,1] implies no pit at [1,2] and [2,1]"
"Stench at [1,2] but not [1,1] β Wumpus is at [1,3] or [2,2]"
Methods to determine entailment (KB β¨ Ξ±):
β In Classic mode, the KB panel shows exactly these inferences as you explore.
"A cell has breeze iff some adjacent cell has a pit" β covers any grid size with one sentence.
"No breeze means all neighbors are pit-free."
β Try Large Cave (6Γ6) mode β notice how many propositions you'd need vs. one FOL rule.
Where:
The book builds a Bayesian network where:
β In Stochastic mode, your moves slip 20% of the time β pure logic fails, you must reason probabilistically about which cells are safe to attempt to reach.
Now even "safe" inferences might be wrong. You need to maintain belief states β probability distributions over possible worlds, updated at each step.
This connects to:
β In Noisy Sensors mode, percepts lie 15% of the time. Watch the KB make wrong inferences! Dashed orange borders = uncertain cells.
Where U(s,a) accounts for:
β Nightmare mode combines everything: stochastic moves + noisy sensors + 6Γ6 + 2 Wumpi. Pure decision theory territory!
| In Game | Formal | Meaning |
|---|---|---|
| π¨ Breeze | Bx,y | Adjacent cell has a pit |
| π’ Stench | Sx,y | Adjacent cell has Wumpus |
| β¨ Glitter | Gx,y | Gold is in this cell |
| β Safe | KB β¨ Β¬P β§ Β¬W | Inferred: no pit and no Wumpus |
| β Unknown | KB β safe | Cannot determine safety |
| β οΈ SLIPPED | P(s'|s,a) β 1 | Non-deterministic transition |
| π« sensors unreliable | P(obs|state) < 1 | Sensor model is noisy |
| Game Mode | Chapters | Concepts Practiced |
|---|---|---|
| π Classic | Ch. 2, 7 | PEAS, propositional logic, KB agents, entailment |
| π² Stochastic | Ch. 13 | Probability, Bayes' theorem, uncertain actions* |
| π‘ Noisy | Ch. 15 | Sensor models, belief states, filtering* |
| πΊοΈ Large | Ch. 8β9 | FOL scalability, universal quantification* |
| π Nightmare | Ch. 16 | Decision theory, MEU, decision networks* |
* Stochastic, Noisy, Large, and Nightmare are extensions inspired by textbook concepts. Classic mode is the exact specification from Section 7.2.
Reference: Russell, S. & Norvig, P. β Artificial Intelligence: A Modern Approach (4th Edition)