Arrtificial I
Arrtificial I
According to Elaine Rich and Kevin Knight (Artificial Intelligence, TMH), "Artificial
Intelligence is the study of how to make computers do things at which, at the moment,
people are better." Nils J. Nilsson defines AI as "the activity devoted to making machines
intelligent," where intelligence is that quality that enables an entity to function
appropriately and with foresight in its environment.
Examples of AI in everyday life include virtual assistants like Siri and Alexa,
recommendation systems (Netflix, Amazon), autonomous vehicles, facial recognition
systems, and fraud detection mechanisms. AI development follows a combination of
symbolic representation (knowledge-based systems) and data-driven techniques (machine
learning models)
Category Description
Narrow AI Specializes in one task; e.g., speech recognition (e.g., Siri, Alexa).
General AI Mimics human cognition across any task (still theoretical).
Super AI Surpasses human intelligence in all aspects (hypothetical/future concept).
1. Machine Learning (ML) – Systems that learn from data and improve over time.
2. Natural Language Processing (NLP) – Understands and processes human
language.
3. Computer Vision – Interprets and processes visual data from the environment.
4. Robotics – Designs intelligent physical agents that can move and interact.
5. Expert Systems – Emulates the decision-making ability of a human expert.
6. Planning & Scheduling – Designs systems that can sequence actions over time.
7. Perception – Interprets input from sensors (e.g., voice, camera) for environmental
understanding.
1.6 Approaches to AI
c. Hybrid AI
1.9 Benefits of AI
1.12 Future of AI
2. Importance of AI
In finance, AI is used for fraud detection, algorithmic trading, credit scoring, and
customer service chatbots. It enhances predictive analytics and risk management, giving
financial institutions a competitive edge.
AI’s role in education includes personalized learning systems, automated grading, and
intelligent tutoring systems. These systems adapt to individual students' needs, enhancing
the learning experience.
AI also plays a pivotal role in manufacturing through automation, predictive
maintenance, and quality control. Robotics combined with AI increases production rates
and consistency.
AI raises concerns about job displacement, bias, privacy, and ethical dilemmas. Despite
these challenges, the potential of AI to augment human abilities and solve complex global
problems is immense.
AI intersects with several related fields, each contributing to its development. These
fields include:
Each field contributes tools, theories, or models that enhance AI's ability to solve real-
world problems.
4. AI Techniques
These techniques are implemented using programming languages like LISP, PROLOG,
Python, and specialized AI platforms and frameworks.
The process of searching involves expanding nodes from the initial state toward the goal,
guided by strategies such as:
Heuristics are rules-of-thumb that guide the search based on domain knowledge, reducing
computational complexity.
Problem Formulation: Clearly define the initial state, goal state, and allowable
operations.
State Representation: Choose a representation that captures all necessary details
and allows efficient manipulation.
Search Space Size: A large or infinite search space demands efficient heuristics
and pruning strategies.
Path Cost and Optimality: Define how to evaluate and compare different
solutions.
Time and Space Complexity: Choose algorithms that balance performance and
resource consumption.
Dead Ends and Loops: Handle situations where the search gets stuck or revisits
states.
Dynamic and Real-time Environments: Account for changes in the environment
during search.
Informed design ensures the system can find a solution within acceptable time and
resource constraints.
Unit 2
📘 Topic 1: Definition and Importance of Knowledge
🔹 Introduction
In the domain of Artificial Intelligence (AI), knowledge plays a central and foundational
role. It is the raw material upon which intelligent behavior is built. The effectiveness of
an intelligent system heavily depends on how much knowledge it possesses and how
efficiently it can utilize that knowledge.
Just like a human cannot function effectively without memory or information about the
world, a machine cannot be intelligent unless it is equipped with relevant, structured,
and retrievable knowledge. In AI, this is often referred to as Knowledge-Based Systems
(KBS), which derive their power from the knowledge they are given.
🔹 Definition of Knowledge
According to Elaine Rich & Kevin Knight, knowledge is “a general term that refers to
stored facts, rules, and heuristics that guide reasoning and problem solving.”
In simpler terms:
🔹 Types of Knowledge in AI
1. Declarative Knowledge
o Consists of facts and assertions.
o Example: "Paris is the capital of France."
2. Procedural Knowledge
o Knowledge of how to do things or perform tasks.
o Example: How to drive a car or play chess.
3. Meta-Knowledge
o Knowledge about knowledge.
o Example: Knowing which type of reasoning method to use for a given
problem.
4. Heuristic Knowledge
o Based on experience and intuition.
o Example: “If a car won’t start, check the battery first.”
5. Common Sense Knowledge
o Everyday general knowledge.
o Example: Water is wet, fire is hot.
🔹 Importance of Knowledge in AI
Knowledge is the core resource of AI. Without it, AI systems cannot reason, learn, or
make decisions. Below are the key reasons why knowledge is so important in artificial
intelligence:
All of this is only possible if the system has access to relevant knowledge and
mechanisms to use it.
If the system knows “All men are mortal” and “Socrates is a man,” it can conclude
“Socrates is mortal.”
This kind of logical reasoning is foundational in Expert Systems, Theorem Provers, and
Diagnosis Systems.
3. Enhances Decision-Making
A self-driving car must know traffic laws, road conditions, and user preferences to
make real-time decisions.
This requires both factual and experiential knowledge, embedded in the form of rules,
probabilistic models, or neural networks.
AI systems, especially in Machine Learning, use data to acquire knowledge over time.
This knowledge can be in the form of:
Statistical patterns
Rule sets
Behavioral models
For systems like chatbots or natural language processors, knowledge is needed to:
Language processing systems use knowledge about syntax, semantics, world facts, and
user preferences to simulate intelligent conversation.
6. Facilitates Problem Solving
AI systems are often used for diagnosing problems, planning tasks, or playing games.
These activities require strategic knowledge such as:
Goal hierarchies
Action-outcome relations
Constraints and heuristics
For example, in a chess game, the AI must evaluate positions using tactical knowledge
and plan using long-term strategies.
“An intelligent system is not the one that knows everything, but the one that can use
what it knows in the right way.” – Adapted from Rich & Knight
Thus, the quality, relevance, and usability of knowledge are more important than
quantity. The system must know:
🔹 Knowledge Hierarchy in AI
mathematica
CopyEdit
Data → Information → Knowledge → Wisdom
AI aims to reach at least the knowledge level, and in some cases emulate wisdom,
especially in Decision Support Systems (DSS) and Autonomous Agents.
Despite its importance, acquiring and managing knowledge is a difficult task. Some of
the key challenges include:
🔹 Introduction
Knowledge Representation (KR) is the field in Artificial Intelligence (AI) that focuses on
how to represent information about the world in a form that a computer system can use
to solve complex tasks. These tasks include reasoning, learning, planning, and decision-
making.
The goal of knowledge representation is to bridge the gap between the symbolic
knowledge (how the world is described) and logical reasoning (how that description is
processed to derive conclusions or actions). KR is foundational to AI because it enables
systems to simulate intelligent behavior by representing facts and relationships.
There are various forms and methods used in knowledge representation. These
methods depend on the nature of the problem, the required flexibility, and the
efficiency of the system. Below are the common methods:
2. Predicate Logic
3. Semantic Networks
4. Frames
6. Bayesian Networks
2. Handling Uncertainty
3. Scalability
4. Handling Inconsistencies
Knowledge Representation (KR) is crucial for building intelligent systems in AI, allowing
machines to reason, make decisions, and solve problems. Different approaches to KR
vary in terms of expressiveness, ease of use, and computational efficiency. Let's look at
the most commonly used approaches in AI.
1. Logic-Based Representation
Logic-based methods are among the oldest and most formal approaches to representing
knowledge. The two primary forms are:
Propositional Logic:
In propositional logic, knowledge is represented as a set of statements or
propositions that are either true or false. This approach is simple and easy to
understand but is limited in its ability to handle complex relationships and
reasoning.
Predicate Logic (First-Order Logic):
Predicate logic is a more powerful extension of propositional logic. It introduces
predicates, objects, variables, and quantifiers, allowing for more detailed
representations of knowledge. For example, instead of just saying "The sky is
blue," predicate logic can represent relationships like "John is a teacher" or "All
humans are mortal." This makes it more expressive for complex relationships.
2. Semantic Networks
3. Frames
Usage: Suitable for representing real-world objects that have certain attributes.
For instance, a frame for a "Car" might have slots for "color," "model," "engine
type," etc.
Advantages: Highly modular and flexible, particularly useful for default reasoning (e.g.,
"birds typically fly").
Disadvantages: Can become complex with many frames and interrelated attributes.
May struggle with contradictions in the knowledge base.
A production system represents knowledge using IF-THEN rules, where each rule
specifies a condition and an action. For example, "IF it is raining, THEN carry an
umbrella." These systems allow for simple, declarative representations of knowledge
that can be easily modified or extended.
Usage: Frequently used in expert systems and decision-making applications.
Advantages: Simple and modular, with the ability to define specific actions for certain
conditions.
Disadvantages: Can become inefficient when the number of rules grows. The system
may also struggle with uncertainty or incomplete knowledge.
5. Bayesian Networks
6. Causal Networks
Usage: Useful in domains like diagnostics, where knowing the cause of a problem
is crucial.
Advantages: Allows for deeper insights into the underlying structure of a system and
provides a way to reason about interventions and their effects.
7. Hybrid Approaches
Many AI systems combine multiple representation methods to benefit from the
strengths of each. For example, a system might use semantic networks to represent
hierarchical relationships and production rules to handle decision-making logic.
Usage: Hybrid systems are often used in complex domains that require diverse
kinds of reasoning.
Disadvantages: Integrating different methods can increase the complexity of the system
and make it harder to manage.
3. Incomplete Knowledge
5. Context Sensitivity
Conclusion
Predicate logic, also known as first-order logic (FOL), is a powerful tool for representing
knowledge in a structured and formal way. It allows us to describe facts and
relationships in the world using predicates, variables, and quantifiers.
o Universal quantifier (∀): Means "for all" (e.g., ∀x, isHuman(x) implies
Quantifiers: Indicate the scope of the statement:
In predicate logic, we represent facts about the world as logical sentences. For instance:
"John is a human":
This can be written as isHuman(John).
"John likes Alice":
This is represented as likes(John, Alice).
Predicate logic can represent more complex relationships and facts, including:
Multiple predicates:
For example, "John gives a book to Alice" can be written as gives(John,
book, Alice).
Unit 3
Generate and test is one of the simplest forms of problem-solving techniques in artificial
intelligence (AI). It falls under the category of heuristic search techniques. The approach
involves generating possible solutions and then testing each to determine whether it
solves the problem. This method is quite general and can be applied to various types of
problems, but it is particularly useful when the space of potential solutions is relatively
small.
Definition: Generate and test is a brute-force search method that explores the space of
possible solutions by generating each one and testing whether it meets the goal condition.
Process:
Example: Consider the 8-puzzle problem. In this scenario, the system would generate a
random move (e.g., sliding a tile), test if the resulting state is the goal state, and continue
until a solution is found.
Advantages:
Simple to implement.
Effective for small problem spaces.
Disadvantages:
2. Hill Climbing
Hill climbing is a local search algorithm that continuously moves towards the direction of
increasing value (uphill) to find the peak of the mountain (maximum value).
Types:
Simple hill climbing: Considers only the current state and chooses the neighbor
with the highest value.
Steepest ascent hill climbing: Considers all neighbors and selects the one closest
to the goal.
Stochastic hill climbing: Chooses at random from among the uphill moves.
Advantages:
Disadvantages:
Best-first search combines the advantages of both depth-first and breadth-first search. It
uses a heuristic to estimate the "best" path to the goal and expands the most promising
node.
Definition: Best-first search is a search algorithm that explores a graph by expanding the
most promising node chosen according to a specified rule.
Types:
Greedy best-first search: Selects the node that appears to be closest to the goal.
A* search**: Combines the cost to reach the node and the estimated cost from the
node to the goal.
Advantages:
Disadvantages:
4. Problem Reduction
Problem reduction is a technique that breaks a problem into sub-problems and solves
each recursively. This approach is especially useful in theorem proving and logic
programming.
Example: In the Tower of Hanoi problem, moving n disks from one peg to another can
be reduced to moving n-1 disks to an intermediate peg, then moving the largest disk, then
moving the n-1 disks on top of it.
Advantages:
Disadvantages:
5. Constraint Satisfaction
Constraint Satisfaction Problems (CSP) involve finding values for problem variables that
satisfy a set of constraints.
Definition: A CSP is defined by a set of variables, a domain for each variable, and a set
of constraints that specify allowable combinations of values.
Example: Sudoku is a CSP where variables are cells, domains are digits 1–9, and
constraints ensure no digit repeats in a row, column, or 3x3 block.
Solving Techniques:
Backtracking
Forward checking
Constraint propagation (e.g., arc consistency)
Advantages:
Suitable for a wide range of problems like scheduling, planning, and resource
allocation.
Disadvantages:
1. Introduction to NLP
Definition: NLP refers to the ability of a computer to understand, interpret, and generate
human language.
Applications:
Machine translation
Speech recognition
Sentiment analysis
Chatbots
Challenges:
Ambiguity in language
Variability in syntax and semantics
Components:
Lexical analysis
Syntax analysis
Semantic analysis
Discourse integration
Pragmatic analysis
2. Syntactic Processing
Example:
Sentence: "The cat sat on the mat."
Syntactic structure reveals that "The cat" is the subject, "sat" is the verb, and "on the mat"
is a prepositional phrase.
Challenges:
3. Semantic Processing
Semantic processing goes beyond syntax to interpret the meaning of words and
sentences.
Techniques:
Challenges:
4. Discourse Processing
Discourse processing focuses on understanding connected text beyond the sentence level.
Tasks:
Example:
"John went to the store. He bought some milk."
"He" refers to John — a relationship established through discourse analysis.
Challenges:
Long-range dependencies
Ambiguity in referents
5. Pragmatic Processing
Definition: It is the layer of NLP that deals with how language is used in practice and in
real-life situations.
Components:
Challenges:
Unit 4
In Artificial Intelligence (AI), learning refers to the process by which machines improve
their performance or make better decisions over time based on experience or data. Just
like humans learn from their surroundings, experiences, and feedback, AI systems are
designed to learn patterns, behaviors, and rules from given inputs.
Learning helps AI systems move beyond hard-coded rules and become autonomous in
handling complex and uncertain real-world problems.
Without learning, AI systems would be rigid, only capable of performing tasks for which
they were explicitly programmed. But real-world environments are dynamic and
constantly changing. AI systems need to:
For example:
A spam filter learns to identify new types of spam emails.
A self-driving car learns to adjust its driving style based on road conditions and
driver preferences.
A chatbot learns better responses over time by interacting with more users.
3. Types of Learning in AI
a) Supervised Learning
The AI system is given a dataset with inputs and correct outputs (labels).
The goal is to learn the mapping from input to output.
Example: Teaching a system to recognize cats in images by showing many labeled
images of cats and dogs.
b) Unsupervised Learning
The system is only given inputs, without any labels or correct outputs.
It tries to find patterns, structures, or groupings in the data.
Example: Customer segmentation based on shopping behavior.
c) Reinforcement Learning
4. Elements of Learning in AI
To understand how machines learn, we need to know about the key elements involved
in the learning process:
a) Knowledge Representation
How the AI system stores and organizes knowledge.
Examples: Logical rules, decision trees, neural networks, graphs.
b) Generalization
c) Feedback Mechanism
6. Applications of Learning in AI
In the 1950s and 60s, AI researchers tried symbolic learning using rules and logic.
By the 1980s, machine learning algorithms became popular with decision trees
and statistical models.
In the 2000s and 2010s, deep learning using neural networks revolutionized AI,
especially in vision and speech.
Today, AI systems combine learning with reasoning, large datasets, and high
computational power.
In human learning:
In artificial intelligence:
Rote learning is used when the system needs to recall exact matches or past
experiences.
For example:
Feature Description
The input must exactly match a stored case to get the correct
Exact Matching
output.
1. Storage Phase
o When a new input-output pair is observed, it is memorized exactly.
o Example: “If the input is ‘X’, the output is ‘Y’,” then store (X, Y).
2. Recall Phase
o When a query/input is received, the system searches the memory.
o If the exact match is found, the stored output is returned.
3. No Match Handling
o If no exact match is found, the system usually returns nothing or a default
response, because it cannot guess or infer.
5. Example of Rote Learning in AI
What is 2 + 2? 2+2=4
If the user asks exactly “What is AI?”, the bot gives the correct answer.
But if the user says “Define AI” or “Tell me about AI,” it won’t understand—because
those are not exact matches.
❌ Lacks Understanding: The system doesn’t know the meaning behind the data.
❌ No Learning from New Problems: Cannot solve unfamiliar or slightly different
problems.
❌ Memory Overload: Requires large memory to store every input-output pair.
❌ No Flexibility: Works only with exact match inputs—no fuzzy or adaptive
behavior.
8. Applications of Rote Learning
In AI, generalization is more powerful and preferred in most cases, but rote learning still
plays a role where exact memory recall is needed.
In Human Learning:
Humans often learn by consulting experts or peers. For example, a student may
learn a complex subject better by seeking advice from a professor or a peer who
has mastered it.
In AI Systems:
AI systems can incorporate advice-based learning by integrating expert
knowledge into their algorithms. For instance, if an AI system encounters a
problem, it can consult a database of expert solutions or rules and apply those
suggestions to make more informed decisions.
Advantages:
o It helps in acquiring knowledge that is otherwise too complex to derive
independently.
o Facilitates faster learning by utilizing external expertise.
Problem-solving is a key domain where learning plays an essential role. AI systems use
various strategies to solve problems by improving their knowledge base or search
process.
Inductive Inference:
Inductive learning works by generalizing from specific instances. For example,
given a series of positive and negative examples of fruits (like apples and
oranges), the system will generalize rules about fruit characteristics (color, shape,
texture) to predict whether an unknown fruit is an apple or orange.
Applications in AI:
o Decision Trees: These models use induction to make decisions based on
historical data.
o Naive Bayes Classifiers: Inductive learning is used to predict the likelihood
of outcomes based on previous data.
Advantages:
o It enables AI systems to handle vast amounts of data and learn general
principles.
o Applicable in various domains, including image recognition, medical
diagnosis, and language processing.
Expert systems are computer programs designed to mimic the decision-making abilities
of a human expert in a specific domain. They use knowledge bases and inference
engines to provide solutions to complex problems.
Knowledge Representation:
o Rules: "If-Then" rules are often used to express domain knowledge in
expert systems.
o Frames: These are structures that represent stereotypical knowledge
about objects or situations.
o Semantic Networks: A network of concepts connected by relationships,
typically used to represent structured knowledge.
Advantages of Domain-Specific Knowledge:
o It enables the system to provide accurate, relevant advice based on expert
insights.
o Reduces the need for generalized knowledge, making the system more
efficient in specific contexts.
An expert system shell is a software framework that provides the basic functions
required to build an expert system. It typically includes a knowledge base, inference
engine, and user interface, allowing the developer to focus on creating the domain-
specific rules and knowledge.
Expert system shells are particularly useful for non-experts in AI development, as they
abstract much of the complexity involved in building an expert system.
LISP (List Processing) is one of the oldest and most popular programming languages for
AI development. It provides powerful capabilities for handling symbolic data and is often
used in building expert systems and other AI applications.
LISP Features:
o Symbolic Computation: LISP excels at symbolic data manipulation, making
it ideal for AI tasks like knowledge representation.
o Recursive Functions: LISP supports recursion, which is useful for many AI
algorithms.
o Dynamic Typing: Allows for more flexible development, particularly in AI
research.
Other AI Languages:
o Prolog: A logic programming language used primarily for expert systems
and natural language processing.
o Python: Widely used for machine learning and AI due to its simplicity and
libraries like TensorFlow and PyTorch.