Computer Science AI Problem Lab

Water Jug Problem Interactive Visualizer

Solve the classic water jug problem by pouring, filling, and emptying jugs while tracing each state toward the target amount. Learn the model, state transitions, search behavior, and practical AI reasoning flow through an OpenLabs interactive simulator.

AI Visualizer
State transitions and goal search
Jug State
3L
5L
Step 1
Fill jug
Step 2
Pour between jugs
Step 3
Empty jug
Step 4
Test target

AI concept

The water jug problem is a state-space search problem where an agent must measure a target amount using jugs of fixed capacities.

Reasoning flow

The search explores states created by fill, empty, and pour actions until a state satisfies the target measurement goal.

Model focus

State transitions and goal search

Visualization

Trace each state, decision, or rule step through an interactive learning flow.

Learn by simulating

Understand Water Jug with step-by-step AI reasoning

The search explores states created by fill, empty, and pour actions until a state satisfies the target measurement goal. The lab turns abstract AI problem solving into a visible sequence of states, decisions, and results.

Understand state representation for classic AI search.

Visualize fill, empty, and pour operations.

Trace solution paths through state transitions.

Connect water jug search with BFS, DFS, and goal testing.

Where this AI concept is used

  • AI search fundamentals
  • State-space modeling
  • Puzzle solving
  • Planning and transition systems

How the interactive lab works

Open the Water Jug lab, adjust the problem inputs, and follow how the visualizer updates each state or inference step. Use it to compare AI theory with observable behavior.

Curriculum Continuity

Explore Sibling AI & Search Experiments

View All AI Problems
Variables, domains, and constraintsBacktracking search with constraint checking

Constraint Satisfaction Problem

Explore how AI solves constraint satisfaction problems by assigning values to variables while respecting rules and pruning invalid choices.

Search and guessing strategyState space search and probabilistic guessing

Hangman AI Problem

Study how an AI agent can reason about hidden words, update possible candidates, and choose letters based on available evidence.

Local search optimizationHeuristic optimization over neighboring states

Hill Climbing Search

Watch hill climbing move from one state to a better neighboring state until it reaches a peak or gets stuck in a local optimum.

Reinforcement learningStates, actions, rewards, and Q-value updates

Maze Q-Learning

Explore reinforcement learning by watching an agent move through a maze, collect rewards, update Q-values, and learn better paths.

Classical AI planningState-space planning and goal achievement

Monkey Banana Problem

Visualize how an AI planner solves the classic monkey banana problem by sequencing actions to reach a goal state.

Deep learning & backpropagationForward pass activations, loss gradients, and weight updates

Multilayer Perceptron Neural Network

Interactive neural network simulator: configure layers, train on non-linear datasets, adjust learning rates, and visualize real-time decision boundary convergence.

Water Jug FAQs

What is the water jug problem?

It is an AI search problem where fixed-size jugs are used to measure a target amount of water.

Which actions are used in the water jug problem?

Common actions include filling a jug, emptying a jug, and pouring water from one jug to another.

What AI concept does it teach?

It teaches state-space search, state transitions, action modeling, and goal testing.

Ready to explore Water Jug?

Launch the visualizer and turn AI search, reasoning, and planning into a clear hands-on learning path.

Open Water Jug Visualizer