---
title: "Why searching; production system"
subject: "Artificial Intelligence"
chapter: 2
key: "semester_6/artificial_intelligence:searching-necessity-production-system"
source: https://www.bctengineer.com/q/semester_6/artificial_intelligence/searching-necessity-production-system
site: BCT Engineering
---

# Why searching; production system

Artificial Intelligence · Chapter 2: Problem Solving

- Asked in: 2070 Magh, 2+6 marks
- Video: [L38: Production System in Artificial Intelligence | Characteristics, Advantages, Steps to Solve](https://www.youtube.com/watch?v=Aebkfuqj1Og) — Easy Engineering Classes
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/artificial_intelligence/searching-necessity-production-system
- Whole chapter: https://www.bctengineer.com/md/semester_6/artificial_intelligence/chapter-2

## Question

Why is searching necessary in AI? Explain the role of production system with a suitable example.

## Short answer

Searching is necessary because many AI problems lack direct solutions and require exploring a state space. A production system uses IF-THEN rules, working memory, and a control strategy; for example, the water jug problem is solved by rules for filling, emptying, and pouring until reaching the goal state (2,0).

## Answer

#### Why searching is necessary in AI
- Most AI problems (puzzles, planning, route finding, game playing, scheduling) have **no direct formula or algorithm** that gives the answer. We must explore possible sequences of actions to find one that reaches the goal.
- The problem is represented as a **state space** (states, operators, initial state, goal). Finding a solution means searching a path from the initial state to a goal state.
- The state space is usually huge (combinatorial explosion), so we need systematic search to avoid missing solutions, and **heuristic search** to avoid examining everything.
- Search also finds the **best** (optimal) solution when several solutions exist.

#### Production system
A **production system** is a model of computation in which the problem-solving knowledge is encoded as IF-THEN rules (productions) and applied by a control strategy until the goal is reached.

**Components**
1. **Production rules:** a set of condition → action pairs, e.g. "IF the 4 L jug is not full THEN fill it".
2. **Working memory / global database:** the current state of the problem; rules read and change it.
3. **Control strategy:** decides which applicable rule to fire when several match (conflict resolution), e.g. first match, priority, most specific rule; and decides the search order (depth-first, breadth-first, heuristic) with backtracking.

```text
 +---------------+  match   +---------------+
 | Rule base     |--------->| Conflict set  |
 | (IF..THEN..)  |          +-------+-------+
 +---------------+                  | select (control)
        ^ update                    v
 +------+--------+  fire    +---------------+
 | Working memory|<---------| Chosen rule   |
 +---------------+          +---------------+
```

**Role:** separates knowledge (rules) from control, so rules can be added or removed without changing the program; it gives a natural way to carry out state-space search; it is the basis of expert systems (MYCIN, OPS5) and rule-based reasoning; it supports reasoning and explanation by recording the rules fired.

#### Example: water jug problem
There are a 4 L jug (x) and a 3 L jug (y), both empty. Goal: exactly 2 L in the 4 L jug, state (2, y).

| No. | Condition | Action |
|---|---|---|
| 1 | x < 4 | (x, y) → (4, y) fill 4 L jug |
| 2 | y < 3 | (x, y) → (x, 3) fill 3 L jug |
| 3 | x > 0 | (x, y) → (0, y) empty 4 L jug |
| 4 | y > 0 | (x, y) → (x, 0) empty 3 L jug |
| 5 | x + y ≥ 4 and y > 0 | (x, y) → (4, y − (4 − x)) pour 3 L into 4 L until full |
| 6 | x + y ≥ 3 and x > 0 | (x, y) → (x − (3 − y), 3) pour 4 L into 3 L until full |
| 7 | x + y ≤ 4 and y > 0 | (x, y) → (x + y, 0) pour all of 3 L into 4 L |
| 8 | x + y ≤ 3 and x > 0 | (x, y) → (0, x + y) pour all of 4 L into 3 L |

**Solution (rules fired):** (0,0) →R2→ (0,3) →R7→ (3,0) →R2→ (3,3) →R5→ (4,2) →R3→ (0,2) →R7→ (2,0). Goal reached.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Why is searching necessary in AI?
   A. Search is faster than any formula
   B. Computers cannot store solutions
   C. All problems have tiny state spaces
   D. Most problems have no direct formula, so we explore sequences of actions to reach the goal
   Answer: D. With no direct algorithm, a solution is found by searching the state space. (Key point: Why search)

2. Why is heuristic search used?
   A. The state space is huge (combinatorial explosion), so we avoid examining everything
   B. To make the state space larger
   C. To remove goal tests
   D. To make rules unnecessary
   Answer: A. Heuristics cut down the exploration of a huge space. (Key point: Heuristic search)

3. Which are the three components of a production system?
   A. Compiler, linker, loader
   B. Production rules, working memory, control strategy
   C. Input, process, output
   D. Agent, sensor, actuator
   Answer: B. Rules, working memory (global database) and a control strategy. (Key point: Production system components)

4. What does the control strategy do?
   A. Stores facts
   B. Defines the goal only
   C. Chooses which applicable rule to fire and the search order
   D. Adds new rules automatically
   Answer: C. It resolves conflicts among matching rules and sets search order. (Key point: Role of control strategy)

5. In the 4 L / 3 L water jug example, how does the solution begin?
   A. (0,0) fill 4 L jug, then empty
   B. (0,0) pour 3 L into 4 L to (4,3)
   C. (0,0) empty both
   D. (0,0) fill 3 L jug to (0,3), then pour into 4 L to (3,0)
   Answer: D. Rule 2 fills the 3 L jug, rule 7 pours it all into the 4 L jug. (Key point: Water jug solution)

## Related in Artificial Intelligence

- [Searching: BFS vs DFS comparison](https://www.bctengineer.com/question.md?key=semester_6%2Fartificial_intelligence%3Ablind-search-dfs-bfs-compare) — Artificial Intelligence, chapter 3, asked 5×

## Related in other subjects

- [System concept and production system model](https://www.bctengineer.com/question.md?key=semester_6%2Findustrial_engineering_and_management%3Asystem-concept-production-system) — Industrial Engineering and Management, chapter 1
- [Three phase system; role of aggregate phase](https://www.bctengineer.com/question.md?key=semester_5%2Fconcrete_technology_and_masonry_structure%3Athree-phase-aggregate-phase) — Concrete Technology and Masonry Structure, chapter 2
- [Production room 27 × 45 m twin 36 W tubes](https://www.bctengineer.com/question.md?key=semester_6%2Findustrial_power_distribution_and_illumination%3Aproduction-room-27x45) — Industrial Power Distribution and Illumination, chapter 7, asked 4×
- [Deadlock; necessary conditions with examples](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Adeadlock-necessary-conditions-examples) — Operating System, chapter 7
