Unit 1 updated
Unit 1 updated
ARTIFICIAL INTELLIGENCE
Unit - 1
AI techniques, Data acquisition Problem solving-
Problem solving AI Models, and learning Problem solving
with AI, aspects in AI, process,
Formulating Problem types and Problem space and Toy Problems – Tic-
problems, characteristics, search, tac-toe problems,
Real World
Missionaries and Problem –
Cannibals Problem, Travelling
Salesman Problem
By John McCarthy (Father of Textbook Definition: Russell and Norvig (Authors of
AI): • "Artificial Intelligence is the study of Artificial Intelligence: A
• "AI is the science and engineering of how to make computers perform tasks Modern Approach):
making intelligent machines, especially that require human intelligence, such • "AI is the designing of agents that
intelligent computer programs." as reasoning, learning, problem-
solving, understanding language, and perceive their environment and take
perception." actions to maximize their chances of
achieving specific goals."
It involves the development of algorithms and computer programs that can perform tasks
that typically require human intelligence such as visual perception, speech recognition,
decision-making, and language translation.
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.
Need for Artificial Intelligence
He even created the Turing test, which is still used today, as a benchmark
to determine a machine’s ability to “think” like a human.
Though his ideas were ridiculed at the time, they set the wheels in
motion, and the term “artificial intelligence” entered popular awareness
in the mid- 1950s, after Turing died.
AI – History and Foundations
DARPA(Defense Advanced
Research Projects Agency) – Narrative Science AI
introduce first vehicle demonstrate ability to write Stanford issues the AI 100
challenge reports reports
Have to design and implement programs as how humans think i.e. need to get inside the
actual workings of human minds.
There are three ways to get in human minds
1.Through introspection—trying to catch our own thoughts as they go by
2.Through psychological experiments—observing a person in action
3.Through brain imaging—observing the brain in action.
Once gets the knowledge about mind, it becomes possible to express the knowledge as a
computer program. If the program’s input–output behavior matches corresponding human
behavior, that is evidence that some of the program’s mechanisms could also be operating in
humans.
By 1965, programs existed that could, solve any solvable problem
described in logical notation.
rationally: The
“laws of thought” There are two main obstacles to this approach.
approach
First, it is not easy to take informal knowledge and state it in the
formal terms required by logical notation, particularly when the
knowledge is less than 100% certain.
Thought Thought
Behavior Behavior
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, vocal tract, and so on 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.
• A rational agent is one that does the right thing.
• Abstractly, an agent is a function from percept histories to actions:
[f: P* 🡺 A]
• When an agent is plunked down in an environment, it generates a sequence
of actions according to the percepts it receives.
• This sequence of actions causes the environment to go through a sequence of
states.
Rational • If the sequence is desirable, then the agent has performed well.
• This is rational agent giving the best outcome.
agent Example,
• The vacuum-cleaner agent.
• We might propose to measure performance by the amount of dirt cleaned up
in a single eight-hour shift.
• With a rational agent, of course, what you ask for is what you get.
• A rational agent can maximize this performance measure by cleaning up the
dirt.
• A more suitable performance measure would reward the agent for having a
clean floor
⮚ Initially, AI dealt with simple reasoning and
reaction problems. It requires only very less
knowledge base
⮚ Washing machines
Stops water after reaching particular level
Fuzzy logic takes necessary amount of
water only
⮚ Traffic control
Automatically, dynamically adjust signal
timing, info to nearby signals, etc…
Fuzzy with washing machine Inputs
Defuzzification:
Input Fuzzification:
Rule Evaluation: The fuzzy results are Control:
Sensor readings (e.g., load
The fuzzy rules are applied converted into precise The washing machine
weight, water clarity, user
to determine the washing values, such as a specific adjusts its operation based
settings) are converted into
parameters. water level, washing on these calculated values.
fuzzy values.
duration, or spin speed.
⮚ So, the basics of AI,
Disadvantages
• Increased costs
• Difficulty with software development
• Few experienced programmers
AI Models
General block diagarm
Data Acquisition and Learning
Aspects in AI
⮚ Knowledge discovery
⮚ Data Mining
⮚ Machine learning
⮚ Computational learning theory
⮚ Study and analyse of algorithms
⮚ Lot of mathematical models
⮚ Neural and Evolutionary computation
⮚ Neural: mimics the neural behaviour of human beings
⮚ Evolutionary: Biological behaviours
⮚ Intelligent agents and multi-agent systems
⮚ Agent: a software which is flexible and supports users
Ex- DNA
Sequencing
Data Acquisition in AI
In AI, data acquisition is the process of sampling signals that measure physical conditions in the real
world and converting the samples into digital numeric values that a computer can manipulate.
Data acquisition helps to understand the behavior of the system, develop a model for the system,
and improve the performance of the system.
Data acquisition devices contain signal conditioning circuitry and an analog-to-digital converter.
These devices are flexible and can be used in many different applications.
Data Collection: The fundamental purpose of Real-Time Monitoring: DAQ systems offer real-
DAQ is to collect real-world measurements from time monitoring of critical parameters, allowing
sensors and transducers, including temperature, continuous tracking of processes, machinery, and
pressure, voltage, current, humidity, etc., environmental conditions. This data enables
providing valuable data for analysis and decision- prompt detection of anomalies, facilitating
making. timely corrective actions.
Data Analysis and Visualization: DAQ systems Process Optimization: DAQ systems continuously
provide data that can be analyzed and visualized collect and analyze data, identifying
for deeper insights. Analyzing trends, patterns, inefficiencies, bottlenecks, and improvement
and correlations in the acquired data helps make areas for enhanced productivity and resource
data-driven decisions and predictions. utilization, contributing to process optimization.
Machine Learning
• Machines learn in a way which help to train an algorithm so that it can learn and improve
by itself, and it is referred to as AI Learning or Machine Learning in AI.
• Machine learning may involve little or no human intervention.
• AI learning is a very important aspect of artificial intelligence as it involves algorithms that
allows the machines to learn automatically from their experience without the need of
human (programmer) intervention.
• Imagine that you are playing scramble with computer. In the beginning you might win
every time. But after many games as the computer starts to learn how to win at scramble
you might not be able to win against him. If the computer applies this strategy against
other players as well in order to win, this is referred to as generalisation.
Components of Machine Learning in AI
• Representation of data
• First and foremost we need to identify the type
of data we have to deal with.
• It is this component which selects the model in
which data can be represented.
• These include decision trees, constraints,
instances etc.
• Evaluation
• This component helps a machine to evaluate the
situation based on an evaluation criterion and
create a hypothesis based on which decisions can
be taken.
• Optimization and Output Unit
• The way by which hypothesis are generated is
known as optimization.
• It is here that the machine learning system would
interact with the outside world with the help of
the output unit and take actions accordingly.
Computational Learning Theory
Supervised
• The main goal of computational learning
theory is to develop algorithms that can
learn from data.
• This includes both supervised and
unsupervised learning algorithms.
• Supervised learning algorithms are given a
set of training data that includes the
correct answers for a set of tasks. The goal
of a supervised learning algorithm is to Unsupervised
learn a function that can map from the
input data to the correct answers.
• Unsupervised learning algorithms are given
a set of data but not the correct answers.
The goal of an unsupervised learning
algorithm is to find patterns in the data.
Computational Learning Methods
1. Inductive learning: This is the most
common type of learning used in AI. In
inductive learning, a computer program
is given a set of training data (examples
of correct inputs and outputs), and it is
then tasked with generating a general
rule or model that can be used to
predict the output for new inputs.
(Eating spicy food)
2. Deductive learning: In deductive
learning, a computer program is given a
set of rules or a model, and it is then
tasked with using these to generate
correct outputs for new inputs.
(Photosynthesis process)
Computational Learning Methods
3. Abductive learning: In abductive learning,
a computer program is given a set of
training data, and it is then tasked with
generating a hypothesis (a possible
explanation for the data) that is consistent
with the data. The grass is wet (the
observation), therefore, It probably rained
last night (the most likely hypothesis).
4. Reinforcement learning: In reinforcement
learning, a computer program is given a set
of rewards and punishments, and it is then
tasked with learning a policy (a set of rules)
that will maximize the rewards and
minimize the punishments. (Autonomous
cars)
Neural and Evolutionary Computing
• Neural Computing
• A neural network is a method in artificial
intelligence that teaches computers to
process data in a way that is inspired by
the human brain.
• It is a type of machine learning process,
that uses interconnected nodes or
neurons in a layered structure that
resembles the human brain.
• It creates an adaptive system that
computers use to learn from their
mistakes and improve continuously.
• Thus, artificial neural networks attempt to
solve complicated problems, like
summarizing documents or recognizing
faces, with greater accuracy.
Neural and Evolutionary Computing
• Evolutionary Computing
• Evolutionary computing is a subfield of
artificial intelligence and soft computing
that studies algorithms inspired by
biological evolution.
• It involves the use of automatic methods
to generate and evaluate successive
generations of a program until a
proficient solution evolves.
• Evolutionary computing techniques are
iterative and population-based, and
involve operations such as selection,
recombination, and mutation.
PROBLEM SOLVING
⮚ Problem solving – area of finding answers for unknown situation
⮚ Understanding
⮚ Representation
⮚ Formulation
⮚ Solving
⮚ Types,
⮚ Simple – Can be solved using deterministic approach
⮚ Complex – Lack of full information
⮚ Humans
⮚ Able to perceive, learn, use statistical methods, mathematical modelling to solve
⮚ AI do the same for the machine
Problem Solving
• Given situation 🡺 Desired situation
• Task of AI – to perform series of action to move from given situation
to desired situation.
• Types of Problem Solving
• Knowledge based :
• Memory based
• Rule based
• Search based
Problem Solving
• Knowledge based
• A knowledge-based system (KBS) is a type of computer system that analyzes
knowledge, data and other information from sources to generate new
knowledge.
• These systems often have built-in problem-solving capabilities that allow
them to understand the context of the data that they review and process and
make informed decisions based on the knowledge that they store.
Problem Solving
• Search based
• The set of states which are possible
via some sequence of actions the
agent takes is called the search space.
• The series of actions that the agent
actually performs is its search path,
and the final state is a solution if it
has the required property. There may
be many solutions to a particular
problem.
• Problem is defined as set of states
• State is the abstraction of all
information
• Collection of state is called state space
• An operator is applied to a state to
move it to the next state
OBJECTIVES OF PROBLEM SOLVING
⮚ Identify the set of actions which leads to the goal (Search)
⮚ Methods of problem solving is categorised into,
⮚ General purpose
⮚ Special purpose
⮚ General purpose:
⮚ Means-ends analysis
⮚ Present situation is compared with goal and the difference is identified
⮚ Search in action space to reduce the difference
⮚ Special purpose:
⮚ A particular problem is modelled with various assumptions
⮚ Special features of the situation are used to solve the problem
⮚ Expert System:
⮚ Uses historical knowledge to define the solution for the current problem
⮚ Problem solving is used in planning and decision making
PROBLEM SOLVING PROCESS
Problem solving is a process of generating solutions for a given
situation.
These are the following steps which require to solve a problem :
⮚ Problem definition: Detailed specification of inputs and acceptable
system solutions.
⮚ Problem analysis: Analyse the problem thoroughly. If boundary
condition not defined properly, it may lead to more operations,
complex and not achievable
⮚ Knowledge Representation: Collect detailed information about the
problem and define all possible techniques.
⮚ Problem-solving: Selection of best techniques
Components to formulate the problem
Problem formulating steps
Problem solving
Initial State Final State
State Transitions
Components to formulate the problem
• Initial State: This state requires an initial state for the problem which starts the AI
agent towards a specified goal. In this state new methods also initialize problem
domain solving by a specific class.
• Action: This stage of problem formulation works with function with a specific
class taken from the initial state and all possible actions done in this stage.
• Transition: This stage of problem formulation integrates the actual action done by
the previous action stage and collects the final stage to forward it to their next
stage.
• Goal test: This stage determines that the specified goal achieved by the
integrated transition model or not, whenever the goal achieves stop the action
and forward into the next stage to determines the cost to achieve the goal.
• Path costing: This component of problem-solving numerical assigned what will be
the cost to achieve the goal. It requires all hardware software and human working
cost.
Problem Solving – Vacuum cleaner
• Two rooms and one vacuum cleaner
• Dirt in both rooms – to be cleaned
• Vacuum cleaner present in any one room
• Goal – clean both rooms
1 – Dirt – both rooms – Vacuum cleaner – Left room
2 – Dirt – both rooms – Vacuum cleaner – Right
room
3 – Dirt - right room – Vacuum cleaner – Left room
4 – Dirt – right room – Vacuum cleaner – Right room
5 – Dirt – left room – Vacuum cleaner – Left room
6 – Dirt – left room – Vacuum cleaner – Right room
7 – No Dirt – both rooms – Vacuum cleaner – Left
room
8 – No Dirt – both rooms – Vacuum cleaner – Right
room
Problem Solving
You are given two jugs, a 5L one and a 3L one, a pump which has
unlimited water which you can use to fill the jug, and the ground on
which water may be poured. Neither jug has any measuring markings
on it. How can you get exactly 4L of water in 5L jug?
Water Jug Problem
You are given two jugs, a 5L one and a 3L one, a pump which has unlimited water which you
can use to fill the jug, and the ground on which water may be poured. Neither jug has any
measuring markings on it. How can you get exactly 4L of water in 5L jug?
57
Problem Types
1. Deterministic or observable(Single-state problems)
• Each state is fully observable and it goes to one
definite state after any action.
• Here , the goal state is reachable in one single action
or sequence of actions.
• Deterministic environments ignore
uncertainty.
• Ex- Vacuum cleaner with sensor.
58
Problem Types
2. Non-observable(Muliple-state problems) /
conformant problems
• Problem – solving agent does not have any
information about the state.
• Solution may or may not be reached.
• Ex- In case of vacuum cleaner , the goal state is to clean the
floor rather clean floor. Action is to suck if there is dirt. So , in
non-observable condition , as there is no sensor , it will have to
suck the dirt , irrespective of whether it is towards right or left .
Here , the solution space is the states specifying its movement
across the floor.
59
Problem Types
3. Non-deterministic(partially observable) /
contingency problem
• The effect of action is not clear.
• Percepts provide new information about the
current state.
• Ex- If we take Vacuum cleaner , and now assume that the
sensor is attached to it , then it will suck if there is dirt.
Movement of the cleaner will be based on its current
percept.
60
Problem Types
4. Unknown state space problems
• Typically exploration problems
• States and impact of actions are not known
• Ex- online search that involves acting without complete
knowledge of the next state or scheduling without map.
61
Problem Characteristics
1. Is the problem Decomposable?
2. Can solution steps to be ignored or undone?
3. Is the problem’s universe predictable?
4. Is the good solution is absolute or relative?
5. Is the solution a state or a path?
6. What is the role of knowledge?
7. Does the task require interaction with a person?
1) Is the problem Decomposable?
• Decomposable problem: Non - Decomposable problem:
2. Can solution steps to be ignored or
undone?
Consider following 3 problems
• In the Theorem Proving problem, a lemma that has been proved can be ignored for the
next steps.
• Such problems are called Ignorable problems.
• In the 8-Puzzle, Moves can be undone and backtracked.
• Such problems are called Recoverable problems.
• In Playing Chess, moves cannot be retracted.
• Such problems are called Irrecoverable problems.
• Ignorable problems can be solved using a simple control structure that never backtracks.
• Recoverable problems can be solved using backtracking.
• Irrecoverable problems can be solved by recoverable style methods via planning.
3. Is the problem’s universe predictable?
• 8 puzzle problem – next step is always predictable – normal planning -
certain outcome
Travelling salesman problem: Goal : shortest path from source city to destination city –
visiting all cities one by one
• Rule selection
Problem Space and Search
• Problem is represented as state space
• Search is a general algorithm for finding path in state space
• The identified path will either lead to solution or dead end
• Search algorithm makes use of control strategy like forward or
backward search
• Two types of search
• Informed search
• Uninformed search
Search Types
⮚ Informed
⮚ Heuristic search – skill based
⮚ Based on common sense, rule of thumb, educated guesses or intuitive judgement
⮚ Higher order cognitive process
⮚ Rank alternatives at each multiple selection path and choose the best
⮚ Speedy
⮚ But it ensures high probability of arriving at solution
⮚ Uninformed
⮚ Does not consider specific nature of problem
⮚ Generates all possible states in state space
⮚ Approach is time consuming
⮚ Uninformed search is also referred as blind search
⮚ Generates all possible states in state space and checks for goal state
⮚ Preferred in the algorithm where any error in algorithm has serious consequences
⮚ Search methods are evaluated based on Completeness, Optimality, Time
complexity and Space complexity
AND OR Graph
🞂 OR graphs : generally used for
data driven approach
🞂 AND OR graphs: used for Goal
driven approach
🞂 Problems solvable by
decomposing into sub problems
some of which is to be solved.
🞂 Graph consisting of OR arcs
and AND arcs
🞂 OR : the node has to be solved.
🞂 AND : all the nodes in the arc has
to be solved
Issues in design of search space
⮚ Problem as state space search
⮚ Solve problem by steps that will lead to solution
⮚ During search, the state space will be traversed
⮚ Forward track – moving from one state to another closer to goal state
⮚ Back track – when an error occurred move backwards in the state space
⮚ Need of systematic forward and backtrack
⮚ Issues while designing
⮚ State representation and relationships among states
⮚ Proper forward and backtrack to obtain optimal route
⮚ Rule selection
State-Space Model
⮚ Initial State
⮚ Operators: maps a state into a next state
⮚ alternative: successors of state
⮚ Goal Predicate: test to see if goal achieved
⮚ Optional:
⮚ cost of operators
⮚ cost of solution
Problems
⮚ Toy Problems,
⮚ Tic Tac Toe