0% found this document useful (0 votes)
4 views4 pages

Ai Unit 2

The document discusses the Minimax algorithm, a decision-making strategy used in AI for two-player games, which aims to minimize potential losses while maximizing gains. It also covers Alpha-Beta Pruning, an optimization technique that enhances the efficiency of the Minimax algorithm by reducing the number of evaluated nodes. Additionally, it introduces the Jug Problem and Tiles Problem, both of which are classic AI problems involving state-space search and specific goal configurations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views4 pages

Ai Unit 2

The document discusses the Minimax algorithm, a decision-making strategy used in AI for two-player games, which aims to minimize potential losses while maximizing gains. It also covers Alpha-Beta Pruning, an optimization technique that enhances the efficiency of the Minimax algorithm by reducing the number of evaluated nodes. Additionally, it introduces the Jug Problem and Tiles Problem, both of which are classic AI problems involving state-space search and specific goal configurations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

UNIT – 2

 Minimax :

 decision-making algorithm used in AI, particularly in the context of two-player


games such as chess, tic-tac-toe, and checkers.
 It is designed to minimize the possible loss for a worst-case scenario while
maximizing the potential gain.
 The algorithm assumes that both players are playing optimally, meaning they will
make the best possible moves to win the game.

Key Concepts of the Minimax Algorithm

1. Game Tree:

 operates on a game tree, where each node represents a game state, and
edges represent possible moves.

 root node  current state of the game.

 Child node  states resulting from possible moves.

2. Players:

 The algorithm typically involves two players:

 Maximizing Player: The player trying to maximize their score (often


referred to as "Max").

 Minimizing Player: The opponent trying to minimize the score of the


maximizing player (often referred to as "Min").

3. Utility Function:

 assign a numerical value to terminal nodes (end states) of the game tree.
This value represents the desirability of that state for the maximizing player
(e.g., a win might be +1, a loss -1, and a draw 0).

4. Backtracking:

 The algorithm backtracks through the tree, propagating the values up to the
root node.

 The root node will ultimately contain the best possible .

Applications
 Game Playing: Widely used in AI for games like chess, checkers, tic-tac-toe, and
other turn-based games.

 Decision Making: Can be applied in scenarios where two opposing agents make
decisions, such as in economic models or competitive environments.

 Alpha-Beta Pruning

is an optimization technique for the Minimax algorithm used in decision-making and game-
playing AI.

It reduces the number of nodes evaluated in the game tree, allowing the algorithm to run
more e iciently.

This is particularly useful in games with large search spaces, such as chess or checkers.

Key Concepts of Alpha-Beta Pruning

1. Alpha and Beta Values:

 Alpha (α): The best value that the maximizing player (Max) can guarantee at
that level or above. It represents the minimum score that the maximizing
player is assured of.

 Beta (β): The best value that the minimizing player (Min) can guarantee at
that level or above. It represents the maximum score that the minimizing
player is assured of.

2. Pruning:

 During the search, if the algorithm finds a move that proves to be worse than
a previously examined move, it can "prune" (ignore) that branch of the tree.
This means that the algorithm does not need to explore that branch further,
as it cannot influence the final decision.

How Alpha-Beta Pruning Works

1. Initialization:

 Start with initial values: ( alpha = -infty ) (for Max) and ( beta = +infty ) (for
Min).

2. Tree Traversal:

 Traverse the game tree using the Minimax algorithm, but at each node,
update the alpha and beta values:
 For a maximizing node, update ( alpha ) with the maximum value
found so far.

 For a minimizing node, update ( beta ) with the minimum value


found so far.

3. Pruning Condition:

 If at any point ( alpha ) (the best option for Max) is greater than or equal to (
beta ) (the best option for Min), prune the remaining branches. This means
that the current path will not yield a better outcome for the maximizing player
than what has already been found.

 Jug Problem (or Water Jug Problem)

is a classic problem in AI that involves measuring a specific amount of water using two
jugs of di erent capacities.

The problem can be framed as a state-space search problem, where the goal is to reach
a desired amount of water in one of the jugs through a series of allowed operations.

Problem Definition

1. Jugs: You have two jugs with capacities ( A ) and ( B ) liters, respectively. The jugs can
hold a maximum of ( A ) and ( B ) liters of water.

2. Initial State: Both jugs are initially empty (0 liters).

3. Goal State: The goal is to measure exactly ( C ) liters of water in one of the jugs,
where ( C ) is less than or equal to the maximum capacity of either jug.

4. Allowed Operations:

 Fill a jug completely from a water source.

 Empty a jug completely.

 Pour water from one jug to the other until one jug is either full or the other is
empty.

Example

Consider the following example:

 Jug A has a capacity of 5 liters.

 Jug B has a capacity of 3 liters.


 The goal is to measure exactly 4 liters.

 Tiles Problem :

 AKA Sliding Puzzle,


 consists of a square grid of numbered tiles with one empty space, allowing the tiles
to slide into the empty space.
 The objective is to arrange the tiles in a specific order, typically in ascending
numerical order, by sliding them into the empty space.

Problem Definition

1. Grid Configuration:

 The puzzle consists of a (4 x 4) grid containing 15 numbered tiles (1 to 15) and


one empty space. The goal is to arrange the tiles in a specific order.

2. Allowed Moves:

 A tile can slide into the empty space if it is adjacent to the empty space. This
means that the possible moves depend on the current position of the empty
space.

3. Goal State:

 The goal is to reach a specific configuration of the tiles, typically the


ordered arrangement

You might also like