21CS54 Module 1
21CS54 Module 1
LEARNING
Course Code 21CS54 CIE Marks 50
Teaching Hours/Week (L:T:P: S) 3:0:0:0 SEE Marks 50
Total Hours of Pedagogy 40 Total Marks 100
Credits 03 Exam Hours 03
Course Learning Objectives
CLO 1. Gain a historical perspective of AI and its foundations
CLO 2. Become familiar with basic principles of AI toward problem solving
CLO 3. Familiarize with the basics of Machine Learning & Machine Learning process,
basics of Decision Tree, and probability learning
CLO 4. Understand the working of Artificial Neural Networks and basic concepts of
clustering
Algorithms
Teaching-Learning Process (General Instructions)
These are sample Strategies, which teachers can use to accelerate the attainment of the
various course outcomes.
1. Lecturer method (L) need not to be only a traditional lecture method, but
alternative effective teaching methods could be adopted to attain the
outcomes.
2. Use of Video/Animation to explain functioning of various concepts.
3. Encourage collaborative (Group Learning) Learning in the class.
4. Ask at least three HOT (Higher order Thinking) questions in the class,
which promotes critical thinking.
5. Adopt Problem Based Learning (PBL), which fosters students’ Analytical
skills, develop design thinking skills such as the ability to design, evaluate,
generalize, and analyze information rather than simply recall it.
6. Introduce Topics in manifold representations.
7. Show the different ways to solve the same problem with different logic and
encourage the students to come up with their own creative ways to solve them.
8. Discuss how every concept can be applied to the real world - and when that's
possible, it
helps improve the students' understanding.
Module-1
Introduction: What is AI? Foundations and History of AI
CIE methods /question paper has to be designed to attain the different levels of
Bloom’s taxonomy as per the outcome defined for the course.
Semester End Examination:
Theory SEE will be conducted by University as per the scheduled timetable, with
common question papers for the subject (duration 03 hours)
1.
The question paper will have ten questions. Each question is set for 20 marks.
Marks scored shall be proportionally reduced to 50 marks.
2. There will be 2 questions from each module. Each of the two questions under a
module (with a maximum of 3 sub-questions), should have a mix of topics under
that module.
The students have to answer 5 full questions, selecting one full question from each module
Suggested Learning Resources:
Textbooks
1. Stuart J. Russell and Peter Norvig, Artificial Intelligence, 3rd Edition, Pearson,2015
2. S. Sridhar, M Vijayalakshmi “Machine Learning”. Oxford ,2021
Reference:
1. Elaine Rich, Kevin Knight, Artificial Intelligence, 3rdedition, Tata McGraw
Hill,2013
2. George F Lugar, Artificial Intelligence Structure and strategies for complex,
Pearson Education, 5th Edition, 2011
3. Tom Michel, Machine Learning, McGrawHill Publication.
Weblinks and Video Lectures (e-Resources):
1. https://www.kdnuggets.com/2019/11/10-free-must-read-books-ai.html
2. https://www.udacity.com/course/knowledge-based-ai-cognitive-systems-
-ud409 3. https://nptel.ac.in/courses/106/105/106105077/
4. https://www.javatpoint.com/history-of-artificial-intelligence
5. https://www.tutorialandexample.com/problem-solving-in-artificial-intelligence
6. https://techvidvan.com/tutorials/ai-heuristic-search/
7. https://www.analyticsvidhya.com/machine-learning/
8. https://www.javatpoint.com/decision-tree-induction
9. https://www.hackerearth.com/practice/machine-learning/machine-learning-
algorithms/ml- decision-tree/tutorial/
10. https://www.javatpoint.com/unsupervised-artificial-neural-networks
Activity Based Learning (Suggested Activities in Class)/ Practical Based learning
Role play for strategies– DFS & BFS, Outlier detection in Banking and insurance transaction
for identifying fraudulent behaviour etc. Uncertainty and reasoning Problem- reliability of
sensor used to detect pedestrians using Bayes Rule
Contents
Module -1 ............................................................................................................................................................................. 6
1.1.Introduction............................................................................................................................................................ 6
Why AI? .......................................................................................................................................................................... 6
Reasons behind why learn AI: ............................................................................................................................... 6
1.1.1. What is AI? ................................................................................................................................................... 8
1.1.2.The foundations of artificial intelligence ........................................................................................ 11
1.1.3. History of AI... ................................................................................................................................... 14
1.1.5. Example problems ........................................................................................................................... 18
1.1.6. Searching for solutions................................................................................................................... 24
1.1.8. Breadth-first search(BFS):........................................................................................................... 29
1.1.9. Depth First Search(DFS): ............................................................................................................. 31
Question Bank : .................................................................................................................................................... 34
Module -1
Introduction: What is AI? Foundations and History of AI
1.1.Introduction
Why AI?
Artificial intelligence (AI) makes it possible for machines to learn from experience, adjust to
new inputs and perform human-like tasks.
Most AI examples
Chess-playing computers(Garry Kasparov-IBM-DEEP BLUE) to self-driving cars(TESLA)
– rely heavily on deep learning and natural language processing.
Using these technologies,
computers can be trained to accomplish specific tasks by
processing large amounts of data and recognizing patterns in the
data.
Reasons behind why learn AI:
1. Bright career- Decent Salary -work as a Machine Learning Engineer, Data Scientist,
Business Intelligence Developer, Research Engineer
2. AI is versatile- It is applicable to any industry-healthcare, automobile, and even
banking and finance sector
for example, PathAI, which is a technology that will assist pathologists in reducinge rror
rates in cancer diagnosis
1. Skill of the century-create many and different job opportunities in related fields.
2. Ingests huge amounts of data-Humans generate more than 2.5 quintillion bytes of data
every day. machines and AI-enabled systems that are able to handle this big data.
1. The information regarding the AADHAR Cards of Indian citizens can
be an example of big data.
2. The posts that we like, view, share, or comment on Facebook are also
an example of big data.
AI has enabled programs to analyze trends in these data and act accordingly.
8. AI improvises user experience-
AI is not a technology that requires a separate app or device. It is adding intelligence to the
products we are using regularly in our lives.
A combination of different types of AI technologies like chatbots, automation,
virtual assistants like Google assistant is helping improve user experience by
adding multiple useful features to a previously existing product.
Siri, the voice assistant that Apple provides specifically for iPhone and iPad
users
The field of artificial intelligence, or AI, goes further still: it attempts not just to understand but
also to build intelligent entities.AI is one of the newest sciences. Work started in earnest soon
after World War II, and the name itself was coined in 1956.Along with molecular biology, AI
is regularly cited as the "field I would most like to be in" by scientists in other disciplines.
A student in physics might reasonably feel that all the good ideas have already been taken by
Galileo, Newton, Einstein, and the rest. AI, on the other hand, still has openings for several
full-time Einsteins.AI systematizes and automates intellectual tasks and is therefore potentially
relevant to any sphere of human intellectual activity. In this sense, it is truly a universal field.
Definition:
(1)Define
Intelligence
Artificial Intelligence
Agent
Rationality
Logical reasoning
(a)Intelligence: Intelligence is the ability to think, learn and act according to a situation and
the environment. It is a process of applying knowledge. It can also be defined as the ability to
adapt to the changes in the environment.
(c)Agent: An agent is something that acts. The word ‘agent’ came from the Latin word “agree”,
which means, to do. An agent acts on behalf of a person. It is an entity that acts in response to
the environmental issues.
(d)Rationality: Rationality means doing the right thing, given what it knows. A rational
approach involves a combination of mathematics and engineering.
(e)Logical reasoning: It is the way of thinking and taking decisions derived from the
conclusions and inferences.
“AI is the study of complex information processing problems that often have their roots in
some aspect of biological information processing. The goal of the subject is to identify
solvable and interesting information processing problems, and solve them.” -- David Marr
“The art of creating machines that perform functions that require intelligence when
performed by people” (Kurzweil,1990).
“The branch of computer science that is concerned with the automation of intelligent
behaviour.” (Luger and Stublefield,1993)
• “The exciting new effort to make computers think • “The study of mental faculties through
. . . machines with minds, in the full and literal theuse of computational models.”
sense.” (Haugeland, 1985) (Charniak and McDermott, 1985)
• “[The automation of] activities that we associate • “The study of the computations that
with human thinking, activities such as decision- makeit possible to perceive, reason, and
making, problem solving, learning ” (Bellman, act.”(Winston, 1992)
1978)
• “The study of how to make computers do things • “AI . . . is concerned with intelligent
at which, at the moment, people are better.” (Rich behavior in artifacts.” (Nilsson, 1998)
and Knight, 1991)
The definitions on the top, (a) and (b) are concerned with thought process and reasoning, whereas
those on the bottom, (c) and (d) address behaviour. 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(maths and engineering)
The cognitive modeling approach under "thinking humanly" involves creating explicit,
computer-based models that simulate human thought processes, such as problem-solving or
decision-making.
An example of a cognitive modeling approach is the development of expert systems in
artificial intelligence
CaDet (Cancer Decision Support Tool) is used to identify cancer in its earliest stages.
The computer would need to possess the following capabilities to do Turing Test:
The Total Turing Test takes this a step further by including not just the ability to engage
in natural language conversation but also other human abilities,
such as vision, hearing, and manual skill in performing tasks
In essence, the Total Turing Test seeks to evaluate a machine's overall capability to
perform any intellectual task that a human can, including perception(taking data from
cameras) and physical actions.
So it requires
COMPUTER VISION • computer vision to perceive objects(image processing,
object detections)
ROBOTICS • robotics to manipulate objects and move about.
The "Laws of Thought" are fundamental principles in classical logic that help guide rational thinking
and reasoning.
A rational agent is one that takes actions to maximize the expected outcome based on its knowledge
and goals.
Computer Program :
Code that we have written in the dark is executed by a conventional
computer software.
It is not acting on its own; rather, it is changing in response to the
outcomes.
Agent Program
A so-called agent program is supposed to function significantly better
than traditional computer programs.
Its predicted behaviors include setting out and achieving goals, changing
into a new stage of being, and functioning on its own.
Imagine a computer program designed to play chess. In this context, a rational agent is one that makes
moves to maximize its chances of winning the game. The agent needs to consider the current state of
the chessboard, its own pieces, the opponent's pieces, and the rules of the game to make a rational
decision at each turn.
The foundation provides the disciplines that contributed ideas, view points and techniques to
Al
1. Philosophy
2. Mathematics & Statistics
3. Economics
Philosophy:
1. Philosophy is the very basic foundation of Al.
2. One important aspect of artificial intelligence is the study of the underlying nature of
reality, existence, and knowledge as they relate to addressing a particular problem..
3. Philosophy defines that how can the formal rules be used to draw valid conclusions.
• With out philosophy it is difficult to answer the following questions.
In what way does a physical brain give rise to intellect?
Where does the knowledge come from?
How does the knowledge lead to action?
Mathematics(B.C 800-present):
Economics (1776-present):
Deals with investing the amount of money and Maximization of utility with minimal
investment .
• While developing an Al product, we should make decisions for
• When to invest?
• How to invest?
• How much to invest?
• Where to invest?
To answer these questions one should have knowledge about Decision Theory, Game
Theory, Operation Research etc
Neuroscience (1861-present):
Neuroscience is the study of the nervous system particularly the human brain.
Human brains are somehow different, when compared to other creatures, man has the
Neurons, also known as nerve cells, send and receive signals from brain.
Specialized projections called axons allow neurons to transmit electrical and chemical
signals to other cells.
Neurons can also receive these signals via root like extensions known as dendrites.
Synapses connect neurons in the brain to neurons in the rest of the body and from
those neurons to the muscles
➢ NOTE :Moore’s Law predicts that the CPU’s gate count will equal the brain’s
neuron count around 2020.
Psychology (1879-present):
The scientific method to the study of human vision.
Problem-solving abilities: how can people make decisions in complex
situations?
What are people's actions in unexpected circumstances?
Perceive: How do you look around you to solve problems?
Process cognitive information to represent knowledge.
How do humans and animals think and act?
How can artifacts(model-output created by training process) operate under their own control?
Linguistics:
• Speech recognition is a technology which enables a machine to understand the spoken
language and translate into a machine readable format.
• It is a way to talk with a computer and on the basis of that command, a computer can
perform a specific task.
• It includes Speech to Text, Text to Speech.
o In the early 1950s, Turing published a paper called “can a machine think?”.
o In 1943, McCulloch and Pitts implemented a neural model as the very first intelligent
program.
The birth of artificial intelligence (1956):
o MacCarthy said that intelligent machines need a separate discipline and he named it
Artificial intelligence.
o According to MacCarthy’s definition, AI is the science and engineering of building
intelligent machines.
Knowledge-based systems(1969–1974):
AI becomes a science(1995-):
o After the 1980s AI also adopted scientific methods that are experimental explanations for
theories. Being a science AI won a big recognition.
Summary of foundation :
1. Philosophers (going back to 400 B.C.) made AI conceivable by considering the ideas that the
mind is in some ways like a machine, that it operates on knowledge encoded in some internal
language, and that thought can be used to choose what actions to take.
3. Economists formalized the problem of making decisions that maximize the expected outcome
to the decision maker.
4. Neuroscientists discovered some facts about how the brain works and the ways in which
it is similar to and different from computers.
5. Psychologists adopted the idea that humans and animals can be considered information
processing machines. Linguists showed that language use fits into this model.
7. Control theory deals with designing devices that act optimally on the basis of feedback from
the environment. Initially, the mathematical tools of control theory were quite different from
AI, but the fields are coming closer together.
Intelligent agent:
What is the intelligent agent in AI, and where are they used?
The intelligent agent can be any autonomous entity that perceives its environment through the sensors
and act on it using the actuators for achieving its goal.
Goal-based agent:
A goal-based agent is an artificial intelligence agent that responds to its environment and
adjusts accordingly to achieve a goal
Example:
Google's Waymo driverless cars are good examples of a goal-based agent when they are
programmed with an end destination, or goal in mind
(9) . Define :
1. Goal formation . 2.Problem formulation 3.Search 4. Execution Phase or The
problem solving agent follows this four phase problem solving process:
Goal Formulation: This is the first and most basic phase in problem solving. It arranges
specific steps to establish a target/goal that demands some activity to reach it. AI agents are
now used to formulate goals.
Problem formulation: The process of selecting what actions and states to consider given a
goal is known as problem formulation.
..
(14) Write an algorithm explaining how the agent solved the problem.
(1)Toy Problems:
State: The state is determined by both the agent location and the dirt locations.
The agent is in one of the two locations, each of which might or might not contain dirt.
1. Initial state: Any state can be designated as the initial state.
2. Successor function: This generates the legal states that result from trying the three
actions (left, right and suck).
3. The complete state space is shown in figure below. A larger environment with n
locations has n X 2n states.
4. Goal test: This checks whether all the squares are clean.
5. Path cost: Each step costs 1, so the path cost, is the number of step in the path.
This toy problem has discrete locations, discrete dirt, reliable cleaning and it never gets
messed up once cleaned.
1. States: A state description specifies the location of each of the eight tiles(1 to 8) and
the blank in one of the nine squares.( 3* 3 board)
2. Initial state: Any state can be designated as the initial state. Note that any given goal
can be reached from exactly half of the possible initial states
3. Actions: The simplest formulation defines the actions as movements of the blank space
Left, Right, Up, or Down. Different subsets of these are possible depending on where
the blank is.
4. Transition model: Given a state and action, this returns the resulting state.
5. for example,
a. if we apply Left to the start state in Figure 3.4, the resulting state has the 5 and
the blank switched.
6. Goal test: This checks whether the state matches the goal configuration shown in
✓ The goal of 8-queens problem is to place 8 queens on the chessboard such that no queen
attacks any other.(A queen attacks any piece in the same row, column or diagonal).
i The goal of the 8-queens problem is to place eight queens on a chess board such that no queen
attacks any other. (A queen attacks any piece in the same row, column or diagonal.)
States: Any arrangement of 0 to 8 queens on the board is a state.
Initial state: No queens on the board.
Actions: Add a queen to any empty square.
Transition model: Returns the board with a queen added to the specified square.
Goal test: 8 queens are on the board, none attacked.
Successor Function : Add a queen to any square in the left most empty column such that it is
not attacked by any other queen.
This formulation reduces the 8-queens state space from 1.8×1014 to just 2,057, and solutions are easy to
find.
Route-Finding Problem :
Route-Finding Problem is defined in terms of specified locations and transitions along links
between them.
Route-finding algorithms are used in a variety of applications.
Some, such as Web sites and in-car systems that provide driving directions.
Others, such as routing video streams in computer networks, military operations
planning, and airline travel planning systems, involve much more complex
specifications.
Example :
Example: Route finding problem-
Problem: On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest.
Find a short route to drive to Bucharest.
Referring to figure - On holiday in Romania : currently in Arad. Flight leaves tomorrow from
Bucharest
Consider the airline travel problems that must be solved by a travel-planning Web site:
States: Obviously, each state comprises a place (for example, an airport) and the current time.
Furthermore -fare bases ,whether the journey is domestic or international etc
Initial state: This is specified by the user’s query.
Action: Take any flight from your current location, in any seat class, departing after the current
time, with adequate time for a within-airport transfer if necessary.
Transition model: The state resulting from taking a flight will include the destination of the
flight as the current location and the arrival time of the flight as the current time.
Goal test: Are we at the final destination specified by the user?
Path cost: This depends on monetary cost, waiting time, flight time, customs and immigration
procedures, seat quality, time of day, type of airplane, frequent-flyer mileage awards, and so
on.
Touring problems :
Touring problems are closely related to route-finding problems, but with an important
difference.
Consider, for example, the problem “Visit every city at least once, starting and ending in
Bucharest”.
Example:
The state space, however, is quite different. Each state must include not just the current location
but also the set of cities the agent has visited.
Initial state: would be In(Bucharest ), Visited({Bucharest})
Intermediate state would be
In(Vaslui ), Visited({Bucharest , Urziceni , Vaslui})
Goal test: would check whether the agent is in Bucharest and all 20 cities have been
visited
The traveling salesperson problem (TSP) is a touring problem in which each city must be
visited exactly once.
▪ The aim is to find the shortest tour.
The problem is known to be NP-hard, but an enormous amount of effort has been expended to
improve the capabilities of TSP algorithms.
Cell layout :
▪ In cell layout, the primitive components of the circuit are grouped into cells, each of
which performs some recognized function.
Channel routing :
▪ Channel routing finds a specific route for each wire through the gaps between the
Example :
The root node of the tree corresponds to the initial state, In(Arad).
The first step is to test whether this is a goal state.Then we need to consider taking various
actions.
We do this by expanding the current state.
ie, GENERATING applying each legal action to the current state, thereby
generating a new set of states(transition Model)
we add three branches from the parent node In(Arad) leading to three new child
nodes:
In(Sibiu), In(Timisoara), and In(Zerind).
Now we must choose which of these three possibilities to consider further.
Tree-Search algorithm :
1. The path from Arad to Sibiu and back to Arad again! We say that In(Arad) is a
repeated state in the search tree, generated in this case by a loopy path. Considering
such loopy paths means that the complete search tree for Romania is infinite
2. Loops can cause certain algorithms to fail, making otherwise solvable problems
unsolvable
Graph search:
Search algorithms require a data structure to keep track of the search tree that is being
constructed.
For each node n of the tree, we have a structure that contains four components:
• n.STATE: the state in the state space to which the node corresponds;
• n.PARENT: the node in the search tree that generated this node;
• n.ACTION: the action that was applied to the parent to generate the node;
• n.PATH-COST: the cost, traditionally denoted by g(n), of the path from the initial state to
the node, as indicated by the parent pointers.
Before we get into the design of specific search algorithms, we need to consider the criteria
that might be used to choose among them.
(24)Types of Uninformed Search Algorithms and explain BFS & DFS algorithm?
There are six uninformed search strategies as given below:
i. Breadth-first search
ii. Uniform-cost search
Breadth-first search is the most common search strategy for traversing a tree or graph.
This algorithm searches breadthwise in a tree or graph, so it is called breadth-first
search.
BFS algorithm starts searching from the root node of the tree and expands all successor
node at the current level before moving to nodes of next level.
The breadth-first search algorithm is an example of a general-graph search algorithm.
Breadth-first search implemented using FIFO queue data structure.
Advantages:
BFS will provide a solution if any solution exists.
If there are more than one solutions for a given problem, then BFS will provide the
minimal solution which requires the least number of steps.
Disadvantages:
It requires lots of memory since each level of the tree must be saved into memory to
expand the next level.
BFS needs lots of time if the solution is far away from the root node.
BFS Algorithm…
Example-2
S---> A--->B---->C--->D---->G--->H--->E---->F---->I---->K
Time Complexity: Time Complexity of BFS algorithm can be obtained by the number of
nodes traversed in BFS until the shallowest Node. Where the d= depth of shallowest solution
and b is a node at every state.
T (b) = 1+b2+b3+.......+ bd= O (bd)
Space Complexity: Space complexity of BFS algorithm is given by the Memory size of
frontier which is O(bd).
Completeness: BFS is complete, which means if the shallowest goal node is at some finite
depth, then BFS will find a solution.
Optimality: BFS is optimal if path cost is a non-decreasing function of the depth of the node
Implementation:
fringe = LIFO queue, i.e., put successors at front.
Example-2
In the below search tree, we have shown the flow of depth-first search, and it will follow
the order as:
Root node--->Left node ----> right node.
It will start searching from root node S, and traverse A, then B, then D and E, after
Completeness: DFS search algorithm is complete within finite state space as it will expand
every node within a limited search tree.
Time Complexity: Time complexity of DFS will be equivalent to the node traversed by the
algorithm. It is given by:
T(n)= 1+ n2+ n3 +.........+ nm=O(nm)
Where, m= maximum depth of any node and this can be much larger than d (Shallowest
solution depth)
Space Complexity: DFS algorithm needs to store only single path from the root node, hence
space complexity of DFS is equivalent to the size of the fringe set, which is O(bm).
Optimal: DFS search algorithm is non-optimal, as it may generate a large number of steps or
high cost to reach to the goal node
(27) What are the advantages of breadth-first search (BFS) over depth-first search (DFS)?
BFS is complete and optimal, while DFS is not guaranteed to halt when there are loops.
The following are the important differences between BFS and DFS −
Key BFS DFS
BFS stands for Breadth First DFS stands for Depth First Search.
Definition
Search.
Data BFS uses a Queue to find the DFS uses a Stack to find the shortest path.
structure shortest path.
Question Bank :
1. What is AI? What are the views of 4 categories of AI definition?
2. What is cognitive modeling approach ?
3. What is Turing test ?Explain process involve in Turing test? What are the Capabilities
require for computer to do total Turing test?
4. Explain foundation of artificial intelligence.
5. Brief about history of artificial intelligence.
6. Explain the steps involved in AI problem solving by agents with example
7. Explain Well defined problems components.
8. Define :
1. Intelligence agent
2. Goal based agent
3. Problem solving agent
4. Goal formation .
5. Problem formulation
6. Search
7. Execution Phase
8. State space
9. Path cost
10. Solution
9. Write algorithm for solving problem by problem solving agent.
10. Mention the Difference between toys and real world problems.
11. Give a complete problem formulation for each of the following problems.
1. Vacuum world
2. The 8-puzzle