0% found this document useful (0 votes)
15 views42 pages

FAI Module - 1

Uploaded by

dhatrikasyap
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)
15 views42 pages

FAI Module - 1

Uploaded by

dhatrikasyap
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

FAI Module - 1

Fundamentals to Artificial Intelligence


Module – 1
Introduction

What is AI?

Artificial Intelligence (AI) is a branch of Science which deals with helping


machines find solutions to complex problems in a more human-like fashion.
This generally involves borrowing characteristics from human intelligence, and
applying them as algorithms in a computer friendly way.
A more or less flexible or efficient approach can be taken depending on the
requirements established, which influences how artificial the intelligent behavior
appears

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


The term was coined by McCarthy in 1956.

There are two ideas in the definition.

1. Intelligence
2. artificial device

What is intelligence?

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


– Accordingly there are two possibilities:
– A system with intelligence is expected to behave as intelligently as a human
– A system with intelligence is expected to behave in the best possible manner
– Secondly what type of behavior are we talking about?
– Are we looking at the thought process or reasoning ability of the system?
– Or are we only interested in the final manifestations of the system in terms of
its actions?

Given this scenario different interpretations have been used by different researchers as
defining the scope and view of Artificial Intelligence.
1
FAI Module - 1

1. One view is that artificial intelligence is about designing systems that are as
intelligent as humans.

This view involves trying to understand human thought and an effort to build
machines that emulate the human thought process. This view is the cognitive
science approach to AI.

2
FAI Module - 1

2. The second approach is best embodied by the concept of the Turing Test.
Turing held that in future computers can be programmed to acquire abilities
rivaling human intelligence. As part of his argument Turing put forward the idea
of an 'imitation game', in which a human being and a computer would be
interrogated under conditions where the interrogator would not know which was
which, the communication being entirely by textual messages. Turing argued that
if the interrogator could not distinguish them by questioning, then it would be
unreasonable not to call the computer intelligent. Turing's 'imitation game' is now
usually called 'the Turing test' for intelligence.

3
FAI Module - 1

Turing Test
Consider the following setting. There are two rooms, A and B. One of the rooms contains
a computer. The other contains a human. The interrogator is outside and does not know
which one is a computer. He can ask questions through a teletype and receives answers
from both A and B. The interrogator needs to identify whether A or B are humans. To
pass the Turing test, the machine has to fool the interrogator into believing that it is
human. For more details on the Turing test visit the site
http://cogsci.ucsd.edu/~asaygin/tt/ttest.html

3. Logic and laws of thought deals with studies of ideal or rational thought process and
inference. The emphasis in this case is on the inferencing mechanism, and its
properties. That is how the system arrives at a conclusion, or the reasoning behind its
selection of actions is very important in this point of view. The soundness and
completeness of the inference mechanisms are important here.

4. The fourth view of AI is that it is the study of rational agents. This view deals with
building machines that act rationally. The focus is on how the system acts and
performs, and not so much on the reasoning process. A rational agent is one that acts
rationally, that is, is in the best possible manner.

Artificial intelligence can be viewed from a variety of perspectives.


✓ From the perspective of intelligence
artificial intelligence is making machines "intelligent" -- acting as we would
expect people to act.
o The inability to distinguish computer responses from human responses is called the Turing
test.
o Intelligence requires knowledge
o Expert problem solving - restricting domain to allow including significant relevant
knowledge
✓ From a business perspective AI is a set of very powerful tools, and
methodologies for using those tools to solve business problems.
✓ From a programming perspective, AI includes the study of symbolic
programming, problem solving, and search.
o Typically AI programs focus on symbols rather than numeric processing.
o Problem solving - achieve goals.
o Search - seldom access a solution directly. Search may include a variety of techniques.
o AI programming languages include:
– LISP, developed in the 1950s, is the early programming language
strongly associated with AI. LISP is a functional programming language with
4
FAI Module - 1

procedural extensions. LISP (LISt Processor) was specifically designed for

5
FAI Module - 1

processing heterogeneous lists -- typically a list of symbols. Features of LISP are run-
time type checking, higher order functions (functions that have other functions as
parameters), automatic memory management (garbage collection) and an interactive
environment.
– The second language strongly associated with AI is PROLOG.
PROLOG was developed in the 1970s. PROLOG is based on first order
logic. PROLOG is declarative in nature and has facilities for explicitly
limiting the search space.
– Object-oriented languages are a class of languages more recently
used for AI programming. Important features of object-oriented languages
include: concepts of objects and messages, objects bundle data and
methods for manipulating the data, sender specifies what is to be done
receiver decides how to do it, inheritance (object hierarchy where objects
inherit the attributes of the more general class of objects). Examples of
object-oriented languages are Smalltalk, Objective C, C++. Object
oriented extensions to LISP (CLOS - Common LISP Object System) and
PROLOG (L&O - Logic & Objects) are also used.
Artificial Intelligence is a new electronic machine that stores large amount of
information and process it at very high speed
The computer is interrogated by a human via a teletype It passes if the human
cannot tell if there is a computer or human at the other end
The ability to solve problems
It is the science and engineering of making intelligent machines, especially
intelligent computer programs. It is related to the similar task of using computers
to understand human intelligence
Typical AI problems
While studying the typical range of tasks that we might expect an “intelligent entity” to
perform, we need to consider both “common-place” tasks as well as expert tasks.
Examples of common-place tasks include

– Recognizing people, objects.


– Communicating (through natural language).
– Navigating around obstacles on the streets
6
FAI Module - 1

These tasks are done matter of factly and routinely by people and some other animals.

Expert tasks include:


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

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

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

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

Intelligent behaviour
This discussion brings us back to the question of what constitutes intelligent behaviour.
Some of these tasks and applications are:
▪ Perception involving image recognition and computer vision
▪ Reasoning
▪ Learning
▪ Understanding language involving natural language processing, speech processing
▪ Solving problems
▪ Robotics
Practical Impact of AI
AI components are embedded in numerous devices e.g. in copy machines for automatic
correction of operation for copy quality improvement. AI systems are in everyday use for
identifying credit card fraud, for advising doctors, for recognizing speech and in helping
complex planning tasks. Then there are intelligent tutoring systems that provide students
with personalized attention

7
FAI Module - 1

Thus AI has increased understanding of the nature of intelligence and found many
applications. It has helped in the understanding of human reasoning, and of the nature of
intelligence. It has also helped us understand the complexity of modeling human reasoning.

Approaches to AI
Strong AI aims to build machines that can truly reason and solve problems. These machines
should be self aware and their overall intellectual ability needs to be indistinguishable from
that of a human being. Excessive optimism in the 1950s and 1960s concerning strong AI
has given way to an appreciation of the extreme difficulty of the problem. Strong AI
maintains that suitably programmed machines are capable of cognitive mental states.

Weak AI: deals with the creation of some form of computer-based artificial intelligence that
cannot truly reason and solve problems, but can act as if it were intelligent. Weak AI holds
that suitably programmed machines can simulate human cognition.

Applied AI: aims to produce commercially viable "smart" systems such as, for example, a
security system that is able to recognise the faces of people who are permitted to enter a
particular building. Applied AI has already enjoyed considerable success.

Cognitive AI: computers are used to test theories about how the human mind works--for
example, theories about how we recognise faces and other objects, or about how we solve
abstract problems.

Goals of AI

▪ Thinking rationally
▪ Acting rationally
▪ Thinking like a human
▪ Acting like a human

Advantages of Artificial Intelligence


• High Accuracy with less errors
• High-Speed
• High reliability
• Useful for risky areas
• Digital Assistant
• Useful as a public utility

Disadvantages of Artificial Intelligence


• High Cost
• Can't think out of the box
• Increase dependency on machines

8
FAI Module - 1

• No Original Creativity

HISTORY OF AI
“Artificial Intelligence (AI) is the part of computer science concerned with
designing intelligent computer systems, that is, systems that exhibit characteristics
we associate with intelligence in human behaviour – understanding language,
learning, reasoning, solving problems, and so on.”
Scientific Goal To determine which ideas about knowledge representation,
learning, rule systems, search, and so on, explain various sorts of real intelligence.
Engineering Goal To solve real world problems using AI techniques such as
knowledge representation, learning, rule systems, search, and so on.
Traditionally, computer scientists and engineers have been more interested in the
engineering goal, while psychologists, philosophers and cognitive scientists have
been more interested in the scientific goal.
The Roots - Artificial Intelligence has identifiable roots in a number of older
disciplines, particularly:
✓ Philosophy
✓ Logic/Mathematics
✓ Computation
✓ Psychology/Cognitive Science
✓ Biology/Neuroscience
✓ Evolution
There is inevitably much overlap, e.g. between philosophy and logic, or between
mathematics and computation. By looking at each of these in turn, we can gain a
better understanding of their role in AI, and how these underlying disciplines have
developed to play that role.
Philosophy
✓ ~400 BC Socrates asks for an algorithm to distinguish piety from non-piety.
✓ ~350 BC Aristotle formulated different styles of deductive reasoning, which

9
FAI Module - 1

could mechanically generate conclusions from initial premises, e.g. Modus


Ponens If A ? B and A then B
If A implies B and A is true then B is true when it’s raining you

get wet and it’s raining then you get wet

✓ 1596 – 1650 Rene Descartes idea of mind-body dualism – part of the mind is
exempt from physical laws.
✓ 1646 – 1716 Wilhelm Leibnitz was one of the first to take the materialist
position which holds that the mind operates by ordinary physical processes –
this has the implication that mental processes can potentially be carried out by
machines.

Logic/Mathematics
✓ Earl Stanhope’s Logic Demonstrator was a machine that was able to solve
syllogisms, numerical problems in a logical form, and elementary questions of
probability.
✓ 1815 – 1864 George Boole introduced his formal language for making logical
inference in 1847 – Boolean algebra.
✓ 1848 – 1925 Gottlob Frege produced a logic that is essentially the first-order
logic that today forms the most basic knowledge representation system.
✓ 1906 – 1978 Kurt Gödel showed in 1931 that there are limits to what logic can
do. His Incompleteness Theorem showed that in any formal logic powerful
enough to describe the properties of natural numbers, there are true statements
whose truth cannot be established by any algorithm.

✓ 1995 Roger Penrose tries to prove the human mind has non-computable
capabilities.
Computation
✓ 1869 William Jevon’s Logic Machine could handle Boolean Algebra and Venn
Diagrams, and was able to solve logical problems faster than human beings.
✓ 1912 – 1954 Alan Turing tried to characterise exactly which functions are
capable of being computed. Unfortunately it is difficult to give the notion of

10
FAI Module - 1

computation a formal definition. However, the Church-Turing thesis, which


states that a Turing machine is capable of computing any computable function,
is generally accepted as providing a sufficient definition. Turing also showed
that there were some functions which no Turing machine can compute (e.g.
Halting Problem).
✓ 1903 – 1957 John von Neumann proposed the von Neuman architecture which
allows a description of computation that is independent of the particular
realisation of the computer.
✓ 1960s Two important concepts emerged: Intractability (when solution time
grows atleast exponentially) and Reduction (to ‘easier’ problems).
Psychology / Cognitive Science
✓ Modern Psychology / Cognitive Psychology / Cognitive Science is the science
which studies how the mind operates, how we behave, and how our brains
process information.
✓ Language is an important part of human intelligence. Much of the early work on
knowledge representation was tied to language and informed by research into
linguistics.
✓ It is natural for us to try to use our understanding of how human (and other
animal) brains lead to intelligent behavior in our quest to build artificial
intelligent systems. Conversely, it makes sense to explore the properties of
artificial systems (computer models/simulations) to test our hypotheses
concerning human systems.
✓ Many sub-fields of AI are simultaneously building models of how the human
system operates, and artificial systems for solving real world problems, and are
allowing useful ideas to transfer between them.
Biology / Neuroscience

✓ Our brains (which give rise to our intelligence) are made up of tens of billions
of neurons, each connected to hundreds or thousands of other neurons.
✓ Each neuron is a simple processing device (e.g. just firing or not firing
depending on the total amount of activity feeding into it). However, large
networks of neurons are extremely powerful computational devices that can
11
FAI Module - 1

learn how best to operate.


✓ The field of Connectionism or Neural Networks attempts to build artificial
systems based on simplified networks of simplified artificial neurons.
✓ The aim is to build powerful AI systems, as well as models of various human
abilities.
✓ Neural networks work at a sub-symbolic level, whereas much of conscious
human reasoning appears to operate at a symbolic level.
✓ Artificial neural networks perform well at many simple tasks, and provide good
models of many human abilities. However, there are many tasks that they are
not so good at, and other approaches seem more promising in those areas.
Evolution
✓ One advantage humans have over current machines/computers is that they have
a long evolutionary history.
✓ Charles Darwin (1809 – 1882) is famous for his work on evolution by natural
selection. The idea is that fitter individuals will naturally tend to live longer and
produce more children, and hence after many generations a population will
automatically emerge with good innate properties.
✓ This has resulted in brains that have much structure, or even knowledge, built in
at birth.
✓ This gives them at the advantage over simple artificial neural network systems
that have to learn everything.
✓ Computers are finally becoming powerful enough that we can simulate
evolution and evolve good AI systems.
✓ We can now even evolve systems (e.g. neural networks) so that they are good at
learning.
✓ A related field called genetic programming has had some success in evolving
programs, rather than programming them by hand.
Sub-fields of Artificial Intelligence

✓ Neural Networks – e.g. brain modeling, time series prediction, classification


✓ Evolutionary Computation – e.g. genetic algorithms, genetic programming
✓ Vision – e.g. object recognition, image understanding
12
FAI Module - 1

✓ Robotics – e.g. intelligent control, autonomous exploration


✓ Expert Systems – e.g. decision support systems, teaching systems
✓ Speech Processing– e.g. speech recognition and production
✓ Natural Language Processing – e.g. machine translation
✓ Planning – e.g. scheduling, game playing
✓ Machine Learning – e.g. decision tree learning, version space learning
Speech Processing
✓ As well as trying to understand human systems, there are also numerous real
world applications: speech recognition for dictation systems and voice activated
control; speech production for automated announcements and computer
interfaces.
✓ How do we get from sound waves to text streams and vice-versa?

Natural Language Processing


✓ For example, machine understanding and translation of simple sentences:
Planning
✓ Planning refers to the process of choosing/computing the correct sequence of
steps to solve a given problem.
✓ To do this we need some convenient representation of the problem domain. We
can define states in some formal language, such as a subset of predicate logic, or
a series of rules.
✓ A plan can then be seen as a sequence of operations that transform the initial
state into the goal state, i.e. the problem solution. Typically we will use some
kind of search algorithm to find a good plan.

13
FAI Module - 1

Current Status of AI

▪ Ethical AI
Some reputed companies such as Google, Microsoft, Apple, Facebook and other tech giants
are building ethical AI to follow an ethical framework with four essential principles for
effective data governance— fairness, accountability, transparency well to explainability. This
is currently the most popular Artificial Intelligence trend in 2021 for providing the inside look
into its own system to stakeholders. These companies are initiating multiple programmes and
research to encourage other companies to adopt ethical AI with personalised strategies as per
the requirements of a business.

▪ Explainable AI
Explainable AI is a part of ethical AI that provides a complete explanation of how the
Artificial Intelligence models and machine learning algorithms are working inside to generate
the appropriate meaningful business insights and predict the future. Companies leveraging
disruptive technologies are required to maintain transparency to stakeholders with a full
explanation. But it is creating controversy because companies do not want to disclose all their
steps and processes to the public for patent purposes in a cut-throat competitive market.

▪ Predictive Analytics
Predictive analytics enables all kinds of businesses to identify the trends of consumers for a
better understanding of consumer behaviour in the current scenario. It predicts all potential
responses from the target audience by employing personalised data that are collected for a
long time. The advancement in Artificial Intelligence and machine learning algorithms are
providing more accurate predictions and insights to maintain better customer engagement and
gain higher ROI from the global market.

▪ Emotional AI
Emotional AI, is one of the most popular Artificial Intelligence trends in 2021because this
technology can sense, learn and interact with multiple human emotions. It is also known as
affective computing that enhances human-robot communication to a whole new level.

14
FAI Module - 1

Emotional AI can understand consumer behaviour through verbal as well as non-verbal


signals. Hi-tech cameras and Chatbots can easily detect various types of human emotions by
studying the reactions to certain contents, products and services. This advancement in
Artificial Intelligence has an immense scope in the retail industry in the nearby future.

15
FAI Module - 1

▪ AI with AR and VR
Augmented Reality and Virtual reality are already providing immersive experiences to
consumers as well as industries all around the world in these recent years. The combination of
these three disruptive technologies- Artificial Intelligence, Augmented Reality and Virtual
Reality has the potential to revolutionise the world with its amazing functionalities. The trio
has already started to transform the relationship between customers and companies by
providing extra personalisation and customisation of products and services to meet the needs
and wants of each customer.

▪ AI in Cybersecurity
The data-driven world has created a data explosion in these recent years that is difficult for
organisations to protect the sets from malicious hackers. The integration of Artificial
Intelligence in cybersecurity has created more advanced and powerful defence against
harmful cyberattacks like phishing, ransomware, virus and so on. AI can instantly detect any
unusual activity in the existing systems and alert the employees as soon as possible. It is
making it more difficult for hackers and frauds to enter any system. Artificial Intelligence
enhances cybersecurity through intelligent code analysis and configuration analysis with
activity monitoring.

▪ AI in IoT
Artificial Intelligence, has a tremendous scope in IoT (Internet of Things) with the help of 5G
network. The implementation of Artificial Intelligence into IoT can help smart devices such as
wearable devices, virtual assistance, refrigerators, etc. to analyse data and make smart
decisions efficiently based on the collected data without any human intervention. It is used to
optimise a system and enhance performance to meet the needs and wants of the target
audience.

16
FAI Module - 1

Scope of AI

• Machine Learning

• Expert Systems

• Computer Vision

• Natural Language Processing

• Robotics

Though the lines between each of these five disciplines has started to blur as we’ve made

progress towards AGI, this framework serves as a helpful starting point for understanding AI.

In this second section, we’ll offer examples and recent trends across each of these five

disciplines.

Machine Learning

Machine learning (ML) is the science of empowering machines to make decisions without

human intervention. This sub-discipline forms the backbone of AI, enabling computers to learn

and interpret patterns in images, sounds, and structured data using multidimensional arrays.

ML is further subdivided into four types of learning:

• Supervised learning: Given an array of features (i.e., week of the year, price, etc.) and a

17
FAI Module - 1

labeled output variable (e.g., sales), predict the best possible estimate of the label variable

given some new input array.

18
FAI Module - 1

• Unsupervised learning: Given an array of features (e.g., demographic information, ZIP

code, etc.), expose and visualize hidden relationships and anomalies within the array.

• Semi-supervised: Given an array of features and a limited quantity of some labeled

output variable, predict the best possible estimates for the missing label variables.

• Reinforcement learning: Given some objective, train an artificial agent to maximize its

utility according to some user-defined utility function.

Expert Systems

An expert system (ES) is an artificial agent which leverages pre-programmed knowledge

to offer advice or make decisions. In its simplest form, we can think of an ES as a

complicated decision tree or nested if-then logic: if x, y, and w happen, we instruct the

computer to do z. Though expert systems don’t enjoy the same hype as machine learning, there

are many reasons why we might prefer an ES over ML:

• An expert system can take advantage of human insights discovered through trial and error

• Expert systems are more predictable and are less likely to make extreme errors when

faced with previously-unseen inputs

• Expert systems have historically been faster and easier to implement, though ML has

become much more accessible in recent years

19
FAI Module - 1

Computer Vision

Computer vision (CV) is the automatic extraction, analysis, and interpretation of images or

videos. CV converts photos and videos into numerical arrays, enabling ML algorithms to draw

inferences, make predictions, and even generate new images based on user-defined inputs.

Natural Language Processing

Natural language processing (NLP) is the automatic extraction, analysis, and generation of

human language. NLP algorithms parse sentences in various ways (e.g., splitting by word,

splitting by letter, reading both left-to-right and right-to-left, etc.) to automatically draw

inferences about the writer’s meaning and intent. NLP’s various use cases include:

• Named entity recognition and conference resolution

• Part-of-speech tagging

• Reading comprehension & question answering

• Machine translation

• Text summarization & topic modeling

• Spell check & auto complete

How Alexa and Siri interpret your commands (source)

Siri and Alexa are great examples of NLP in action: by listening for “wake words”, these tools

allow you to play music, search the Web, create to-do lists, and control popular smart-home

20
FAI Module - 1

products — all while your smart phone stays in your pocket. These virtual assistants will

continue to improve over time as they gather data from existing users, unlocking new use cases

and integrating with the modern enterprise.

Robotics

Robotics is the science of designing, constructing, operating, and applying robots to solve

human problems. Robots come in thousands of shapes and sizes, making it difficult to nail

down the precise meaning of the term. Joseph Engelberger, a pioneer in industrial robotics,

said it best:

• Boston Dynamics, an early innovator in the humanoid robotics space, continues to inch

closer to human-simulated movement.

• DJI has focused on consumer-grade drones, making it easier than ever for the average

person to take to the skies.

• Amazon Robotics lies at the core of Amazon’s logistics strategy, saving the retail

behemoth billions of dollars each year.

Most robots rely on expert systems to accomplish their objective, but the robots of tomorrow

will become exponentially more useful by incorporating machine learning, computer vision,

and natural language processing into their operating systems.

21
FAI Module - 1

AGENTS
• An agent is anything that can be viewed as perceiving its environment
through sensors and SENSOR acting upon that environment through
actuators. This simple idea is illustrated in Figure.
• A human agent has eyes, ears, and other organs for sensors and hands,
legs, mouth, and other body parts for actuators.
• A robotic agent might have cameras and infrared range finders for
sensors and various motors for actuators.
• A software agent receives keystrokes, file contents, and network packets
as sensory inputs and acts on the environment by displaying on the
screen, writing files, and sending network packets.

22
FAI Module - 1

• Percept
We use the term percept to refer to the agent's perceptual inputs at any given instant.
• Percept Sequence
An agent's percept sequence is the complete history of everything the agent has ever
perceived.
• Agent function
Mathematically speaking, we say that an agent's behavior is described by the agent
• Function
that maps any given percept

sequence to an action.

f : P*-> A

Some types of Intelligent Systems :

Agents can be grouped into five classes based on their degree of perceived intelligence
and capability. All these agents can improve their performance and generate better
action over the time. These are given below:

• Simple Reflex Agent


• Model-based reflex agent
• Goal-based agents
• Utility-based agent
• Learning agent

1. Simple Reflex agent:

o The Simple reflex agents are the simplest agents. These agents take decisions on
the basis of the current percepts and ignore the rest of the percept history.
o These agents only succeed in the fully observable environment.
23
FAI Module - 1

o The Simple reflex agent does not consider any part of percepts history during their
decision and action process.
o The Simple reflex agent works on Condition-action rule, which means it maps the
current state to action. Such as a Room Cleaner agent, it works only if there is dirt
in the room.
o Problems for the simple reflex agent design approach:
o They have very limited intelligence
o They do not have knowledge of non-perceptual parts of the current state
o Mostly too big to generate and to store.
o Not adaptive to changes in the environment.

2. Model-based reflex agent

o The Model-based agent can work in a partially observable environment, and track
the situation.
o A model-based agent has two important factors:
o Model: It is knowledge about "how things happen in the world," so it is
called a Model-based agent.
o Internal State: It is a representation of the current state based on
percept history.

24
FAI Module - 1

o These agents have the model, "which is knowledge of the world" and based on
the model they perform actions.
o Updating the agent state requires information about:
a. How the world evolves
b. How the agent's action affects the world.

3. Goal-based agents

o The knowledge of the current state environment is not always sufficient to


decide for an agent to what to do.
o The agent needs to know its goal which describes desirable situations.
o Goal-based agents expand the capabilities of the model-based agent by having
the "goal" information.
o They choose an action, so that they can achieve the goal.
o These agents may have to consider a long sequence of possible actions before
deciding whether the goal is achieved or not. Such considerations of different
scenario are called searching and planning, which makes an agent proactive.

25
FAI Module - 1

4. Utility-based agents
o These agents are similar to the goal-based agent but provide an extra
component of utility measurement which makes them different by providing a
measure of success at a given state.
o Utility-based agent act based not only goals but also the best way to achieve
the goal.
o The Utility-based agent is useful when there are multiple possible alternatives,
and an agent has to choose in order to perform the best action.
o The utility function maps each state to a real number to check how efficiently each
action achieves the goals.

26
FAI Module - 1

5. Learning Agents

o A learning agent in AI is the type of agent which can learn from its past
experiences, or it has learning capabilities.
o It starts to act with basic knowledge and then able to act and adapt automatically
through learning.
o A learning agent has mainly four conceptual components, which are:
a. Learning element: It is responsible for making improvements by learning from
environment
b. Critic: Learning element takes feedback from critic which describes that how
well the agent is doing with respect to a fixed performance standard.
c. Performance element: It is responsible for selecting external action
d. Problem generator: This component is responsible for suggesting actions that
will lead to new and informative experiences.
Hence, learning agents are able to learn, analyze performance, and look for new
ways to improve the performance.

27
FAI Module - 1

Environments

An environment in artificial intelligence is the surrounding of the agent. The agent takes
input from the environment through sensors and delivers the output to the environment
through actuators. There are several types of environments:

• Fully Observable vs Partially Observable


• Deterministic vs Stochastic
• Competitive vs Collaborative
• Single-agent vs Multi-agent
• Static vs Dynamic
• Discrete vs Continuous

1. Fully Observable vs Partially Observable

• When an agent sensor is capable to sense or access the complete state of an agent at each
point in time, it is said to be a fully observable environment else it is partially observable.
• Maintaining a fully observable environment is easy as there is no need to keep track of
the history of the surrounding.
• An environment is called unobservable when the agent has no sensors in all
environments.
• Example:
• Chess – the board is fully observable, so are the opponent’s moves
• Driving – the environment is partially observable because what’s around the
corner is not know.

2. Deterministic vs Stochastic

• When a uniqueness in the agent’s current state completely determines the next state of the
agent, the environment is said to be deterministic.
• The stochastic environment is random in nature which is not unique and cannot be
completely determined by the agent.
• Example:
Chess – there would be only a few possible moves for a coin at the current state and these
moves can be determined
Self Driving Cars – the actions of a self-driving car are not unique, it varies time to time

3. Competitive vs Collaborative

28
FAI Module - 1

• An agent is said to be in a competitive environment when it competes against another


agent to optimize the output.
• The game of chess is competitive as the agents compete with each other to win the game
which is the output.
• An agent is said to be in a collaborative environment when multiple agents cooperate to
produce the desired output.
• When multiple self-driving cars are found on the roads, they cooperate with each other to
avoid collisions and reach their destination which is the output desired.

4. Single-agent vs Multi-agent
• An environment consisting of only one agent is said to be a single-agent environment.
• A person left alone in a maze is an example of the single-agent system.
• An environment involving more than one agent is a multi-agent environment.
• The game of football is multi-agent as it involves 11 players in each team.

5. Dynamic vs Static
• An environment that keeps constantly changing itself when the agent is up with some
action is said to be dynamic.
• A roller coaster ride is dynamic as it is set in motion and the environment keeps changing
every instant.
• An idle environment with no change in its state is called a static environment.
• An empty house is static as there’s no change in the surroundings when an agent enters.

6. Discrete vs Continuous
• If an environment consists of a finite number of actions that can be deliberated in the
environment to obtain the output, it is said to be a discrete environment.
• The game of chess is discrete as it has only a finite number of moves. The number of
moves might vary with every game, but still, it’s finite.
• The environment in which the actions performed cannot be numbered ie. is not discrete, is
said to be continuous.
• Self-driving cars are an example of continuous environments as their actions are driving,
parking, etc. which cannot be numbered.

Problem Formulation

Every problem should be properly formulated in artificial intelligence. Problem formulation is very
important before applying any search algorithm. Every algorithm demands problem is specific form.
Before problem formulation it is very important to know components of problem.

What are General Problem Solving Components?


29
FAI Module - 1

In AI one must identify components of problems, which are:-

• Problem Statement
• Definition
• Limitation or Constraints or Restrictions
• Problem Solution
• Solution Space
• Operators

Definition of Problem

The information about what is to be done? Why it is important to build AI system? What will be the
advantages of proposed system? For example “I want to predict the price of house using AI
system”.

Problem Limitation

There always some limitations while solving problems. All these limitations or constraints must be
fulfill while creating system. For example “I have only few features, some records are missing.
System must be 90% accurate otherwise will be useless”.

Goal or Solution

What is expected from system? The Goal state or final state or the solution of problem is defined here.
This will help us to proposed appropriate solution for problem. For example “we can use some
machine learning technique to solve this problem”.

Solution Space

Problem can be solve in many ways. Some solution will be efficient than others. Some will consume
less resources, some will be simple etc. There are always alternatives exists. Many possible ways with
which we can solve problem is known as Solution Space. For example “price of house can be predict
using many machine learning algorithms”.

Operators

Operators are the actions taken during solving problem. Complete problem is solved using tiny steps or
actions and all these consecutive actions leads to solution of problem.

Examples of Problem Formulation


30
FAI Module - 1

Mouse Path Problem

• Problem Statement
• Problem Definition: Mouse is hungry, mouse is in a puzzle where there are some cheese. Mouse will
only be satisfied if mouse eat cheese
• Problem Limitation: Some paths are close i-e dead end, mouse can only travel through open paths
• Problem Solution: Reach location where is cheese and eat minimum one cheese. There are possible
solutions (cheese pieces)
• Solution Space: To reach cheese there are multiple paths possible
• Operators: Mouse can move in four possible directions, these directions are operators or actions which are
UP, DOWN, LEFT and RIGHT

Water Jug Problem

• Problem Statement
• Problem Definition: You have to measure 4 liter (L) water by using three buckets 8L, 5L and 3L.
• Problem Limitation: You can only use these (8L, 5L and 3L) buckets
• Problem Solution: Measure exactly 4L water
• Solution Space: There are multiple ways doing this.
• Operators: Possible actions are fill water in any bucket and remove water from any bucket.

31
FAI Module - 1

Well-defined Problems and Solution

Problem solving components discussed above are applicable to any problem. For AI system
implementation, problem must be well defined. A well-defined problem must have five components:-

• Initial State: Start point of problem


• Final State: The finish point of problem. Aka Goal or solution state
• States: Total states in problem
• Transition Model: How one can shift from one state to another
• Actions: Actions set, used to move from one state to another
• Path Cost: What is total effort (cost) from initial state to final state

Examples of Well-Defined Problems

1. Vacuum World

• States: Agent can be location A or B, hence 2 possibilities. Dirt can be in none, one or both location, and
hence 4 possibilities. Thus, there are total 2 × 22 = 8 possible world states. For environment with n locations
has (n * 2n) states.
• Initial state: Any state can be designated as the initial state.
• Actions
• Move Left
• Move Right
• And Suck or Clean
• Transition model: This is a function which define transition from one state to another. Consider state 1 in
following diagram is initial state. There 3 actions possible
• If it move LEFT (L) then it will remain in same state
32
FAI Module - 1

• and If it move RIGHT ( R), agent will be in state 2


• If it suck or clean, it will be in state 3
In this way complete graph is created. Transition function be defined as

state = function (state, action)state=function(state,action)


3 = function(1, S)3=function(1,S)
• Goal test: Function used to check whether current state is goal or not? That is “squares are clean”
• Path cost: Cost of each action, for now here each action cost is 1

2. 8 Puzzle or Slide Puzzle

• States: A state description specifies the location of each of the eight tiles and the blank in one of the nine
squares.
• Initial state: Any random shuffled state can be designated as initial state
• Actions:
• Slide Left
• or Slide Right
• or Slide Up
• And Slide Down
• Transition model: Given a state and action, this returns the resulting state
• Goal test: This checks whether the state matches the goal
• Path cost: Each step costs 1

33
FAI Module - 1

What is Tree?
A tree is a non-linear data structure that represents the hierarchy. A tree is a collection of nodes that are
linked together to form a hierarchy.

Let's look at some terminologies used in a tree data structure.

o Root node: The topmost node in a tree data structure is known as a root node. A root node is a node that
does not have any parent.
o Parent of a node: The immediate predecessor of a node is known as a parent of a node. Here
predecessor means the previous node of that particular node.
o Child of a node: The immediate successor of a node is known as a child of a node.
o Leaf node: The leaf node is a node that does not have any child node. It is also known as an external
node.
o Non-leaf node: The non-leaf node is a node that has atleast one child node. It is also known as
an internal node.
o Path: It is a sequence of the consecutive edges from a source node to the destination node. Here edge is
a link between two nodes.
o Ancestor: The predecessor nodes that occur in the path from the root to that node is known as an
ancestor.
o Descendant: The successor nodes that exist in the path from that node to the leaf node.
o Sibling: All the children that have the same parent node are known as siblings.
o Degree: The number of children of a particular node is known as a degree.
o Depth of node: The length of the path from the root to that node is known as a depth of a node.

34
FAI Module - 1

o Height of a node: The number of edges that occur in the longest path from that node to the leaf node is
known as the height of a node.
o Level of node: The number of edges that exist from the root node to the given node is known as a level
of a node.

Let's understand the structure that forms the hierarchy.

In the above figure, we can assume the company hierarchy where A represents the CEO of the
company, B, C and D represent the managers of the company, E and F represent the team leaders, and
G and H represent the team members. This type of structure has more than one level, so it is known as
a non-linear data structure.

How is a tree represented in the memory?


Each node will contain three parts, data part, address of the left subtree, and address of the right
subtree. If any node does not have the child, then both link parts will have NULL values.

35
FAI Module - 1

What is a Graph?
A graph is like a tree data structure is a collection of objects or entities known as nodes that are
connected to each other through a set of edges. A tree follows some rule that determines the
relationship between the nodes, whereas graph does not follow any rule that defines the relationship
among the nodes. A graph contains a set of edges and nodes, and edges can connect the nodes in any
possible way.

Mathematically, it can be defined as an ordered pair of a set of vertices, and a set of nodes where
vertices are represented by 'V' and edges are represented by 'E'.

G= (V , E)

Here we are referring to an ordered pair because the first object must be the set of vertices, and the
second object must be a set of edges.

In Graph, each node has a different name or index to uniquely identify each node in the graph. The
graph shown below has eight vertices named as v1, v2, v3, v4, v5, v6, v7, and v8. There is no first
node, a second node, a third node and so on. There is no ordering of the nodes. Now, we will see how
can we represent the edges in a graph?. An edge can be represented by the two endpoints in the graph.
We can write the name of the two endpoints as a pair, that represents the edge in a graph.

There are two types of edges:

o Directed edge: The directed edge represents one endpoint as an origin and another point as a
destination. The directed edge is one-way. For example, there are two vertices U and V; then directed
edge would represent the link or path from U to V, but no path exists from V to U. If we want to create a
path from V to U, then we need to have one more directed edge from V to U.
The directed edge can be represented as an ordered pair in which the first element is the origin, whereas
the second element is the destination.
o Undirected edge: The undirected edge is two-way means that there is no origin and destination. For
example, there are two vertices U and V, then undirected would represent two paths, i.e., from U to V as
well as from V to U. An undirected edge can be represented as an unordered pair because the edge is bi-
directional.

The tree data structure contains only directed edges, whereas the graph can have both types of edges,
i.e., directed as well as undirected. But, we consider the graph in which all the edges are either
directed edges or undirected edges.

There are two types of graphs:


36
FAI Module - 1

Directed graph: The graph with the directed edges known as a directed graph.

Undirected graph: The graph with the undirected edges known as a undirected graph. The directed
graph is a graph in which all the edges are uni-directional, whereas the undirected graph is a graph in
which all the edges are bi-directional.

37
FAI Module - 1

State Space

• Formulate a problem as a state space search by showing the legal


problem states, the legal operators, and the initial and goal states .
• A state is defined by the specification of the values of all attributes of
interest in the world
• An operator changes one state into the other; it has a precondition which
is the value of certain attributes prior to the application of the operator,
and a set of effects, which are the attributes altered by the operator
• The initial state is where you start
• The goal state is the partial description of the solution

Goal Directed Agent

Percepts

Environment
Agent

Actions

Figure 1

We have earlier discussed about an intelligent agent. Today we will study a type of
intelligent agent which we will call a goal directed agent.

A goal directed agent needs to achieve certain goals. Such an agent selects its actions
based on the goal it has. Many problems can be represented as a set of states and a set of
rules of how one state is transformed to another. Each state is an abstract representation
of the agent's environment. It is an abstraction that denotes a configuration of the agent.
Initial state : The
38
FAI Module - 1

description of the starting configuration of the agent


An action/ operator takes the agent from one state to another state. A state can have a
number of successor states.
A plan is a sequence of actions.

A goal is a description of a set of desirable states of the world. Goal states are often
specified by a goal test which any goal state must satisfy.

Let us look at a few examples of goal directed agents.

1. 15-puzzle: The goal of an agent working on a 15-puzzle problem may be


to reach a configuration which satisfies the condition that the top row has
the tiles 1, 2 and 3. The details of this problem will be described later.
2. The goal of an agent may be to navigate a maze and reach the HOME
position.

The agent must choose a sequence of actions to achieve the desired goal. State Space

Search Notations

Let us begin by introducing certain terms.

An initial state is the description of the starting configuration of the agent

An action or an operator takes the agent from one state to another state which is called a
successor state. A state can have a number of successor states.

A plan is a sequence of actions. The cost of a plan is referred to as the path cost. The path
cost is a positive number, and a common path cost may be the sum of the costs of the
steps in the path.

Now let us look at the concept of a search problem.


Problem formulation means choosing a relevant set of states to consider, and a
feasible set of operators for moving from one state to another.
Search is the process of considering various possible sequences of operators applied to
the initial state, and finding out a sequence which culminates in a goal state.

39
FAI Module - 1

Tree Search:

• Tree Search possible paths to be explored organized in a tree (search tree)


• search nodes correspond 1:1 to paths from initial state
• duplicates (also: transpositions) possible,
• i.e., multiple nodes with identical state search tree can have unbounded depth

Algorithm

open := new OpenList


open.insert(make root node())
while not open.is empty():
n := open.pop()
if is goal(n.state):
return extract path(n)

Graph Search

• possible paths to be explored organized in a tree (search tree)


• search nodes correspond 1:1 to paths from initial state
• duplicates (also: transpositions) possible,
• i.e., multiple nodes with identical state
• search tree can have unbounded depth

differences to tree search:

• recognize duplicates:
• when a state is reached on multiple paths,
• only keep one search node search nodes correspond 1:1 reachable states
• search tree bounded, as number of states is finite

Algorithm

open := new OpenList


open.insert(make root node())
closed := new ClosedList
while not open.is empty():
n := open.pop()

40
FAI Module - 1

if closed.lookup(n.state) = none:
closed.insert(n)
if is goal(n.state):
return extract path(n)

41
FAI Module - 1

42

You might also like