Artificial Intelligence
Artificial Intelligence
CA-1 Assignment
NAME – BIDISHA SARKAR
DEPARTMENT – COMPUTER SCIENCE &
ENGINEERING ROLL NUMBER –
10200222028
YEAR – 3RD SEMESTER – 5TH
SESSION – 2024 -2025 DATE –
07.08.2024
TOPIC 1: WATER-JUG
PROBLEM
• Abstract
• Introduction
• Problem
Description
• Process
• Algorithm
• Conclusion
• Reference
ABSTRACT
The water jug problem involves measuring a
specific amount of water using two jugs with
different capacities. It illustrates problem-
solving techniques in AI and computer science,
employing operations like filling, emptying,
and transferring water between jugs. This
presentation covers problem definition,
solution strategies, and algorithmic
approaches.
INTRODUCTION
• The water jug problem is a classic example in AI and computer
science.
• Involves two jugs with capacities m and n liters, and a goal to
measure d liters.
• Useful for teaching problem-solving, algorithm design, and
mathematical reasoning.
• Operations allowed include filling, emptying, and
transferring water.
• This presentation explores the problem statement,
solution process,
algorithm, and applications.
• Highlights the relevance of the problem in understanding search
algorithms like BFS and DFS.
PROBLEM DESCRIPTION
• Overview: Classic puzzle in artificial • Operations :
intelligence. • Fill either jug completely.
• Jugs: • Empty either jug completely.
• One jug with a capacity of x liters. • Pour water from one jug to the other
• Another jug with a capacity of y liters. until one is empty or the other is
• Objective: Measure exactly z liters of water. full.
• Constraints: • F o c u s : Pr o b l e m - s o l v i n g a n d
• No volume markings on the jugs. state
• Unlimited water source available. space search.
• Initial State: Both jugs are empty. • Ap p r o a c h : F i n d a n e ff i c i e n t
• Goal State: One jug holds exactly z liters. sequence of steps using the
allowed operations to measure
the desired
amount of water.
PROCESS
•Fill Jug A: Fill jug A to its full capacity.
•Fill Jug B: Fill jug B to its full capacity.
•Empty Jug A: Empty the jug A.
•Empty Jug B: Empty the Jug B.
•Pour from A to B: Pour water from jug A to jug B unless you get an empty jug A or full jug B.
•Pour from B to A: Pour water from jug B to jug A until either jug B is empty or jug A is full.
ALGORITHM
Breadth-First Search(BFS) approach:
•M i n i m a x Al g o r i t h m : F u n d a m e n t a l i n A I
for decision- making in competitive
games.
• Context : Used in turn- based games
where
players al ternate turns.
•O b j e c t i ve : M a x i m i z e t h e p l a y e r ' s m i n i m u m
g a i n assuming the opponent aims to
minimize the
player' s gain.
• G a m e Typ e : Ty p i c a l l y a p p l i e d t o z e r o - s u m
games where one player' s gain is another ’
s loss.
•Features : Assumes rational behavior f rom
all players, searching through the game t
ree for
optimal st r a t egi es.
PROBLEM DESCRIPTION
• https://www.wikipedia.com
tutorialspoint.com
REFERENCE • https://www.tutorialspoint.com
• https://www.slideshare.net
Thank
You.