Ai Module1 Notes
Ai Module1 Notes
1 What is AI?
Artificial intelligence is defined as methods and techniques used for implementing human
intelligence in computer.
The definitions on top are concerned with thought processes and reasoning.
The ones on the bottom address behavior.
The definitions on the left measure success in terms of fidelity to human performance.
The ones on the right measure against an ideal performance measure, called rationality.
A system is rational if it does the ―right thing,‖ given what it knows.
1
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
Once we have a sufficiently precise theory of the mind, it becomes possible to express the
theory 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.
For example, Allen Newell and Herbert Simon, who developed GPS, the ―General Problem
Solver‖ (Newell and Simon, 1961), were not content merely to have their program solve
problems correctly. They were more concerned with comparing the trace of its reasoning
steps to traces of human subjects solving the same problems.
The interdisciplinary field of cognitive science brings together computer models from AI
and experimental techniques from psychology to construct precise and testable theories of
the human mind.
2
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
logical notation. The so-called logicist tradition within artificial intelligence hopes to build
on such programs to create intelligent systems.
There are two main obstacles to this approach.
1) 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.
2) Second, there is a big difference between solving a problem ―in principle‖ and
solving it in practice.
3
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
Aristotle was the first person to formulate a precise set of laws governing the mind's rational
part. He developed an informal system of syllogisms for proper reasoning, which allowed
one to generate conclusions with the given initial premises.
[Syllogism: It is a Logical Argument consisting of two premises and a conclusion]
At that time, the study of human intelligence began with no formal expression.
They Initiated the idea of the mind as a machine and its internal operations.
Mathematics
• What are the formal rules to draw valid conclusions?
• What can be computed?
• How do we reason with uncertain information?
Mathematics formalizes the three main areas of AI: computation, logic, and probability.
Boole introduced formal language for making logical inference and used formal logic
methods such as Boolean Logic & Fuzzy Logic. At the same time, we consider these bases
for most modern approaches that handle uncertainty in AI Applications. Besides logic and
computation, another contribution of mathematics to AI is the theory of probability used to
deal with uncertain measurements and incomplete theories.
Economics
• How should we make decisions so as to maximize payoff?
• How should we do this when others may not go along?
• How should we do this when the payoff may be far in the future?
Most people think that economics is being money, but it will say that they study how people
make choices that lead to preferred outcomes. So, the mathematical treatment of the
preferred outcome, "Utility", was first formalized. Here they considered a "Decision
Theory" that combines the Probability Theory & Utility Theory for making decisions.
4
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
Neuroscience
• How do brains process information?
It is the study of the Nervous System, particularly the brain. More recent studies used
accurate sensors to correlate brain activity to human thought. This is done by monitoring
individual neurons. As we know, there are 1000 times more neurons in a typical human
brain than the gates in the CPU of a typical high-end computer. Moore's Law predicts that
the CPU gate count will be equal to brains neuron count around 2020.
Psychology
• How do humans and animals think and act?
The origins of scientific psychology are usually traced to the German physicist Hermann
von Helmholtz's work and his student Wilhelm Wundt. He applied some scientific methods
to the study of human vision. He also used his view on humans' behaviourism movement
and the brain's view as an Information-Processing-Device, Which is a principle
characteristic of cognitive psychology.
Computer engineering
• How can we build an efficient computer?
We need two things: intelligence and an artifact for artificial intelligence to succeed. AI also
requires the software side of Computer Science, which has supplied the operating systems,
Programming Languages, Tools, etc.…
Control theory and cybernetics
• How can artifacts operate under their own control?
The artifacts adjust their actions:
To do better for the environment over time
Based on an objective function and feedback from the environment
Machines can modify their behaviour in response to the environment (Sense/Action). These
machines are called self-controlling machines. The goal is to build systems that transition
from initial state to goal state with minimum energy. Examples of self-regulating feedback
control systems include the steam engine, created by James Watt and the thermostat,
invented by Colnelis Drebbel, who also invented the submarine.
5
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
Linguistics
• How does language relate to thought?
Modem linguistics and AI, then, were "born" at about the same time and grew up together,
intersecting in a hybrid field called computational linguistics or natural language processing.
The speech demonstrates so much of human intelligence. Children can create sentences they
have never heard before. So language and thought are believed to be tightly intertwined.
6
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
7
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
Rationality
What is rational at any given time depends on four things:
• The performance measure that defines the criterion of success.
• The agent’s prior knowledge of the environment.
• The actions that the agent can perform.
• The agent’s percept sequence to date.
This leads to a definition of a rational agent:
“For each possible percept sequence, a rational agent should select an action that is
expected to maximize its performance measure, given the evidence provided by the percept
sequence and whatever built-in knowledge the agent has.”.
Consider the simple vacuum-cleaner agent that cleans a square if it is dirty and moves to the
other square if not. First, we need to say what the performance measure is, what is known
about the environment, and what sensors and actuators the agent has. Let us assume the
following:
o The performance measure awards one point for each clean square at each
time step, over a ―lifetime‖ of 1000 time steps.
o The ―geography‖ of the environment is known a priori but the dirt
distribution and the initial location of the agent are not. Clean squares stay
clean and sucking cleans the current square. The Left and Right actions move
the agent left and right except when this would take the agent outside the
environment, in which case the agent remains where it is.
o The only available actions are Left , Right, and Suck.
o The agent correctly perceives its location and whether that location contains
dirt.
We claim that under these circumstances the agent is indeed rational.
8
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
Omniscience:
An omniscient agent knows the actual outcome of its actions and can act accordingly; but
omniscience is impossible in reality. Our definition of rationality does not require omniscience, then,
because the rational choice depends only on the percept sequence to date.Therefore a Rational agent
is not Omniscient.
Learning:
Doing actions in order to modify future percepts—sometimes called information gathering is an
important part of rationality.
A second example of information gathering is provided by the exploration that must be undertaken
by a vacuum-cleaning agent in an initially unknown environment.
Our definition requires a rational agent not only to gather information but also to learn as much as
possible from what it perceives. The agent’s initial configuration could reflect some prior knowledge
of the environment, but as the agent gains experience this may be modified and augmented.
Autonomy:
To the extent that an agent relies on the prior knowledge of its designer rather than on its own
percepts, we say that the agent lacks autonomy. A rational agent should be autonomous—it should
learn what it can to compensate for partial or incorrect prior knowledge.
For example, a vacuum-cleaning agent that learns to foresee where and when additional dirt will
appear will do better than one that does not.
9
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
10
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
11
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
12
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
For example, in solitaire card games, I know the rules but am still unable to see the
cards that have not yet been turned over. Conversely, an unknown environment can
be fully observable—in a new video game, the screen may show the entire game
state but I still don’t know what the buttons do until I try them.
13
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
Agent programs
The agent programs that we design in this book all have the same skeleton: they take the
current percept as input from the sensors and return an action to the actuators.
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.
The TABLE-DRIVEN-AGENT program is invoked for each new percept and returns an
action each time.
It retains the complete percept sequence in memory.
The Table Driven Agent Program has the following disadvantages:
(a) no physical agent in this universe will have the space to store the large sized table,
(b) the designer would not have time to create the table,
(c) no agent could ever learn all the right table entries from its experience, and
(d) even if the environment is simple enough to yield a feasible table size, the designer still
has no guidance about how to fill in the table entries.
Despite all this, TABLE-DRIVEN-AGENT does do what we want: it implements the
desired agent function.
The key challenge for AI is to find out how to write programs that, to the extent possible,
produce rational behavior from a smallish program rather than from a vast table.
14
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
15
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
16
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
A model-based reflex agent prgram. It keeps track of the current state of the world, using an internal model.
It then chooses an action in the same way as the reflex agent.
The function UPDATE-STATE,is responsible for creating the new internal state description.
Goal-based agents
Knowing something about the current state of the environment is not always enough to
decide what to do.
For example, at a road junction, the taxi can turn left, turn right, or go straight on. The
correct decision depends on where the taxi is trying to get to.
In other words, as well as a current state description, the agent needs some sort of goal
information that describes situations that are desirable—for example, being at the
passenger’s destination.
The agent program can combine this with the model (the same information as was used in
the model based reflex agent) to choose actions that achieve the goal.
17
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
A model-based, goal-based agent. It keeps track of the world state as well as a set of
goals it is trying to achieve, and chooses an action that will (eventually) lead to the
achievement of its goals.
A goal-based agent, in principle, could reason that if the car in front has its brake lights on,
it will slow down. Given the way the world usually evolves, the only action that will
achieve the goal of not hitting other cars is to brake.
Advantage of Goal based agents over Reflex agents:
Although the goal-based agent appears less efficient, it is more flexible because the
knowledge that supports its decisions is represented explicitly and can be modified. If it
starts to rain, the agent can update its knowledge of how effectively its brakes will operate;
this will automatically cause all of the relevant behaviors to be altered to suit the new
conditions.
For the reflex agent, on the other hand, we would have to rewrite many condition–action
rules. The goal-based agent’s behavior can easily be changed to go to a different destination,
simply by specifying that destination as the goal. The reflex agent’s rules for when to turn
and when to go straight will work only for a single destination; they must all be replaced to
go somewhere new.
18
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
Utility-based agents
Goals alone are not enough to generate high-quality behavior in most environments.
For example, many action sequences will get the taxi to its destination (thereby achieving the goal)
but some are quicker, safer, more reliable, or cheaper than others.
Goals just provide a crude binary distinction between ―happy‖ and ―unhappy‖ states.
A more general performance measure should allow a comparison of different world states according
to exactly how happy they would make the agent. Because ―happy‖ does not sound very scientific,
economists and computer scientists use the term utility instead.
A performance measure assigns a score to any given sequence of environment states, so it can easily
distinguish between more and less desirable ways of getting to the taxi’s destination.
An agent’s utility function is essentially an internalization of the performance measure. If the
internal utility function and the external performance measure are in agreement, then an agent that
chooses actions to maximize its utility will be rational according to the external performance
measure.
Advantage of Utility based agents over goal based agents
A utility-based agent has many advantages in terms of flexibility and learning.
Furthermore, in two kinds of cases, goals are inadequate but a utility-based agent can still make
rational decisions.
1. First, when there are conflicting goals, only some of which can be achieved (for example,
speed and safety), the utility function specifies the appropriate tradeoff.
2. Second, when there are several goals that the agent can aim for, none of which can be
achieved with certainty, utility provides a way in which the likelihood of success can be
weighed against the importance of the goals.
A rational utility-based agent chooses the action that maximizes the expected utility of the action
outcomes—that is, the utility the agent expects to derive, on average, given the probabilities and
utilities of each outcome.
A model-based, utility-based agent. It uses a model of the world, along with a utility function that measures
its preferences among states of the world. Then it chooses the action that leads to the best expected utility,
where expected utility is computed by averaging over all possible outcome states, weighted by the
probability of the outcome.
19
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
Learning agents
Learning has an advantage: it allows the agent to operate in initially unknown environments and to
become more competent than its initial knowledge alone might allow.
A learning agent can be divided into four conceptual components:
the learning element, which is responsible for making improvements,
performance element, which is responsible for selecting external actions. It takes in percepts and
decides on actions.
The learning element uses feedback from the critic on how the agent is doing and determines how
the performance element should be modified to do better in the future.
The critic tells the learning element how well the agent is doing with respect to a fixed performance
standard. The critic is necessary because the percepts themselves provide no indication of the agent’s
success.
For example, a chess program could receive a percept indicating that it has checkmated its opponent,
but it needs a performance standard to know that this is a good thing; the percept itself does not say
so. It is important that the performance standard be fixed. Conceptually, one should think of it as
being outside the agent altogether because the agent must not modify it to fit its own behavior.
The last component of the learning agent is the problem generator. It is responsible for suggesting
actions that will lead to new and informative experiences. The point is that if the performance
element had its way, it would keep doing the actions that are best, given what it knows. But if the
agent is willing to explore a little and do some perhaps suboptimal actions in the short run, it might
discover much better actions for the long run.
20
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
3. Machine Learning: Many machine learning techniques fall under the umbrella of
empiricist approaches. Supervised learning, unsupervised learning, and reinforcement
learning are common examples, where models learn from labeled data, patterns, or rewards
and punishments, respectively.
4. Big Data: Empiricist AI benefits from large-scale datasets. These datasets contain diverse
and representative samples of real-world scenarios, enabling AI models to generalize well
and make accurate predictions.
5. Pattern Recognition: Empiricist AI excels in tasks that involve recognizing patterns and
correlations within data. For example, image recognition, natural language processing, and
speech recognition are areas where data-driven approaches have shown significant success.
6. Deep Learning: Deep learning is a subset of machine learning that employs neural
networks with multiple layers to learn hierarchical representations of data. Deep learning
models, such as convolutional neural networks (CNNs) and recurrent neural networks
(RNNs), are widely used in empiricist AI due to their ability to process large amounts of
data and learn complex patterns.
8. Online Learning: Empiricist AI can adapt to changing data and environments through
online learning, where the system updates its knowledge continuously as new data becomes
available.
10. Bayesian Inference: Bayesian methods are also considered part of empiricist
21
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
approaches in AI, as they involve updating probabilities based on evidence and observed
data.
One of the main advantages of empiricist approaches is their ability to handle complex and
real-world tasks by learning from vast amounts of data. However, they may require
substantial computational resources and data to achieve optimal performance. Additionally,
they might not always provide transparent explanations for their decisions, which can be a
concern in critical applications.
It's important to note that empiricist approaches are just one paradigm in AI, and there are
other philosophies and methodologies, such as symbolic or logic-based approaches, which
emphasize the use of formal rules and knowledge representation. In practice, a combination
of various approaches is often employed to create robust and intelligent AI systems.
8 Applications of Artificial Intelligence:
Robotic vehicles: A driverless robotic car named STANLEY sped through the rough terrain
of the Mojave dessert at 22 mph, finishing the 132-mile course first to win the 2005
DARPA Grand Challenge. STANLEY is a Volkswagen Touareg outfitted with cameras,
radar, and laser rangefinders to sense the environment and onboard software to command
the steering, braking, and acceleration (Thrun, 2006). The following year CMU’s BOSS
won the Urban Challenge, safely driving in traffic through the streets of a closed Air Force
base, obeying traffic rules and avoiding pedestrians and other vehicles.
Speech recognition: A traveler calling United Airlines to book a flight can have the entire
conversation guided by an automated speech recognition and dialog management system.
Autonomous planning and scheduling: A hundred million miles from Earth, NASA’s
Remote Agent program became the first on-board autonomous planning program to control
the scheduling of operations for a spacecraft (Jonsson et al., 2000). REMOTE AGENT
generated plans from high-level goals specified from the ground and monitored the
execution of those plans—detecting, diagnosing, and recovering from problems as they
occurred. Successor program MAPGEN plans the daily operations for NASA’s Mars
Exploration Rovers, and MEXAR2 did mission planning—both logistics and science
planning—for the European Space Agency’s Mars Express mission in 2008.
Game playing: IBM’s DEEP BLUE became the first computer program to defeat the world
champion in a chess match when it bested Garry Kasparov by a score of 3.5 to 2.5 in an
exhibition match (Goodman and Keene, 1997). Kasparov said that he felt a ―new kind of
intelligence‖ across the board from him. Newsweek magazine described the match as ―The
brain’s last stand.‖ The value of IBM’s stock increased by $18 billion. Human champions
studied Kasparov’s loss and were able to draw a few matches in subsequent years, but the
most recent human-computer matches have been won convincingly by the computer.
Spam fighting: Each day, learning algorithms classify over a billion messages as spam,
saving the recipient from having to waste time deleting what, for many users, could
comprise 80% or 90% of all messages, if not classified away by algorithms. Because the
spammers are continually updating their tactics, it is difficult for a static programmed
approach to keep up, and learning algorithms work best.
Logistics planning: During the Persian Gulf crisis of 1991, U.S. forces deployed a
Dynamic Analysis and Replanning Tool, DART , to do automated logistics planning and
22
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
scheduling for transportation. This involved up to 50,000 vehicles, cargo, and people at a
time, and had to account for starting points, destinations, routes, and conflict resolution
among all parameters. The AI planning techniques generated in hours a plan that would
have taken weeks with older methods. The Defense Advanced Research Project Agency
(DARPA) stated that this single application more than paid back DARPA’s 30-year
investment in AI.
Robotics: The iRobot Corporation has sold over two million Roomba robotic vacuum
cleaners for home use. The company also deploys the more rugged PackBot to Iraq and
Afghanistan, where it is used to handle hazardous materials, clear explosives, and identify
the location of snipers.
Machine Translation: A computer program automatically translates from Arabic to
English, allowing an English speaker to see the headline ―Ardogan Confirms That Turkey
Would Not Accept Any Pressure, Urging Them to Recognize Cyprus.‖ The program uses a
statistical model built from examples of Arabic-to-English translations and from examples
of English text totaling two trillion words. None of the computer scientists on the team
speak Arabic, but they do understand statistics and machine learning algorithms.
These are just a few examples of artificial intelligence systems that exist today.
9 Limitations of Artificial Intelligence:
AI, while incredibly powerful and promising, has its limitations. Some of the main
limitations include:
1. Lack of common sense: AI systems lack innate common sense and understanding of
the world that humans possess. They can perform specific tasks extremely well
within their programmed scope, but they struggle with generalizing knowledge and
applying it in novel situations.
2. Data dependency: AI models require large amounts of high-quality data to be
trained effectively. Without sufficient data, their performance can be subpar, and
they may even produce inaccurate or biased results.
3. Bias and fairness issues: AI systems can inherit biases from the data they are trained
on, reflecting the biases present in society. This can lead to discriminatory or unfair
outcomes, especially in applications like hiring, lending, and law enforcement.
4. Lack of creativity: While AI can generate content like text, images, and music, it is
still far from being truly creative in the way humans are. AI-generated content is
typically based on patterns in the data it was trained on, lacking genuine inspiration
or understanding.
5. Interpretability and explainability: Many AI models, especially deep learning ones,
are often seen as "black boxes" because they can be challenging to interpret and
explain. This lack of transparency raises concerns in critical applications, like
healthcare or autonomous vehicles, where understanding the decision-making
process is crucial.
6. Security and privacy concerns: AI systems are susceptible to attacks, and malicious
actors can exploit vulnerabilities for harmful purposes. Moreover, the collection and
23
CSEN2031 ARTIFICIAL INTELLIGENCE MODULE 1
24