0% found this document useful (0 votes)
8 views29 pages

Agent

Artificial Intelligence (AI) is the field focused on creating machines that can perform tasks requiring human-like intelligence, such as reasoning, learning, and problem-solving. It encompasses various approaches, including acting humanly, thinking rationally, and utilizing machine learning, with applications in areas like healthcare, finance, and natural language processing. While AI offers advantages like high accuracy and speed, it also presents challenges such as high costs and a lack of emotional intelligence.
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)
8 views29 pages

Agent

Artificial Intelligence (AI) is the field focused on creating machines that can perform tasks requiring human-like intelligence, such as reasoning, learning, and problem-solving. It encompasses various approaches, including acting humanly, thinking rationally, and utilizing machine learning, with applications in areas like healthcare, finance, and natural language processing. While AI offers advantages like high accuracy and speed, it also presents challenges such as high costs and a lack of emotional intelligence.
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/ 29

UNIT- I

Introduction: AI problems, Agents and Environments, Structure of Agents, Problem Solving


Agents Basic Search Strategies: Problem Spaces, Uninformed Search (Breadth First, Depth-
First Search, Depth-first with Iterative Deepening), Heuristic Search (Hill Climbing, Generic
Best-First, A*), Constraint Satisfaction (Backtracking, Local Search)

Introduction:

 Artificial Intelligence is concerned with the design of intelligence in an artificial device.


The term was coined by John McCarthy in 1956.
 Intelligence is the ability to acquire, understand and apply the knowledge to achieve goals
in the world.
 AI is the study of the mental faculties through the use of computational models
 AI is the study of intellectual/mental processes as computational processes.
 AI program will demonstrate a high level of intelligence to a degree that equals or
exceeds the intelligence required of a human in performing some task.
 AI is unique, sharing borders with Mathematics, Computer Science, Philosophy,
Psychology, Biology, Cognitive Science and many others.
 Although there is no clear definition of AI or even Intelligence, it can be described as an
attempt to build machines that like humans can think and act, able to learn and use
knowledge to solve problems on their own.
What is Artificial Intelligence?
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.
It is related to the similar task of using computers to understand human intelligence,
but AI does not have to confine itself to methods that are biologically observable
Definition: Artificial Intelligence is the study of how to make computers do things
which, at the moment, people do better.
Since the definition is based on the current capabilities of computers, this means that
AI will change subtlety from year to year and dramatically from decade to decade.
According to the father of Artificial Intelligence, John McCarthy, it is “The science
and engineering of making intelligent machines, especially intelligent computer

MCKVIE-Artificial Intelligence-3rd year II Semester Page 6


programs”.
Artificial Intelligence is a way of making a computer, a computer-controlled robot, or a
software think intelligently, in the similar manner the intelligent humans think.
AI is accomplished by studying how human brain thinks and how humans learn,
decide, and work while trying to solve a problem, and then using the outcomes of this study
as a basis of developing intelligent software and systems.
It has gained prominence recently due, in part, to big data, or the increase in speed,
size and variety of data businesses are now collecting. AI can perform tasks such as
identifying patterns in the data more efficiently than humans, enabling businesses to gain
more insight out of their data.
From a business perspective AI is a set of very powerful tools, and methodologies for
using those tools to solve business problems.
From a programming perspective, AI includes the study of symbolic programming,
problem solving, and search.

Intelligence is composed of:


1. Reasoning
2. Learning
3. Problem Solving
4. Perception
 Machine vision
 Speech understanding
 Touch (tactile or haptic) sensation
5. Linguistic Intelligence
Many tools are used in AI, including versions of search and mathematical optimization,
logic, and methods based on probability and economics. The AI field draws upon computer
science, mathematics, psychology, linguistics, philosophy, neuroscience, artificial
psychology, and many others. Linguistic Intelligence − It is one's ability to use, comprehend,
speak, and write the verbal and written language
The main focus of artificial intelligence is towards understanding human behavior and
performance. This can be done by creating computers with human-like intelligence and
capabilities. This includes natural language processing, facial analysis and robotics. The main
applications of AI are in military, healthcare, and computing; however, it’s expected that
these applications will start soon and become part of our everyday lives.

Approaches of AI
There are a total of four approaches of AI and that are as follows:

1. Acting humanly (The Turing Test approach): This approach was designed by Alan Turing.
The ideology behind this approach is that a computer passes the test - if a human
interrogator, after asking some written questions, cannot identify whether the written
responses come from a human or from a computer.
2. Thinking humanly (The cognitive modeling approach): The idea behind this approach is to
determine whether the computer thinks like a human.
3. Thinking rationally (The “laws of thought” approach): The idea behind this approach is to
determine whether the computer thinks rationally i.e. with logical reasoning.
4. Acting rationally (The rational agent approach): The idea behind this approach is to
determine whether the computer acts rationally i.e. with logical reasoning.
MCKVIE-Artificial Intelligence-3rd year II Semester Page 7
Applications of AI include Natural Language Processing (Natural Language
Understanding, Speech Understanding Language Generation, and Machine Translation),
Gaming, Speech Recognition, Vision Systems, Healthcare, Automotive, etc

An AI system is composed of an agent and its environment.

An agent (e.g., human or robot) is anything that can perceive its environment
through sensors and acts upon that environment through effectors. Intelligent agents must be
able to set goals and achieve them. In classical planning problems, the agent can assume that
it is the only system acting in the world, allowing the agent to be certain of the consequences
of its actions. However, if the agent is not the only actor, then it requires that the agent can
reason under uncertainty. This calls for an agent that cannot only assess its environment and
make predictions but also evaluate its predictions and adapt based on its assessment.
Natural language processing gives machines the ability to read and understand human
language. Some straightforward applications of natural language processing include
information retrieval, text mining, question answering, and machine translation. Machine
perception is the ability to use input from sensors (such as cameras, microphones, sensors,
etc.) to deduce aspects of the world. e.g., Computer Vision. Concepts such as game theory,
and decision theory, necessitate that an agent can detect and model human emotions.
Many times, we get confused between Machine Learning and Artificial Intelligence,
but Machine learning, a fundamental concept of AI research since the field’s inception, is the
study of computer algorithms that improve automatically through experience. The
mathematical analysis of machine learning algorithms and their performance is a branch of
theoretical computer science known as a computational learning theory.
AI research into three approaches, which he calls computational psychology,
computational philosophy, and computer science.
 Computational psychology is used to make computer programs that mimic human behavior.
 Computational philosophy is used to develop an adaptive, free-flowing computer mind.
 Implementing computer science serves the goal of creating computers that can perform
tasks that only people could previously accomplish.
AI has developed a large number of tools to solve the most difficult problems in computer
science, like:

1. Search and optimization


2. Logic
3. Probabilistic methods for uncertain reasoning
4. Classifiers and statistical learning methods
5. Neural networks
6. Control theory
7. Languages
High-profile examples of AI include autonomous vehicles (such as drones and self-driving
cars), medical diagnosis, creating art (such as poetry), proving mathematical theorems,
playing games (such as Chess or Go), search engines (such as Google search), virtual
assistants (such as Siri), image recognition in photographs, spam filtering, prediction of
judicial decisions[204] and targeted online advertisements. Other applications include
Healthcare, Automotive, Finance, Video games, etc

MCKVIE-Artificial Intelligence-3rd year II Semester Page 8


Need for Artificial Intelligence:
1. To create expert systems that exhibit intelligent behavior with the capability to learn,
demonstrate, explain, and advise its users.
2. Helping machines find solutions to complex problems like humans do and applying them as
algorithms in a computer-friendly manner.
Advantages of Artificial Intelligence
Following are some main advantages of Artificial Intelligence:
1. 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.
2. 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.
3. High reliability: AI machines are highly reliable and can perform the same action multiple
times with high accuracy.
4. 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.
5. 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.
6. 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:
1. High Cost: The hardware and software requirement of AI is very costly as it requires lots of
maintenance to meet current world requirements.
2. 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.
3. 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.
4. Increase dependency on machines: With the increment of technology, people are getting
more dependent on devices and hence they are losing their mental capabilities.
5. 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.
Linguistic Intelligence − It is one's ability to use, comprehend, speak, and write the
verbal and written language

MCKVIE-Artificial Intelligence-3rd year II Semester Page 9


Sub Areas of AI:

1) Game Playing
Deep Blue Chess program beat world champion Gary Kasparov
2) Speech Recognition
PEGASUS spoken language interface to American Airlines' EAASY SABRE reseration
system, which allows users to obtain flight information and make reservations over the
telephone. The 1990s has seen significant advances in speech recognition so that limited
systems are now successful.
3) Computer Vision
Face recognition programs in use by banks, government, etc. The ALVINN system from
CMU autonomously drove a van from Washington, D.C. to San Diego (all but 52 of 2,849
miles), averaging 63 mph day and night, and in all weather conditions. Handwriting
recognition, electronics and manufacturing inspection, photo interpretation, baggage
inspection, reverse engineering to automatically construct a 3D geometric model.
4) Expert Systems
Application-specific systems that rely on obtaining the knowledge of human experts in an
area and programming that knowledge into a system.
a. Diagnostic Systems : MYCIN system for diagnosing bacterial infections of the
blood and suggesting treatments. Intellipath pathology diagnosis system (AMA
approved). Pathfinder medical diagnosis system, which suggests tests and makes
diagnoses. Whirlpool customer assistance center.
b. System Configuration
DEC's XCON system for custom hardware configuration. Radiotherapy treatment planning.
c. Financial Decision Making
Credit card companies, mortgage companies, banks, and the U.S. government
employ AI systems to detect fraud and expedite financial transactions. For
example, AMEX credit check.
d. Classification Systems
Put information into one of a fixed set of categories using several sources of
information. E.g., financial decision making systems. NASA developed a system for
classifying very faint areas in astronomical images into either stars or galaxies with
very high accuracy by learning from human experts' classifications.
MCKVIE-Artificial Intelligence-3rd year II Semester Page 10
5) Mathematical Theorem Proving
Use inference methods to prove new theorems.
6) Natural Language Understanding
AltaVista's translation of web pages. Translation of Catepillar Truck manuals into 20
languages.Scheduling and Planning
Automatic scheduling for manufacturing. DARPA's DART system used in Desert Storm and
Desert Shield operations to plan logistics of people and supplies. American Airlines rerouting
contingency planner. European space agency planning and scheduling of spacecraft assembly,
integration and verification.
7) Artificial Neural Networks:
8) Machine Learning

Applications of AI:

AI algorithms have attracted close attention of researchers and have also been applied successfully
to solve problems in engineering. Nevertheless, for large and complex problems, AI algorithms
consume considerable computation time due to stochastic feature of the search approaches

1. Business; financial strategies


2. Engineering: check design, offer suggestions to create new product, expert systems for all
engineering problems
3. Manufacturing: assembly, inspection and maintenance
4. Medicine: monitoring, diagnosing
5. Education: in teaching
6. Fraud detection
7. Object identification
8. Information retrieval
9. Space shuttle scheduling

Building AI Systems:
1) Perception
Intelligent biological systems are physically embodied in the world and experience the
world through their sensors (senses). For an autonomous vehicle, input might be images

MCKVIE-Artificial Intelligence-3rd year II Semester Page 11


from a camera and range information from a rangefinder. For a medical diagnosis system,
perception is the set of symptoms and test results that have been obtained and input to the
system manually.

2) Reasoning
Inference, decision-making, classification from what is sensed and what the internal "model" is of
the world. Might be a neural network, logical deduction system, Hidden Markov Model induction,
heuristic searching a problem space, Bayes Network inference, genetic algorithms, etc.
Includes areas of knowledge representation, problem solving, decision theory, planning, game
theory, machine learning, uncertainty reasoning, etc.
3) Action
Biological systems interact within their environment by actuation, speech, etc. All behavior is centered
around actions in the world. Examples include controlling the steering of a Mars rover or autonomous
vehicle, or suggesting tests and making diagnoses for a medical diagnosis system. Includes areas of
robot actuation, natural language generation, and speech synthesis.
The definitions of AI:

a) "The exciting new effort to make b) "The study of mental faculties


computers think . . . machines with minds, through the use of computational
in the full and literal sense" (Haugeland, models" (Charniak and McDermott,
1985) 1985)

"The automation of activities that we "The study of the computations that


associate with human thinking, activities make it possible to perceive, reason,
such as decision-making, problem solving, and act" (Winston, 1992)
learning..."(Bellman, 1978)

MCKVIE-Artificial Intelligence-3rd year II Semester Page 12


c) "The art of creating machines that perform d) "A field of study that seeks to explain
functions that require intelligence when and emulate intelligent behavior in
performed by people" (Kurzweil, 1990) terms of computational processes"
(Schalkoff, 1 990)
"The study of how to make computers "The branch of computer science
do things at which, at the moment, that is concerned with the
people are better" (Rich and Knight, 1 automation of intelligent behavior"
99 1 ) (Luger and Stubblefield, 1993)

The definitions on the top, (a) and (b) are concerned with reasoning, whereas those on the
bottom, (c) and (d) address behavior. The definitions on the left, (a) and (c) measure success
in terms of human performance, and those on the right, (b) and (d) measure the ideal concept
of intelligence called rationality

Question: What is AI?

Artificial Intelligence is concerned with the design of intelligence in an artificial device. The
term was coined by McCarthy in 1956.

There are two ideas in the definition.

 Intelligence

 Artificial device

Question: What is intelligence?

– Is it that which characterize humans? Or is there an absolute standard of judgement?


– Accordingly there are two possibilities:

o A system with intelligence is expected to behave as intelligently as a human

o A system with intelligence is expected to behave in the best possible manner

– Secondly what type of behavior are we talking about?


o Are we looking at the thought process or reasoning ability of the system?

o Or are we only interested in the final manifestations of the system in terms of its
actions?
Intelligent Systems:
In order to design intelligent systems, it is important to categorize them into four categories

MCKVIE-Artificial Intelligence-3rd year II Semester Page 13


(Luger and Stubberfield 1993), (Russell and Norvig, 2003)
1. Systems that think like humans
2. Systems that think rationally
3. Systems that behave like humans
4. Systems that behave rationally

Human- Like Rationally

Cognitive Science Approach Laws of thought Approach


Think:
“Machines that think like humans” “ Machines that think Rationally”

Turing Test Approach Rational Agent Approach


Act:
“Machines that behave like humans” “Machines that behave Rationally”

Cognitive Science: Think Human-Like

a. Requires a model for human cognition. Precise enough models allow


simulation by computers.

b. Focus is not just on behavior and I/O, but looks like reasoning process.

c. Goal is not just to produce human-like behavior but to produce a sequence of steps of the
reasoning process, similar to the steps followed by a human in solving the same task.

Laws of thought: Think Rationally

a. The study of mental faculties through the use of computational models; that it is, the study
of computations that make it possible to perceive reason and act.Focus is on inference
mechanisms that are probably correct and guarantee an optimal solution.

b. Goal is to formalize the reasoning process as a system of logical rules and procedures of
inference.

c. Develop systems of representation to allow inferences to be like

“Socrates is a man. All men are mortal. Therefore Socrates is mortal”


Turing Test: Act Human-Like

a. The art of creating machines that perform functions requiring intelligence when performed
MCKVIE-Artificial Intelligence-3rd year II Semester Page 14
by people; that it is the study of, how to make computers do things which, at the moment,
people do better.

b. Focus is on action, and not intelligent behavior centered around the representation of the world

c. Example: Turing Test

o 3 rooms contain: a person, a computer and an interrogator.

o The interrogator can communicate with the other 2 by teletype (to avoid
the machine imitate the appearance of voice of the person)

o The interrogator tries to determine which the person is and which the
machine is.

o The machine tries to fool the interrogator to believe that it is the human,
and the person also tries to convince the interrogator that it is the human.

o If the machine succeeds in fooling the interrogator, then conclude that the
machine is intelligent.
Typical AI problems:

1. Bias

AI’s bias problem has been well documented. It can lead to things like discrimination in
housing, job applications, and the criminal justice system. For example, Amazon used AI to
choose job applicants only to realize it was consistently viewing women as unqualified. Such
bias is the result of bias in the data used to train the AI.

2. Security

AI has the potential to improve cybersecurity but also to create new vulnerabilities. The
following are key security threats for AI applications.

 Unauthorized entry. A cybercriminal could hack into a voice-recognition security system


by creating an audio recording that an audio recognition algorithm would recognize as
human. Images and facial recognition can be used in the same way.
 False predictions. A cybercriminal may provide the AI with false inputs designed to lead to
inaccurate predictions.
 Data corruption. Data sets may be altered to create inaccurate results. Organizations should
use strict privileged access management (PAM) policies to prevent this type of attack.
 Transfer learning. Here, the cybercriminal deceives an AI that is trained to perform a
certain function.
 Online manipulation. When an AI is connected to the internet, cybercriminals can directly
attack it by feeding it false data or training it to return inaccurate results.

Another issue related to security is data privacy. AI operators have a responsibility to keep
MCKVIE-Artificial Intelligence-3rd year II Semester Page 15
data confidential, especially sensitive information such as health or financial records.
However, insufficient security may leave systems vulnerable to attack and data susceptible to
being stolen.
3. Ethics:
AI understands logic, but ethics aren’t always logical. So, engineers haven’t yet been able to
program AI to understand the morality involved in human activities. That means some
decisions made by AI systems based on algorithms could go against human ethical concerns

Other challenges are related to the ways in which AI is used. For example, many workers are
concerned about losing their jobs to AI machines. Is it ethical for employers to make these
replacements, leading to high unemployment? Self-driving cars may injure pedestrians. Is it
ethical to allow them to be on the road if such accidents are possible? Who is at fault in such
situations, as there is no driver? Another example is surveillance which includes AI. Is it
ethical to deploy facial recognition, which raises significant privacy concerns?
4. Lack of Talent:
The IT field has been dealing with a talent shortage for some time. While many new IT
workers are becoming available, the demand still outpaces the supply. AI data scientists are
even rarer, and companies may struggle to find qualified workers in this area. Some
businesses are addressing this challenge by creating internal training and education programs,
which can be shaped to each company’s unique needs

5. High Cost in Dollars and Time :


AI is expensive, especially in the beginning. Monetary costs include hardware, software, and
staff training. The hardware must be dedicated and high-powered, which increases the
expense.

While studying the typical range of tasks that we might expect an “intelligent entity” to
perform, we need to consider both “common-place” tasks as well as expert tasks.
Examples of common-place tasks include

– Recognizing people, objects.


– Communicating (through natural language).
– Navigating around obstacles on the streets
These tasks are done matter of factly and routinely by people and some other animals.

Expert tasks include:


• Medical diagnosis.
• Mathematical problem solving
• Playing games like chess

These tasks cannot be done by all people, and can only be performed by skilled specialists.

Now, which of these tasks are easy and which ones are hard? Clearly tasks of the first type
are easy for humans to perform, and almost all are able to master them. The second range of
tasks requires skill development and/or intelligence and only some specialists can perform
them well. However, when we look at what computer systems have been able to achieve to
date, we see that their achievements include performing sophisticated tasks like medical
diagnosis, performing symbolic integration, proving theorems and playing chess.

MCKVIE-Artificial Intelligence-3rd year II Semester Page 16


On the other hand it has proved to be very hard to make computer systems perform many
routine tasks that all humans and a lot of animals can do. Examples of such tasks include
navigating our way without running into things, catching prey and avoiding predators.
Humans and animals are also capable of interpreting complex sensory information. We are
able to recognize objects and people from the visual image that we receive. We are also able
to perform complex social functions.

Rational agent: Act Rationally

a. Tries to explain and emulate intelligent behavior in terms of computational process; that it is
concerned with the automation of the intelligence.

b. Focus is on systems that act sufficiently if not optimally in all situations.

c. Goal is to develop systems that are rational and sufficient.

The Water Jug Problem


In this problem, we use two jugs called four and three; four holds a maximum of four gallons
of
water and three a maximum of three liters of water. How can we get two liters of water in
the four jug?

The state space is a set of prearranged pairs giving the number of liters of water in the pair of
jugs at any time, i.e., (four, three) where four = 0, 1, 2, 3 or 4 and three = 0, 1, 2 or 3.

The start state is (0, 0) and the goal state is (2, n) where n may be any but it is limited to three
holding from 0 to 3 liters of water or empty. Three and four shows the name and numerical
number shows the amount of water in jugs for solving the water jug problem. The major
production rules for solving this problem are shown below:

Initial condition Goal comment

1. (four, three) if four < 4 (4, three) fill four from tap
2. (four, three) if three< 3 (four, 3) fill three from tap
3. (four, three) If four > 0 (0, three) empty four into drain
4. (four, three) if three > 0 (four, 0) empty three into drain
5. (four, three) if four + three<4 (four + three, 0) empty three liters jug into four
liters jug
6. (four, three) if four + three<3 (0, four + three) empty four liters jug into three
liters jug
7. (0, three) If three > 0 (three, 0) empty three into four
8. (four, 0) if four > 0 (0, four) empty four into three
9. (0, 2) (2, 0) empty three liters jug into
four liters jug
10. (2, 0) (0, 2) empty four liters jug into
three liters jug
MCKVIE-Artificial Intelligence-3rd year II Semester Page 17
11. (four, three) if four < 4 (4, three-diff) pour diff, 4-four, into four from
three
<3 (four-diff, 3) pour diff, 3-three, into three from four and a solution is given below four three
rule

(Fig. 2.2 Production Rules for the Water Jug Problem)

Liters in Four Jug Liters in Three Jug Rules


Applied
0 0 -
0 3 2
3 0 7
3 3 2
4 2 11
0 2 3
2 0 10
(Fig. 2.3 One Solution to the Water Jug Problem)
The problem solved by using the production rules in combination with an appropriate control
strategy, moving through the problem space until a path from an initial state to a goal state is
found. In this problem solving process, search is the fundamental concept. For simple
problems
it is easier to achieve this goal by hand but there will be cases where this is far too difficult.

1. (x, y ) —> (4-liters Jug, 3-liters Jug) –,


2. (0,0) —> (Empty, Empty) ---- Initially both the jug is Empty
3. (0, 3) —> (Empty, 3) – Fill the 3-liters Jug with water. 4-liters Jug is Empty and 3-
liters Jug is completely filled with water
4. (3,0) —> (3-liters of water, Empty) – pour this 3-liters of water into 4-liters Jug &3-
liters Jug is Empty
5. (3, 3) —> Fill the 3-liters Jug with water. 4-liters Jug has 3-liters of water. 3-liters
Jug has also 3-liters of water.
6. (3, 3) —> Pour this 3-liters of water into 4-liters Jug. 4-liters Jug has already 3-liters
of water.1- liter volume is remaining in 4-liters Jug to pour 1-liter of water.
7. (4, 2) —> 4-liters Jug and 3-liters Jug consist of 4-liters and 2-liters of water
respectively.
8. (0, 2) —> Empty this 4-liters Jug.
9. (2, 0) —> Then pour 2-liters of water from 3-liters Jug into 4-liters Jug.

MCKVIE-Artificial Intelligence-3rd year II Semester Page 18


Input: X = 4, Y = 3, Z = 2
Output: {(0, 0), (0, 3), (3, 0), (3, 3), (4, 2), (0, 2)}
Explanation:
Step 1:- First we will fill the 4 litre jug completely with water.
Step 2:- Then optimal approach would be to empty water from 4-litre jug into 3-litre
(leaving 1L water in 4L jug and 3L completely full). Hence we got 1L water.
Step 3:- Now, Empty water from 3L.
Step 4:- Pour the water from 4L jug into 3L jug now 4L container is completely empty and
1L water in present in 3L litre jug.
Step 5:- Fill the 4L jug with water completely again.
Step 6:- On transferring water from 4L jug to 3L jug, we will get 2L water in 4L jug which
was our required quantity.

The top four techniques of AI:


1. Machine Learning:
Artificial neural networks are the foundation of the subfield of machine learning known as
“Deep Learning” that is used for predictive analysis. Unsupervised machine learning,
supervised and unsupervised, and reinforcement learning are only a few examples of the
many machine learning algorithms.

The algorithm is unsupervised learning and does not employ categorized information to make
choices on its own without any direction.

In supervised learning, a feature that includes a combination of an input data set and the
intended output is inferred from the training data.

MCKVIE-Artificial Intelligence-3rd year II Semester Page 19


Machines utilize reinforcement learning to determine the best alternative that needs to be
considered and to take the appropriate actions to improve the reward.

2. Machine Vision:
Machines are capable of collecting and analyzing visual data. In this case, cameras are
utilized to record sensory information, which is then processed using digital signal
processing once the picture is converted from analog to digital.

The data that is produced is then input into a computer. Sensitivity is the capacity of the
machine to recognize weak impulses and resolution. The extent to which it can discriminate
between objects—are two essential components of machine vision.

Machine vision is used in a variety of applications, including object recognition, medical


picture analysis, and signature detection.

Thinking of doing masters in AI? Enroll for a master’s in Artificial Intelligence.

3. NLP( Natural Language Processing)


The way in which computers were trained to comprehend natural languages is via their
connections with human language.

Natural Language Processing, the method of extracting meaning from human languages, is
trustworthy technology. The machine in NLP records the speech of a person speaking.

Following the audio-to-textual dialogue, the writing is converted to turn the data into audio.

The system then responds to people via audio. Applications of NLP may be found in
Interactive Voice Response (IVR) systems used in contact centers, in language translations
like Google Translate, and in word processors that verify the correctness of syntax in text,
like Microsoft Word.

Be a master in NLP by enrolling in NLP Course in Bangalore.

4. Automation and Robotics


The goal of automation is to enable machines to perform boring, repetitive jobs, increasing
productivity and delivering more effective, efficient, and affordable results. In order to
automate processes, many businesses employ machine learning, artificial neural, and graphs.

By leveraging the CAPTCHA technique, this automation can avoid fraud problems during
online payments.

Robotic process automation is designed to carry out high-volume, repetitive jobs while being
capable of adapting to changing conditions.

MCKVIE-Artificial Intelligence-3rd year II Semester Page 20


Comparison and Difference between Artificial Intelligence and Conventional Computing

S.No. Artificial Intelligence Conventional Computing


1. AI software uses the techniques of search and Conventional computer software follows a
pattern matching. . logical series of steps to reach a conclusion
2. Programmers design Al software to give the Computer programmers originally designed
computer only the problem, not the steps software that accomplished tasks by
necessary to solve it. competing algorithms

Q: State the Characteristics of an AI problem.


Since artificial intelligence (AI) is mainly related to the search process, it is important to have some methodology to
choose the best possible solution.
To choose an appropriate method for a particular problem first we need to categorize the problem based on
the following characteristics.

I. Is the problem decomposable into small sub-problems which are easy to solve?
II. Can solution steps be ignored or undone?
III. Is the universe of the problem is predictable?
IV. Is a good solution to the problem is absolute or relative?
V. Is the solution to the problem a state or a path?
VI. What is the role of knowledge in solving a problem using artificial intelligence?
VII. Does the task of solving a problem require human interaction?

MCKVIE-Artificial Intelligence-3rd year II Semester Page 21


Agents and Environments:

Fig 2.1: Agents and Environments


Agent:
An Agent is anything that can be viewed as perceiving its environment through sensors and
acting upon that environment through actuators.

 A human agent has eyes, ears, and other organs for sensors and hands, legs, mouth,
and other body parts for actuators.
 A robotic agent might have cameras and infrared range finders for sensors and
various motors for actuators.
 A software agent receives keystrokes, file contents, and network packets as sensory
inputs and acts on the environment by displaying on the screen, writing files, and
sending network packets.
Percept:
We use the term percept to refer to the agent's perceptual inputs at any given instant.

PerceptSequence:
An agent's percept sequence is the complete history of everything the agent has ever perceived.

Agent function:
Mathematically speaking, we say that an agent's behavior is described by the agent function
that maps any given percept sequence to an action.

Agent program
Internally, the agent function for an artificial agent will be implemented by an agent program.

MCKVIE-Artificial Intelligence-3rd year II Semester Page 22


It is important to keep these two ideas distinct. The agent function is an abstract mathematical
description; the agent program is a concrete implementation, running on the agent
architecture.

To illustrate these ideas, we will use a very simple example-the vacuum-cleaner world shown in
Fig 2.1.5. This particular world has just two locations: squares A and B. The vacuum agent
perceives which square it is in and whether there is dirt in the square. It can choose to move left,
move right, suck up the dirt, or do nothing. One very simple agent function is the following: if the
current square is dirty, then suck, otherwise move to the other square. A partial tabulation of this
agent function is shown in Fig 2.1.6.

Fig 2.1.5: A vacuum-cleaner world with just two locations.

Agent function

Percept Sequence Action

[A, Clean] Right

[A, Dirty] Suck

[B, Clean] Left

[B, Dirty] Suck

[A, Clean], [A, Clean] Right

[A, Clean], [A, Dirty] Suck

MCKVIE-Artificial Intelligence-3rd year II Semester Page 23


Fig 2.1.6: Partial tabulation of a simple agent function for the example: vacuum-cleaner world shown in the Fig2.1.5

Function REFLEX-VACCUM-AGENT ([location, status]) returns an

action If status=Dirty then return Suck

else if location = A then return Right

else if location = B then return Left

Fig 2.1.6(i): The REFLEX-VACCUM-AGENT program is invoked for each new percept
(location, status) and returns an action each time

 A Rational agent is one that does the right thing. We say that the right action is the one that will
cause the agent to be most successful. That leaves us with the problem of deciding how and
when to evaluate the agent's success.
We use the term performance measure for the how—the criteria that determine how successful
an agent is.
 Ex-Agent cleaning the dirty floor
 Performance Measure-Amount of dirt collected
 When to measure-Weekly for better results

What is rational at any given time depends on four things :


 The performance measure defining the criterion of success
 The agent’s prior knowledge of the environment
 The actions that the agent can perform
 The agent’s percept sequence up to now.

Omniscience, Learning and Autonomy:


 We need to distinguish between rationality and omniscience. An Omniscient agent knows the
actual outcome of its actions and can act accordingly but omniscience is impossible in reality.
 Rational agent not only gathers information but also learns as much as possible from what it
perceives.
 If an agent just relies on the prior knowledge of its designer rather than its own percepts then
the agent lacks autonomy.
 A system is autonomous to the extent that its behavior is determined its own experience.
 A rational agent should be autonomous.
E.g., a clock(lacks autonomy)
 No input (percepts)

MCKVIE-Artificial Intelligence-3rd year II Semester Page 24


 Run only but its own algorithm (prior knowledge)
 No learning, no experience, etc.
Q: What is PEAS? What is the role of performance measure in the design of an intelligent
agent, and how is it used to evaluate the success of the agent?
PEAS is a type of model on which an AI agent works upon. When we define an AI agent or
rational agent, then we can group its properties under PEAS representation model. It is made up
of four words:
P: Performance measure E: Environment A: Actuators S: Sensors
PEAS is a representation system for AI agents which caters to measuring Performance with respect to
Environment, Sensors, and actuators. To design an agent, we must know our task environment. PEAS
system helps specify the task environment. PEAS is a short form for Performance Measure,
Environment, Actuators, and Sensors. Identifying PEAS can help to write optimum algorithms for AI.
Sensors: Sensors help agents perceive their environment by giving them a complete set of Inputs. The
action of agents depends on the past history and the current input set. Examples of sensors include
cameras, GPS, odometers, various sensing tools, etc.
Actuators: Actuators help agents operate in the environment. Actuators include display boards, object
picking arms, track-changing mechanisms, etc. Actions performed by agents can bring change to the
environment as well.
Environment: The surrounding of the agent at a particular instant in which the agent works is called
the environment. It can be static or dynamic based on the motion of the agent. A small ch ange in the
environment will also change the required sensors and actions of the Agent.
As per Russell and Norvig, an environment can be classified on various factors:
1. Fully observable vs. Partially Observable
2. Static vs. Dynamic
3. Discrete vs. Continuous
4. Deterministic vs. Stochastic
5. Single-agent vs. Multi-agent
6. Episodic vs. sequential
Performance measure : Performance measure is the unit to define the agent’s success or accuracy in
achieving its set goals.
Understanding PEAS with an Example

Let’s understand the PEAS system for a ketchup-producing industry. To produce good quality ketchup,
it is important to segregate the ripe tomatoes and use them for production. Using bad quality or unripe
tomatoes can lower the quality of the ketchup. Now, classifying the tomatoes can be done manually,
but it would be a tedious job for humans as a factory might process thousands of tomatoes daily. Hence,
we can incorporate an AI to help us. Hence, we need to know about our task environment and the agent
we will use.
MCKVIE-Artificial Intelligence-3rd year II Semester Page 25
Agent: Tomato classification system.

Sensors: Weighing sensors, Cameras for visual input, color sensing, etc.

Actuators: Track changing mechanism for segregation, display boards, or a Y-belt for quick
classification into ripe and unripe tomatoes.

Environment: Our environment can be a moving walkway through which the tomatoes are passed on
for segregation. It should have a good source of light for better camera input.

Performance: It measures how successful the agent is in classifying the tomatoes. It can be a confusion
matrix with true positive, true negative, false positive, and false negative numbers or the model’s
accuracy.
ENVIRONMENTS:
The Performance measure, the environment and the agents actuators and sensors comes under the
heading task environment. We also call this as PEAS(Performance,Environment,Actuators,Sensors)

MCKVIE-Artificial Intelligence-3rd year II Semester Page 26


Environment-Types:
1. Accessible vs. inaccessible or Fully observable vs Partially Observable:
If an agent sensor can sense or access the complete state of an environment at each point of time
then it is a fully observable environment, else it is partially observable.
2. Deterministic vs. Stochastic:
If the next state of the environment is completely determined by the current state and the actions
selected by the agents, then we say the environment is deterministic
3. Episodic vs. nonepisodic:
 The agent's experience is divided into "episodes." Each episode consists of the agent
perceiving and then acting. The quality of its action depends just on the episode itself, because
subsequent episodes do not depend on what actions occur in previous episodes.
 Episodic environments are much simpler because the agent does not need to think ahead.
4. Static vs. dynamic.
If the environment can change while an agent is deliberating, then we say the environment is
dynamic for that agent; otherwise it is static.
5. Discrete vs. continuous:
If there are a limited number of distinct, clearly defined percepts and actions we say
that the environment is discrete. Otherwise it is continuous.
MCKVIE-Artificial Intelligence-3rd year II Semester Page 27
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 the 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

MCKVIE-Artificial Intelligence-3rd year II Semester Page 28


Agent programs:
 Intelligent agents accepts percepts from an environment and generates actions. The early
versions of agent programs will have a very simple form (Figure 2.4)
 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
What are the disadvantages of table driven agent?
The agent program takes in the current percept of the environment from the sensors of the agent and
returns an action to be performed by the actuators. If you need to depend on the entire percept sequence,
the agent will have to remember the percepts.
In a simple Table-driven Agent, a lookup table is used to match every possible percept sequence
to the corresponding action. It is the most effective form of implementing the desired agent function,
but it comes with a penalty of occupying humongous amounts of space. Even for a small game of
chess requires 150th power of 10 entries in the lookup table, forget about the lookup table for the taxi
MCKVIE-Artificial Intelligence-3rd year II Semester Page 29
driving agent (for comparison, the number of atoms in the observable universe is less than 80th power of
10). This huge requirement of space means that: 1) there is not much space in the entire universe to
store this huge amount of data. 2) The designer will not have time to fill up the table. 3) Even if you
make a learning agent to fill the lookup table on itself, it’ll take ages for it.
The key challenge of AI is to frame efficient agent programs that produce rational behavior from a
small program instead of a huge table. There are four basic kinds of agent programs, used in almost all
Intelligent systems:

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 on the basis of
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.

MCKVIE-Artificial Intelligence-3rd year II Semester Page 30


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.

MCKVIE-Artificial Intelligence-3rd year II Semester Page 31


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 in order 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 has to
choose in order to perform the best action.
 The term utility can be used to describe how "happy" the agent is.

MCKVIE-Artificial Intelligence-3rd year II Semester Page 32


Q: a) Discuss on ‘agents as search procedure’? b) How do you evaluate any search technique?
Search techniques are universal problem-solving methods in Artificial Intelligence, 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:
 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:
o Search Space: Search space represents a set of possible solutions, which a system may have.
o Start State: It is a state from where agent begins the search.
o Goal test: It is a function which observe the current state and returns whether the goal state is
achieved or not.
 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.
MCKVIE-Artificial Intelligence-3rd year II Semester Page 33
 Actions: It gives the description of all the available actions to the agent.
 Transition model: A description of what each action do, can be represented as a transition model.
 Path Cost: It is a function which assigns a numeric cost to each path.
 Solution: It is an action sequence which leads from the start node to the goal node.
 Optimal Solution: If a solution has the lowest cost among all solutions.

Properties of Search Algorithms /Evaluation of any search technique:


Following are the four essential properties of search algorithms to compare the efficiency of these
algorithms:
1. Completeness: A search algorithm is said to be complete if it guarantees to return a solution if at
least any solution exists for any random input.
2. Optimality: If a solution found for an algorithm is guaranteed to be the best solution (lowest path
cost) among all other solutions, then such a solution for is said to be an optimal solution.
3. Time Complexity: Time complexity is a measure of time for an algorithm to complete its task.
4. Space Complexity: It is the maximum storage space required at any point during the search, as the
complexity of the problem.

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.
Informed Search :

MCKVIE-Artificial Intelligence-3rd year II Semester Page 34

You might also like