0% found this document useful (0 votes)
6 views134 pages

Unit1_AI

Uploaded by

Sm
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)
6 views134 pages

Unit1_AI

Uploaded by

Sm
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/ 134

NOIDA INSTITUTE OF ENGINEERING AND TECHNOLOGY,

GREATER NOIDA

INTRODUCTION

Unit: 1

Introduction to Artificial Intelligence


ACSAI0513
Faculty Name:
RAJEEV KUMAR
Course Details: Assistant Professor
(B. Tech IT 5th Sem) Department:
IT

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 1


EVALUATION SCHEME

Introduction to Artificial Intelligence (Elective I)


Machine Learning (Elective II)

RAJEEV KUMAR Introduction to Artificial Intelligence


9/30/24 2
Unit 1
SYLLABUS

9/30/24 3
RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1
SYLLABUS

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 4


Branch wise Applications

1. Maps and Navigation


2. Computer Vision
3. Facial Detection and Recognition
4. Text Editors or Autocorrect
5. Search and Recommendation Algorithms
6. Chat bots
7. Digital Assistants
8. Social Media
9. E-Payments
10. Digital Advertising

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 5


COURSE OBJECTIVES

In this semester, the students will -

Introduce knowledge of historical perspective of AI and its foundations

Familiarization with principles of AI toward problem solving, inference,


perception, knowledge representation, and learning.
Introduce the concepts of Searching strategies used in Artificial
Intelligence.

List the objectives and functions of modern Artificial Intelligence.

Categorize an AI problem based on its characteristics and its


constraints.
Learn different logic formalisms and decision taking in planning
problems.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 6


COURSE OUTCOMES

After completion of this course students will be able to:

Understand fundamentals of the history of K2


CO1
Artificial intelligence (AI) and its foundations
Apply principles of AI in solutions that require K3
CO2
problem solving, inference and perception.
Explain strong familiarity with a number of K3
CO3 important AI techniques, including in particular
intelligent search methods and solutions.
Apply the concepts of knowledge & reasoning of K3
CO4 predicate logic and representing knowledge using
rules and Probabilistic reasoning.
Analysis critically the techniques presented and K2
CO5
apply them to real world problems.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 7


PROGRAM OUTCOMES

9/30/24 8
RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1
CO-PO MAPPING

Sr. No CO.K PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12

1 CO1 2 2 2 3 3 - - - - - - -
2 CO2 3 2 3 2 3 - - - - - - -
3 CO3 3 2 3 2 3 - - - - - - -
4 CO4 3 2 3 2 3 - - - - - - -
5 CO5 3 2 3 3 3 - - - - - - -

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 9


PROGRAM SPECIFIC OUTCOMES

On successful completion of graduation degree the Computer Science &


Engineering graduates will be able to:

PSO1: Design and develop the Hardware and Software systems.


Understand the interdisciplinary computing techniques and an ability
PSO2:
to apply them in the design of advanced computing.
Understand the programming methodology, software development
paradigms, design and analysis of Algorithms, Operating Systems,
PSO3:
Digital Logic Design, Theory of Computation, Discrete Mathematics,
Compiler Design, etc.
To integrate & manage the various phases/components of software
PSO4:
development projects of society.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 10


CO’s and PSO’s Mapping

CO.K PSO1 PSO2 PSO3 PSO4

CO1 3 - - -

CO2 3 3 - -

CO3 3 3 - -

CO4 3 3 - -

CO5 3 3 - -

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 11


Program Educational Objectives (PEOs)

Program Educational
PEOs Description
Objectives (PEOs)
To have an excellent scientific and engineering breadth so as to
PEO 1 comprehend, analyze, design and provide sustainable solutions for
real-life problems using state-of-the-art technologies.
To have a successful career in industries, to pursue higher studies or
PEO 2 to support entrepreneurial endeavors and to face the global
challenges.
To have an effective communication skills, professional attitude,
ethical values and a desire to learn specific knowledge in emerging
PEO 3
trends, technologies for research, innovation and
product development and contribution to society.
To have life-long learning for up-skilling and re-skilling for successful
PEO 4 professional career as engineer, scientist, entrepreneur and
bureaucrat for betterment of society.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 12


Result Analysis(Department Result & Subject Result &
Individual result)

Name of the
Subject code Result % of clear passed
faculty

Divya Pauchuri ACSAI0513 100

Renuka Sharma ACSAI0513 100

Dr. Mohd. Nazim ACSAI0513 100

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 13


Question Paper Template

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 14


Question Paper Template

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 15


Question Paper Template

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 16


Question Paper Template

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 17


Question Paper Template

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 18


PREREQUISITE & RECAP

Basic Knowledge of Transform techniques.

Knowledge of Data structure Algorithms.

Students must have logical and practical skill set towards analyzing
various problems related to algorithms.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 19


Brief Introduction (CO1)

• The intelligence demonstrated by machines is known as Artificial


Intelligence. It is the simulation of natural intelligence in machines that
are programmed to learn and mimic the actions of humans. These
machines are able to learn with experience and perform human-like
tasks. As technologies such as AI continue to grow, they will have a
great impact on our quality of life. It’s but natural that everyone today
wants to connect with AI technology somehow, may it be as an end-
user or pursuing a career in Artificial Intelligence.

• https://www.youtube.com/watch?v=4jmsHaJ7xEA
• https://www.youtube.com/watch?v=oV74Najm6Nc
• https://www.youtube.com/watch?v=y5swZ2Q_lBw
• https://www.youtube.com/watch?v=ptWmh0ocveM

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 20


UNIT CONTENT

Ø Introduction-:
• Introduction to Artificial Intelligence
• Historical developments of Artificial Intelligence
• Well defined learning problems
• Designing a Learning System
• Basics of problem-solving: problem representation paradigms
• State Space
• Problem reduction
• Constraint satisfaction
• Applications of AI

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 21


UNIT OBJECTIVES

• To gain an understanding of the fundamentals of Artificial


Intelligence, History of Artificial Intelligence.

• To gain knowledge of historical development of AI.

• To gain knowledge of well defined learning problems,


Designing a Learning System.

• Basics of problem-solving Like problem representation


paradigms, state space, satisfiability vs optimality, pattern
classification problems, example domains.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 22


Topic Objective

Topic- Introduction to Artificial Intelligence

To find out what are the fundamentals of Artificial


Intelligence.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 23


Introduction to Artificial Intelligence

AI is the main tool behind new-age Generalized AI is worth thinking


innovation and discoveries like about because it stretches our
driverless cars or disease detecting imaginations and it gets us to think
algorithm about our core values and issues of
choice

We are now solving problems with


Artificial Intelligence will be ‘vastly machine learning and AI that
smarter’ than any human and would were…in the realm of science fiction
overtake us by 2025. for the last several decades
Introduction to Artificial Intelligence

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 25


Introduction to Artificial Intelligence

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 26


Introduction to Artificial Intelligence

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 27


Introduction to Artificial Intelligence

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 28


Introduction to Artificial Intelligence

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 29


Introduction to Artificial Intelligence

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 30


Introduction to Artificial Intelligence

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 31


Introduction to Artificial Intelligence

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 32


Introduction to Artificial Intelligence

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 33


Introduction to Artificial Intelligence

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 34


Introduction to Artificial Intelligence

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 35


Introduction to Artificial Intelligence

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 36


Introduction to Artificial Intelligence

• Combination of 2 words:

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 37


Introduction to Artificial Intelligence

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 38


Daily QUIZ

ØAI is intelligence demonstrated by ________.


a.Machine
b.Human
c.Both a and b
d.Animals

ØArtificial Intelligence is about_____.


a. Playing a game on Computer
b. Making a machine Intelligent
c. Programming on Machine with your Own Intelligence
d. Putting your intelligence in Machine

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 39


Introduction to Artificial Intelligence

• What is AI?
Ability of machines to
– Learn
– Think
– Behave
Like humans

Formal Definition: branch of computer science which


emphasizes on creation of intelligent machines that work and act like
humans.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 40


History of AI

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 41


History of AI

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 42


History of AI

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

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 43


History of AI
§ 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.
Ø 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.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 44


History of AI

§ 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.
9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 45
History of 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.
§ 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.
9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 46
Daily QUIZ

Ø Who is known as the -Father of AI"?


1.Fisher Ada
2.Alan Turing
3.John McCarthy
4.Allen Newell

Ø Which of the given language is not commonly used for AI?


1.LISP
2.PROLOG
3.Python
4.Perl

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 47


CONTENTS

v Lecture
§ Well Defined Learning Problems

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 48


Well Defined Learning Problems

Artificial Intelligence provides right extracted knowledge to make more


informed, data-driven decisions that are faster than traditional
approaches. Here are some common learning problems.

1) Understanding Which Processes Need Automation


2) Lack of Quality Data
3) Inadequate Infrastructure
4) Implementation

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 49


Other AI Problems

1. Lack of technical knowledge

2. The price factor

3. Data acquisition and storage

4. Rare and expensive workforce

5. Issue of responsibility

6. Ethical challenges

7. Lack of computation speed

8. AI Myths & Expectation

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 50


CONTENTS

v Lecture
§ Designing a Learning System

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 51


Design a learning system

Learning: A Definition

• Definition: A computer program is said to learn from experience E with


respect to some class of tasks T and performance measure P, if its
performance at tasks in T, as measured by P, improves with experience E.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 52


Design a learning system

• Some tasks cannot be defined well, except by examples (e.g., recognizing


people).
• Relationships and correlations can be hidden within large amounts of data.
Machine Learning/Data Mining may be able to find these relationships.
• Human designers often produce machines that do not work as well as
desired in the environments in which they are used.
• The amount of knowledge available about certain tasks might be too large
for explicit encoding by humans (e.g., medical diagnostic).
• Environments change over time.
• New knowledge about tasks is constantly being discovered by humans. It
may be difficult to continuously re-design systems “by hand”.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 53


Design a learning system

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 54


Design a learning system

• Task T: Playing Checkers


• Performance Measure P: Percent of games won against opponents
• Training Experience E: To be selected ==> Games Played against itself

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 55


Design a learning system

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 56


Design a learning system

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 57


Design a learning system

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 58


Design a learning system

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 59


Design a learning system

RAJEEV KUMAR Introduction to Artificial Intelligence


9/30/24 60
Unit 1
Design a learning system

RAJEEV KUMAR Introduction to Artificial Intelligence


9/30/24 61
Unit 1
Steps in designing a learning system

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 62


Design a learning system

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 63


Design a learning system

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 64


Design a learning system

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 65


Design a learning system

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 66


Design a learning system

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 67


Design a learning system

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 68


Design a learning system

Let us therefore define the target value V(b) for an arbitrary board state b in
B, as follows:

1. if b is a final board state that is won, then V(b) = 100


2. if b is a final board state that is lost, then V(b) = -100
3. if b is a final board state that is drawn, then V(b) = 0
4. if b is a not a final state in the game, then V(b) = V(b’),
where b' is the best final board state that can be achieved starting from b
and playing optimally until the end of the game

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 69


Design a learning system

Choosing a Representation for the Target Function

Now that we have specified the ideal target function V, we must choose a
representation that the learning program will use to describe the
function V’ that it will learn. As with earlier design choices, we again have
many options.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 70


Design a learning system

To keep the discussion brief, let us choose a simple representation: for any
given board state, the function c will be calculated as a linear combination of
the following board features:

x1: the number of black pieces on the board


x2: the number of red pieces on the board
x3: the number of black kings on the board
x4: the number of red kings on the board
x5:the number of black pieces threatened by red (i.e., which can be
captured on red's next turn)
X6: the number of red pieces threatened by black

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 71


Design a learning system

Thus, our learning program will represent V’(b) as a linear function of the
form

§ where wo through W6 are numerical coefficients, or weights, to be


chosen by the learning algorithm.
§ Learned values for the weights w1 through W6 will determine the
relative importance of the various board features in determining the
value of the board.
§ The weight wo will provide an additive constant to the board value.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 72


Design a learning system

Partial design of a checkers learning program:


• Task T: playing checkers
• Performance measure P: percent of games won in the world tournament
• Training experience E: games played against itself
• Target function: V:Board + 8
• Target function representation

The first three items above correspond to the specification of the learning
task, whereas the final two items constitute design choices for the
implementation of the learning program.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 73


Design a learning system

Choosing a Function Approximation Algorithm


In order to learn the target function f we require a set of training examples,
each describing a specific board state b and the training value V train(b) for b.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 74


Design a learning system

9/30/24 75
RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1
Design a learning system

ADJUSTING THE WEIGHTS

Specify the learning algorithm for choosing the weights wi to best fit the set
of training examples { (b,V train(b))}.
A first step we must define what we mean by the bestfit to the training data.
• One common approach is to define the best hypothesis, or set of weights,
as that which minimizes the squarg error E between the training values
and the values predicted by the hypothesis .

Several algorithms are known for finding weights of a linear function that
minimize E

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 76


Design a learning system

In our case, we require an algorithm that will incrementally refine the


weights as new training examples become available and that will be robust
to errors in these estimated training values.
One such algorithm is called the least mean squares, or LMS training rule.
For each observed training example it adjusts the weights a small amount in
the direction that reduces the error on this training example.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 77


Design a learning system

The Final Design

The final design of our checkers learning system can be naturally described
by four distinct program modules that represent the central components
in many learning systems. These four modules, summarized in Figure 1.1,
are as follows:

The Performance System is the module that must solve the given
performance task, in this case playing checkers, by using the learned
target function(s). It takes an instance of a new problem (new game) as
input and produces a trace of its solution (game history) as output. In our
case, the strategy used by the Performance System to select its next move
at each step is determined by the learned p evaluation function.
Therefore, we expect its performance to improve as this evaluation
function becomes increasingly accurate.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 78


Design a learning system

The Critic takes as input the history or trace of the game and produces as
output a set of training examples of the target function. As shown in the
diagram, each training example in this case corresponds to some game state
in the trace, along with an estimate Vtraio,f the target function value for this
example. In our example, the Critic corresponds to the training rule given by
Equation (1.1).

The Generalizer takes as input the training examples and produces an output
hypothesis that is its estimate of the target function. It generalizes from the
specific training examples, hypothesizing a general function that covers these
examples and other cases beyond the training examples. In our example, the
Generalizer corresponds to the LMS algorithm, and the output hypothesis is
the function f described by the learned weights wo, . . . , W6.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 79


Design a learning system

The Experiment Generator takes as input the current hypothesis (currently


learned function) and outputs a new problem (i.e., initial board state) for the
Performance System to explore. Its role is to pick new practice problems that
will maximize the learning rate of the overall system. In our example, the
Experiment Generator follows a very simple strategy: It always proposes the
same initial game board to begin a new game. More sophisticated strategies
could involve creating board positions designed to explore particular regions
of the state space.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 80


Design a learning system

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 81


Daily QUIZ

Agents behavior can be best described by ______


a. Perception sequence
b. Agent Function
c. Sensors and Actuators
d. All of the above

Which of the following are examples of Machine Learning?


a. Learning to recognize spoken words
b. Learning to drive an autonomous vehicle
c. Learning to classify new astronomical structures
d. All of the above

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 82


CONTENTS

v Lecture
§ Basics of problem-solving
§ Problem representation paradigms

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 83


Agents and Environment
What are Agent and Environment?
An agent is anything that can perceive its environment through sensors and
acts upon that environment through effectors(actuators).
A human agent has sensory organs such as eyes, ears, nose, tongue and skin
parallel to the sensors, and other organs such as hands, legs, mouth, for
effectors.
A robotic agent replaces cameras and infrared range finders for the sensors,
and various motors and actuators for effectors.
A software agent has encoded bit strings as its programs and actions.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 84


Agents and Environment

What are Intelligent Agents?

An intelligent agent is a software program that supports a user with the


accomplishment of some task or activity by collecting information
automatically over the internet and communicating data with other agents
depending on the algorithm of the program.

Intelligent agents play an important role in e-marketing and enhancing the


e-Commerce aspect of an organization. It enables both buyers and sellers in
e-Commerce transactions by providing efficient, precise, and enhanced
comprehensive searches on the web and information repository.
AI assistants, like Alexa and Siri, are examples of intelligent agents as they
use sensors to perceive a request made by the user

In which we see how an agent can find a sequence of actions that


achieves its goals, when no single action will do.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 85


Basics of problem-solving

■ The method of solving problem through AI involves the process of defining


the search space, deciding start and goal states and then finding the path
from start state to goal state through search space.
■ State space search is a process used in the field of computer science,
including artificial intelligence(AI), in which successive configurations or
states of an instance are considered, with the goal of finding a goal state
with a desired property.
■ This is a one kind of goal-based agent called a problem-solving agent.

■ Problem-solving agents use atomic representations, states of the world


are considered as wholes, with no internal structure visible to the
problem solving algorithms.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 86


Basics of problem-solving

■ Goal-based agents that use more advanced factored or


structured representations are usually called planning
agents.
■ Problem solving begins with precise definitions of
problems and their solutions and give several examples to
illustrate these definitions.
■ We then describe several general-purpose search
algorithms that can be used to solve these problems. We
will see several uninformed search algorithms—
algorithms that are given no information about the
problem other than its definition.
■ Although some of these algorithms can solve any solvable
problem, none of them can do so efficiently.
■ Informed search algorithms, on the other hand, can do
quite well given some guidance on where to look for
solutions.
9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 87
Basics of problem-solving

performance measure.
■Problem-solving agents: find sequence of
actions that achieve goals.
■In this section we will use a map as an
example, if you take fast look you can deduce
that each node represents a city, and the cost to
travel from a city to another is denoted by the
number over the edge connecting the nodes of
those 2 cities.
■In order for an agent to solve a problem it
should pass by 2 phases of formulation:

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 88


Basics of problem-solving

■ Goal Formulation:
– Problem solving is about having a goal we want to reach, (i.e.,
I want to travel from ‘A’ to ‘E’).
– Goals have the advantage of limiting the objectives the agent
is trying to achieve.
– We can say that goal is a set of environment states in which
our goal is satisfied.
■ Problem Formulation:
– A problem formulation is about deciding what actions and
states to consider, we will come to this point it shortly.
– We will describe our states as “in(CITYNAME)”
where CITYNAME is the name of the city in which we are
currently in.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 89


Basics of problem-solving

■ Once our agent has found the sequence of cities it should pass by to
reach its goal it should start following this sequence.
■ The process of finding such sequence is called search, a search
algorithm is like a black box which takes problem as input returns a
solution, and once the solution is found the sequence of actions it
recommends is carried out and this is what is called the execution
phase.
■ We now have a simple (formulate, search, execute) design for our
problem solving agent, so lets find out precisely how to formulate a
problem.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 90


Basics of problem-solving

Formulating Problems

■ A problem can be defined formally by 4 components:


■ Initial State:
– it is the state from which our agents start solving the problem {e.i: in(A)}.
■ State Description:
– a description of the possible actions available to the agent, it is common
to describe it by means of a successor function, given state x then
SUCCESSOR-FN(x) returns a set of ordered pairs
<action, successor> where action is a legal action from state x and successor
is the state in
which we can be by applying action.
– The initial state and the successor function together defined what is called
state space which is the set of all possible states reachable from the
initial state {e.i: in(A), in(B), in(C), in(D), in(E)}.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 91


Basics of problem-solving

■ Goal Test:
– we should be able to decide whether the current state is a goal state {e.i:
is the current state is in(E)?}.
■ Path cost:
– a function that assigns a numeric value to each path, each step we take in
solving the problem should be somehow weighted, so If I travel from A
to E our agent will pass by many cities, the cost to travel between two
consecutive cities should have some cost measure, {e.i: Traveling from
‘A’ to ‘B’ costs 20 km or it can be typed as c(A, 20, B)}.
■ A solution to a problem is path from the initial state to a goal state, and
solution quality is measured by the path cost, and the optimal solution
has the lowest path cost among all possible solutions.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 92


Example

EXAMPLE
PROBLEMS
Toy Problem

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1


Example

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1


Example

Vacuum
World
– Initial state:
■Our vacuum can be in any state of the 8 states shown in
the picture.
– State description:
■Successor function generates legal states resulting from
applying the three actions {Left, Right, and Suck}.
■The states space is shown in the picture, there are 8 world
states.
– Goal test:
■Checks whether all squares are clean.
– Path cost:
■Each step costs 1, so the path cost is the sum of steps in
the path.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 95


Example

EXAMPLE
PROBLEMS
8 Puzzle

96

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 96


Example

8-Puzzle
■ Initial state:
– Our board can be in any state resulting from making it in any configuration.
■ State description:
– Successor function generates legal states resulting from applying the three actions
{move blank Up, Down, Left, or Right}.
– State description specifies the location of each of the eight titles and the blank.
■ Goal test:
– Checks whether the states matches the goal configured in the goal state shown in the
picture.
■ Path cost:
– Each step costs 1, so the path cost is the sum of steps in the path.

97

9/30/24 RAJEEV KUMAR Introduction to 97


Artificial Intelligence Unit 1
Example

98

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 98


Example

EXAMPLE
PROBLEMS
8-Queens Problem

99

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 99


Example

8-Queens Problem
■ States: ???
■ Initial State: ???
■ Successor Function: ???
■ Goal Test: ???

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 100


Example

EXAMPLE
PROBLEMS
Real World Problem

10
1

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 101


Example

Real World Problems


■ Airline Travelling Problem
■ States:
– Each is represented by a location and the current time.
■ Initial State:
– This is specified by the problem.
■ Successor Function:
– This returns the states resulting from taking any scheduled flight, leaving later than the
current time plus the within airport transit time, from the current airport to another.
■ Goal Test:
– Are we at the destination by some pre-specified time?
■ Path Cost:
– This depends on the monetary cost, waiting time, flight time, customs and immigration
procedures, seat quality, time of day, type of air place, frequent-flyer mileage awards and
so on.
9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 102
Example

Continue…
■ Touring problems
■ Traveling salesperson
problem
■ Robot navigation
■ Automatic assembly
sequencing

10
3

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 103


Example

SEARCHING FOR SOLUTIONS


■ After formulating our problem we are ready to solve it, this can be done by
searching through the state space for a solution, this search will be applied on a
search tree or generally a graph that is generated using the initial state and the
successor function.
■ Searching is applied to a search tree which is generated through state expansion,
that is applying the successor function to the current state, note that here we
mean by state a node in the search tree.
■ Generally, search is about selecting an option and putting the others aside for
later in case the first option does not lead to a solution, The choice of which
option to expand first is determined by the search strategy used.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 104


Example

10
5

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 105


Example

Continue…
■ The structure of a node in the search tree can be as follows:
– State: the state in the state space to which this state corresponds
– Parent-Node: the node in the search graph that generated this node.
– Action: the action that was applied to the parent to generate this node.
– Path-Cost: the cost of the path from the initial state to this node.
– Depth: the number of steps along the path from the initial state.
■ It is important to make a distinction between nodes and states, A node
in the search tree is a data structure holds a certain state and some info
used to represent the search tree, where state corresponds to a world
configuration, that is more than one node can hold the same state, this
can happened if 2 different paths lead to the same state. 10
6

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 106


Example

Measuring problem-solving performance


■ Search as a black box will result in an output that is either failure or a
solution, We will evaluate a search algorithm`s performance in four ways:
– Completeness: is it guaranteed that our algorithm always finds a solution
when there is one ?
– Optimality: Does our algorithm always find the optimal solution ?
– Time complexity: How much time our search algorithm
takes to find a solution ?
– Space complexity: How much memory required to run the search algorithm?
■ Time and Space in complexity analysis are measured with respect to the
number of nodes the problem graph has in terms of asymptotic notations.

10
7

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 107


Example

Continue….
■ In AI, complexity is expressed by three factors b, d and m:
1. b the branching factor is the maximum number of
successors of any node.
2. d the depth of the deepest goal.
3. m the maximum length of any path in the state space.

10
8

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 108


Example

Problem Solving By Search


■ Missionaries and Cannibals
– Three missionaries and cannibals are on one side of a
river, along with a boat that can hold one or two people.
Find a way to get everyone to the other side, without ever
leaving a group of missionaries outnumbered by cannibals.
– How do we transport them other side of the river?

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 109


Example

Problem solving

■ We want:
– To automatically solve a problem
■ We need:
– A representation of the problem
– Algorithms that use some strategy to solve the problem
defined in that representation

9/30/24 110
RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1
Example

Problem representation

■ General:
– State space: a problem is divided into a set of resolution steps
from the initial state to the goal state
– Reduction to sub-problems: a problem is arranged into a
hierarchy of sub-problems
■ Specific:
– Game resolution
– Constraints satisfaction

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 111


Applications

Here is a list of eight examples of artificial intelligence that you're likely to


come across on a daily basis.

• Maps and Navigation. AI has drastically improved traveling.


• Facial Detection and Recognition.
• Text Editors or Autocorrect.
• Search and Recommendation Algorithms.
• Chatbots.
• Digital Assistants.
• Social Media.
• E-Payments.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 112


Constraint Satisfaction

• Constraint satisfaction is a fundamental concept in AI that involves


finding solutions to problems that satisfy a set of constraints. It is widely
used in various domains, including planning, scheduling, optimization,
and decision-making.

• Constraint satisfaction problems (CSPs) provide a framework for


representing and solving problems where a set of variables must satisfy
specific constraints.

In AI, constraint satisfaction typically involves the following components:


1.Variables: These represent the entities or objects involved in the
problem. Each variable has a domain, which defines the possible values it
can take.

113
9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1
Constraint Satisfaction

2. Constraints: Constraints define the relationships or conditions that must be


satisfied among variables. They restrict the combinations of values that
variables can take simultaneously.

3. Domains: A domain represents the set of possible values that a variable can
take. It constrains the potential values a variable can be assigned during the
problem-solving process.

The goal of constraint satisfaction in AI is to find a consistent assignment of


values to variables that satisfies all the constraints. This can be achieved
through various algorithms and techniques, such as backtracking, constraint
propagation, and search heuristics.

114
9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1
Problem Reduction

115
9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1
Problem Reduction

116
9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1
Daily QUIZ
ØAI is intelligence demonstrated by ________.
a.Machine
b.Human
c.Both a and b
d.Animals

ØArtificial Intelligence is about_____.


a. Playing a game on Computer
b. Making a machine Intelligent
c. Programming on Machine with your Own Intelligence
d. Putting your intelligence in Machine

ØWho is known as the -Father of AI"?


1.Fisher Ada
2.Alan Turing
3.John McCarthy
4.Allen Newell

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 117


Daily QUIZ

ØAgents behavior can be best described by ______


a. Perception sequence
b. Agent Function
c. Sensors and Actuators
d. All of the above

Ø Which of the following are examples of Machine Learning?


a. Learning to recognize spoken words
b. Learning to drive an autonomous vehicle
c. Learning to classify new astronomical structures
d. All of the above

ØWhich of the given language is not commonly used for AI?


1.LISP
2.PROLOG
3.Python
4.Perl

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 118


MCQ’s
Ø An AI problem can be solved using
a. State Space Representation
b. Problem Reduction
c. Both a and b
d. None of the above

Ø What among the following is/are the example of the intelligent


agent/agents?
a. Human
b. Robot
c. Autonomous Spacecraft
d. All of the above

Ø The core components of learning system are:


a. The class of Tasks
b. Measure of performance
c. Source of Experience
d. All of the above
9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 119
MCQ’s

ØThe core components of learning system are:


a. The class of Tasks
b. Measure of performance
c. Source of Experience
d. All of the above

ØWhat is Human Intelligence?


a. Learning
b. Perceiving
c. Reasoning
d. All of the above

Ø What is Human Intelligence?


a. Learning
b. Perceiving
c. Reasoning
d. All of the above
9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 120
Glossary Question

Ø Computer, Algorithm, human, Artificial Intelligence, Machine learning,


Chatbots, f(n) = h(n), Time, Shallowest
1. ____________ is a formula given to a computer in order for it to
complete a task (i.e. a set of rules for a __________).
2. _____________a subset of computer science that deals with
computer systems performing tasks with similar, equal, or superior
intelligence to that of a __________.
3. _____________a chat robot that can converse with a human user
through text or voice commands.
4. _____________focuses on developing programs that access and use
data on their own, leading machines to learn for themselves and
improve from learned experiences.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 121


Glossary Question

Ø Computer, Algorithm, human, Artificial Intelligence, Machine learning,


Chatbots, f(n) = h(n), Time, Shallowest
1. Breadth-first search always expands the ______ node in the current
fringe of the search tree.
2. Heuristic function of greedy best-first search denoted as ______.
3. ____________complexity is a measure of time for an algorithm to
complete its task.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 122


Weekly Assignment

v What do you understand by Artificial Intelligence?


v Why do we need Artificial Intelligence?
v Give some real-world applications of AI.
v What are the types of AI?
v Which programming language is used for AI?
v What is the intelligent agent in AI, and where are they used?
v How is machine learning related to AI?
v What is Strong AI, and how is it different from the Weak AI?
v Give a brief introduction to the Turing test in AI?
v What is a Chatbot?
v What are the different areas where AI has a great impact?
v What is Artificial Intelligence? Give an example of where AI is used on a
daily basis.
v Explain the assessment that is used to test the intelligence of a machine.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 123


Weekly Assignment

v What are the core components of Learning System? What do you mean
by well defined Learning System?
v What are the basic attributes of types of training in a Learning System?
v How is machine learning related to AI?
v How will artificial intelligence change the future?
v What do you mean by well-defined Learning System? Explain the steps to
design a well- defined Learning System.
v Explain Knowledge Pyramid.
v Explain the Goal of Artificial Intelligence?
v What is the future of Artificial intelligence?
v Distinguish between strong and weak artificial intelligence?
v What are the three features of well-posed learning problem?
v Elaborate on the History of Artificial Intelligence.
v Explain the different steps to design a well- defined Learning System in
detail.
v Explain well defined or well posed Learning System with one example.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 124


Old Exam Question Papers

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 125


Old Exam Question Papers

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 126


Old Exam Question Papers

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 127


Old Exam Question Papers

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 128


Old Exam Question Papers

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 129


Expected Questions for University Exam

• What are the core components of Learning System? What do you


mean by well defined Learning System?
• What are the three features of well-posed learning problem?
• Elaborate on the History of Artificial Intelligence.
• What is a Chatbot?
• What are the different areas where AI has a great impact?
• What is Artificial Intelligence? Give an example of where AI is used
on a daily basis.
• Explain the different steps to design a well- defined Learning
System in detail.
• Explain the following terms:
– Machine Learning
– Speech Recognition
– Deep Learning
– Artificial Intelligence

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 130


RECAP

Basics of problem-solving:-
Ø how to represent the problem.
Ø State space- State space representation of the problem,
satisfiability vs optimality,
Ø pattern classification problems,
Ø example domains.

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 131


FACULTY VIDEO LINKS, YOUTUBE & NPTEL VIDEO LINKS AND
ONLINE COURSES DETAILS

• Youtube/other Video Links


• https://www.youtube.com/watch?v=4jmsHaJ7xEA
• https://www.youtube.com/watch?v=oV74Najm6Nc
• https://www.youtube.com/watch?v=y5swZ2Q_lBw
• https://www.youtube.com/watch?v=ptWmh0ocveM

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 132


REFERENCES

• Patrick Henry Winston, “Artificial Intelligence”, Pearson Education Inc.,


Third edition.
• Python Machine Learning: Learn Python in a Week and Master It. An
Hands-On Introduction to Artificial Intelligence Coding, a Project-Based
Guide with Practical Exercises (7 Days Crash Course, Book 2) 2020.
• Nils J.Nilsson, “Artificial Intelligence - A New Synthesis", Harcourt Asia Pvt.
Ltd
• AI in the Wild: Sustainability in the Age of Artificial Intelligence 2020.
• Knowledge-Based Systems Techniques and Applications (4-Volume Set).

9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 133


9/30/24 RAJEEV KUMAR Introduction to Artificial Intelligence Unit 1 134

You might also like