0% found this document useful (0 votes)
9 views

Introduction to Ai and Production Systen

The document provides an introduction to Artificial Intelligence (AI) and production systems, detailing the core components of problem formulation, problem-solving steps, and characteristics of effective control strategies. It discusses various problem-solving techniques, including search algorithms and the importance of knowledge representation in AI. Additionally, it outlines the structure of production systems, emphasizing their modularity and simplicity in decision-making processes.

Uploaded by

Harshitha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Introduction to Ai and Production Systen

The document provides an introduction to Artificial Intelligence (AI) and production systems, detailing the core components of problem formulation, problem-solving steps, and characteristics of effective control strategies. It discusses various problem-solving techniques, including search algorithms and the importance of knowledge representation in AI. Additionally, it outlines the structure of production systems, emphasizing their modularity and simplicity in decision-making processes.

Uploaded by

Harshitha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

INTRODUCTION TO AI AND

PRODUCTION SYSTEN
INTRODUCTION TO AI
• It is a branch of Computer Science that pursues creating the computers
or machines as intelligent as human beings.
• It is the science and engineering of making intelligent machines,
especially intelligent computer programs.
• Definition : Artificial Intelligence is the study of how to make
computers do things, which, at the moment, people do better.
• According to the father of Artificial Intelligence, John McCarthy, it is
“The science and engineering of making intelligent machines,
especially intelligent computer programs”.
PROBLEM FORMULATION

It is one of the core steps of problem solving which decides


what action should be taken to achieve the formulated goal
in Ai in this core part is dependent upon software agent
which consisted of the following components to formulate
the associated problem.
COMPONENTS TOOL FORMULATE THE
ASSOCIATED PROBLEM
• Initial state : This state requires an initial state for the problem which starts the AI
agent towards a specified goal in this state new methods also initialise problem domain
solving by a specific class.
• Action : This stage of problem formulation works with function with a specific class
taken from the initial state and all possible actions done in this stage.
• Transition : This stage of problem formulation integrates the actual action done by the
previous action stage and collect the final stage to forward it to their next stage.
• Goal test : This stage determines that the specified goal achieved by the integrated
transition model or not whenever the goal achieved stop the action and forward into the
next stage to determine the cost to achieve the goals.
• Path Costing : This component of problem solving numerical assigned what will be
the cost to achieve the goal it requires all hardware software and human working cost.
Problem Statement
We have an 3L and 5L
water jug and an unlimited
source of tap water we need
to measure 4L from this
how will you do that
SOLUTION
• Step 1 : Fill 5L jug and empty into 3L jug.
• Step 2 : 5L Jug will be left with 2L water. Then 3L jug and put 2L
water from 5L Jug to 3L jug.
• Step 3 : Now 3L jug is having 2L water, having space for 1 more
liter.
• Step 4 : Fill 5L jug and put 1L into 3L jug.
• Step 5 : Solved. Now 5L jug is left with 4L water.
PROBLEM, PROBLEM SPACE AND SEARCH
• A problem is a specific task or challenge that requires finding a solution or
making a decision.
• In artificial intelligence, problems can vary in complexity and scope,
ranging from simple tasks like arithmetic calculations to complex
challenges such as image recognition, natural language processing, game
playing, and optimization.
• Each problem has a defined set of initial states, possible actions or moves,
and a goal state that needs to be reached or achieved.
• For example, in a game of chess, the problem is to find a sequence of
moves that lead to checkmate, while in route planning, the problem is to
find the shortest path between two locations on a map.
PROBLEM, PROBLEM SPACE AND SEARCH
• The problem space is the set of all possible states, actions, and
transitions that can be encountered while attempting to solve a
specific problem.
• It represents the entire landscape of potential solutions and paths
from the initial state to the goal state.
• For example, in the problem of route planning, the problem space
includes all possible locations on the map as states and all valid
roads or paths between them as actions.
PROBLEM, PROBLEM SPACE AND SEARCH
• Search is the process of exploring the problem space to find a sequence
of actions or moves that lead to the goal state or a satisfactory solution.
In AI, search algorithms are used to systematically navigate through the
problem space and discover paths or solutions that satisfy the problem’s
constraints and objectives.
• There are various search algorithms used in AI, such as depth-first
search, breadth-first search, A* search, and heuristic search. Each
algorithm has its strengths and weaknesses, and the choice of search
algorithm depends on the problem’s characteristics, size of the problem
space, and the resources available.
PROBLEM SOLVING
The problem of AI is directly associated with the nature of humans and
their activities. So we need a number of finite steps to solve a problem
which makes human easy works.
These are the following steps which require to solve a problem
• Problem definition: Detailed specification of inputs and acceptable
system solutions.
• Problem analysis: Analyse the problem thoroughly.
• Knowledge Representation: collect detailed information about the
problem and define all possible techniques.
• Problem-solving: Selection of best techniques.
CHARACTERISTICS OF PROBLEM SOLVING
• Is the problem decomposable into small sub-problems which are easy to
solve?
• Can solution steps be ignored or undone?
• Is the universe of the problem is predictable?
• Is a good solution to the problem is absolute or relative?
• Is the solution to the problem a state or a path?
• What is the role of knowledge in solving a problem using artificial
intelligence?
• Does the task of solving a problem require human interaction?
1. IS THE PROBLEM DECOMPOSABLE INTO SMALL
SUB-PROBLEMS WHICH ARE EASY TO SOLVE?
Can the problem be broken down into smaller problems to be solved independently ? The decomposable
problem can be solved easily.
Example: In this case, the problem is divided into smaller problems.
The smaller problems are solved independently. Finally, the result is merged to get the final result.
2. CAN SOLUTION STEPS BE IGNORED OR UNDONE?
• In the Theorem Proving problem, a lemma that has been proved can
be ignored for the next steps.
• Such problems are called Ignorable problems.
• In the 8-Puzzle, Moves can be undone and backtracked.
• Such problems are called Recoverable problems.
2. CAN SOLUTION STEPS BE IGNORED OR
UNDONE?
• In Playing Chess, moves can be retracted.
• Such problems are called Irrecoverable problems.
• Ignorable problems can be solved using a simple control structure that
never backtracks. Recoverable problems can be solved using
backtracking. Irrecoverable problems can be solved by recoverable style
methods via planning.
3. IS THE UNIVERSE OF THE PROBLEM IS
PREDICTABLE?
• In Playing Bridge, We cannot know exactly where all the cards are or what
the other players will do on their turns.
• Uncertain outcome!
• For certain-outcome problems, planning can be used to generate a
sequence of operators that is guaranteed to lead to a solution.
• For uncertain-outcome problems, a sequence of generated operators can
only have a good probability of leading to a solution. Plan revision is made
as the plan is carried out and the necessary feedback is provided.
4. IS A GOOD SOLUTION TO THE PROBLEM
IS ABSOLUTE OR RELATIVE?
• The Travelling Salesman Problem, we have to try all paths to find
the shortest one . Any path problem can be solved using heuristics
that suggest good paths to explore.
• For best-path problems, a much more exhaustive search will be
performed.
5. IS THE SOLUTION TO THE PROBLEM A
STATE OR A PATH?
• The Water Jug Problem, the path that leads to the goal must be
reported.
• A path-solution problem can be reformulated as a state-solution
problem by describing a state as a partial path to a solution. The
question is whether that is natural or not.
6. WHAT IS THE ROLE OF KNOWLEDGE IN SOLVING A
PROBLEM USING ARTIFICIAL INTELLIGENCE?
Playing Chess
Consider again the problem of playing chess. Suppose you had unlimited
computing power available. How much knowledge would be required by a
perfect program? The answer to this question is very little—just the rules for
determining legal moves and some simple control mechanism that implements
an appropriate search procedure.
Additional knowledge about such things as good strategy and tactics could of
course help considerably to constrain the search and speed up the execution of
the program. Knowledge is important only to constrain the search for a
solution.
7. DOES THE TASK OF SOLVING A PROBLEM
REQUIRE HUMAN INTERACTION?
• Sometimes it is useful to program computers to solve problems in ways that
the majority of people would not be able to understand.
• This is fine if the level of the interaction between the computer and its human
users is problem-in solution-out.
• But increasingly we are building programs that require intermediate interaction
with people, both to provide additional input to the program and to provide
additional reassurance to the user.
• The solitary problem, in which there is no intermediate communication and
no demand for an explanation of the reasoning process.
• The conversational problem, in which intermediate communication is to
provide either additional assistance to the computer or additional information
to the user.
PRODUCTION SYSTEM
• A production system refers to a type of rule-based system that is
designed to provide a structured approach to problem solving and
decision-making.
• This framework is particularly influential in the realm of expert systems,
where it simulates human decision-making processes using a set of
predefined rules and facts.
COMPONENTS OF A PRODUCTION SYSTEM
• Global Database
A global database consists of the architecture used as a central data structure. A database
contains all the necessary data and information required for the successful completion of a
task. It can be divided into two parts as permanent and temporary. The permanent part of the
database consists of fixed actions, whereas the temporary part alters according to
circumstances.
• Production Rules
Production rules in AI are the set of rules that operate on the data fetched from the global
database. Also, these production rules are bound with precondition and postcondition that gets
checked by the database. If a condition is passed through a production rule and gets satisfied
by the global database, then the rule is successfully applied. The rules are of the form A®B,
where the right-hand side represents an outcome corresponding to the problem state
represented by the left-hand side.
COMPONENTS OF A PRODUCTION SYSTEM
• Control System
The control system checks the applicability of a rule. It helps decide
which rule should be applied and terminates the process when the
system gives the correct output. It also resolves the conflict of
multiple conditions arriving at the same time. The strategy of the
control system specifies the sequence of rules that compares the
condition from the global database to reach the correct result.
CONTROL STRATEGIES

• Control Strategy in Artificial Intelligence scenario is a technique or


strategy, tells us about which rule has to be applied next while
searching for the solution of a problem within problem space.
• It helps us to decide which rule has to apply next without getting
stuck at any point.
• Examples: Widely used Control Strategies are Breadth- First Search,
Depth-First Search, Generate and Test, Hill-Climbing, Best-first
search, Problem Reduction and many more.
CHARACTERISTICS OF CONTROL STRATEGIES
• Control Strategy should cause Motion
Each rule or strategy applied should cause the motion because if there will be
no motion than such control strategy will never lead to a solution. Motion
states about the change of state and if a state will not change then there be no
movement from an initial state and we would never solve the problem.
• Control Strategy should be Systematic
Though the strategy applied should create the motion but if do not follow
some systematic strategy than we are likely to reach the same state number of
times before reaching the solution which increases the number of steps.
Taking care of only first strategy we may go through particular useless
sequences of operators several times. Control Strategy should be systematic
implies a need for global motion as well as for local motion.
SEARCH STRATEGIES
• Search forms the core component of many intelligent processes.
• Search is the systematic examination of states to find path from the
start/root state to the goal state.
• Many traditional search algorithms are used in Ai applications.
• For Complex problems the traditional algorithms are unable to find
the solution within the some practical time and space limits.
• Consequently many special techniques are developed using heuristic
functions.
• Uninformed Search Algorithms
The search algorithms in this section have no additional information on the
goal node other than the one provided in the problem definition. The plans to
reach the goal state from the start state differ only by the order and/or length
of actions. Uninformed search is also called Blind search. These algorithms
can only generate the successors and differentiate between the goal state and
non goal state.

• Informed Search Algorithms


Here, the algorithms have information on the goal state, which helps in more
efficient searching. This information is obtained by something called a
heuristic.
BEST-FIRST SEARCH

It is a general heuristic based search technique. In best first search, in


the graph of problem representation, one evaluation function (which
corresponds to heuristic function) is attached with every node. The
value of evaluation function may depend upon cost or distance of
current node from goal node. The decision of which node to be
expanded depends on the value of this evaluation function. The best
first can understood from following tree. In the tree, the attached
value with nodes indicates utility value.
BEST-FIRST SEARCH
Here, at any step, the most promising node having least value of utility function is chosen for expansion.
In the tree shown above, best first search technique is applied, however it is beneficial sometimes to
search a graph instead of tree to avoid the searching of duplicate paths. In the process to do so, searching
is done in a directed graph in which each node represents a point in the problem space. This graph is
known as OR-graph. Each of the branches of an OR graph represents an alternative problem solving path.
Two lists of nodes are used to implement a graph search procedure discussed above. These are
1.OPEN: these are the nodes that have been generated and have had the heuristic function
applied to them but not have been examined yet.
2.CLOSED: these are the nodes that have already been examined. These nodes are kept in
the memory if we want to search a graph rather than a tree because whenever a node
will be generated, we will have to check whether it has been generated earlier.
BEST-FIRST SEARCH
The best first search is a way of combining the advantage of both depth first and breath first search. The
depth first search is good because it allows a solution to be found without all competing branches have to
be expanded. Breadth first search is good because it does not get trapped on dead ends of path. The way
of combining this is to follow a single path at a time but switches between paths whenever some
competing paths looks more promising than current one does. Hence at each step of best first search
process, we select most promising node out of successor nodes that have been generated so far.
The functioning of best first search is summarized in the following steps:
1.It maintains a list open containing just the initial state.
2.Until a goal is found or there are no nodes left in open list do:
a. Pick the best node from open,
b. Generate its successor, and for each successor:
i. Check, and if it has not been generated before evaluate it and add it to open and record its parent.
ii. If it has been generated before, and new path is better than the previous parent then change the
parent.
BEST-FIRST SEARCH
• Put the initial node on the list say OPEN.
• If (OPEN = empty or OPEN= goal) terminate search, else
• Remove the first node from open( say node is a)
• If (a=goal) terminate search with success else
• Generate all the successor node of a. Send node a to a list called
CLOSED.
• Find out the value of heuristic function of all nodes. Sort all children
generated so far on the basis of their utility value. Select the node of
minimum heuristic value for further expansion.
• Go back to step 2.
DEPTH FIRST SEARCH

• Algorithm
• If the initial state is the goal state, quit and return success.
• Otherwise do the following until success or failure is signaled:
a) Generate a successor, E, of initial state. If there are no more successor,
signal failure.
b) Call depth first search, with E as the initial state.
c) If the success is returned, signal success. Otherwise continue in this loop.
CHARACTERISTICS OF PRODUCTION SYSTEM
• Simplicity : Due to the use of the IF THEN structure, each sentence is unique in the
production system. This uniqueness makes the knowledge representation simple to
enhance the readability of the production rules.
• Modularity : The knowledge available is coded in discrete pieces by the production
system ,which makes it easy to add ,modify , or delete the information without any
side effects.
• Modifiability : This feature allows for the modification for the production rules. The
rules are first defined in the skill skeletal form and then modified to suit an
application.
• Knowledge intensive : As the name suggests, the system only stores knowledge. All
the rules are written in English language. This type of Representation solves the
semantics problem.
CLASIFICATION PRODUCTION SYSTEM
• Monotonic Production System (MPS): The Monotonic production
system (MPS) is a system in which the application of a rule never
prevents later application of the another rule that could also have been
applied at the time that the first rule was selected.
• Non-monotonic Production (NMPS): The non-monotonic production
system is a system in which the application of a rule prevents the later
application of the another rule which may not have been applied at the
time that the first rule was selected, i.e. it is a system in which the above
rule is not true, i.e. the monotonic production system rule not true.
PRODUCTION SYSTEM CHARACTERISTICS

• Commutative Production System (CPS): Commutative law based


production systems is a system in which it satisfies both monotonic &
partially commutative.
• Partially Commutative Production System (PCPS): The partially
commutative production system is a system with the property that if the
application of those rules that is allowable & also transforms from state
x to state y‘.
HILL CLIMBING
• Hill climbing algorithm is a local search algorithm which continuously
moves in the direction of increasing elevation/value to find the peak of the
mountain or best solution to the problem. It terminates when it reaches a
peak value where no neighbor has a higher value.
• Hill climbing algorithm is a technique which is used for optimizing the
mathematical problems. One of the widely discussed examples of Hill
climbing algorithm is Traveling-salesman Problem in which we need to
minimize the distance traveled by the salesman.
HILL CLIMBING

• It is also called greedy local search as it only looks to its good


immediate neighbor state and not beyond that.
• A node of hill climbing algorithm has two components which are
state and value.
• Hill Climbing is mostly used when a good heuristic is available.
• In this algorithm, we don't need to maintain and handle the search
tree or graph as it only keeps a single current state.
HOW DOES THE HILL CLIMBING ALGORITHM WORK?
• The Hill Climbing Algorithm in AI initiates its process at a base point,
analogous to standing at the foot of a hill, and embarks on an iterative
exploration of adjacent solutions. Like a climber assessing the next best step,
each algorithm move is an incremental change scrutinized against an objective
function. This function guides the algorithm towards the peak, ensuring
progression.
• For instance, a maze-solving application would be great. In this scenario, each
step the algorithm executes symbolizes a strategic move within the maze,
targeting the shortest route to the exit. The algorithm evaluates each potential
step for its effectiveness in advancing it closer to the exit, similar to a climber
gauging which step will elevate it closer to the peak of a hill.
HOW DOES THE HILL CLIMBING ALGORITHM WORK?
HOW DOES THE HILL CLIMBING ALGORITHM WORK?
• Local Maximum: Local maximum is a state which is better than its
neighbor states, but there is also another state which is higher than it.
• Global Maximum: Global maximum is the best possible state of state
space landscape. It has the highest value of objective function.
• Current state: It is a state in a landscape diagram where an agent is
currently present.
• Flat local maximum: It is a flat space in the landscape where all the
neighbor states of current states have the same value.
• Shoulder: It is a plateau region which has an uphill edge.
FEATURES OF HILL CLIMBING ALGORITHM
• Generate and Test Approach: This feature involves generating
neighboring solutions and evaluating their effectiveness, always
aiming for an upward move in the solution space.
• Greedy Local Search: The algorithm uses a cheap strategy, opting
for immediate beneficial moves that promise local improvements.
• No Backtracking: Unlike other algorithms, Hill Climbing
Algorithm in AI does not revisit or reconsider previous decisions,
persistently moving forward in the quest for the optimal solution.
TYPES OF HILL CLIMBING ALGORITHM

• Simple Hill Climbing


• Steepest-Ascent Hill Climbing
• Stochastic Hill Climbing
SIMPLE HILL CLIMBING
• Step 1: Start with an initial state.
• Step 2: Check if the initial state is the goal. If so, return success and exit.
• Step 3: Enter a loop to search for a better state continuously.
• Select a neighboring state within the loop by applying an operator to the current state.
• Evaluate this new state:
If it’s the goal state, return success and exit.
If it’s better than the current state, update the current state to this new state.
If it’s not better, discard it and continue the loop.
• Step 4: End the process if no better state is found and the goal isn’t achieved.
STEEPEST-ASCENT HILL CLIMBING
• The steepest-Ascent algorithm is a variation of simple
hill climbing algorithm.
• This algorithm examines all the neighboring nodes of the
current state and selects one neighbor node which is
closest to the goal state.
• This algorithm consumes more time as it searches for
multiple neighbors.
STOCHASTIC HILL CLIMBING
• Stochastic hill climbing does not examine for all its
neighbor before moving.
• Rather, this search algorithm selects one neighbor node at
random and decides whether to choose it as a current state
or examine another state.
PROBLEM SOLVING METHODS
INDEXING
• Indexing in AI plays a vital role in problem-solving by enabling efficient data retrieval, organizing large
datasets, and supporting advanced analytical methods.
MATCHING
• Matching in AI involves finding relationships, similarities, or correspondences between different data entities.
This is fundamental in various problem-solving methods across AI applications.
HEURISTICS FUNCTIONS
• Heuristic functions are strategies or methods that guide the search process in AI algorithms by providing
estimates of the most promising path to a solution. They are often used in scenarios where finding an exact
solution is computationally infeasible. Instead, heuristics provide a practical approach by narrowing down the
search space, leading to faster and more efficient problem-solving.
GRAPHS
• Graphs are fundamental structures in AI problem-solving, representing relationships between entities. Their
versatility and expressiveness make them suitable for various applications.
CONSTRAINT SATISFACTION PROBLEMS (CSP)
• Variable: Variables are the items that need to be determined. The objects in a CSP that
must have values given to them in order to meet a specific set of constraints are known as
variables. Boolean, integer, and category variables are just a few examples of a variety of
variables. The set of variables is denoted as {X1,X2,…..,Xn} and often takes values from
columns that are predefined and represent possible values they can assume.
• Domain: Domains describe the variety of possible values that a variable might have. A
domain may be finite or limitless, depending on the problem. For example, in Sudoku, a
variable that represents a puzzle cell can have as its domain a range of values from 1 to 9.
It is denoted by “D”. Domains can be finite, like {1, 2, 3}, or continuous, such as real
numbers between 0 and 1.
CONSTRAINT SATISFACTION PROBLEMS
(CSP)

• Constraints: Constraints are the rules that control how variables interact with
one another. The ranges of acceptable values for variables are determined by
constraints in a CSP. The different types of constraints include unary
constraints, binary constraints, and higher-order constraints, to mention a few.
For example, in a sudoku puzzle, the limitations might be that only one of each
number from 1 to 9 can appear in each row, column, and 3*3 boxe.
CONSTRAINT SATISFACTION PROBLEMS (CSP)
• Constraint Satisfaction Problems (CSP) representation:
• The finite set of variables V1, V2, V3 ……………..Vn.
• Non-empty domain for every single variable D1, D2, D3 …………..Dn.
• The finite set of constraints C1, C2 …….…, Cm. where each constraint Ci restricts the
possible values for variables,e.g., V1 ≠ V2
• Each constraint Ci is a pair <scope, relation>
• Example: <(V1, V2), V1 not equal to V2>
• Scope = set of variables that participate in constraint.
• Relation = list of valid variable value combinations.
• There might be a clear list of permitted combinations.
• Perhaps a relation that is abstract and that allows for membership testing and listing.
IMPORTANT QUESTIONS
1. Define AI. Discuss about the AI techniques in details.
2. What is production system? Explain its components in details with its types.
3. Discuss about the problem characteristics in details.
4. What is Hill Climbing? Explain about DFS and BFS with suitable example.
5. What are the various application of AI.
6. Define state space search. Illustrate with an example.
7. Describe different classes of production system.
8. Explain BFS and DFS algorithm.
9. How to overcome the Hill Climbing problem.

You might also like