Topic 7: Wumpus World Case Study

Classic Testbed for Logical Agents

Back to Lecture 7 Overview

What is Wumpus World?

Wumpus World is a classic AI environment designed to test logical reasoning agents. It features partial observability, uncertainty, and requires intelligent reasoning to navigate safely.

Why Wumpus World is Perfect for KBAs:
  • Partial Observability: Agent can't see the whole world
  • Uncertainty: Multiple possible world states
  • Logical Inference: Can derive safe actions from percepts
  • Knowledge Accumulation: Each step adds new information

World Description

Wumpus World is a 4×4 grid where the agent must navigate to find gold while avoiding dangers. The world contains:

Wumpus World Grid (4×4)
W
P
G
A
World Elements:
Dangers:
  • Wumpus: Deadly monster (1 per world)
  • Pits: Bottomless holes (0-3 per world)
Goals:
  • Gold: Treasure to collect (1 per world)
  • Exit: Return to starting position

PEAS Analysis

Component Description
Performance Find gold, avoid wumpus and pits, minimize steps
Environment 4×4 grid, partially observable, stochastic, sequential
Actuators Move forward, turn left/right, grab gold, shoot arrow
Sensors Stench (near wumpus), breeze (near pit), glitter (gold present)

Percepts and Actions

Percepts:
Stench
(near wumpus)
Breeze
(near pit)
Glitter
(gold present)
Bump
(hit wall)
Scream
(wumpus killed)
Actions:
Move Forward
Turn Left
Turn Right
Grab Gold
Shoot Arrow

Knowledge Representation

The agent represents its knowledge using propositional logic statements:

Knowledge Base Structure:
  • Percepts: S₁,₁ (stench), B₁,₁ (breeze), G₁,₁ (glitter)
  • Dangers: W₁,₁ (wumpus), P₁,₁ (pit)
  • Safety: Safe₁,₁ (safe to enter)
  • Visited: V₁,₁ (has been visited)
Inference Rules:
  • S₁,₁ ↔ (W₁,₁ ∨ W₁,₂ ∨ W₂,₁) (stench means wumpus nearby)
  • B₁,₁ ↔ (P₁,₁ ∨ P₁,₂ ∨ P₂,₁) (breeze means pit nearby)
  • ¬W₁,₁ ∧ ¬P₁,₁ → Safe₁,₁ (safe if no wumpus and no pit)

Step-by-Step Reasoning Process

Let's trace through a typical reasoning sequence:

Reasoning Steps:
  1. Agent starts at (1,1) - safe by definition
  2. Moves to (1,2), perceives stench
  3. Concludes: W₁,₁ ∨ W₁,₃ ∨ W₂,₂
  4. Moves to (2,1), no stench
  5. Concludes: ¬W₁,₁ ∧ ¬W₂,₂
  6. Updates: W₁,₃ (wumpus must be at (1,3))
  7. Moves to (2,2), perceives breeze
  8. Concludes: P₂,₁ ∨ P₂,₃ ∨ P₁,₂ ∨ P₃,₂
  9. Continues reasoning to find safe path
Example Inference:

Given: S₁,₂ (stench at (1,2))

Rule: S₁,₂ ↔ (W₁,₁ ∨ W₁,₃ ∨ W₂,₂)

Conclusion: W₁,₁ ∨ W₁,₃ ∨ W₂,₂

Additional Info: ¬W₁,₁ (no stench at (2,1))

Final Conclusion: W₁,₃ ∨ W₂,₂

Challenges in Wumpus World

Key Challenges:
  • Partial Observability: Can't see the whole world
  • Uncertainty: Multiple possible world states
  • Logical Inference: Must derive safe actions
  • Knowledge Management: Must track what's known/unknown
  • Decision Making: Must choose between multiple safe actions
Why These Challenges Matter:
  • Real-world Relevance: Many real problems have similar challenges
  • Logical Reasoning: Tests ability to reason with incomplete information
  • Knowledge Representation: Tests ability to represent and update knowledge
  • Decision Making: Tests ability to make intelligent choices

Agent Strategies

Different types of agents can approach Wumpus World differently:

Logical Agent:
  • Uses knowledge base
  • Applies inference rules
  • Derives safe actions
  • Most intelligent approach
Random Agent:
  • Chooses actions randomly
  • No reasoning
  • Very likely to die
  • Baseline for comparison
Performance Comparison:
  • Logical Agent: High success rate, efficient
  • Random Agent: Very low success rate
  • Reactive Agent: Medium success rate, no learning
  • Learning Agent: Improves over time

Wumpus World Extensions

Wumpus World can be extended to test more sophisticated reasoning:

Extensions:
  • Larger Worlds: 5×5, 10×10 grids
  • Multiple Wumpuses: More complex reasoning
  • Probabilistic: Uncertainty in percepts
  • Learning: Adapt to world patterns
Advanced Features:
  • Time Constraints: Limited time to find gold
  • Energy: Limited movement energy
  • Communication: Multiple agents
  • Dynamic World: World changes over time

Key Takeaways

Wumpus World:
  • Classic testbed for logical agents
  • Tests partial observability
  • Requires logical reasoning
  • Demonstrates knowledge-based AI
Lessons Learned:
  • Knowledge representation is crucial
  • Logical inference enables safe actions
  • Partial observability is challenging
  • Reasoning beats random behavior
Next Steps:

Now that we've seen how logical reasoning works in practice, we'll explore the practical considerations and limitations in Topic 8: Practical Considerations.

Previous: Reasoning Techniques Next: Practical Considerations