UNIT – I
Syllabus:
Introduction: AI problems, foundation of AI and history of AI. Intelligent agents: Agents and
Environments, the concept of rationality, the nature of environments, structure of agents, problem
solving agents, problem formulation.
Introduction
• In today's world, technology is growing very fast, and we are getting in touch with different
new technologies day by day.
• Here, one of the booming technologies of computer science is Artificial Intelligence which is
ready to create a new revolution in the world by making intelligent machines.
• The Artificial Intelligence is now all around us.
• It is currently working with a variety of subfields, ranging from general to specific, such as
self-driving cars, playing chess, proving theorems, playing music, Painting, etc.
• AI is one of the fascinating and universal fields of Computer science which has a great scope
in future.
• AI holds a tendency to cause a machine to work as a human.
Artificial Intelligence is composed of two words Artificial and Intelligence, where Artificial
defines "man-made," and intelligence defines "thinking power", hence AI means "a man-made
thinking power."
So, we can define AI as:
• "It is a branch of computer science by which we can create intelligent machines which can
behave like a human, think like humans, and able to make decisions."
• Artificial Intelligence exists when a machine can have human based skills such as learning,
reasoning, and solving problems
• With Artificial Intelligence you do not need to preprogram a machine to do some work,
despite that you can create a machine with programmed algorithms which can work with
own intelligence, and that is the awesomeness of AI.
Intelligence Vs Artificial Intelligence
➢ Why Artificial Intelligence?
• Before Learning about Artificial Intelligence, we should know that what is the importance of
AI and why should we learn it.
Following are some main reasons to learn about AI:
• With the help of AI, you can create such software or devices which can solve real-world
problems very easily and with accuracy such as health issues, marketing, traffic issues, etc.
• With the help of AI, you can create your personal virtual Assistant, such as Cortana, Google
Assistant, Siri, etc.
• With the help of AI, you can build such Robots which can work in an environment where
survival of humans can be at risk.
• AI opens a path for other new technologies, new devices, and new Opportunities.
Goals of Artificial Intelligence
Following are the main goals of Artificial Intelligence:
1. Replicate human intelligence
2. Solve Knowledge-intensive tasks
3. An intelligent connection of perception and action
4. Building a machine which can perform tasks that requires human intelligence such as:
1. Proving a theorem
2. Playing chess
3. Plan some surgical operation
4. Driving a car in traffic
5. Creating some system which can exhibit intelligent behavior, learn new things by itself,
demonstrate, explain, and can advise to its user.
Note:
[Link] is the process by which sensory information captured in the real world is interpreted,
acquired, selected, and then organized.
→Human beings, for example, have sensory receptors for touch, taste, smell, sight, and hearing
→As a result, the information received from these receptors is transmitted to the human brain,
which organizes the data
[Link] selection in AI systems is a basic system in which the problem can be analyzed by the AI
machine to understand what it has to do next to get closer to the solution of the problem.
Advantages of Artificial Intelligence
Following are some main advantages of Artificial Intelligence:
• High Accuracy with less errors: AI machines or systems are prone to less errors and high
accuracy as it takes decisions as per pre-experience or information.
• High-Speed: AI systems can be of very high-speed and fast-decision making, because of that
AI systems can beat a chess champion in the Chess game.
• High reliability: AI machines are highly reliable and can perform the same action multiple
times with high accuracy.
• Useful for risky areas: AI machines can be helpful in situations such as defusing a bomb,
exploring the ocean floor, where to employ a human can be risky.
• Digital Assistant: AI can be very useful to provide digital assistant to the users such as AI
technology is currently used by various E-commerce websites to show the products as per
customer requirement.
• Useful as a public utility: AI can be very useful for public utilities such as a self-driving car
which can make our journey safer and hassle-free, facial recognition for security purpose,
Natural language processing to communicate with the human in human-language, etc.
Disadvantages of Artificial Intelligence
• Every technology has some disadvantages, and the same goes for Artificial intelligence.
• Being so advantageous technology still, it has some disadvantages which we need to keep in
our mind while creating an AI system.
Following are the disadvantages of AI:
• High Cost: The hardware and software requirement of AI is very costly as it requires lots of
maintenance to meet current world requirements.
• Can't think out of the box: Even we are making smarter machines with AI, but still they
cannot work out of the box, as the robot will only do that work for which they are trained, or
programmed.
• No feelings and emotions: AI machines can be an outstanding performer, but still it does not
have the feeling so it cannot make any kind of emotional attachment with human, and may
sometime be harmful for users if the proper care is not taken.
• Increase dependency on machines: With the increment of technology, people are getting
more dependent on devices and hence they are losing their mental capabilities.
• No Original Creativity: As humans are so creative and can imagine some new ideas but still
AI machines cannot beat this power of human intelligence and cannot be creative and
imaginative.
➢ Applications of AI
• Artificial Intelligence has various applications in today's society.
• It is becoming essential for today's time because it can solve complex problems with an
efficient way in multiple industries, such as Healthcare, entertainment, finance, education,
etc.
• AI is making our daily life more comfortable and fast.
• Following are some sectors which have the application of Artificial Intelligence:
1. AI in Astronomy
• Artificial Intelligence can be very useful to solve complex universe problems.
AI technology can be helpful for understanding the universe such as how it works, origin,
etc.
2. AI in Healthcare
• In the last, five to ten years, AI becoming more advantageous for the healthcare industry and
going to have a significant impact on this industry.
• Healthcare Industries are applying AI to make a better and faster diagnosis than humans.
• AI can help doctors with diagnoses and can inform when patients are worsening so that
medical help can reach to the patient before hospitalization.
3. AI in Gaming
• AI can be used for gaming purpose. The AI machines can play strategic games like chess,
where the machine needs to think of a large number of possible places.
4. AI in Finance
• AI and finance industries are the best matches for each other. The finance industry is
implementing automation, chatbot, adaptive intelligence, algorithm trading, and machine
learning into financial processes.
5. AI in Data Security
• The security of data is crucial for every company and cyber-attacks are growing very rapidly in
the digital world. AI can be used to make your data more safe and secure.
• Some examples such as AEG(Automatic exploit generation) bot, AI2(analyst-in-the-loop)
Platform, are used to determine software bug and cyber-attacks in a better way.
6. AI in Social Media
• Social Media sites such as Facebook, Twitter, and Snapchat contain billions of user profiles,
which need to be stored and managed in a very efficient way.
• AI can organize and manage massive amounts of data.
• AI can analyze lots of data to identify the latest trends, hashtag, and requirement of different
users.
7. AI in Travel & Transport
• AI is becoming highly demanding for travel industries.
• AI is capable of doing various travel related works such as from making travel arrangement to
suggesting the hotels, flights, and best routes to the customers.
• Travel industries are using AI-powered chatbots which can make human-like interaction with
customers for better and fast response.
8. AI in Automotive Industry
• Some Automotive industries are using AI to provide virtual assistant to their user for better
performance. Such as Tesla has introduced TeslaBot, an intelligent virtual assistant.
• Various Industries are currently working for developing self-driven cars which can make your
journey more safe and secure.
9. AI in Robotics:
• Artificial Intelligence has a remarkable role in Robotics.
• Usually, general robots are programmed such that they can perform some repetitive task, but
with the help of AI, we can create intelligent robots which can perform tasks with their own
experiences without pre-programmed.
• Humanoid Robots are best examples for AI in robotics, recently the intelligent Humanoid
robot named as Erica and Sophia has been developed which can talk and behave like
humans.
10. AI in Entertainment
• We are currently using some AI based applications in our daily life with some entertainment
services such as Netflix or Amazon.
• With the help of ML/AI algorithms, these services show the recommendations for programs
or shows.
11. AI in Agriculture
• Agriculture is an area which requires various resources, labor, money, and time for best
result.
• Now a day's agriculture is becoming digital, and AI is emerging in this field.
• Agriculture is applying AI as agriculture robotics, solid and crop monitoring, predictive
analysis. AI in agriculture can be very helpful for farmers.
Real Life Applications of Research Areas.
Real Life Applications of Research Areas
• There is a large array of applications where AI is serving common people in their day-to-day
lives
❖ History of Artificial Intelligence
• Artificial Intelligence is not a new word and not a new technology for researchers.
• This technology is much older than you would imagine.
• Even there are the myths of Mechanical men in Ancient Greek and Egyptian Myths.
Following are some milestones in the history of AI which defines the journey from the AI
generation to till date development.
• History of AI
History of AI
Year Milestone / Innovation
Karel Čapek play named “Rossum's Universal Robots” (RUR) opens in London,
1923
first use of the word "robot" in English.
1943 Foundations for neural networks laid.
1945 Isaac Asimov, a Columbia University alumni, coined the term Robotics.
Alan Turing introduced Turing Test for evaluation of intelligence and
1950 published Computing Machinery and Intelligence. Claude Shannon
published Detailed Analysis of Chess Playing as a search.
John McCarthy coined the term Artificial Intelligence. Demonstration of the
1956
first running AI program at Carnegie Mellon University.
1958 John McCarthy invents LISP programming language for AI.
Danny Bobrow's dissertation at MIT showed that computers can understand
1964
natural language well enough to solve algebra word problems correctly.
Joseph Weizenbaum at MIT built ELIZA, an interactive problem that carries on
1965
a dialogue in English.
✓ Maturation of Artificial Intelligence (1943-1952)
• Year 1943: The first work which is now recognized as AI was done by Warren McCulloch and
Walter pits in 1943. They proposed a model of artificial neurons.
• Year 1949: Donald Hebb demonstrated an updating rule for modifying the connection
strength between neurons. His rule is now called Hebbian learning.
• Year 1950: The Alan Turing who was an English mathematician and pioneered Machine
learning in 1950. Alan Turing publishes "Computing Machinery and Intelligence" in which he
proposed a test.
• The test can check the machine's ability to exhibit intelligent behavior equivalent to human
intelligence, called a Turing test.
✓ The birth of Artificial Intelligence (1952-1956)
• Year 1955: An Allen Newell and Herbert A. Simon created the "first artificial intelligence
program“ Which was named as "Logic Theorist".
• This program had proved 38 of 52 Mathematics theorems, and find new and more elegant
proofs for some theorems.
• Year 1956: The word "Artificial Intelligence" first adopted by American Computer scientist
John McCarthy at the Dartmouth Conference. For the first time, AI coined as an academic
field.
• John McCarthy is considered as the father of Artificial Intelligence. John McCarthy was an
American computer scientist. The term "artificial intelligence" was coined by him. He is one
of the founder of artificial intelligence, together with Alan Turing, Marvin Minsky, Allen
Newell, and Herbert A.
• At that time high-level computer languages such as FORTRAN, LISP, or COBOL were invented.
And the enthusiasm for AI was very high at that time.
✓ The golden years-Early enthusiasm (1956-1974)
• Year 1966: The researchers emphasized developing algorithms which can solve mathematical
problems. Joseph Weizenbaum created the first chatbot in 1966, which was named as ELIZA.
• Year 1972: The first intelligent humanoid robot was built in Japan which was named as
WABOT-1.
• The first AI winter (1974-1980)
• The duration between years 1974 to 1980 was the first AI winter duration.
• AI winter refers to the time period where computer scientist dealt with a severe shortage of
funding from government for AI researches.
• During AI winters, an interest of publicity on artificial intelligence was decreased.
• A boom of AI (1980-1987)
• Year 1980: After AI winter duration, AI came back with "Expert System". Expert systems were
programmed that emulate the decision-making ability of a human expert.
• In the Year 1980, the first national conference of the American Association of Artificial
Intelligence was held at Stanford University.
• The second AI winter (1987-1993)
• The duration between the years 1987 to 1993 was the second AI Winter duration.
• Again Investors and government stopped in funding for AI research as due to high cost but
not efficient result. The expert system such as XCON was very cost effective.
✓ The emergence of intelligent agents (1993-2011)
• Year 1997: In the year 1997, IBM Deep Blue beats world chess champion, Gary Kasparov, and
became the first computer to beat a world chess champion.
• Year 2002: for the first time, AI entered the home in the form of Roomba, a vacuum cleaner.
• Year 2006: AI came in the Business world till the year 2006. Companies like Facebook, Twitter,
and Netflix also started using AI.
Deep learning, big data and artificial general intelligence (2011-present)
• Year 2011: In the year 2011, IBM's Watson won jeopardy, a quiz show, where it had to solve
the complex questions as well as riddles. Watson had proved that it could understand natural
language and can solve tricky questions quickly.
• Year 2012: Google has launched an Android app feature "Google now", which was able to
provide information to the user as a prediction.
• Year 2014: In the year 2014, Chatbot "Eugene Goostman" won a competition in the infamous
"Turing test."
• Year 2018: The "Project Debater" from IBM debated on complex topics with two master
debaters and also performed extremely well.
• Google has demonstrated an AI program "Duplex" which was a virtual assistant and which
had taken hairdresser appointment on call, and lady on other side didn't notice that she was
talking with the machine.
Now AI has developed to a remarkable level.
• The concept of Deep learning, big data, and data science are now trending like a boom.
• Nowadays companies like Google, Facebook, IBM, and Amazon are working with AI and
creating amazing devices.
• The future of Artificial Intelligence is inspiring and will come with high intelligence.
Types of Artificial Intelligence:
• Artificial Intelligence can be divided in various types, there are mainly two types of main
categorization which are based on capabilities and based on functionally of AI.
• Following is flow diagram which explain the types of AI
AI type-1: Based on Capabilities
1. Weak AI or Narrow AI:
• Narrow AI is a type of AI which is able to perform a dedicated task with intelligence.
• The most common and currently available AI is Narrow AI in the world of Artificial
Intelligence.
• Narrow AI cannot perform beyond its field or limitations, as it is only trained for one
specific task. Hence it is also termed as weak AI.
• Narrow AI can fail in unpredictable ways if it goes beyond its limits.
• Apple Siri is a good example of Narrow AI, but it operates with a limited pre-defined range
of functions.
• IBM's Watson supercomputer also comes under Narrow AI, as it uses an Expert system
approach combined with Machine learning and natural language processing.
• Some Examples of Narrow AI are playing chess, purchasing suggestions on e-commerce
site, self-driving cars, speech recognition, and image recognition.
2. General AI:
• General AI is a type of intelligence which could perform any intellectual task with efficiency
like a human.
• The idea behind the general AI to make such a system which could be smarter and think
like a human by its own.
• Currently, there is no such system exist which could come under general AI and can
perform any task as perfect as a human.
• The worldwide researchers are now focused on developing machines with General AI.
• As systems with general AI are still under research, and it will take lots of efforts and time
to develop such systems.
3. Super AI:
• Super AI is a level of Intelligence of Systems at which machines could surpass human
intelligence, and can perform any task better than human with cognitive properties.
• It is an outcome of general AI.
• Some key characteristics of strong AI include capability include the ability to think, to
reason, solve the puzzle, make judgments, plan, learn, and communicate by its own.
• Super AI is still a hypothetical concept of Artificial Intelligence.
• Development of such systems in real is still world changing task.
Artificial Intelligence type-2: Based on functionality
1. Reactive Machines
• Purely reactive machines are the most basic types of Artificial Intelligence.
• Such AI systems do not store memories or past experiences for future actions.
• These machines only focus on current scenarios and react on it as per possible best action.
• IBM's Deep Blue system is an example of reactive machines.
• Google's AlphaGo is also an example of reactive machines.
2. Limited Memory
• Limited memory machines can store past experiences or some data for a short period of
time.
• These machines can use stored data for a limited time period only.
• Self-driving cars are one of the best examples of Limited Memory systems.
• These cars can store recent speed of nearby cars, the distance of other cars, speed limit,
and other information to navigate the road.
3. Theory of Mind
• Theory of Mind AI should understand the human emotions, people, beliefs, and be able to
interact socially like humans.
• This type of AI machines are still not developed, but researchers are making lots of efforts
and improvement for developing such AI machines.
4. Self-Awareness
• Self-awareness AI is the future of Artificial Intelligence.
• These machines will be super intelligent, and will have their own consciousness,
sentiments, and self-awareness.
• These machines will be smarter than human mind.
• Self-Awareness AI does not exist in reality still and it is a hypothetical concept.
Agents and Environments:
What is a Rational Agent in AI?
In artificial intelligence and machine learning, there's a concept called the "rational agent." It's a theoretical
entity that considers realistic models of how people think, with preferences for advantageous outcomes and
an ability to learn. In other words, it's what most people would call "you."
The rational agent is used in game theory and decision theory to help us apply artificial intelligence to various
real-world scenarios.
We can use it to understand how we make decisions, allowing us to develop artificial intelligence that can
mimic human behavior to solve problems or make decisions.
Intelligent Agent vs. Rational Agent
Intelligent Agent Rational Agent
A Rational Agent is an Intelligent Agent that
An Intelligent Agent is a system that
makes decisions based on logical reasoning
Definition can perceive its environment and take
and optimizes its behavior to achieve a
actions to achieve a specific goal.
specific goal.
An Intelligent Agent can perceive its A Rational Agent's perception is based on
Perception environment through various sensors the information available to it and logical
or inputs. reasoning.
It makes decisions based on logical
Decision- It can make decisions based on a set of
reasoning and optimizes its behavior to
making rules or a pre-defined algorithm.
achieve its goals.
A Rational Agent can also learn from its
An Intelligent Agent can learn from its
Learning environment and adapt its behavior, but it
environment and adapt its behavior.
does so based on logical reasoning.
It can also operate independently of human
It can operate independently of human
Autonomy intervention, but it does so based on logical
intervention.
reasoning.
An Intelligent Agent can be designed to A Rational Agent has a specific goal and
Goals
achieve a specific goal. optimizes its behavior.
An Intelligent Agent can be a self-
A Rational Agent can be a financial advisor, a
Examples driving car, a virtual personal assistant,
chess-playing program, or a logistics planner.
or a recommendation system.
What is meant by a rational agent?
A rational agent is a computer program that performs tasks based on pre-defined rules and procedures. The
idea is that the agent can be programmed to follow specific instructions to make decisions rather than
requiring its programmer to write every decision down manually.
What are the four characteristics of a rational agent?
A rational agent has four primary characteristics:
• Perception: The ability to perceive the current state of the environment and gather relevant
information.
• Actuators: The ability to take actions within the environment to achieve its goals.
• Performance measure: A way to evaluate the success or failure of the agent's actions.
• Rationality: The ability to make decisions based on logical reasoning and optimize behavior to achieve
its goals, considering its perception of the environment and the performance measure.
Why are rational agents important?
Rational agents are essential for several reasons:
1. Real-world applications: Rational agents can be used to control autonomous systems such as self-
driving cars, robots, or drones, to make financial decisions, or to plan logistics.
2. Optimization: Rational agents can optimize their behavior to achieve a specific goal, considering the
current state of the environment, the available resources, and the constraints.
3. Decision-making: Rational agents can make decisions based on logical reasoning and optimize their
behavior to achieve their goals, considering their perception of the environment and the performance
measure; this allows for better decision-making
4. Adaptability: Rational agents can learn from their environment and adapt their behavior. This allows
them to improve their performance over time.
5. Autonomy: Rational agents can operate independently of human intervention. This can lead to
increased efficiency and reduced human error.
6. Simulation: Rational agents can be used to simulate the behavior of other agents or systems, allowing
for the study and prediction of their behavior.
STRUCTURE OF INTELLIGENT AGENTS :
• The job of AI is to design the agent program: a function that implements the agent mapping from
percepts to actions. We assume this program will run on some sort of ARCHITECTURE computing
device, which we will call architecture.
• The architecture might be a plain computer, or it might include special-purpose hardware for
certain tasks, such as processing camera images or filtering audio input. It might also include
software that provides a degree of insulation between the raw computer and the agent program,
so that we can program at a higher level.
• In general, the architecture makes the percepts from the sensors available to the program, runs the
program, and feeds the program's action choices to the effectors as they are generated.
• The relationship among agents, architectures, and programs can be summed up as follows:
agent = architecture + program
Agent programs:
• Intelligent agents accept percepts from an environment and generate actions. The early versions
of agent programs will have a very simple form
• Each will use some internal data structures that will be updated as new percepts arrive.
• These data structures are operated on by the agent's decision-making procedures to generate an
action choice, which is then passed to the architecture to be executed.
Types of agents: Agents can be grouped into four classes based on their degree of perceived
intelligence and capability: Simple Reflex Agents Model-Based Reflex Agents Goal-Based
Agents Utility-Based Agents Simple reflex agents: Simple reflex agents ignore the rest of the
percept history and act only based on the current percept. The agent function is based on the
condition-action rule. If the condition is true, then the action is taken, else not. This agent
function only succeeds when the environment is fully observable.
Model-based reflex agents:
The Model-based agent can work in a partially observable environment and track the situation. A model-
based agent has two important factors: Model: It is knowledge about "how things happen in the world," so
it is called a Model-based agent. Internal State: It is a representation of the current state based on percept
history.
Goal-based agents:
✓ A goal-based agent has an agenda.
✓ It operates based on a goal in front of it and makes decisions based on how best to reach that goal.
✓ A goal-based agent operates as a search and planning function, meaning it targets the goal ahead
and finds the right action to reach it.
✓ Expansion of model-based agent.
Utility-based agents:
A utility-based agent is an agent that acts based not only on what the goal is, but the best way to reach that goal.
The Utility-based agent is useful when there are multiple possible alternatives, and an agent must choose in order to
perform the best action. The term utility can be used to describe how "happy" the agent is.
PROBLEM SOLVING AGENTS:
➢ Problem solving agent is a goal-based agent.
➢ Problem solving agents decide what to do by finding sequence of actions that lead to desirable
states.
PROBLEM-SOLVING APPROACH IN ARTIFICIAL INTELLIGENCE PROBLEMS
The reflex agents are known as the simplest agents because they directly map states into
actions. Unfortunately, these agents fail to operate in an environment where the mapping is too
large to store and learn. Goal-based agent, on the other hand, considers future actions and the
desired outcomes.
Here, we will discuss one type of goal-based agent known as a problem-solving agent,
which uses atomic representation with no internal states visible to the problem-solving algorithms.
Problem-solving
agent
The problem-solving agent perfoms precisely by defining problems and its several
solutions.
• According to psychology, “a problem-solving refers to a state where we wish to reach to
a definite goal from a present state or condition.”
• According to computer science, a problem-solving is a part of artificial intelligence which
encompasses a number of techniques such as algorithms, heuristics to solve a problem.
Therefore, a problem-solving agent is a goal-driven agent and focuses on satisfying the goal.
Goal Formulation:
It organizes the steps required to formulate/ prepare one goal out of multiple goals available.
Problem Formulation:
o It is a process of deciding what actions and states to consider following goal formulation.
The process of looking for the best sequence to achieve a goal is called Search.
o A search algorithm takes a problem as input and returns a solution in the form of action
sequences. Once the solution is found the action it recommends can be carried out. This is
called Execution phase.
Well Defined problems and solutions:
A problem can be defined formally by 4 components:
The initial state of the agent is the state where the agent starts in. In this case, the initial state can be
described as in: Arad. The possible actions available to the agent correspond to each of the state the
agent residesin. For example, ACTIONS (In: Arad) = {Go: Sibiu, Go: Timisoara, Go: Zerind}.
Actions are also known as operations. A description of what each action does. The formal name for
this is Transition model, Specified by thefunction Result(s,a) that returns the state that results from
the action a in states. We also use the term Successor to refer to any state reachable from a given state
by a single action.
Together the initial state, actions and transition model implicitly defines the state space of the problem
State space: set of all states reachable from the initial state by any sequence of actions.
o The goal test, determining whether the current state is a goal state. Here, the goal state is {In:
Bucharest}
o The path cost function, which determines the cost of each path, is reflecting in the performance
measure. we define the cost function as c(s, a, s‘), where s is the current state and a is the
action performed by the agent to reach state’s‘.
PROBLEM DEFINITION
To build a system to solve a particular problem, we need to do four things:
(i) Define the problem precisely. This definition must include specification of the
initial situations and also final situations which constitute (i.e) acceptable solution to the problem.
(ii) Analyze the problem (i.e) important features have an immense (i.e) huge impact on
the appropriateness of various techniques for solving the problems.
(iii) Isolate and represent the knowledge to solve the problem.
(iv) Choose the best problem – solving techniques and apply it to the particular
problem.
Steps performed by Problem-solving agent
• Goal Formulation: It is the first and simplest step in problem-solving. It organizes
the steps/sequence required to formulate one goal out of multiple goals as well as actions to
achieve that goal. Goal formulation is based on the current situation and the agent’s
performance measure (discussed below).
• Problem Formulation: It is the most important step of problem-solving which
decides what actions should be taken to achieve the formulated goal. There are following
five components involved in problem formulation:
• Initial State: It is the starting state or initial step of the agent towards its goal.
• Actions: It is the description of the possible actions available to the agent.
• Transition Model: It describes what each action does.
• Goal Test: It determines if the given state is a goal state.
• Path cost: It assigns a numeric cost to each path that follows the goal. The problem-
solving agent selects a cost function, which reflects its performance measure. Remember, an
optimal solution has the lowest path cost among all the solutions.
Note: Initial state, actions, and transition model together define the state-space of the problem
implicitly. State-space of a problem is a set of all states which can be reached from the initial state
followed by any sequence of actions. The state-space forms a directed map or graph where nodes
are the states, links between the nodes are actions, and the path is a sequence of states connected
by the sequence of actions.
• Search: It identifies all the best possible sequence of actions to reach the goal state from
the current state. It takes a problem as an input and returns solution as its output.
• Solution: It finds the best algorithm out of various algorithms, which may be proven as the
best optimal solution.
• Execution: It executes the best optimal solution from the searching algorithms to reach the
goal state from the current state.
Example Problems
Basically, there are two types of problem approaches:
• Toy Problem: It is a concise and exact description of the problem which is used by the
researchers to compare the performance of algorithms.
• Real-world Problem: It is real-world based problems which require solutions. Unlike a toy
problem, it does not depend on descriptions, but we can have a general formulation of the
problem.
Some Toy Problems
• 8 Puzzle Problem: Here, we have a 3×3 matrix with movable tiles numbered from 1 to 8
with a blank space. The tile adjacent to the blank space can slide into that space. The
objective is to reach a specified goal state similar to the goal state, as shown in the below
figure.
• In the figure, our task is to convert the current state into goal state by sliding digits into the blank space.
In the above figure, our task is to convert the current(Start) state into goal state by sliding digits
into the blank space.
The problem formulation is as follows:
• States: It describes the location of each numbered tiles and the blank tile.
• Initial State: We can start from any state as the initial state.
• Actions: Here, actions of the blank space is defined, i.e., either left, right, up or down
• Transition Model: It returns the resulting state as per the given state and actions.
• Goal test: It identifies whether we have reached the correct goal-state.
• Path cost: The path cost is the number of steps in the path where the cost of each step is 1.
Note: The 8-puzzle problem is a type of sliding-block problem which is used for testing
new search algorithms in artificial intelligence.
• 8-queens problem: The aim of this problem is to place eight queens on a chessboard in an
order where no queen may attack another. A queen can attack other queens either diagonally
or in same row and column.
From the following figure, we can understand the problem as well as its correct solution.
It is noticed from the above figure that each queen is set into the chessboard in a position where
no other queen is placed diagonally, in same row or column. Therefore, it is one right approach to
the 8-queens problem.
For this problem, there are two main kinds of formulation:
1. Incremental formulation: It starts from an empty state where the operator augments a queen
at each step.
Following steps are involved in this formulation:
• States: Arrangement of any 0 to 8 queens on the chessboard.
• Initial State: An empty chessboard
• Actions: Add a queen to any empty box.
• Transition model: Returns the chessboard with the queen added in a box.
• Goal test: Checks whether 8-queens are placed on the chessboard without any attack.
• Path cost: There is no need for path cost because only final states are counted.
In this formulation, there is approximately 1.8 x 1014 possible sequence to investigate.
2. Complete-state formulation: It starts with all the 8-queens on the chessboard and moves them
around, saving from the attacks.
Following steps are involved in this formulation
• States: Arrangement of all the 8 queens one per column with no queen attacking the other
queen.
• Actions: Move the queen at the location where it is safe from the attacks.
This formulation is better than the incremental formulation as it reduces the state space from 1.8 x
1014 to 2057, and it is easy to find the solutions.
Some Real-world problems
• Traveling salesperson problem(TSP): It is a touring problem where the
salesman can visit each city only once. The objective is to find the shortest tour and sell-out
the stuff in each city.
• VLSI Layout problem: In this problem, millions of components and connections
are positioned on a chip in order to minimize the area, circuit-delays, stray-capacitances, and
maximizing the manufacturing yield.
The layout problem is split into two parts:
• Cell layout: Here, the primitive components of the circuit are grouped into cells,
each performing its specific function. Each cell has a fixed shape and size. The task is to place
the cells on the chip without overlapping each other.
• Channel routing: It finds a specific route for each wire through the gaps between
the cells.
• Protein Design: The objective is to find a sequence of amino acids which will fold
into 3D protein having a property to cure some disease.
Searching for solutions
We have seen many problems. Now, there is a need to search for solutions to solve them.
In this section, we will understand how searching can be used by the agent to solve a problem.
For solving different kinds of problem, an agent makes use of different strategies to reach
the goal by searching the best possible algorithms. This process of searching is known as search
strategy.
The End