0% found this document useful (0 votes)
49 views25 pages

AI Notes - 1

Uploaded by

monuoffice11
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)
49 views25 pages

AI Notes - 1

Uploaded by

monuoffice11
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/ 25

Artificial Intelligence

What is Artificial Intelligence?


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." Artificial Intelligence exists when a machine can have human based skills such
as learning, reasoning, and solving problems

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."

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:
o Proving a theorem
o Playing chess
o Plan some surgical operation
o 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.
Advantages of Artificial Intelligence
Following are some main advantages of Artificial Intelligence:

o High Accuracy with less error: AI machines or systems are prone to less errors and
high accuracy as it takes decisions as per pre-experience or information.
o 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.
o High reliability: AI machines are highly reliable and can perform the same action
multiple times with high accuracy.
o 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.
o 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.
o 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 thesame 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:

o High Cost: The hardware and software requirement of AI is very costly as it requires lots
of maintenance to meet current world requirements.
o 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.
o 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.
o Increase dependency on machines: With the increment of technology, people are
getting more dependent on devices and hence they are losing their mental capabilities.
o 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 Artificial Intelligence

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 Application in E-Commerce

Personalized Shopping

Artificial Intelligence technology is used to create recommendation engines through which you
can engage better with your customers. These recommendations are made in accordance with
their browsing history, preference, and interests. It helps in improving your relationship with
your customers and their loyalty towards your brand.

AI-powered Assistants

Virtual shopping assistants and chatbots help improve the user experience while shopping
online. Natural Language Processing is used to make the conversation sound as human and
personal as possible. Moreover, these assistants can have real-time engagement with your
customers. Did you know that on amazon.com, soon, customer service could be handled by
chatbots?

Fraud Prevention

Credit card frauds and fake reviews are two of the most significant issues that E-Commerce
companies deal with. By considering the usage patterns, AI can help reduce the possibility of
credit card frauds taking place. Many customers prefer to buy a product or service based on
customer reviews. AI can help identify and handle fake reviews.

2. Applications of Artificial Intelligence in Education

Although the education sector is the one most influenced by humans, Artificial Intelligence has
slowly begun to seep its roots in the education sector as well. Even in the education sector, this
slow transition of Artificial Intelligence has helped increase productivity among faculties and
helped them concentrate more on students than office or administration work.

Some of these applications in this sector include:

Administrative Tasks Automated to Aid Educators

Artificial Intelligence can help educators with non-educational tasks like task-related duties like
facilitating and automating personalized messages to students, back-office tasks like grading
paperwork, arranging and facilitating parent and guardian interactions, routine issue feedback
facilitating, managing enrollment, courses, and HR-related topics.

Creating Smart Content

Digitization of content like video lectures, conferences, and text book guides can be made using
Artificial Intelligence. We can apply different interfaces like animations and learning content
through customization for students from different grades.

Artificial Intelligence helps create a rich learning experience by generating and providing audio
and video summaries and integral lesson plans.

Voice Assistants

Without even the direct involvement of the lecturer or the teacher, a student can access extra
learning material or assistance through Voice Assistants. Through this, printing costs of
temporary handbooks and also provide answers to very common questions easily.
Personalized Learning

Using AI technology, hyper-personalization techniques can be used to monitor students’ data


thoroughly, and habits, lesson plans, reminders, study guides, flash notes, frequency or revision,
etc., can be easily generated.

3. Applications of Artificial Intelligence in Lifestyle

Artificial Intelligence has a lot of influence on our lifestyle. Let us discuss a few of them.

Autonomous Vehicles

Automobile manufacturing companies like Toyota, Audi, Volvo, and Tesla use machine learning
to train computers to think and evolve like humans when it comes to driving in any environment
and object detection to avoid accidents.

Spam Filters

The email that we use in our day-to-day lives has AI that filters out spam emails sending them to
spam or trash folders, letting us see the filtered content only. The popular email provider, Gmail,
has managed to reach a filtration capacity of approximately 99.9%.

Facial Recognition

Our favorite devices like our phones, laptops, and PCs use facial recognition techniques by using
face filters to detect and identify in order to provide secure access. Apart from personal usage,
facial recognition is a widely used Artificial Intelligence application even in high security-related
areas in several industries.

Recommendation System

Various platforms that we use in our daily lives like e-commerce, entertainment websites, social
media, video sharing platforms, like youtube, etc., all use the recommendation system to get user
data and provide customized recommendations to users to increase engagement. This is a very
widely used Artificial Intelligence application in almost all industries.
4. Applications of Artificial intelligence in Navigation

Based on research from MIT, GPS technology can provide users with accurate, timely, and
detailed information to improve safety. The technology uses a combination of Convolutional
Neural Network and Graph Neural Network, which makes lives easier for users by automatically
detecting the number of lanes and road types behind obstructions on the roads. AI is heavily used
by Uber and many logistics companies to improve operational efficiency, analyze road traffic,
and optimize routes.

5. Applications of Artificial Intelligence in Robotics

Robotics is another field where artificial intelligence applications are commonly used. Robots
powered by AI use real-time updates to sense obstacles in its path and pre-plan its journey
instantly.

It can be used for -


Carrying goods in hospitals, factories, and warehouses
Cleaning offices and large equipment
Inventory management

6. Applications of Artificial Intelligence in Human Resource

Did you know that companies use intelligent software to ease the hiring process?
Artificial Intelligence helps with blind hiring. Using machine learning software, you can examine
applications based on specific parameters. AI drive systems can scan job candidates' profiles, and
resumes to provide recruiters an understanding of the talent pool they must choose from.

7. Applications of Artificial Intelligence in Healthcare

Artificial Intelligence finds diverse applications in the healthcare sector. AI applications are used
in healthcare to build sophisticated machines that can detect diseases and identify cancer cells.
Artificial Intelligence can help analyze chronic conditions with lab and other medical data to
ensure early diagnosis. AI uses the combination of historical data and medical intelligence for
the discovery of new drugs.
8. Applications of Artificial Intelligence in Agriculture

Artificial Intelligence is used to identify defects and nutrient deficiencies in the soil. This is done
using computer vision, robotics, and machine learning applications, AI can analyze where weeds
are growing. AI bots can help to harvest crops at a higher volume and faster pace than human
laborers.

9. Applications of Artificial Intelligence in Gaming

Another sector where Artificial Intelligence applications have found prominence is the gaming
sector. AI can be used to create smart, human-like NPCs to interact with the players.

It can also be used to predict human behavior using which game design and testing can be
improved. The Alien Isolation games released in 2014 uses AI to stalk the player throughout the
game. The game uses two Artificial Intelligence systems - ‘Director AI’ that frequently knows
your location and the ‘Alien AI,’ driven by sensors and behaviors that continuously hunt the
player.

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.
Maturation of Artificial Intelligence (1943-1952)
o 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.
o Year 1949: Donald Hebb demonstrated an updating rule for modifying the connection
strength between neurons. His rule is now called Hebbian learning.
o 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)


o 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.
o 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.

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)


o 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.
o Year 1972: The first intelligent humanoid robot was built in Japan which was named as
WABOT-1.
The first AI winter (1974-1980)
o 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.
o During AI winters, an interest of publicity on artificial intelligence was decreased.

A boom of AI (1980-1987)
o 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.
o 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)


o The duration between the years 1987 to 1993 was the second AI Winter duration.
o 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)


o 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.
o Year 2002: for the first time, AI entered the home in the form of Roomba, a vacuum
cleaner.
o 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)
o 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.
o Year 2012: Google has launched an Android app feature "Google now", which was able
to provide information to the user as a prediction.
o Year 2014: In the year 2014, Chatbot "Eugene Goostman" won a competition in the
infamous "Turing test."
o Year 2018: The "Project Debater" from IBM debated on complex topics with two master
debaters and also performed extremely well.
o 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 explains the types of AI.
AI type-1: Based on Capabilities
1. Weak AI or Narrow AI:
o 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.
o 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.
o Apple Siriis a good example of Narrow AI, but it operates with a limited pre-defined
range of functions.
o IBM's Watson supercomputer also comes under Narrow AI, as it uses an Expert system
approach combined with Machine learning and natural language processing.
o 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:
o General AI is a type of intelligence which could perform any intellectual task with
efficiency like a human.
o The idea behind the general AI to make such a system which could be smarter and think
like a human by its own.
o Currently, there is no such system exist which could come under general AI and can
perform any task as perfect as a human.
o The worldwide researchers are now focused on developing machines with General AI.
o 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:
o 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.
o 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.
o 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
o Purely reactive machines are the most basic types of Artificial Intelligence.
o Such AI systems do not store memories or past experiences for future actions.
o These machines only focus on current scenarios and react on it as per possible best
action.
o IBM's Deep Blue system is an example of reactive machines.
o Google's AlphaGo is also an example of reactive machines.

2. Limited Memory
o Limited memory machines can store past experiences or some data for a short period of
time.
o These machines can use stored data for a limited time period only.
o 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
o Theory of Mind AI should understand the human emotions, people, beliefs, and be able
to interact socially like humans.
o 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
o 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.
o These machines will be smarter than human mind.
o Self-Awareness AI does not exist in reality still and it is a hypothetical concept.

Agents in Artificial Intelligence

To understand the structure of Intelligent Agents, we should be familiar


with Architecture and Agent programs. Architecture is the machinery that the agent executes
on. It is a device with sensors and actuators, for example, a robotic car, a camera, a PC. Agent
program is an implementation of an agent function.

Examples of Agent:
 A software agent has Keystrokes, file contents, received network packages which act as
sensors and displays on the screen, files, sent network packets acting as actuators.
 A Human-agent has eyes, ears, and other organs which act as sensors, and hands, legs,
mouth, and other body parts acting as actuators.
 A Robotic agent has Cameras and infrared range finders which act as sensors and various
motors acting as actuators.

Types of Agents
Agents can be grouped into five classes based on their degree of perceived intelligence and
capability:
 Simple Reflex Agents
 Model-Based Reflex Agents
 Goal-Based Agents
 Utility-Based Agents
 Learning Agent
Simple reflex agents

Simple reflex agents ignore the rest of the percept history and act only on the basis of
the current percept. Percept history is the history of all that an agent has perceived to date.
The agent function is based on the condition-action rule. A condition-action rule is a rule that
maps a state i.e, condition to an action. If the condition is true, then the action is taken, else
not. This agent function only succeeds when the environment is fully observable. For simple
reflex agents operating in partially observable environments, infinite loops are often
unavoidable. It may be possible to escape from infinite loops if the agent can randomize its
actions.
Problems with Simple reflex agents are :
 Very limited intelligence.
 No knowledge of non-perceptual parts of the state.
 Usually too big to generate and store.
 If there occurs any change in the environment, then the collection of rules need to be
updated.

Model-based reflex agents

It works by finding a rule whose condition matches the current situation. A model-based agent
can handle partially observable environments by the use of a model about the world. The
agent has to keep track of the internal state which is adjusted by each percept and that
depends on the percept history. The current state is stored inside the agent which maintains
some kind of structure describing the part of the world which cannot be seen.
Updating the state requires information about :
 how the world evolves independently from the agent, and
 how the agent’s actions affect the world.
Goal-based agents

These kinds of agents take decisions based on how far they are currently from
their goal(description of desirable situations). Their every action is intended to reduce its
distance from the goal. This allows the agent a way to choose among multiple possibilities,
selecting the one which reaches a goal state. The knowledge that supports its decisions is
represented explicitly and can be modified, which makes these agents more flexible. They
usually require search and planning. The goal-based agent’s behavior can easily be changed.
Utility-based agents

The agents which are developed having their end uses as building blocks are called utility -
based agents. When there are multiple possible alternatives, then to decide which one is best,
utility-based agents are used. They choose actions based on a preference (utility) for each
state. Sometimes achieving the desired goal is not enough. We may look for a quicker, safer,
cheaper trip to reach a destination. Agent happiness should be taken into consideration. Utility
describes how “happy” the agent is. Because of the uncertainty in the world, a utility agent
chooses the action that maximizes the expected utility. A utility function maps a state onto a
real number which describes the associated degree of happiness.

Learning Agent :
A learning agent in AI is the type of agent that can learn from its past experiences or it has
learning capabilities. It starts to act with basic knowledge and then is able to act and adapt
automatically through learning.
A learning agent has mainly four conceptual components, which are:
1. Learning element: It is responsible for making improvements by learning from the
environment
2. Critic: The learning element takes feedback from critics which describes how well the
agent is doing with respect to a fixed performance standard.
3. Performance element: It is responsible for selecting external action
4. Problem Generator: This component is responsible for suggesting actions that will lead to
new and informative experiences.
What is Production system in AI?
A production system is an artificial intelligence program that consists of some rules and the
procedures or processes for following them. This set of rules can be termed as ‘production’.
They enhance action selection and automated planning.

This system consists of a global database that contains all the information required to execute
tasks, a set of rules that are applied to the data from the global database, and a control system
that applies the rules. In production systems, knowledge is encoded in declarative statements.
Knowledge representation creates a system that is used to run AI applications.

This partly explains why production systems are used in the creation of AI programs and the
automation of machines. Some of the machines that can be automated using these systems
include computers, manufacturing tools, and mobile applications. These systems execute search
algorithms and exhibit problem-solving skills that can be displayed by humans.
Features of a Production System in AI
The following are the main features of a production system in AI:

 Simplicity: The system utilizes IF-THEN statements that make problem-solving simple.
 Modularity: Knowledge can be coded in separate segments, which allows adjustments to
be made in the system without challenges. It is possible to delete, modify or feature the
knowledge without facing challenges.
 Modifiability: It is possible to modify or change the rules in this system as per the
requirements. With this feature, the production system can undergo iterative
improvement.
 Knowledge-Intensive: The production system relies on knowledge to a large extent. It
employs a language that is spoken by humans, e.g. English. English sentences enable the
system to draw productive conclusions based on production rules.
 Adaptability: The system can adapt to situations accordingly. It implements pattern-
directed control, which enhances the hierarchical control of search in the event of
complexities.

Production system components


A production system consists of three main components: A global database, a set of rules, and a
control system.

Global database
This contains the architecture of the production system and acts as a central data structure. All
the information and data used in the execution of tasks is stored in this database. The production
rules of the system operate here.

There are two types of global databases: temporary and permanent. The temporary global
database consists of short-term actions that are based on circumstances. In a permanent global
database, there are fixed actions that cannot be altered.

Production rules
The data gathered from the global database applies some rules within the production system.
These rules are called the production rules. Some certain pre-conditions and post-conditions that
bind these rules. The global database checks these conditions so that the rules can be applied. If a
particular pre-condition is accepted by the central data structure, the rule will be executed. In this
case, the central data structure will adjust accordingly. If the global database does not accept the
pre-condition, no action is taken. In this case, the database doesn’t change.
A control system
The application of rules in the system is examined by the control system. When a pre-condition
is accepted by the global database, the control system decides the rule that needs to be applied.
When the correct output is given, the control system terminates the production system.

This system helps to resolve conflicts in the production system. For example, if multiple
conditions are occurring simultaneously, the control system will resolve the conflict by
specifying the sequence.

Classification of production systems in AI


Production systems can be classified into the following categories:

 Monotonic system This system allows the simultaneous application of rules. This means
that the application of one rule does not prevent another rule from being applied at the
same time.
 Partially commutative system Here, the order of operation is important. If a given set of
rules is employed to convert a start state A into a different state B, then the same results
can be attained using any permutation of these production rules.
 Non-monotonic system This system helps in solving problems that were ignored. It can
be executed without backtracking to initial states when an incorrect path was taken. The
Non-monotonic system provides an efficient way of solving problems.
 Commutative system This system is used when the order of operation is not an
important issue of consideration. It is ideal for solving problems in a situation where
changes can be reversed. This is unlike in a partially commutative system, where the
order of operation is crucial and changes are irreversible.

Advantages and disadvantages of production systems


Advantages
1. They enhance the heuristic control of search, which promotes adaptability.
2. The production rules can be modified without causing adverse effects in the system.
3. They offer an efficient way of solving problems in real-life situations.
4. They consist of ‘IF-THEN’ conditions that enhance simplicity in problem-solving.
5. They have reliable troubleshooting methods. It takes little time to locate and resolve
conflicts in the system.

Disadvantages
1. The production system does not store the output results for future reference, which may
limit learning.
2. When various conflicting rules are employed, the control system establishes the best
possible production rule to be applied. This may lead to reduced efficiency of the system.
3. Combination or merging of rules may lead to opaqueness, especially when there is little
prioritization of production rules. This problem can be solved by predetermining the
priority of rules.

Real-life applications of production systems in AI


Automation of AI machines
Production systems are used to execute commands in automated machines. These systems
consist of IF-THEN conditions that set conditions that need to be met before an action is taken.
Some of the automated machines that apply the concept of production systems include washing
machines, airplanes, and autonomous cars.

In a washing machine, the condition-action rules enable the system to allow water and wash
clothes based on the size and nature of clothes. If the size is large, the system will take the action
of allowing large amounts of water. If the clothes are greasy, the machine will wash them for a
long period.

When flying a plane at the cruising phase, the aim is to maintain the same level of attitude
(cruising attitude). If the plane is flying at a different attitude, the IF-THEN conditions will be
applied to bring the plane back to the desired level of attitude. These conditions are also used in
planes to control various automated processes.

In autonomous cars, the production system uses the IF-THEN conditions to avoid collision with
objects or other cars. The following shows examples of how these conditions are applied in
autonomous cars.

1. IF there is an object or car in front, THEN apply brakes.


2. IF there is a traffic light AND the lights indicate red, THEN stop.

Conflict resolution
Automated processes or machines make work easy since they do what humans can do faster and
accurately. However, automation may sometimes be faced with challenges of breakdown or
conflicts in the system. A production system is programmed to resolve these conflicts using
the IF-THEN conditions. In situations where the system cannot resolve the conflict, it provides
the recommended action.A good example is when a car or an automated machine is not working
properly. The following are some of the IF-THEN conditions that can be applied.

1. IF the engine is not turning, THEN ask the driver to check the battery.
2. IF the engine is not turning AND the battery is working, THEN ask the driver to test the
starter motor.
Search Algorithms in Artificial Intelligence

Search algorithms are one of the most important areas of Artificial Intelligence. This topic will explain all
about the search algorithms in AI.

Problem-solving agents:
In Artificial Intelligence, Search techniques are universal problem-solving methods. Rational
agents or Problem-solving agents in AI mostly used these search strategies or algorithms to solve a
specific problem and provide the best result. Problem-solving agents are the goal-based agents and use
atomic representation. In this topic, we will learn various problem-solving search algorithms.

Search Algorithm Terminologies:


o Search: Searching is a step by step procedure to solve a search-problem in a given search space.
A search problem can have three main factors:
a. Search Space: Search space represents a set of possible solutions, which a system may
have.
b. Start State: It is a state from where agent begins the search.
c. Goal test: It is a function which observe the current state and returns whether the goal
state is achieved or not.
o Search tree: A tree representation of search problem is called Search tree. The root of the search
tree is the root node which is corresponding to the initial state.
o Actions: It gives the description of all the available actions to the agent.
o Transition model: A description of what each action do, can be represented as a transition
model.
o Path Cost: It is a function which assigns a numeric cost to each path.
o Solution: It is an action sequence which leads from the start node to the goal node.
o Optimal Solution: If a solution has the lowest cost among all solutions.
Types of search algorithms
Based on the search problems we can classify the search algorithms into uninformed (Blind search)
search and informed search (Heuristic search) algorithms.

Uninformed/Blind Search:
The uninformed search does not contain any domain knowledge such as closeness, the location of the
goal. It operates in a brute-force way as it only includes information about how to traverse the tree and
how to identify leaf and goal nodes. Uninformed search applies a way in which search tree is searched
without any information about the search space like initial state operators and test for the goal, so it is also
called blind search.It examines each node of the tree until it achieves the goal node.

It can be divided into five main types:

o Breadth-first search
o Uniform cost search
o Depth-first search
o Iterative deepening depth-first search
o Bidirectional Search

Informed Search
Informed search algorithms use domain knowledge. In an informed search, problem information is
available which can guide the search. Informed search strategies can find a solution more efficiently than
an uninformed search strategy. Informed search is also called a Heuristic search.

A heuristic is a way which might not always be guaranteed for best solutions but guaranteed to find a
good solution in reasonable time.
Uninformed Search Algorithms
Uninformed search is a class of general-purpose search algorithms which operates in brute force-way.
Uninformed search algorithms do not have additional information about state or search space other than
how to traverse the tree, so it is also called blind search.

1. Breadth-first Search:
o Breadth-first search is the most common search strategy for traversing a tree or graph. This
algorithm searches breadthwise in a tree or graph, so it is called breadth-first search.
o BFS algorithm starts searching from the root node of the tree and expands all successor node at
the current level before moving to nodes of next level.
o The breadth-first search algorithm is an example of a general-graph search algorithm.
o Breadth-first search implemented using FIFO queue data structure.

Advantages:

o BFS will provide a solution if any solution exists.


o If there are more than one solutions for a given problem, then BFS will provide the minimal
solution which requires the least number of steps.

Disadvantages:

o It requires lots of memory since each level of the tree must be saved into memory to expand the
next level.
o BFS needs lots of time if the solution is far away from the root node.

Example:
In the below tree structure, we have shown the traversing of the tree using BFS algorithm from the root
node S to goal node K. BFS search algorithm traverse in layers, so it will follow the path which is shown
by the dotted arrow, and the traversed path will be:

1. S---> A--->B---->C--->D---->G--->H--->E---->F---->I---->K
Completeness: BFS is complete, which means if the shallowest goal node is at some finite depth, then
BFS will find a solution.

Optimality: BFS is optimal if path cost is a non-decreasing function of the depth of the node.

2. Depth-first Search
o Depth-first search isa recursive algorithm for traversing a tree or graph data structure.
o It is called the depth-first search because it starts from the root node and follows each path to its
greatest depth node before moving to the next path.
o DFS uses a stack data structure for its implementation.
o The process of the DFS algorithm is similar to the BFS algorithm.

Advantage:

o DFS requires very less memory as it only needs to store a stack of the nodes on the path from root
node to the current node.
o It takes less time to reach to the goal node than BFS algorithm (if it traverses in the right path).

Disadvantage:

o There is the possibility that many states keep re-occurring, and there is no guarantee of finding
the solution.
o DFS algorithm goes for deep down searching and sometime it may go to the infinite loop.

Example:
In the below search tree, we have shown the flow of depth-first search, and it will follow the order as:

Root node--->Left node ----> right node.

It will start searching from root node S, and traverse A, then B, then D and E, after traversing E, it will
backtrack the tree as E has no other successor and still goal node is not found. After backtracking it will
traverse node C and then G, and here it will terminate as it found goal node.

Completeness: DFS search algorithm is complete within finite state space as it will expand every node
within a limited search tree.
Optimal: DFS search algorithm is non-optimal, as it may generate a large number of steps or high cost to
reach to the goal node.

You might also like