Introduction to Artificial Intelligence
Introduction to Artificial Intelligence
1. What is AI?
Artificial Intelligence (AI) is the science and engineering of creating intelligent machines,
particularly computer programs. In simple terms, it's the intelligence shown by machines that
helps them mimic human actions. From a technical standpoint, AI is a set of algorithms that
can produce results without being explicitly programmed for that specific outcome, allowing
machines to think and act rationally.
• Learning Processes: This is the foundational stage where the AI acquires data and
creates rules, known as algorithms, for turning that data into actionable information.
The system is fed large volumes of labeled training data, which it analyzes to discover
correlations and patterns. For example, a chatbot is trained on millions of text chats to
learn how to converse with humans naturally.
• Reasoning Processes: This principle involves choosing the right algorithm to achieve a
desired outcome. The success of an AI program depends on its ability to apply logic
and select the most appropriate set of rules for a given task. For instance, after learning
patterns from data, the reasoning process decides which pattern is most relevant for
a new, unseen input.
• Learning: Uber's AI system processes massive amounts of historical and real-time data,
including ride requests, traffic conditions, time of day, and local events. It learns the
patterns of when and where people are most likely to need a ride.
• Reasoning: Based on the learned patterns, the system's reasoning algorithms predict
future demand. For example, it might reason that demand in a business district will
surge around 5 PM on weekdays.
• Self-Correction & Action: The system uses these predictions to proactively get drivers
on the road and direct them to high-demand areas before the surge actually happens.
If its predictions are off, it self-corrects by adjusting its model based on the new data,
constantly improving its accuracy for the next prediction cycle.
Conclusion In essence, AI works by ingesting large datasets, using learning and reasoning
processes to identify subtle patterns within that data, and applying self-correction
mechanisms to continually refine its predictive models. This allows AI to perform complex,
human-like tasks with increasing accuracy and efficiency.
3.1 Advantages of AI
[Link] well on tasks that uses detailed data.
[Link] less time to perform tasks that needs to process huge volumes of data.
[Link] consistent and accurate results.
[Link] be used 24 X 7.
[Link] tasks by better utilizing resources.
[Link] complex processes.
[Link] downtime by predicting maintenance needs.
[Link] companies to produce new products having better quality and speed.
3.2 Disadvantages of AI
[Link] more cost.
4. History of AI:
The history of Artificial Intelligence is a journey of ambitious ideas, significant breakthroughs,
and periods of challenge known as "AI Winters". From its conceptual beginnings in the 1950s
to its current boom, AI has evolved dramatically, driven by advances in computing power and
data availability.
Key Stages and Milestones
• 1943: Warren McCullough and Walter Pitts proposed the first mathematical model for
building a neural network.
• 1950: Alan Turing published his seminal paper, "Computing Machinery and
Intelligence," where he introduced the Turing Test, a method for determining if a
machine is intelligent.
• The term "Artificial Intelligence" was officially coined by John McCarthy at the
Dartmouth Conference. This event is considered the birth of AI as a formal field of
research.
• A period of reduced funding and interest in AI research followed the initial hype.
Progress slowed as the computational limits of the time were reached and early
promises went unfulfilled.
• 1980: The first successful commercial expert system, R1 (also known as XCON), was
developed by DEC to help configure computer systems. Expert systems, which use a
knowledge base to solve problems like a human expert, became a major focus of AI
research.
• The expert system market collapsed, and funding once again dried up, leading to
another period of stagnation.
• 1997: A major milestone was achieved when IBM's Deep Blue chess computer
defeated the reigning world champion, Garry Kasparov, demonstrating the power of
AI in complex strategic games.
• 2005: A self-driving car from Stanford, named STANLEY, won the DARPA Grand
Challenge, reigniting interest in autonomous vehicles.
• 2014: Amazon launched Alexa, its virtual assistant, further popularizing AI in the
home.
• 2016: Google DeepMind's AlphaGo defeated Lee Sedol, the world champion Go player.
This was a significant achievement because Go is considered far more complex than
chess, and the victory showcased the power of deep learning and neural networks.
5. Types of AI
Artificial Intelligence systems can be classified into different types based on two primary
criteria: their capabilities (what they can do) and their functionalities (how they are designed
to work). This classification helps in understanding the current state of AI and its future
potential.
1. Weak AI (or Narrow AI): This type of AI is designed and trained to perform a specific,
narrow task. It operates within a limited, pre-defined context and does not possess
general intelligence. The vast majority of AI applications that we use today fall into this
category.
o Examples:
o Example: Currently, AGI exists only in science fiction. A famous example is HAL
9000 from the movie 2001: A Space Odyssey, a machine that could emulate
human intelligence, think strategically, and even exhibit emotions.
This classification is based on how an AI system functions and its level of "consciousness."
1. Reactive Machines: These are the most basic AI systems. They do not have memory
and cannot use past experiences to inform current decisions. They perceive the world
and react to it directly based on a set of pre-programmed rules.
o Example: IBM's Deep Blue, the chess computer that defeated Garry Kasparov,
is a prime example. It analyzed the current state of the chessboard and chose
the optimal move without any memory of previous games or moves.
2. Limited Memory: These AI systems can retain data for a short period and use it to
make decisions. They can learn from recent past experiences but cannot build a
permanent library of knowledge. Most modern AI applications have limited memory
capabilities.
o Example: Autonomous vehicles use this type of AI. They store and analyze
recent data about the speed of nearby cars, the distance between vehicles, and
traffic signals to navigate safely. However, this data is transient and not
permanently stored.
6. Machine Intelligence
Machine Intelligence, often used interchangeably with Artificial Intelligence, refers to the
ability of a machine or system to exhibit intelligent behavior. A system is considered artificially
intelligent when it can demonstrate one or more core components of intelligence that are
typically associated with the human mind.
Components of Intelligence
Intelligence is not a single entity but a composite of several distinct capabilities. The key
components are:
2. Learning: Learning is the process of gaining knowledge or skills through study, practice,
teaching, or experience. For an AI, learning involves improving its performance on a
task by analyzing new data. Different forms include:
o Motor Learning:
o Observational Learning:
o Perceptual Learning:
o Relational Learning:
o Spatial Learning:
Learning through visual stimuli like images, maps, and colors. Example:
Creating a mental map of a route before actually driving.
o Stimulus-Response Learning:
3. Problem Solving: This component involves identifying a problem, analyzing it, and
selecting the best possible solution or path to reach a desired goal. Search algorithms,
covered in Module 2, are a primary method AI uses for problem-solving.
o AI systems use sensors like cameras, microphones, and radar to acquire data
from their environment. Computer Vision and Speech Recognition are key AI
fields focused on perception.
5. Linguistic Intelligence: This is the ability to use, comprehend, speak, and write
language effectively. It is the foundation of interpersonal communication. In AI, this is
the domain of Natural Language Processing (NLP), which enables machines like
chatbots and virtual assistants to understand and respond to human language.
Key Differences
o Human Intelligence: Humans can learn new concepts and skills from a very
small number of examples, or even just one. We can generalize effectively from
limited information.
o Human Intelligence: Humans have a deep well of common sense and life
experience, which allows us to effortlessly navigate ambiguous situations and
infer missing information.
o Machine Intelligence: AI systems lack common sense and struggle with
ambiguity. They interpret instructions literally and can fail in unexpected ways
when faced with a situation not covered in their training data.
2. Enhanced Speed and Accuracy: AI systems can process and analyze massive amounts
of data far faster and more accurately than is humanly possible.
2. Lack of Expertise and Trained Professionals: There is a significant skills gap in the AI
field. The demand for qualified AI experts, data scientists, and machine learning
engineers far outstrips the current supply, making it difficult for many organizations to
implement AI effectively.
3. Risk of Bias and Inaccurate Results: AI systems are only as good as the data they are
trained on. If the training data is incomplete, inaccurate, or contains historical biases,
the AI will learn and amplify those biases, leading to unfair and discriminatory
outcomes.
4. Lack of Generalization and Common Sense: Most current AI is "Narrow AI," meaning
it is highly specialized for one task. It cannot easily transfer its knowledge to a different
domain. Furthermore, AI lacks the common sense reasoning and intuition that humans
use to navigate novel situations.
5. Ethical and Societal Concerns: The rise of AI brings concerns about job displacement
due to automation, the potential for autonomous weapons, and the erosion of privacy
through mass data collection and surveillance.
Conclusion While the advantages of AI—such as increased efficiency, accuracy, and data-
driven insights—are revolutionizing industries, it is crucial to address its disadvantages.
Mitigating risks related to cost, bias, and ethical implications is essential for harnessing the full
potential of AI responsibly and for the benefit of society.
The Agent An agent is anything that can be viewed as perceiving its environment through
sensors and acting upon that environment through actuators. In essence, an agent is a
decision-maker. The agent's behavior is governed by an agent function, which maps any given
sequence of perceptions (percepts) to an action.
Types of Agents:
• Human Agent: A person is a biological agent. Our sensors are our sense organs (eyes,
ears, skin), and our actuators are our body parts (hands, legs, mouth).
• Robotic Agent: A physical robot is a common example. Its sensors include cameras and
infrared range finders, while its actuators are motors and mechanical limbs that allow
it to move and manipulate objects.
The Environment The environment is the world or context in which the agent operates. It is
where the agent exists, perceives, and acts. The environment provides the agent with percepts
and is affected by the agent's actions. Environments can be characterized along several
dimensions:
• Observable vs. Partially Observable: If an agent's sensors can detect all aspects of the
environment that are relevant to its choice of action, the environment is observable.
A chess game is fully observable. If some information is hidden, it is partially
observable, like a self-driving car that cannot see around a corner.
• Static vs. Dynamic: A static environment does not change while the agent is deciding
on its next action. A crossword puzzle is static. A dynamic environment can change on
its own, like a busy traffic intersection for a self-driving car.
• Discrete vs. Continuous: A discrete environment has a finite number of distinct states
and actions, like a chess game. A continuous environment has an infinite range of
states and actions, like the speed and steering angle of a car.
1. The agent receives a percept from the environment via its sensors.
4. The agent executes the action using its actuators, which in turn changes the state of
the environment.
The "right thing" is determined by whether the sequence of states the environment goes
through, because of the agent's actions, is desirable (i.e., leads from an initial state to a goal
state).
• A rational agent always performs the right action to maximize its performance.
Problem Solved by Agent (PEAS):
A rational agent makes decisions that maximize its performance based on:
c. Prior knowledge (what the agent already knows about the environment).
[Link] of agents
An AI agent is any entity that perceives its environment through sensors and acts upon that
environment through actuators. For example, a robotic vacuum's sensors are its cameras and
bump detectors, and its actuators are its wheels and suction motor. Agents are classified
based on how they process information to make decisions.
These are the most basic types of agents. They choose actions based only on the current
percept, ignoring the rest of the percept history.
• How they work: They operate on a simple "condition-action" rule (an IF-THEN rule).
If a certain condition in the environment is met, they execute a corresponding action.
They do not have any memory of past events.
• Limitations:
o They are only effective in fully observable environments where the current
percept provides all the necessary information to make the right decision.
o In partially observable environments, they can easily get stuck in infinite loops.
• Example: A simple automated vacuum cleaner that changes direction only when its
bump sensor hits an obstacle. It doesn't remember where it has been; it just reacts to
the current input from its sensor.
These agents are an upgrade to simple reflex agents because they maintain an internal state
or "model" of the world to handle partially observable environments.
• How they work: The agent uses its internal state to keep track of parts of the world it
can't see at the moment. This internal model is updated based on two kinds of
knowledge:
• Advantage: By maintaining a model of the environment, these agents can make better
decisions when the current percept alone is insufficient.
• Example: A self-driving car needs to change lanes. It remembers a car was in its blind
spot a moment ago, even if it can't see it currently. This internal model of the other
car's likely position allows it to make a safer decision than a simple reflex agent could.
3. Goal-Based Agents
Unlike reflex agents that just react to the environment, goal-based agents are capable of
making decisions based on information about a desirable situation, or a goal.
• How they work: When making a decision, these agents consider the future. They ask,
"What will happen if I do action A versus action B?" and choose the action that will
lead them to a goal state. This requires search and planning.
• Advantage: They are much more flexible and can adapt their behavior if the goal
changes. The knowledge that supports a decision is explicitly modeled, which allows
for modifications.
• Example: A GPS navigation system in a car. Its goal is the destination address. It uses a
map and search algorithms to plan a sequence of turns (actions) to reach that goal. If
it encounters a roadblock, it can re-plan a new route to the same goal.
4. Utility-Based Agents
These agents are a more advanced form of goal-based agents. They don't just distinguish
between goal states and non-goal states; they try to find the best possible outcome by
maximizing their "utility"—a measure of preference or happiness.
• How they work: A utility function maps a state to a real number that describes the
associated degree of happiness. When there are conflicting goals (e.g., fast vs. safe) or
multiple ways to reach a goal, a utility-based agent chooses the action that leads to
the state with the highest expected utility.
• Advantage: This allows for more nuanced decision-making in complex situations by
enabling the agent to make trade-offs between different objectives.
• Example: A ride-sharing AI deciding on a route. While multiple routes might reach the
destination (the goal), a utility-based agent would choose the one that provides the
best balance of speed, cost, safety, and rider comfort, thereby maximizing the overall
utility of the trip.
5. Learning Agents
Learning agents are the most sophisticated type. They are designed to improve their
performance over time by learning from their experiences. A learning agent can start with
basic knowledge and then adapt and improve automatically.
2. Critic: This element provides feedback to the agent by comparing its performance
against a fixed standard. It tells the agent how well it is doing.
3. Learning Element: This component uses the feedback from the critic to make
improvements to the performance element's decision-making process.
o After a game, the critic provides feedback (e.g., "this sequence of moves led to
a win").
o The learning element analyzes this feedback and adjusts the agent's strategy
to favor winning moves in the future.
[Link] of Environments
In Artificial Intelligence, the environment is the world or context in which an agent operates.
Understanding the properties of this environment is crucial because it dictates the type of
agent required to solve a problem effectively.
This dimension describes how much of the environment the agent can perceive at any given
moment.
• Fully Observable: An environment is fully observable if the agent's sensors can detect
the complete state of the environment relevant to its choice of action at any point in
time. In such an environment, the agent doesn't need to maintain an internal state or
memory to keep track of the world's history.
o Example: A classic chess game is fully observable. The agent can see the
position of every piece on the board, so it has all the information needed to
make its next move.
• Partially Observable: An environment is partially observable if the agent's sensors
provide incomplete information about the state. This can be due to noise, inaccurate
sensors, or parts of the environment being hidden. In this case, the agent must
maintain an internal state or memory to track the unobserved aspects of the world.
This dimension describes whether the environment can change while the agent is
deliberating.
• Static: A static environment does not change while the agent is performing its actions
or deciding what to do next. These are easier to work with because the agent doesn't
need to worry about the world changing during its thought process.
o Example: A crossword puzzle or a game of chess is static. The board waits for
the player to make a move.
• Dynamic: A dynamic environment can change on its own while the agent is acting. This
requires the agent to continuously monitor the world and react quickly.
This dimension relates to the nature of the states and actions in the environment.
• Discrete: A discrete environment has a finite number of distinct, clearly defined states
and actions.
o Example: A chess game has a finite (though very large) number of possible
board configurations and a limited set of legal moves from each position.
o Example: A simple puzzle game where a specific move always produces the
exact same result.
This dimension describes how many agents are operating in the environment.
This dimension refers to how actions and their consequences are linked over time.
o Example: Chess and driving are sequential environments. A single bad move
early in a chess game can lead to an inevitable loss. Similarly, a turn taken while
driving determines the subsequent road and the decisions that follow.
[Link] Representation
Knowledge Representation (KR) is a subfield of Artificial Intelligence that focuses on
representing information about the world in a form that a computer system can utilize to solve
complex tasks. It is not merely about storing data in a database; it is about encoding
knowledge in a way that allows a machine to learn, reason, and behave intelligently, similar
to a human.
KR is the process of creating a model of the world inside an AI agent. This internal model
allows the agent to reason about its environment and make informed decisions. A good KR
system must be able to represent different types of knowledge, including:
• Objects: Facts about all relevant objects (e.g., in a self-driving car, other vehicles and
roads are objects).
• Events: Information about actions that occur (e.g., applying the brakes is an event).
• Performance: Knowledge about how to perform actions (e.g., how to turn the steering
wheel smoothly).
• Meta-Knowledge: Knowledge about what the agent knows (e.g., knowing the limits of
its own knowledge).
• Facts: Truths about the real world (e.g., "Red traffic light means stop").
3. Handles Complexity and Ambiguity: The real world is complex and filled with
ambiguity. KR provides formalisms, such as logic and probability, to represent this
uncertainty and complexity in a way that a machine can handle.
o Example: A chatbot uses KR to understand that the word "bank" can mean a
financial institution or the side of a river, and it uses context to determine the
correct meaning.
Conclusion Knowledge Representation is arguably the most crucial component for building
intelligent systems because it provides the foundation upon which all higher-level cognitive
functions—such as reasoning, learning, and problem-solving—are built. It bridges the gap
between raw data and intelligent action, allowing an AI to understand its world and act
purposefully within it.
[Link] of Knowledge
1. Declarative Knowledge: This is knowledge of facts. It is explicit, conscious knowledge
that can be "declared" in a statement. It represents the "what" of a domain.
o Example:
o Example:
▪ The rules for driving a car (e.g., "IF the traffic light is red, THEN apply
the brakes").
o Example:
o Example:
[Link] is Logic?
Introduction In the field of Artificial Intelligence, logic is the fundamental component of
knowledge that enables an intelligent agent (whether human or machine) to reason and draw
conclusions by filtering required information from large volumes of sentences. It provides a
formal, unambiguous way to represent knowledge so that it can be processed by a computer.
Every logical system is built upon three main elements: Syntax, Semantics, and Logical
Inference.
1. Syntax
Syntax refers to the set of rules that defines how to construct well-formed or legal sentences
in a language. It is concerned with the structure and representation of the language, not its
meaning. Just as English grammar has rules about subject-verb agreement and sentence
structure, a logical language has rules for combining symbols into valid expressions.
• Function: It dictates the sequence of symbols and connectives that form a complete
and structurally correct statement.
o "Ram is riding a bike." — This sentence follows the grammatical rules of English
and is therefore syntactically correct.
2. Semantics
Semantics is concerned with the meaning of the sentences. It provides the rules for
interpreting a sentence and relating it to the real world to determine if it is logically correct
and meaningful. A sentence can be perfectly structured (syntactically correct) but still be
nonsensical (semantically incorrect).
• Function: Semantics checks the validity and truth of a statement in a given context. It
defines the sense of the sentence.
The distinction between syntax and semantics is crucial for an AI to not only process language
correctly but also to understand it.
3. Logical Inference
Inference is the process of deducing new conclusions from existing facts, evidence, or a
problem description. Logical inference is the mechanism that uses formal inference
algorithms to reason with the knowledge represented in the system. It allows an agent to
derive new facts that are not explicitly stated in its knowledge base.
• Function: It is the "thinking" part of the system. It uses established rules (like Modus
Ponens) to extend the agent's knowledge and find solutions to problems.
• Example:
An AI system has several interconnected components that work together to complete this
cycle.
1. Perception
This is the first and foundational step in the cycle. The perception component is responsible
for gathering data from the environment. It acts as the sensory system for the AI agent.
• Function: It retrieves raw data using various types of sensors. This input can be in the
form of video from cameras, audio from microphones, text from documents, or any
other sensor-based input like temperature or pressure readings.
• Role: The perception component takes in the external world and converts it into a
format that the system can process.
2. Learning
Once data is captured by the perception component, it is passed to the learning component.
The goal of this stage is to enable the system to improve its performance over time through
experience, rather than being explicitly programmed for every possible scenario.
• Function: The learning component analyzes the perceived data to identify patterns,
acquire new knowledge, develop heuristics (rules of thumb), and refine its internal
models.
This is the core "thinking" component of the AI system and is what most clearly demonstrates
human-like intelligence. It has two parts:
• Knowledge Representation: This involves taking the knowledge acquired during the
learning phase and encoding it into a formal, structured, machine-understandable
format (like logical rules or semantic networks). It defines what the agent needs to
know to behave intelligently.
• Role: The KRR component allows the machine to "think" about what it knows and
make logical deductions to inform its actions.
This is the final stage of the cycle, where the agent acts on the world. This component uses
the output from the Knowledge Representation and Reasoning stage to formulate and carry
out a plan.
• Role: This component translates thought into action, allowing the agent to affect its
environment.
The entire process is a continuous loop. After the agent executes an action, the state of the
environment may change. The perception component senses this new state, and the cycle
begins again, allowing the agent to continuously learn, adapt, and refine its behavior.
[Link]-Based Agent.
Introduction A Knowledge-Based Agent is an intelligent agent that acts by using its internal
knowledge and reasoning capabilities to make decisions. Instead of relying on hard-coded
reflexes, it uses a representation of the world to act intelligently, making it more flexible and
powerful than simpler agents. Such an agent is composed of two primary components: the
Knowledge Base and the Inference Engine.
Primary Components
1. Knowledge Base (KB): The Knowledge Base is the central repository of the agent's
knowledge. It is the most important component and contains information about the
environment and the world, stored in the form of sentences. These are not sentences
in plain English but are expressed in a formal knowledge representation language (like
propositional or first-order logic) that the system can understand and process.
o Factual Knowledge: Information that is widely accepted and true within the
domain (e.g., "All mammals are warm-blooded").
2. Inference Engine (IE): The Inference Engine is the "brain" or the reasoning mechanism
of the agent. Its job is to apply logical rules to the facts stored in the Knowledge Base
to deduce new information or to decide on an action to take. The IE allows the agent
to reason about its knowledge and the information it perceives from the environment.
o For example, if the KB contains the rule "If it is raining, then the ground is wet"
and it receives a percept that "it is raining," the Inference Engine can deduce
the new fact that "the ground is wet" without needing to directly observe it.
The agent interacts with its components through a few core operations:
• TELL: This operation is used to add new sentences or facts to the Knowledge Base.
When an agent perceives something new about its environment, it "TELLS" the KB so
that its internal knowledge is updated.
• ASK: This operation is used to query the Knowledge Base to determine which action
to take. The agent "ASKS" the KB for a course of action, and the Inference Engine uses
the stored knowledge to derive an answer.
• PERFORM: Once the agent receives an answer from the ASK operation, it performs the
selected action in the environment.
• Knowledge Base: Contains rules like "If a patient has a fever AND a sore throat, THEN
they might have strep throat." and facts like "Patient X has a fever."
• Inference Engine: The agent receives a new percept: "Patient X has a sore throat." It
TELLS this new fact to the KB. It then ASKS the KB what the diagnosis is. The Inference
Engine applies the rule to the facts ("Patient X has a fever" and "Patient X has a sore
throat") and infers that "Patient X might have strep throat."
• Action: The agent can then PERFORM an action, such as recommending a test for strep
throat.
Conclusion The combination of a Knowledge Base (to store what is known) and an Inference
Engine (to reason with that knowledge) makes a Knowledge-Based Agent highly adaptable. It
can handle complex situations, learn from new information by updating its KB, and make
rational decisions based on logical deduction, forming the foundation for more advanced AI
systems like expert systems.
The agent's primary function is to accept information it perceives from the environment as
input and return an action as output. To do this, it maintains two key things:
• A Knowledge Base (KB), which stores sentences about the world.
The agent operates in a continuous three-step cycle each time it is called upon to act.
Each time the agent's program is executed, it performs the following sequence of operations
to decide on an action.
First, the agent takes its current percept from the environment (e.g., what it sees or hears).
This raw sensory input is then converted into a formal sentence using a function like MAKE-
PERCEPT-SENTENCE. The agent then TELLS this sentence to its Knowledge Base.
• Purpose: This step updates the agent's internal knowledge of the world with the most
recent information. It's how the agent stays informed about changes in its
environment.
• Analogy: Imagine you're in a room and you feel a draft. You "tell" your internal
knowledge base, "There is a draft."
Next, the agent needs to decide on an action. It uses a function like MAKE-ACTION-QUERY to
formulate a question about the best action to perform at the current time. The agent then
ASKS its Knowledge Base this question.
• Purpose: This is the reasoning step. The agent's inference engine uses the facts and
rules stored in the KB to deduce the most rational action to achieve its goals.
• Analogy: After noting the draft, you "ask" yourself, "What should I do about this draft?"
Based on your knowledge (e.g., "Drafts can make me cold," "Closing a window stops a
draft"), your brain infers that closing the window is a good action.
After the inference engine determines the best action, the agent records this decision before
executing it. It uses a function like MAKE-ACTION-SENTENCE to create a sentence declaring
the chosen action. It then TELLS this sentence to the Knowledge Base. Finally, the agent
returns the action so it can be performed in the environment.
• Purpose: This step is crucial for the agent to keep track of its own actions over time.
This helps it understand the effects of its actions on the environment and allows it to
learn from its behavior.
• Analogy: You decide to close the window. You update your internal state: "I am now
closing the window." This prevents you from trying to close the same window again
immediately.
Example: A Wumpus World Agent Consider an agent in the Wumpus World game.
1. TELL (Perceive): The agent is in square [1,2] and perceives a stench. It TELLS its KB:
Stench_in_[1,2].
2. ASK: The agent ASKS its KB: "What is a safe move?" The inference engine uses the rule
"If there is a stench, a Wumpus is in an adjacent square" to infer that square [1,3] or
[2,2] might have a Wumpus. It also knows [1,1] and [2,1] are safe from previous moves.
The best action returned might be "Move to [2,2]".
3. TELL (Act): The agent TELLS its KB: Action_is_Move_to_[2,2]. It then returns the action
to be executed.
Conclusion This generic "Perceive-TELL, ASK, Act-TELL" cycle provides a powerful and flexible
framework for any knowledge-based agent. It allows the agent to maintain a consistent view
of the world, learn from new perceptions, and make rational decisions by logically reasoning
with its accumulated knowledge.
These levels are the Knowledge Level, the Logical Level, and the Implementation Level.
1. Knowledge Level
This is the most abstract level. It describes the agent in terms of what it knows and what its
goals are, without any detail about how this knowledge is actually represented or computed.
• Focus: The focus is purely on the agent's knowledge and objectives. We specify the
information the agent has about its environment and what it is trying to achieve. This
level allows us to predict the agent's behavior by assuming it will act rationally to
achieve its goals based on its knowledge.
• Analogy: Describing a doctor at the knowledge level means saying, "She knows about
human anatomy, diseases, and treatments, and her goal is to cure the patient." We are
not concerned with the specific language she thinks in or the neural pathways in her
brain.
• Example: For an AI agent tasked with navigating from point A to point B, the knowledge
level description would simply be: "The agent knows the map of the area and the
location of point B, and its goal is to reach point B."
2. Logical Level
This level is concerned with how the knowledge from the knowledge level is represented
inside the agent. It describes the encoding of knowledge into formal sentences.
• Focus: At this level, the abstract knowledge is translated into a specific knowledge
representation language, such as propositional logic or first-order logic. The
knowledge base is viewed as a collection of logical sentences, and the agent's
reasoning process is described in terms of logical inference.
• Analogy: For the doctor, this level would represent her knowledge as a set of logical
rules, such as: "IF a patient has a fever AND a cough, THEN they might have a
respiratory infection."
• Example: For the navigation agent, the knowledge is now encoded into logical
sentences like At(Agent, A) and Path(A, X, B). The agent uses these sentences and an
inference engine to deduce a sequence of actions.
3. Implementation Level
This is the most concrete level. It describes the physical implementation of the agent,
including the data structures and algorithms that run on the hardware.
• Focus: This level deals with how the logical sentences and inference mechanisms are
actually implemented in code and executed on a computer. It specifies the data
structures used to store the knowledge base (e.g., lists, hash tables) and the algorithms
that perform the logical inference.
• Analogy: For the doctor, this is the physical brain itself—the neurons, synapses, and
electrical signals that store her knowledge and carry out the thought processes. For an
AI, this is the actual code, the CPU, and the memory.
• Example: The navigation agent's knowledge base is stored in a specific data structure,
and its inference engine is an algorithm running on a processor. The agent performs
actions by sending electronic signals to its motors to physically move from point A to
B.
• Knowledge Level: The agent knows it should adjust the room temperature based on
the weather.
1. Declarative Approach
The declarative approach focuses on telling the agent what it needs to know. The design
process starts by initializing the agent with an empty knowledge base and then systematically
adding sentences and rules about the world one by one.
• Core Principle: The focus is on building a comprehensive and explicit Knowledge Base
(KB). The agent's desired behavior is not programmed directly. Instead, it emerges
from the agent's ability to reason with the knowledge it has been given.
• Process:
• Analogy: This is similar to teaching a human. You don't program a child's brain directly.
Instead, you teach them facts ("The stove is hot"), rules ("Don't touch hot things"), and
general knowledge, and you trust that they will use this information to reason about
how to act in a new situation.
• Advantage: This approach is highly flexible. To change the agent's behavior, you simply
need to update the knowledge base by adding, removing, or modifying sentences. You
don't need to rewrite the core program.
2. Procedural Approach
The procedural approach focuses on programming the agent's behavior directly. The desired
behavior is explicitly encoded into the agent's program code.
• Core Principle: The focus is on the algorithms and control flow that dictate the agent's
actions. The knowledge is often implicit, embedded within the structure and logic of
the program itself.
• Process: The programmer writes a set of procedures or functions that the agent will
execute. The agent's intelligence is a direct result of the programmer's code. This
approach is often implemented using programming languages like LISP or Prolog.
• Analogy: This is like writing a script for a robot to follow. The code gives explicit
instructions: "Move forward 5 steps, turn right, pick up the object." The robot is not
reasoning from a knowledge base; it is simply executing a pre-defined sequence of
commands.
• Disadvantage: This approach is less flexible. If you want to change the agent's
behavior, you must modify and recompile the program code, which can be a complex
and error-prone process.
In practice, a purely declarative or procedural approach is rare. Most modern AI systems use
a hybrid approach that combines the strengths of both.
• Process:
• Benefit: This provides the best of both worlds: the flexibility of being able to easily
update the high-level knowledge base, combined with the speed and efficiency of a
hard-coded procedural system.
• Example: An expert system for medical diagnosis might have its rules defined
declaratively. When the system is run, these rules are compiled into a highly efficient
decision tree (a procedural structure) that can provide diagnoses very quickly.
• Inferential Knowledge
• In this technique, facts about a set of objects are systematically stored using relations
(or tables) in database systems.
• These relations depict relationship between different entities.
• The main shortcoming of this approach is that there is little opportunity for inference.
Inheritable Knowledge
• The representation starts using generalized classes and move down to specialized
classes in the hierarchy.
Example:
Zinya and Vidhi both are instances of under-graduate and post-graduate students,
respectively.
Inheritable knowledge shows the relation between instance a class, and is therefore known
as instance relation of IS-A relation.
Inferential Knowledge Represents Knowledge in the Form of Formal Logic and Can be Used to
Derive More Facts Accurately.
Student(Diya)
Human intelligence perceives the world through patterns and context, utilizing prior experience and intuition to understand and interpret ambiguous information. On the other hand, machine intelligence perceives by analyzing data using rules and algorithms, often relying on mathematical models like Convolutional Neural Networks (CNNs) to identify features and objects in images. Machines see data as a matrix of values rather than holistic contexts .
AI in healthcare offers significant advantages such as rapid data processing and high accuracy in analyzing medical images like X-rays or MRIs, enabling quicker diagnosis and treatment. However, challenges include ensuring data privacy, managing computational demands, and integrating AI systems with existing healthcare frameworks, thus requiring careful oversight and validation .
Deductive reasoning in AI involves a top-down approach that moves from a general premise to a specific, certain conclusion, exemplified by reasoning: 'All humans are mortal; Socrates is a human; therefore, Socrates is mortal.' Inductive reasoning, however, uses specific observations to form a general hypothesis, as seen in concluding 'all swans are white' based on observing only white swans, though this can be falsified by a single contrary observation .
The agent-environment interaction model structures an agent's operation into a continuous loop: the agent receives a percept from the environment, processes it, selects an action, and executes it using actuators, altering the environment's state. This model guides the agent's responsive behavior and learning from stimuli, akin to a decision-making cycle that meshes perception with action .
Limited memory AI systems can retain and use data from the recent past to inform decisions, like autonomous vehicles analyzing nearby traffic to navigate safely. In contrast, reactive machines do not have memory and make decisions solely based on real-time data, such as IBM's Deep Blue, which could choose optimal chess moves without recalling previous games .
Current AI systems struggle with learning from minimal data, often requiring large datasets to achieve high accuracy, as seen in deep learning paradigms which demand massive labeled images. In contrast, humans can learn new concepts from few examples, utilizing effective generalization from limited information, highlighting a critical gap in AI's capability to mimic human learning efficiency .
Perception for humans involves acquiring and interpreting sensory data using organs like eyes and ears to understand environments contextually. Machines, however, use sensors like cameras and microphones, processing data through algorithms to interpret surroundings. Unlike humans, who utilize intuition and experience, machines perceive strictly by pre-set rules and data patterns .
Current AI exhibits narrow intelligence as it is designed to excel in specific tasks, such as playing chess or recognizing faces, but cannot transfer its learning across different contexts or tasks. In contrast, human general intelligence allows abstract thinking, learning from minimal examples, and applying knowledge across domains. For instance, an AI proficient in chess cannot drive a car or compose music, highlighting its task-specific capabilities .
A knowledge-based agent operates in a three-step process: 1) It TELLS the Knowledge Base (KB) what it perceives by converting sensory input into a formal sentence. 2) It ASKS the KB what action should be taken by formulating and reasoning about a query to determine the best course of action. 3) It TELLS the KB about the chosen action, recording its decision before executing it to track the effects and learn from the outcome .
A knowledge-based agent maintains a consistent worldview by continuously updating its Knowledge Base (KB) with new percepts and recording chosen actions. This ensures it tracks environmental changes and learns effects of its actions, enabling rational decision-making. Such consistency is crucial for adapting to complex scenarios and is foundational for advanced systems like expert systems which rely on logical deduction and updated environmental data .