Professional Documents
Culture Documents
Ai Assignment
Ai Assignment
- States: The state in this problem can be defined by the amount of water in each jug. So,
we have two jugs, Jug A with a capacity of 4 gallons and Jug B with a capacity of 3 gallons.
Each state can be represented as (x, y), where x is the amount of water in Jug A and y is the
amount of water in Jug B. The initial state is (0, 0), and the goal state is (2, _), where _
represents any amount of water in Jug B.
- Operators/Moves:
1. Fill Jug A: Fills Jug A to its maximum capacity.
2. Fill Jug B: Fills Jug B to its maximum capacity.
3. Empty Jug A: Empties the contents of Jug A.
4. Empty Jug B: Empties the contents of Jug B.
5. Pour from Jug A to Jug B: Transfers water from Jug A to Jug B until Jug B is full or Jug A is
empty.
6. Pour from Jug B to Jug A: Transfers water from Jug B to Jug A until Jug A is full or Jug B is
empty.
At this point, we have 2 gallons of water in Jug A, which is the goal state.
Starting from the initial state (0, 0), we can follow these steps to reach the goal state (2, _):