[go: up one dir, main page]

0% found this document useful (0 votes)
436 views56 pages

BCA AI Chapter-1 Complete

Uploaded by

sujithsaju564
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)
436 views56 pages

BCA AI Chapter-1 Complete

Uploaded by

sujithsaju564
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

Artificial Intelligence-

CA-C21T
Syllabus

• Unit-1: Introduction to AI
• Unit-2: Knowledge-based Agents
• Unit-3: Introduction to Planning
• Unit-4: Natural Language Processing(NLP)

For Complete Syllabus


Course
Course Outcomes
Outcomes(CO’s)
CO 1. Understand the various characteristics of
problem-solving agents and apply problem-solving
through the search for AI applications.
CO 2. Appreciate the concepts of knowledge
representation using Propositional logic and Predicate
calculus and apply them for inference/reasoning.
CO 3. Obtain insights about Planning and handling
uncertainty through probabilistic reasoning and
fuzzy systems.
CO 4. Understand the basics of computer vision and
Natural Language Processing and understand their
relevance in AI applications.
CO 5. Obtain insights about machine learning, neural
networks, deep learning networks, and their significance.
Unit-1: Introduction to AI
Topics:
Chapter-1.1:
• Introduction to Al:
• Intelligent Agents:
• Agents and environment,
• The concept of Rationality,
• The nature of the environment,
• The structure of agents;
• Problem-solving:
• Problem-solving agents;
Intelligence?
• T he a b i l i t y o f a s y s t e m t o c a l c u l a t e , r e a s o n , p e r c e i v e
relationships and analogies, learn from experience, store and
retrieve information from memory, solve problems, comprehend
complex ideas, use natural language fluently, classify, generalize,
and adapt to new situations.
• The Intelligence composed of
• Reasoning
• Learning
• Problem Solving
• Perception
• Linguistic Intelligence, etc..,
Q1. Introduction to AI
• Artificial Intelligence is the part of computer science concerned with
designing intelligent computer systems, that is, Computer systems
that exhibit the characteristics we associate with intelligence in
human behavior understanding language, learning, reasoning, and
solving problems.
• Alternative Definitions:
• Artificial intelligence is the study of how to make computers do
things that at the moment people do better.
• Artificial intelligence is a field of study encompassing
computational techniques for performing tasks that require
intelligence when performed by humans.
1) Acting humanly: The Turing Test approach

• The Turing Test, proposed by Alan Turing (1950), was


designed to provide a satisfactory operational definition
of intelligence.
• A computer passes the test if a human interrogator, after
posing some written questions, cannot tell whether the
written responses come from a person or a computer.
• The computer would need to possess the following
capabilities:
• Natural Language Processing
• Knowledge Representation
• Automated Reasoning.
• Machine Learning, etc..,
2) Thinking humanly: The cognitive modeling approach
If we are going to say that a given program thinks like a human, we must have some
way of determining how humans think.

• We need to get inside the actual workings of human minds.


• There are three ways to do this:
• Through introspection- trying to catch our own thoughts as they go by
• Through psychological experiments—observing a person in action; and
• Through brain imaging—observing the brain in action.
3) Thinking rationally: The “laws of thought” approach

• The Greek philosopher Aristotle was one of the first to attempt to codify
“right thinking,” that is, irrefutable(impossible to disprove) reasoning
processes.
• His syllogisms provided patterns for argument structures that always
yielded correct conclusions when given correct premises—for example,
“Socrates is a man; all men are mortal; therefore, Socrates is mortal.”
• These laws of thought were supposed to govern the operation of the mind;
their study initiated the field called logic.
There are two main obstacles to this approach.
• First, it is not easy to state informal knowledge in the formal terms
required by logical notation, particularly when the knowledge is less than
100% certain.
• Second, there is a big difference between solving a problem “in principle”
and solving it in practice.
4. Acting rationally: The rational agent approach

• An agent is just something that acts of course, all computer programs


do something, but computer agents are expected to do more: operate
autonomously, perceive their environment, persist over a prolonged
period, adapt to change, and create and pursue goals.
• A rational agent acts to achieve the best outcome or, when there is
uncertainty, the best-expected outcome.
• In the “laws of thought” approach to AI, the emphasis was on correct
inferences (Reasoning).
• Making correct inferences is sometimes part of being a rational agent
because one way to act rationally is to reason logically to the conclusion
that a given action will achieve one’s goals and then act on that
conclusion.
History of AI
Important research that laid the groundwork for AI:
• In 1931, Goedel layed the foundation of Theoretical Computer Science in
1920-30s:
• He published the first universal formal language and showed that math
itself is either flawed or allows for unprovable but true statements.
• In 1936, Turing reformulated Goedel’s result and the church’s extension
thereof.
• In 1956, John McCarthy coined the term "Artificial Intelligence" as the topic
of the Dartmouth Conference, the first conference devoted to the subject.
• In 1957, The General Problem Solver (GPS) was demonstrated by Newell,
Shaw & Simon.
• In 1958, John McCarthy (MIT) invented the Lisp language.
• In 1959, Arthur Samuel (IBM) wrote the first game-playing program, for
checkers, to achieve sufficient skill to challenge a world champion.
• In Mid 80’s, Neural Networks become widely used with the
Backpropagation algorithm.
History of AI
In 1990, Major advances in all areas of AI, with significant demonstrations in
machine learning, intelligent tutoring, case-based reasoning, multi-agent
planning, scheduling, uncertain reasoning, data mining, natural language
understanding and translation, vision, virtual reality, games, and other topics.
In 1997, Deep Blue beat the World Chess Champion Kasparov.
In 2002, iRobot, founded by MIT Artificial Intelligence Lab researchers,
introduced Roomba, a vacuum cleaning robot. By 2006, two million had been
sold.

History_of_artificial_intelligence
Artificial Intelligence
Disciplines/Foundations of AI
What can AI do Today?
A concise answer is difficult because there are so many activities in so
many subfields. Here we sample a few disciplines used with AI.
1. Philosophy
2. Mathematics
3. Economics
4. Neuroscience
5. Psychology
6. Computer Engineering.
7. Linguistics
• Philosophy:
• Foundational issues (can a machine think?), issues of knowledge and belief,
mutual knowledge, answering important questions, etc.,

• Mathematics:
• Mathematics is used to write the logic and algorithm for Machine Learning.
• Good knowledge of mathematics is a must skill to be able to develop an AI
Model.
• Economics:
• AI is used in the domain of Economics to solve a lot of organizational and
Financial areas, like Decision Situations, Projecting Areas, and Operation
Research, etc.,
• Neuroscience:
• Neuroscience is the study of the nervous system, particularly the brain. However,
the exact way in which the brain enables thought is one of the great mysteries of
science.
• This enables AI Scientists to develop programming models like the Human Brain.
• Psychology:
• How do humans and animals think and act?
• How computer models could address the psychology of memory, language,
and logical thinking, respectively.
• It is now a common (although far from universal) view among
psychologists that “a cognitive theory should be like a computer program”
• That is, it should describe a detailed information processing mechanism
whereby some cognitive function might be implemented.
• Computer Engineering:
• The programmers write the codes to make the neural network for artificial
intelligence. Based on the data provided the system is updated
automatically.
Eg: complexity theory, algorithms, logic and inference, programming
languages, and system building.
• Linguistics:
• The Modern Linguistics is called “Computational Linguistics or
Natural Language Processing.
• The Natural Language processing experience is also a must for
developing AI Systems for machines.
• Control Theory and Cybernetics:
• It describes how things operate under their own control.
• It is the Scientific study of the workings of humans, animals, and
machines to control and communicate with each other.
• Sub areas of AI
• Game playing, speech recognition, computer vision, machine learning,
etc.
Advantages and Disadvantages of AI

Advantages of AI:
• Reduction in Human Errors
• Zero Risks
• Digital Assistance
• New Inventions
• Unbiased Decisions
• Risky Situations
• Pattern Identification.
Advantages and Disadvantages of AI

Disadvantages of AI:
• High Costs
• No Creativity
• Unemployment
• No Ethics
• Make Humans Lazy
• Emotionless
Topic- 2: Intelligent Agents
Agents and Environments:
• What is an Agent?
• An agent is anything that can be viewed as perceiving its environment
through sensors and acting upon that environment through actuators.
• In AI, an Agent is a computer program or system that is
designed to perceive its environment, make decisions, and take
actions to achieve a specific goal or set of goals.
• An Agent operates autonomously, takes input from the
environment based on abilities, preferences, prior knowledge,
and past experiences, and finally formulates the actions.
• An Agent can be
• Human- Agent
• Software Agent
• Robotic Agent
• Gaming Agent
• Human- Agent: A human agent has eyes, ears, and other organs for
sensors and hands, legs, mouth, and other body parts for actuators.
• Robotic agents might have cameras and infrared range finders for sensors
and various motors for actuators.
• 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.

Agents can be divided into different types based on their characteristics,


such as whether they are reactive or proactive, whether they have a fixed
or dynamic environment, and whether they are single or multiple agents.
• Reactive Agent: The agent that responds to immediate input(stimuli)
from their environment and takes actions based on those inputs.
• Proactive Agent: Take initiative and plan based to achieve their goals.
• Fixed Environment: In this environment has a static set of rules that do
not change, Dynamic environments are constantly changing and
require agents to adapt to new situations.
• Multiple Agents involved and working together to achieve a common
goal for the environment, here multiple agents communicate with each
other to achieve the necessities.
Agents & its Environment
Agents & its Environment
• In AI, the System is composed of an Agent and its environment. The Agent acts
in their environment. For Eg:
• 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.
• We use the term percept to refer to the agent’s perceptual inputs at any given
instant.
• An agent’s percept sequence is the complete history of everything the agent
has ever perceived.
• In general, an agent’s choice of action at any given instant can depend on the
entire percept sequence observed to date, but not on anything it hasn’t
perceived
Agents & its Environment
• 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.
• Tabulating the agent function that describes any given agent; for most agents,
this would be a very large table—infinite,
• Given an agent to experiment with, we can, in principle, construct this table
by trying out all possible percept sequences and recording which actions the
agent does in response.
• The table is, of course, an external characterization of the agent. Internally,
the agent function for an artificial agent will be implemented by an Agent
Program”.
• Eg: The vacuum-cleaner world shown in Figure. This particular world has
just two locations: squares A and B.
• The vacuum agent perceives which square it is in and whether there is dirt
in the square. It can choose to move left, move right, suck up the dirt, or
do nothing.
Agents & its Environment
• One very simple agent function is the following: if the current square
is dirty, then suck; otherwise, move to the other square.
• A partial tabulation of this agent function is shown in Figure and an
agent program that implements it appears in Figure.
o f A gent
b u la tion c t ions
Ta n s& A
c t io
F un

m with
rogra
gent P
The A Functions
Goal Formulation:
Naturally, we want all the dirt cleaned up, formally the goal is
either state 7 or state 8
State Space Graph:
3Q) The Concept of Rationality( Good Behavior)
• Rationality is nothing but the status of being reasonable, sensible and
having a good sense of judgment.
• Rationality is concerned with expected actions and results depending upon
what the agent has perceived.
• “Performing actions with the aim of obtaining useful information is
an important part of rationality.”
• A Rational Agent always performs the right action, where the right action
means the action that causes the agent to be most successful in the
perception sequence.
• The Problem the agent solves is characterized by Performance
Measure, Environment, Actuators, and Sensors(PEAS).
• Rationality of an agent depends on the following:
• The Performance Measures, which determine the degree of success.
• Agent’s Percept Sequence till now.
• The Agent’s Prior knowledge about the environment.
• The actions that the agent can carry out.
A Rational agent should select an action that is expected to
maximize its performance measure, given the evidence provided by
the percept sequence.
• Example: Rational Agent (Vacuum Cleaner):

• Role: The agent cleans a square if it is dirty, and moves to the other square if
not;
• Now we can examine the Rationality of the agent, First we need to examine the
performance measure, what is known about the environment, and what
sensors and actuators the agent has.
• The Performance measure awards one point for each clean square at each
time step.
• The Complete awareness of the environment is called “Priori”, clean
squares stay clean, and sucking cleans the current square, the agent
position after the completion of actions.
• Agent actions are Left, Right and Suck.
• The agent correctly perceives its location and whether that location
contains dirt.
We claim that under these circumstances the agent is Surely Rational or not,
and its performance is high or least compared to others.
• Eventually the same agent would be irrational
under different circumstances.

• For Eg: In the vacuum cleaner example, the agent


performing dirt cleaning on our side will be
uncertain about how to move in the environment,
and the agent should gain the penalty.
4Q) The Nature of the Environment
• Task Environments:
• The “Task environments are essentially the problems”, to
which the “Rational Agents are Solutions”.
• In designing an agent, the first step must always be to specify the
task environment as fully as possible.
• Specifying the Task Environment:
• Eg: The “Vaccum Cleaner” Agent is a simple environmental
example, now we can test some complex problems “Taxi Driver
Example”.
• The Automatic Taxi Driver Example is fully open-ended and
the PEAS Description about this Envionment as follows.
• In Contrast, some Software agents (Software Robots/ Soft bots) exist in rich, unlimited
domains.
• Imagine a softbot Web site operator designed to scan Internet news sources and show
interesting items to its users, while selling advertising space to generate revenue.
• To do well, that operator will need some natural language processing abilities, it will
need to learn what each user and advertiser is interested in, and it will need to change
its plans dynamically.
Selecting visual
aids
Properties of Environment:
• Discrete or Continuous:
• There are a limited no. of distinct, clearly defined, states of the environment, the
environment is discrete (Chess), otherwise it is continuous (Driving).
• Observable or Partially Observable
• If an agent’s sensors give it access to the complete state of the environment at each
point in time, then we say that the task environment is fully observable, An
environment might be partially observable because of noisy and inaccurate sensors or
because parts of the state are simply missing from the sensor data—
• for example, a vacuum agent with only a local dirt sensor cannot tell whether there is
dirt in other squares, and an automated taxi cannot see what other drivers are
thinking.
• Static or Dynamic
• The Environment may not change while the agent is acting, then it is static,
otherwise, it is dynamic
• The Environment may contain other agents that may be of the same or different kind as that of the
agent.

• If the agent sensory device can have access to the complete state of the environment, then the
environment is accessible to that agent.

• The Next state of the environment is completely determined by the current state and the actions
of the agent, then the environment is deterministic otherwise it is non-deterministic.

• Episodic or Non- Episodic:

• In an episodic task environment, the agent’s experience is divided into atomic episodes. In each
episode, the agent receives a percept and then performs a single action.

• Crucially, the next episode does not depend on the actions taken in previous episodes.

• Many classification tasks are episodic. For example, an agent that has to spot defective parts on an
assembly line bases each decision on the current part, regardless of previous decisions;
5Q) The Structure of Agent
• The job of AI is to design an agent program that implements the agent
function the mapping from percepts to actions.
• We assume this program will run on some sort of computing device
with physical sensors and actuators, we call this the architecture.

• In general, the architecture makes the percepts from the sensors


available to the program, runs the program, and feeds the program’s
action choices to the actuators as they are generated.
• The agent program takes just the current percept as input because nothing more is available from
the environment; if the agent’s actions need to depend on the entire percept sequence, the agent
will have to remember the percepts.
Simply define Agent Program:
• The agent programs be coroutines that run asynchronously with the environment. Each such
coroutine has an input and output port and consists of a loop that reads the input port for
percepts and writes actions to the output port.
• We describe the agent programs in the simple pseudocode language, the program that keeps track of
the percept sequence and then uses it to index into a table of actions to decide what to do

• Eg:
To build a rational agent in this way, we as designers must construct a
table that contains the appropriate action for every possible percept
sequence.
• Four basic kinds of agent programs(types of agents) that embody
the principles underlying almost all intelligent systems:
• Simple reflex agents;
• Model-based reflex agents;
• Goal-based agents; and
• Utility-based agents.
Each kind of agent program combines particular components in particular ways to
generate actions.
Simple Reflex Agent:
• The simplest kind of agent is the simple reflex agent.
• These agents select actions on the basis of the current percept, ignoring the rest of the
percept history.
Eg: Vacuum Cleaner Agent Program
• Model Based Agents:
• The most effective way to handle partial observability is for the agent to keep track of the
part of the world it can’t see now.

• That is, the agent should maintain some sort of internal state that depends on the percept
history and thereby reflects at least some of the unobserved aspects of the current state.

• Eg: In Self Taxi Driver agent, For overtake action, other driving tasks such as changing lanes,
the agent needs to keep track of where the other cars are if it can’t see them all at once. And
for any driving to be possible at all, the agent needs to keep track of where its keys are.

• Updating this internal state information as time goes by to


be encoded in the agent program.
• First, we need some information about how the world evolves independently of the
agent.
• Second, we need some information about how the agent’s own actions affect the world
• This knowledge about “how the world works”—whether implemented in
simple Boolean circuits or in complete scientific theories—is called a model
of the world.
• An agent that uses such a model is called a model-based agent.
• Model based Agents consider the percept history in their actions.
• The Agent Function can still work well even in an environment that
is not fully observable.
Goal Based Agents:
• These agents have higher capabilities than model based reflex
agents.
• Goal based agents use goal information to describe desriable
capabilities.
• This allows them to choose among various possibilites, like select
the best action that enhances the attainment of the goal.
Utility Based Agents:
• These agents make choices based on utility. They are more
advanced than goal- based agents because of an extra component
of utility measurement.
• Using Utility function, a state is mapped against a certain
measure of utility.
• A rational agent selects the action that optimizes the expected
utility of the outcome.
Summary of Chapter1:
• Points to Remember:
• An agent is something that perceives and acts in an environment.
The agent function for an agent specifies the action taken by the
agent in response to any percept sequence.
• The performance measure evaluates the behavior of the agent in an
environment.
• A rational agent acts so as to maximize the expected value of the
performance measure, given the percept sequence it has seen so far.
• A task environment specification includes the performance measure,
the external environment, the actuators, and the sensors.
• In designing an agent, the first step must always be to specify the
task environment as fully as possible.
• Task environments vary along several significant dimensions. They can be fully or
partially observable, single-agent or multiagent, deterministic or stochastic,
episodic or sequential, static or dynamic, discrete or continuous, and known or
unknown.
• The agent program implements the agent function. There exists a variety of basic
agent-program designs reflecting the kind of information made explicit and used
in the decision process. The designs vary in efficiency, compactness, and
flexibility.
• The appropriate design of the agent program depends on the nature of the
environment.
• Simple reflex agents respond directly to percepts, whereas model-based reflex
agents maintain internal state to track aspects of the world that are not evident in
the current percept.
• Goal-based agents act to achieve their goals, and utility-based agents try to
maximize their own expected “happiness.”
• All agents can improve their performance through learning
Thank you
Mr. Moulallie Padigepati,
Assistant Professor,
Department of BCA,
Acharya Institute of Graduate School (AIGS),
Bengalore

You might also like