THEORY FILE - Artificial Intelligence (Sem-6th) !!
THEORY FILE - Artificial Intelligence (Sem-6th) !!
ER
MAINTAINED BY: TEACHER’S /MAM’:
Sahil Kumar Prof.
D
UNIVERSITY ROLL NO: 2200315
O
C
U
PT
@
Program BCA ➖➖
Course Name
Semester
➖ 6th.
Artificial Intelligence (Theory).
UNIT ➖01
● # Introduction-What is intelligence? Foundations of artificial intelligence (AI).
History of AI. AI problems: Toy Problems, Real World problems- Tic-Tac-Toe, Water
➖
Jug, Question-Answering, 8-puzzle, 8-Queens problem. Formulating problems,
Searching for Solutions .
ER
1. What is Intelligence ➖?
Intelligence refers to the ability to learn, understand, and apply knowledge to solve problems, adapt to new
D
situations, and perform complex tasks. It is commonly associated with humans and animals but can also be
demonstrated by machines.
Types of Intelligence
O
● Natural Intelligence: Exhibited by humans and animals. It involves reasoning, problem-solving, learning,
and decision-making.
C
● Artificial Intelligence (AI): The simulation of human intelligence in machines, enabling them to perform
tasks such as learning, reasoning, problem-solving, and understanding language.
➖
U
1. Mathematics
2. Computer Science
3. Logic
● AI is inspired by the human brain, leading to the development of artificial neural networks (ANNs).
3. History of AI ➖
Early AI (1940s – 1950s)
ER
● 1943: Warren McCulloch and Walter Pitts developed the first artificial neuron model.
● 1950: Alan Turing proposed the Turing Test to evaluate machine intelligence.
● 1956: John McCarthy coined the term Artificial Intelligence at the Dartmouth Conference.
D
● 1958: McCarthy developed LISP, the first AI programming language.
● 1965: Joseph Weizenbaum developed ELIZA, an early chatbot.
● 1970s: AI faced the "AI Winter", a period of reduced funding due to high expectations and slow progress.
finance.
● 2016: Google’s AlphaGo defeated a human Go champion.
PT
Toy problems are simplified AI problems used for research and education. They have clear rules, defined
states, and limited complexity.
● Tic-Tac-Toe
● Water Jug Problem
● 8-Puzzle Problem
● 8-Queens Problem
● Question-Answering Systems
3
2. Real-World Problems
Real-world problems are complex and require AI to handle large amounts of data, uncertainty, and real-time
processing.
5. Examples of AI Problems ➖
ER
1. Tic-Tac-Toe
D
● Used to teach game theory and decision-making in AI.
4. 8-Puzzle Problem
PT
● A 3x3 sliding puzzle with one empty space where tiles need to be arranged in order.
● Solved using A Search Algorithm* (heuristic-based).
5. 8-Queens Problem
● The goal is to place 8 queens on an 8x8 chessboard such that no two queens attack each other.
@
6. Formulating AI Problems ➖
To solve AI problems, they must be well-defined using the following components:
1. Initial State
● The starting point of the problem (e.g., the initial configuration of a chessboard).
4
2. Actions
3. Transition Model
● Describes how actions change the state (e.g., moving left in an 8-puzzle).
4. Goal State
● The desired outcome of the problem (e.g., winning the game, arranging a puzzle).
5. Path Cost
ER
● The cost associated with reaching a goal state (e.g., shortest path in navigation).
D
AI search algorithms explore possible solutions to a problem by systematically navigating through a problem
space.
3. Adversarial Search
@
Conclusion
Artificial Intelligence is a rapidly evolving field with strong foundations in mathematics, logic, and computer science. The
history of AI has seen many breakthroughs, from early rule-based systems to modern machine learning and deep
learning. AI problems range from simple toy problems like tic-tac-toe to complex real-world applications like
autonomous vehicles and medical diagnosis. By formulating AI problems correctly and applying efficient search
algorithms, AI can optimize decision-making, automate tasks, and enhance human capabilities in various fields.
5
● # Knowledge Representation: Propositional Logic, Propositional Theorem
Proving-Inference and Proofs, Proof by Resolution, Horn Clauses and definite
➖
Clauses, Forward and Backward chaining; First order Logic, Inference in First
Order Logic.
KR uses different logic-based and rule-based approaches to represent information about the world,
ER
allowing AI to perform inference and derive conclusions.
D
What is Propositional Logic?
Propositional Logic (PL) is a formal system in AI that represents facts and relationships in the form of
statements (propositions).
O
● A proposition is a declarative statement that is either true (T) or false (F) but not both.
● It does not consider the internal structure of statements but only the truth values.
C
Syntax of Propositional Logic
U
1. Atomic Propositions (P, Q, R, ...) – Simple statements (e.g., "It is raining").
2. Logical Operators:
PT
ER
2. Propositional Theorem Proving ➖
D
What is Theorem Proving?
Theorem proving is a method used in AI to infer conclusions from given facts and logical
statements.
O
● Uses deductive reasoning to derive new truths.
● A theorem prover checks whether a given statement logically follows from a set of axioms
C
(known truths).
Inference is the process of deriving new facts from existing facts and rules using logical reasoning.
PT
● Example:
○ If "It rains (R) → The ground is wet (W)" is true, and "It is raining (R)" is true, then
@
2. Modus Tollens
● Example:
○ If "If the alarm is ringing (A) → There is a fire (F)" is true, and "There is no fire (¬F)" is
true, then "The alarm is not ringing (¬A)" must also be true.
3. Proof by Resolution ➖ 7
Resolution is a powerful inference rule used in automated theorem proving and logic programming.
Given:
ER
1. P ∨ Q
2. ¬P ∨ R
3. ¬Q ∨ ¬R
Using resolution:
D
● Resolve (P ∨ Q) with (¬P ∨ R): Q ∨ R
● Resolve Q ∨ R with (¬Q ∨ ¬R): ⊥ (Contradiction, so proven true)
O
4. Horn Clauses and Definite Clauses ➖
C
Horn Clause
U
Example:
PT
Definite Clause
Example:
Horn Clauses and Definite Clauses are widely used in logic programming and Prolog.
5. Forward and Backward Chaining ➖ 8
● Starts with known facts and applies rules to infer new facts.
● Continues until the goal is reached.
Example:
● Given:
1. If Raining (R) → Then Wet ground (W)
2. R is true
● Inference: Since R → W and R is true, W must also be true.
ER
2. Backward Chaining (Goal-Driven Reasoning)
● Starts with a goal and works backwards to check if known facts support the goal.
● Useful in Expert Systems and AI Planning.
Example:
D
● Goal: Prove that the ground is wet (W).
● Given Rules:
1. R → W
O
2. R is true.
● Since R is true, W must be true.
C
➖
U
1. Unification
2. Resolution in FOL
● Converts statements into clausal form and applies resolution for inference.
ER
3. Forward and Backward Chaining in FOL
D
Conclusion O
Knowledge Representation in AI relies on logical formalisms like Propositional Logic (PL) and
First-Order Logic (FOL). Theorem proving methods like resolution, forward chaining, and
backward chaining enable AI systems to reason efficiently. AI applications such as Expert Systems,
C
Knowledge-Based Systems, and Natural Language Processing (NLP) depend on these logic-based
techniques to infer conclusions and solve problems.
U
UNIT ➖ 02
➖
● # Uncertain Knowledge and Reasoning: Basic probability, Bayes rule, Belief
networks, Default reasoning, Fuzzy sets and fuzzy logic.
ER
true or false. However, in real-life scenarios, AI systems must handle uncertainty and make
probabilistic inferences.
To deal with uncertainty, AI uses various techniques like Probability Theory, Bayesian Networks,
Default Reasoning, and Fuzzy Logic.
1. Basic Probability in AI ➖
D
O
1.1 Probability Basics
Probability provides a mathematical framework for modeling uncertainty. It represents the likelihood
C
of an event occurring.
● Prior Probability P(A) → The probability of event A occurring before any new evidence is
considered.
● Conditional Probability P(A | B) → The probability of A occurring given that B has already
occurred.
● Joint Probability P(A ∩ B): The probability that both A and B occur together.
● Marginal Probability P(A): The probability of A, ignoring any other variable.
For a set of mutually exclusive events {B1, B2, ..., Bn} that cover all possibilities:
11
P(A)=∑P(A∣Bi)P(Bi)P(A) = \sum P(A | Bi) P(Bi)P(A)=∑P(A∣Bi)P(Bi)
2. Bayes’ Rule in AI ➖
Bayes’ Theorem is used to update probabilities based on new evidence. It is a foundational concept
in probabilistic reasoning.
Where:
ER
● P(B | A): Likelihood → Probability of B given that A is true.
● P(A): Prior probability → Probability of A before observing B.
● P(B): Marginal probability → Total probability of B occurring.
D
● A doctor wants to diagnose a disease (D) based on a test result (T).
● Let’s say:
○ P(D) = 0.01 (1% of people have the disease).
O
○ P(T | D) = 0.95 (Test is positive if a person has the disease).
○ P(T | ¬D) = 0.05 (Test is false positive for 5% of healthy people).
○ P(T) = (P(T | D) * P(D)) + (P(T | ¬D) * P(¬D))
C
Using Bayes’ rule:
A Bayesian Belief Network (BBN) is a graphical model that represents probabilistic dependencies
among variables.
● Nodes represent random variables (e.g., "Rain", "Traffic", "Late for work").
● Edges represent dependencies between variables.
ER
Using Bayesian Networks, AI can predict the likelihood of being late given weather conditions.
4. Default Reasoning ➖
D
In real life, we often make decisions based on common-sense assumptions even with incomplete
information.
Default reasoning is useful in Expert Systems, Robotics, and Decision Support Systems.
➖
@
However, in real life, decisions are often not absolute but rather partial (e.g., "Tall person", "Hot
weather").
● Fuzzy Logic allows partial truths, where variables have a degree of membership between 0
and 1.
13
● Used for approximate reasoning in uncertain environments.
Example:
ER
5.3 Fuzzy Logic Operators
D
O
Fuzzy logic modifies classical logic operators:
➖
@
Conclusion
Handling uncertainty in AI is crucial for real-world decision-making. AI systems use:
These techniques power AI applications in Robotics, Medical Diagnosis, Weather Forecasting, and
Machine Learning!
14
➖
● # Structured Knowledge: Associative Networks, Frame Structures,
Conceptual Dependencies and Scripts.
ER
2. Frame Structures
3. Conceptual Dependencies
4. Scripts
➖
D
1. Associative Networks O
1.1 What is an Associative Network?
Associative networks store meaningful relationships between concepts, making them useful in
Natural Language Processing (NLP), Expert Systems, and AI-based Knowledge Graphs.
● Dog is a Mammal
● Mammals breathe air
● Dogs bark
@
scss
[Mammal]
[Dog] → (barks)
(breathes air)
15
1.3 Types of Relationships in Associative Networks
ER
● Machine Translation (e.g., Google Translate)
2. Frame Structures
D
2.1 What is a Frame?
Frames support:
3. Conceptual Dependencies ➖
3.1 What is Conceptual Dependency?
Conceptual Dependency (CD) is a knowledge representation model that captures the meaning of
ER
natural language sentences using a set of primitive concepts.
● It reduces language ambiguity by using a common representation for sentences with the
same meaning.
● It was developed by Roger Schank (1973) for Natural Language Processing (NLP) and
AI-based reasoning.
D
3.2 Basic Conceptual Dependency Notation
scss
CopyEdit
@
ER
● Entry Conditions → Preconditions before an event.
● Roles → Participants in the script.
● Props → Objects involved.
● Scenes → Steps in the process.
● Results → Expected outcomes.
D
4.3 Example of a Restaurant Script
O
C
U
PT
If AI understands the script, it can fill in missing details and make better predictions.
@
ER
Conclusion
Structured knowledge representation techniques help AI understand and reason about the world.
Each technique has its advantages:
D
2. Frames → Object-based knowledge representation with default values.
3. Conceptual Dependencies → Language-independent understanding of meaning.
4. Scripts → Representing sequences of events for context-aware reasoning.
O
These techniques are widely used in AI applications like NLP, Expert Systems, Chatbots, Robotics,
and Knowledge Graphs, improving AI’s ability to learn, reason, and interact with the world.
C
➖ SAHIL RAUNIYAR & PTUCODER !! 😀
U
HAPPY ENDING BY
PT
@
19
UNIT ➖ 03
● # Uninformed Search strategies- Breadth-first search, Uniform-cost search,
➖
Depth-first search, Depth-limited search, Iterative deepening depth-first search,
Bidirectional search, Comparing uninformed search strategies.
ER
1. Introduction to Uninformed Search
Uninformed search strategies (also called blind search strategies) are general-purpose search
methods that explore a problem space without any additional knowledge about the goal state other
than the problem definition. These strategies systematically explore the search space without using
heuristics.
D
Uninformed search algorithms include:
2.1 Concept
Breadth-First Search (BFS) is a tree-based or graph-based search strategy that explores all the
nodes at one depth level before moving to the next level.
@
1. Start from the root node (initial state) and add it to a queue.
2. Expand the first node (FIFO order) and generate its children.
3. Enqueue all the children into the queue.
4. Repeat the process until the goal state is found or the queue is empty.
20
2.3 Example
mathematica
/ \
B C
/ \ \
D E F
ER
● BFS explores: A → B → C → D → E → F (level-wise).
2.4 Properties
D
O
C
U
3.1 Concept
Uniform-Cost Search (UCS) is a variation of BFS that considers path cost. Instead of exploring
nodes in order of depth, UCS expands the node with the lowest path cost (g(n)) first.
@
scss
/ \
(4) (2)
B ----- C
ER
(3)
3.4 Properties
D
O
C
U
4.1 Concept
Depth-First Search (DFS) explores as far deep as possible along a branch before backtracking.
mathematica
/ \
B C
/ \ \
D E F
ER
● DFS explores: A → B → D → E → C → F.
4.4 Properties
D
O
C
U
PT
DLS is a modified DFS that limits depth exploration to a predefined depth (L) to avoid infinite loops.
1. Perform DFS but terminate when the depth limit L is reached.
2. If the goal is found before L, return success; otherwise, fail.
23
5.3 Example
mathematica
/ \
B C
/ \ \
ER
D E F
5.4 Properties
D
O
C
U
6.1 Concept
IDDFS combines BFS and DFS by running DFS multiple times with increasing depth limits.
@
6.3 Example
● DLS(0)
● DLS(1)
● DLS(2)
● DLS(3) → Goal Found
24
6.4 Properties
ER
7. Bidirectional Search ➖
7.1 Concept
D
Bidirectional Search runs two searches simultaneously:
7.3 Example
css
PT
A → B → C → D (Goal)
← ← ← ←
7.4 Properties
25
ER
Conclusion ➖
D
Uninformed search strategies explore the search space without heuristics. Each has advantages:
➖
Genetic Algorithm, Greedy best-first search, A* and optimal search, Memory
bounded heuristic search.
ER
Heuristic search algorithms include:
D
5. A Search and Optimal Search*
6. Memory-Bounded Heuristic Search
O
2. Hill Climbing Algorithm ➖
C
2.1 Concept
Hill Climbing is a local search algorithm that starts from an initial state and moves towards
U
higher-valued states (states with better heuristic values). It is similar to climbing a hill, always taking
steps in the direction of increasing evaluation values.
PT
2.3 Example
Peak
(6)
/ \
(3) (5)
Hill climbing moves from 3 → 6 but may stop at 6 (local maximum) instead of the peak.
27
2.4 Problems with Hill Climbing
1. Local Maxima - The algorithm may stop at a local peak instead of the global peak.
2. Plateau - A flat region with no change in heuristic value may cause the algorithm to get stuck.
3. Ridges - A narrow region where a greedy approach fails.
1. Steepest-Ascent Hill Climbing - Considers all neighbors and picks the best.
2. Stochastic Hill Climbing - Chooses randomly among better neighbors.
3. First-Choice Hill Climbing - Evaluates neighbors randomly and moves to the first improvement.
ER
3. Simulated Annealing
3.1 Concept
Simulated Annealing (SA) is a probabilistic search algorithm that avoids getting stuck in local maxima
by allowing occasional bad moves. It is inspired by metallurgy annealing, where materials are
D
heated and cooled to reach a stable state.
➖
@
4.1 Concept
Genetic Algorithms (GA) use biological evolution principles (mutation, crossover, selection) to find
optimal solutions. It maintains a population of solutions and evolves them over generations.
4.4 Advantages of GA
ER
✅ Good for NP-hard problems
D
O
Greedy Best-First Search (GBFS) selects the most promising node based on the heuristic function
h(n) and expands it first.
C
5.2 Algorithm Steps
5.3 Example
A(6)
@
/ \
B(4) C(2)
/ \
ER
where:
D
6.2 Algorithm Steps O
1. Initialize a priority queue with the start node.
2. Expand the node with the lowest f(n).
3. If the goal is reached, return success.
4. Otherwise, add the node’s children to the queue.
C
5. Repeat until a solution is found.
6.3 Example
U
/ \
(2) (4)
@
B C
| |
(3) (2)
D E (Goal)
➖ ✅ Complete
✅ Optimal (if h(n) is admissible and consistent)
6.4 Properties
A* requires high memory. Memory-bounded heuristic search addresses this issue by limiting memory
usage.
ER
7.3 Benefits
➖
D
8. Comparing Heuristic Search Strategies
O
C
U
PT
9. Conclusion ➖
Informed search strategies use heuristics to guide the search, making them more efficient than
uninformed search methods. Among them:
@
UNIT ➖ 04
● # Natural language processing: Grammars, Parsing. ➖
Natural Language Processing (NLP): Grammars and Parsing ➖
1. Introduction to Natural Language Processing (NLP) ➖
Natural Language Processing (NLP) is a subfield of Artificial Intelligence (AI) that focuses on enabling
ER
machines to understand, interpret, and generate human language. It is used in various applications
such as machine translation, speech recognition, sentiment analysis, and chatbot development.
1. Natural Language Understanding (NLU) – Understanding the meaning, structure, and intent of
D
a sentence.
2. Natural Language Generation (NLG) – Generating human-like text based on structured data.
A key challenge in NLP is dealing with the ambiguity, variability, and complexity of human
O
language, which requires a well-defined set of grammars and parsing techniques to process and
analyze text efficiently.
C
2. Grammars in NLP ➖
U
A grammar is a set of rules that defines how words and phrases are structured in a language. It
provides the framework for syntax analysis, which helps machines understand the structure of
PT
sentences.
1. Phrase Structure Grammar (PSG) – Represents sentences using hierarchical structures.
2. Dependency Grammar (DG) – Focuses on relationships between words rather than phrase
@
structures.
3. Context-Free Grammar (CFG) – Uses production rules to define how symbols can be replaced.
A Context-Free Grammar (CFG) is widely used in NLP for parsing sentences. It consists of:
mathematica
S → NP VP
NP → Det N
VP → V NP
N → "cat" | "dog"
ER
V → "chased" | "saw"
A valid sentence:
"The cat chased a dog"
D
Instead of phrase structures, Dependency Grammar (DG) represents sentences as directed trees,
where words (nodes) are connected by grammatical relationships (edges).
Example:
O
Sentence: "The cat chased the mouse."
C
Dependency Structure: (bash)
chased
U
├── cat
PT
│ └── The
└── mouse
└── The
@
3. Parsing in NLP ➖
Parsing is the process of analyzing a sentence based on grammar rules to extract meaning and
structure. It is a fundamental step in syntactic analysis, which helps machines understand language by
breaking sentences into their components.
4. Parsing Techniques ➖
4.1 Top-Down Parsing
Top-down parsing begins with the start symbol and applies production rules recursively to derive the
sentence.
ER
Recursive descent parsing is a top-down parsing method that recursively expands non-terminals
until the input is matched.
Example Grammar:
mathematica
D
CopyEdit
S → NP VP
O
NP → Det N
C
VP → V NP
U
Steps:
PT
1. S → NP VP
2. NP → Det N → (The cat)
3. VP → V NP → (saw a dog)
Bottom-up parsing starts with the words and builds up the structure until it reaches the start symbol.
bash
ER
❌ Requires backtracking in ambiguous cases
4.3 Chart Parsing (Dynamic Programming Approach)
D
Chart parsing uses dynamic programming to store intermediate parsing results, preventing redundant
computations.
O
CYK Algorithm (Cocke-Younger-Kasami Algorithm)
The CYK algorithm is a bottom-up parser for context-free grammars in Chomsky Normal Form
C
(CNF).
Example:
U
mathematica
S → NP VP
PT
NP → Det N
VP → V NP
N → "cat" | "dog"
V → "chased"
For the sentence "The cat chased a dog", CYK builds a table and determines if it matches the
grammar.
ER
1. Syntax Checking – Used in compilers and spell checkers.
2. Machine Translation – Helps in language conversion.
3. Speech Recognition – Transforms spoken words into structured sentences.
4. Chatbots & Virtual Assistants – Analyzes user queries for meaningful responses.
5. Text-to-Speech Systems – Converts structured text into natural speech.
D
7. Conclusion
O
Grammars and parsing are essential components of NLP that help machines understand and process
C
human language. Context-Free Grammars (CFGs) and Dependency Grammars (DGs) define
sentence structures, while parsing techniques like Recursive Descent, Shift-Reduce, and CYK
Parsing analyze them. These methods are widely used in speech recognition, machine translation,
U
➖
Classification, Syntactic Classification; Learning Classification Patterns,
Recognizing and Understanding Speech.
ER
1.1 What is Pattern Recognition?
Pattern Recognition is the process of identifying and categorizing input data based on predefined
patterns. It involves detecting similarities, regularities, and structures within data.
Example Applications:
D
● Face Recognition – Identifying individuals based on facial features.
● Speech Recognition – Converting spoken words into text.
● Handwriting Recognition – Converting handwritten text into digital text.
●
O
Medical Diagnosis – Detecting diseases based on medical images.
➖
C
2. Recognition and Classification Process
Pattern recognition systems follow a systematic process for recognizing and classifying patterns. The
U
1. Data Collection – Gathering raw data from various sources (e.g., images, speech, text).
2. Preprocessing – Removing noise and normalizing the data.
3. Feature Extraction – Identifying key features that represent the data.
4. Classification – Assigning the data to predefined categories.
5. Post-processing – Refining the classification and improving accuracy.
@
Each stage plays a crucial role in ensuring accurate recognition and classification.
Bayesian Decision Theory calculates the probability of a pattern belonging to a class and makes
decisions based on maximum likelihood estimation (MLE) or maximum a posteriori estimation
(MAP).
Bayes’ Rule:
Where:
● P(Ci∣X)P(C_i | X)P(Ci∣X) = Probability that class CiC_iCiis correct given data XXX.
● P(X∣Ci)P(X | C_i)P(X∣Ci) = Likelihood of data XXX given class CiC_iCi.
ER
● P(Ci)P(C_i)P(Ci) = Prior probability of class CiC_iCi.
● P(X)P(X)P(X) = Probability of data XXX.
D
P(Ci∣X)>P(Cj∣X)∀j≠iP(C_i | X) > P(C_j | X) \quad \forall j \neq iP(Ci∣X)>P(Cj∣X)∀j=i
mathematica
S → / \ (Diagonal lines)
S → — (Horizontal line)
ER
5.1 Supervised Learning
D
5.2 Unsupervised Learning
application of Pattern Recognition that involves converting spoken language into text.
Coefficients (MFCCs)).
3. Pattern Matching – Comparing input with stored patterns.
4. Language Modeling – Using grammar rules to refine recognition.
39
6.3 Challenges in Speech Recognition
ER
7. Conclusion
Pattern Recognition is essential for AI-driven applications, enabling machines to classify, analyze,
and interpret data efficiently.
D
● Decision Theoretic Classification uses probability-based models like Bayesian classifiers.
● Syntactic Classification relies on grammatical structures for recognition.
● Learning Classification Patterns involves supervised, unsupervised, and reinforcement
learning techniques.
O
● Speech Recognition applies these principles to convert spoken words into text.
The advancements in Machine Learning and Deep Learning continue to improve accuracy and
C
efficiency in pattern recognition applications like speech recognition, image analysis, and medical
diagnosis.
U
PT
@
40
● # Expert System Architectures: Characteristics, Rule-Based System
➖
Architectures, Nonproduction System Architectures, Knowledge Acquisition
and Validation.
ER
1.1 Characteristics of Expert Systems
D
✅ Decision Making – Provides solutions even with incomplete data.
✅ Explainability – Justifies its decisions with reasoning.
✅ Self-Learning – Some systems can update their knowledge over time.
O
1.2 Applications of Expert Systems
C
● Medical Diagnosis – MYCIN (for bacterial infections).
● Engineering Design – XCON (configuring computer systems).
● Business and Finance – Loan approval, fraud detection.
U
➖
PT
ER
D ➖
3. Nonproduction System Architectures
O
Unlike rule-based systems that rely on IF-THEN rules, nonproduction expert systems use alternative
C
approaches such as neural networks, case-based reasoning, and fuzzy logic.
Knowledge acquisition is the process of collecting, organizing, and storing expert knowledge into the
system.
ER
● Machine Learning Approaches – Automatically learning from data patterns.
D
● Rule Testing – Checking if rules lead to correct conclusions.
● Simulation & Case Studies – Running the system on real-world problems.
●
●
O
Expert Review – Asking domain experts to verify the system’s decisions.
Comparison with Human Experts – Measuring the system's performance against human
specialists.
C
5. Conclusion ➖
U
Expert systems are AI-driven problem-solving tools that use structured knowledge and inference
mechanisms. Rule-based architectures rely on IF-THEN statements, while nonproduction
architectures use methods like neural networks and fuzzy logic. Knowledge acquisition and
PT
With advancements in machine learning and deep learning, modern expert systems are becoming
more accurate, adaptable, and capable of handling complex, real-world problems.
@
1. Write briefly : ➖
ER
a. Define intelligence. What is the intelligent behaviour of a machine? Discuss various levels of artificial
intelligence.
b. Discuss the history of artificial intelligence briefly.
c. What is Bayesian reasoning? How does an expert system rank potentially true hypotheses? Give an
example.
D
d. What are a fuzzy set and a Membership function? What is the difference between a crisp set and a
fuzzy set? Determine possible fuzzy sets on the universe of discourse for man weights.
e. Write down the steps of breadth first search. Illustrate with examples.
O
f. Explain the process of memory bounded heuristic search.
g. Discuss the advantages of using context-free grammars in design of practical natural language
parsers.
C
h. Give a heuristic that a block-stacking program might use to solve problems of the form “stack block X
on block Y”.
U
i. What is an expert system shell? What are the fundamental characteristics of an expert system?
j. What is pattern recognition? Discuss its applications.
PT
ANSWERS
Intelligence refers to the ability to acquire knowledge, apply reasoning, adapt to new situations, learn
from experiences, solve problems, and understand complex ideas. It is often divided into various forms
such as logical reasoning, creativity, and problem-solving abilities.
Intelligent Behavior of a Machine: Intelligent behavior in a machine refers to the ability of the machine
to perform tasks that require human-like cognitive functions. These tasks include reasoning, learning,
perception, problem-solving, understanding natural language, and even emotional responses in some
cases.
1. 1950s-1960s: The term "Artificial Intelligence" was coined by John McCarthy in 1956. Early
ER
pioneers like Alan Turing developed foundational theories, including the Turing Test for machine
intelligence.
2. 1960s-1970s: Early AI research focused on solving mathematical problems, learning, and
reasoning, with systems such as the General Problem Solver (GPS) and ELIZA (a natural
language processing program).
3. 1980s: Expert systems became popular in commercial applications, marking a period of success
D
for rule-based reasoning and symbolic AI.
4. 1990s: Machine learning techniques gained prominence, with advances in statistical methods
and neural networks.
O
5. 2000s-present: The rise of deep learning, large datasets, and powerful computing led to
significant breakthroughs in computer vision, natural language processing, and autonomous
systems.
C
U
c. What is Bayesian Reasoning? How Does an Expert System Rank Potentially True
Hypotheses? Give an Example.
Bayesian Reasoning is a statistical method based on Bayes' Theorem, which describes how to update
PT
the probability of a hypothesis based on new evidence. It is used to make decisions under uncertainty.
In an Expert System, Bayesian reasoning helps rank hypotheses based on their likelihood. The system
assigns probabilities to various hypotheses and updates them as new information is provided.
Example: Suppose an expert system is diagnosing a disease. It might have hypotheses like:
@
If the system receives evidence like fever (which is more likely for flu), it will update the probability of Flu
being true, while decreasing the probability of Cold.
d. What are a Fuzzy Set and a Membership Function? What is the Difference Between a
Crisp Set and a Fuzzy Set? Determine Possible Fuzzy Sets on the Universe of Discourse
for Man Weights.
45
Fuzzy Set: A fuzzy set is a set in which elements have degrees of membership between 0 and 1. Unlike
traditional sets (crisp sets), where an element is either in or out of the set, in fuzzy sets, an element can
partially belong to the set.
Membership Function: A membership function is used to define the degree to which an element
belongs to a fuzzy set. It assigns a value between 0 and 1 for each element.
● A Crisp Set has binary membership: an element either belongs or does not belong to the set.
● A Fuzzy Set allows partial membership, where elements can belong to a set to varying degrees.
Example of Fuzzy Sets for Man Weights: Let’s say the universe of discourse for man weights is from
40kg to 120kg. The fuzzy sets might be:
ER
● Lightweight: Membership function could be μ(weight) = (120 - weight)/80, for weights from 40kg
to 120kg.
● Heavyweight: Membership function could be μ(weight) = (weight - 40)/80, for weights from 40kg
to 120kg.
D
e. Write Down the Steps of Breadth First Search. Illustrate with Example.
O
Breadth-First Search (BFS) is an algorithm used for traversing or searching tree or graph data
structures.
C
Steps:
○ Dequeue a node.
○ Visit and process the node.
○ Enqueue all unvisited adjacent nodes.
PT
Example:
For a graph with nodes A, B, C, D, E:
mathematica
@
A
/ \
B C
| |
D E
46
● Start at node A, enqueue B and C.
● Visit A, then dequeue B and C, enqueue D and E.
● Visit B, then C, then D, then E.
Memory-bounded heuristic search algorithms are designed to find a solution within a limited amount of
memory. These algorithms discard less promising paths or use memory more efficiently.
Steps:
1. Limited Memory: The algorithm only stores a subset of all possible states, prioritizing those that
ER
seem most promising.
2. Heuristic Function: A heuristic guides the search towards likely solutions, based on available
knowledge.
3. Backtracking or Pruning: Memory-bound methods often prune or backtrack when memory
limitations are reached, focusing on critical areas of the search space.
D
g. Discuss the Advantages of Using Context-Free Grammars in the Design of Practical
Natural Language Parsers.
O
Advantages of Context-Free Grammars (CFG) in NLP Parsing:
C
1. Simplicity: CFG provides a clear and simple way to define the structure of sentences in a
language.
2. Generative Power: CFG can generate a wide variety of syntactically correct sentences.
U
3. Efficiency: Many natural language parsers use CFG-based algorithms, which can be efficiently
implemented and allow for parsing in polynomial time.
4. Language Independence: CFGs can be used for a variety of languages with relatively little
PT
modification.
h. Give a Heuristic that a Block-Stacking Program Might Use to Solve Problems of the
Form “Stack Block X on Block Y.”
@
For example:
● If Block Y is already clear and on top of the stack, only Block X needs to be moved.
● If Block Y is blocked, the program needs to consider clearing it by moving other blocks first.
47
i. What is an Expert System Shell? What are the Fundamental Characteristics of an
Expert System?
Expert System Shell: An expert system shell is a software framework that provides the basic
components for creating expert systems. It includes a knowledge base, inference engine, and user
interface, allowing users to build expert systems without having to program every part.
1. Knowledge Base: Contains facts and rules about the domain of expertise.
2. Inference Engine: Applies logical reasoning to the knowledge base to draw conclusions.
3. User Interface: Allows users to interact with the system and input data.
4. Explanation Facility: Explains how the system arrived at its conclusions.
ER
5. Knowledge Acquisition: Mechanisms for acquiring new knowledge to update the system.
Pattern Recognition is the process of identifying patterns, trends, or regularities in data. It involves
D
classifying input data into predefined categories based on certain features.
Applications:
1.
O
Image and Speech Recognition: Recognizing faces, handwriting, or spoken words.
2. Medical Diagnosis: Identifying diseases based on symptoms or medical images.
3. Financial Fraud Detection: Detecting abnormal transactions that may indicate fraud.
C
4. Autonomous Vehicles: Recognizing road signs, pedestrians, and other vehicles.
U
PT
@
48
SECTION–B
2. What are the different approaches in defining artificial intelligence? What characteristics must a
problem possess to be solved using artificial intelligence? Write a description of the 8-queens problem.
3. Discuss the syntax and semantics of propositional logic. List the rules of inference for propositional
logic. Consider the following facts and construct a step-by-step proof by resolution of the statement
“John likes peanuts”.
a. John likes all kinds of food.
b. Apple and vegetables are foods.
c. Anything anyone eats and is not killed by is food.
d. Anil eats peanuts and is still alive.
ER
e. Harry eats everything that Anil eats.
4. How are objects related in frame-based systems? What are the ‘a-kind-of’ and ‘a-part-of’
relationships? Give examples.
5. Differentiate between informed search and uninformed search. Explain depth first search technique
D
with examples. Discuss the performance of this technique.
6. Explain the architecture of an expert system. What are rule based system architecture and on
production system architecture?
O
7. Write about the various tasks in natural language processing in detail. What are the main difficulties in
natural language understanding?
C
➖
U
Approaches in Defining AI: Artificial Intelligence has been defined in multiple ways, reflecting its
PT
various aspects:
● Behavioral Approach: AI is the field of study that seeks to simulate human behavior. A machine
is said to exhibit intelligent behavior if it performs tasks or solves problems that typically require
human intelligence, such as decision-making and problem-solving.
● Functional Approach: AI is defined as any machine that can perform cognitive tasks like
@
● Complexity: The problem is often too complex for traditional algorithms to solve efficiently,
especially if the number of variables or possible states is large.
● Uncertainty: AI can handle problems involving incomplete or uncertain information, unlike
traditional deterministic systems.
● Adaptability: The problem should allow for solutions that can adapt or improve over time with
experience, such as learning from past mistakes.
● Decision-Making: The problem often involves making decisions based on past data, analysis, or
future predictions.
● Search Space: AI can navigate large and complex search spaces, often using heuristics or other
methods to reduce the space and find solutions.
ER
8-Queens Problem: The 8-Queens Problem is a classic problem in artificial intelligence where the goal
is to place eight queens on a chessboard such that no two queens threaten each other. In chess,
queens can move horizontally, vertically, or diagonally, and the challenge is to place them on the board
without any two queens being in the same row, column, or diagonal. The problem can be solved using
search algorithms or constraint satisfaction techniques. The problem becomes more complex as the
D
number of queens increases, and finding an optimal solution involves exploring different configurations
of queen placements.
O
3. Syntax and Semantics of Propositional Logic
C
Syntax of Propositional Logic: The syntax of propositional logic involves the symbols and rules for
constructing valid formulas. These include:
Semantics of Propositional Logic: The semantics define the truth values of propositions:
Rules of Inference: The rules of inference in propositional logic allow one to derive conclusions from
premises. Some important rules include:
ER
By combining all the facts, we can conclude that since peanuts are food, and John likes all foods, John
likes peanuts.
D
In frame-based systems, objects are described using frames, which are data structures that represent
knowledge about objects or concepts. A frame contains slots (attributes) and values that define an
O
object’s properties and relationships. Frames can also have pointers to other frames (objects)
representing more complex concepts.
‘A-kind-of’ Relationship: This relationship defines hierarchical connections, where one object is a
C
subclass of another. For example, a “Dog” is a kind of “Animal.”
‘A-part-of’ Relationship: This relationship defines the part-whole association between objects. For
U
Informed Search: Informed search algorithms use additional knowledge about the problem domain to
guide the search towards the goal more efficiently. An example is A Search*, which uses a heuristic to
estimate the cost from the current state to the goal.
@
Uninformed Search: Uninformed search algorithms, like Breadth-First Search (BFS), do not use any
domain-specific knowledge and explore the search space blindly.
Depth-First Search (DFS): DFS is an uninformed search algorithm that explores as far as possible
along each branch before backtracking. The algorithm follows the path from the start node to the
deepest node and backtracks when it reaches a dead end.
Example: For a graph with nodes A, B, C, D, DFS would explore one branch completely, say A → B →
D, before backtracking.
Performance:
● Time Complexity: O(b^d) where b is the branching factor and d is the depth of the solution.
51
● Space Complexity: O(b * d) for storing the search tree.
1. Knowledge Base: A collection of facts and rules that represent expert knowledge.
2. Inference Engine: Applies logical reasoning to the knowledge base to infer conclusions or make
decisions.
3. User Interface: Facilitates interaction with the user, allowing input and output of data.
4. Explanation Module: Explains the reasoning behind decisions to users.
5. Knowledge Acquisition Module: Allows for the system to learn and update its knowledge base.
ER
Rule-based System Architecture: This architecture relies on if-then rules (production rules) to make
decisions. Each rule has a premise (if part) and a conclusion (then part).
Non-production System Architecture: This type does not rely on rules. Instead, it uses knowledge
representation techniques like frames or semantic networks to represent and reason about knowledge.
D
O
NLP Tasks:
C
● Tokenization: Breaking text into words or sentences.
● Part-of-Speech Tagging: Identifying the grammatical categories of words.
● Named Entity Recognition (NER): Identifying entities such as names, locations, and dates.
U
● Context: Understanding the full meaning requires considering the context of a sentence or
conversation.
● Slang and Variability: Different dialects, slang, or informal language make understanding more
challenging.
1. Write briefly :
ER
a) Name any two problem characteristics.
b) Explain state search space.
c) Represent the following sentence using propositional logic : Every one is loyal to someone.
d) Explain Depth first search.
e) Explain CYC.
D
f) Explain disjunction with example.
g) Define natural language processing.
h) Explain scripts.
O
i) Explain knowledge representation.
j) What is Resolution?
C
ANSWERS
➖
U
1. Search Space: The search space refers to the set of all possible states or configurations that a
PT
problem can have. It represents the environment in which an AI algorithm operates to find a solution.
The search space is explored by search algorithms, and it typically includes all possible moves or
decisions that can be made to solve the problem. The size and structure of the search space heavily
influence the efficiency of the search process.
2. Problem Formulation: Problem formulation refers to how a problem is defined and structured for an
@
AI system to solve. This involves specifying the initial state, the goal state, the set of possible actions,
and the transition model (how one state leads to another). A well-defined problem makes it easier to
apply algorithms like search or optimization techniques to find a solution.
For example, in the 8-puzzle problem, the state space includes all possible configurations of the
puzzle's pieces. The algorithm explores the space to find a sequence of moves that results in the goal
configuration.
➖
c) Represent the Following Sentence Using Propositional Logic: "Everyone is loyal to
someone."
ER
Let the propositional variables be:
The sentence "Everyone is loyal to someone" can be represented in First-Order Logic (a more
expressive form of logic compared to propositional logic):
D
∀x∃y L(x,y)\forall x \exists y \, L(x, y)∀x∃yL(x,y)
This means for every individual x, there exists an individual y such that x is loyal to y.
O
In Propositional Logic, it would be difficult to express this directly, since propositional logic doesn’t
handle quantifiers or individual variables. However, you could use specific constants for individuals,
C
such as:
● L(john, mary), L(susan, john), etc. But this representation would not cover the general form of
the sentence.
U
➖
PT
Depth-First Search (DFS) is a search algorithm that explores as far down a branch as possible before
backtracking. It systematically explores the deepest unexplored nodes first and moves to the next node
only after all descendants of the current node have been visited.
@
Steps of DFS:
1. Start at the root node and push it onto the stack.
2. Pop a node from the stack and explore its unvisited neighbors.
3. Push unvisited neighbors onto the stack.
4. Repeat until the stack is empty or the goal is found.
Advantages:
● DFS is memory efficient because it only needs to store a single path from the root to the current
node.
● It can find a solution quickly if the solution is located deep in the search space.
54
Disadvantages:
● DFS can get stuck in infinite loops if the search space has cycles.
● It may not always find the shortest path or a solution quickly, especially if the solution is at a
shallow depth.
Example:
For a tree:
Mathematica
/ \
ER
B C
/ \
D E
D
Starting from A, DFS might explore A → B → D before backtracking and exploring E, and then move to
C.
O
e) Explain CYC ➖
C
CYC is an AI project developed by Cycorp with the goal of encoding a large body of common-sense
knowledge into a machine-readable form. The system uses a knowledge base to simulate human
reasoning and understanding in areas that require common sense.
U
CYC's key idea is to create a semantic network where entities and their relationships are represented.
It contains millions of assertions (facts) about the world, such as:
PT
The system can answer complex questions and solve problems by reasoning over this vast body of
knowledge. CYC is considered a knowledge-based system that provides a foundation for
commonsense reasoning and is used in many fields like natural language understanding and expert
@
systems.
ER
g) Define Natural Language Processing (NLP) ➖
Natural Language Processing (NLP) is a subfield of artificial intelligence that focuses on the
interaction between computers and human languages. It involves enabling machines to understand,
D
interpret, and generate human language in a way that is both meaningful and useful.
NLP combines linguistics, computer science, and machine learning techniques to process and analyze
large amounts of natural language data.
PT
h) Explain Scripts ➖
In AI, scripts refer to knowledge representations that capture the structure of events or situations. A
script is a structured framework for understanding and predicting typical sequences of events.
@
Scripts are used in natural language understanding and are helpful in understanding actions and events
in context. They are useful for tasks such as machine understanding of stories, event recognition, and
dialogue systems.
56
ER
reasoning.
Effective knowledge representation is essential for building AI systems that can understand and reason
about the world.
D
j) What is Resolution?
Resolution is a rule of inference used in propositional logic and first-order logic for automated
O
theorem proving. It is a refutation-based approach that combines two clauses to derive a new clause.
The basic idea of resolution is to eliminate complementary literals (e.g., P and ¬P) from two clauses,
which produces a new clause that logically follows from the two original clauses.
C
Example: Given two clauses:
U
1. P ∨ Q
2. ¬P ∨ R
● Q ∨ R
2. What is artificial intelligence? Discuss three problems which have been solved by artificial
intelligence.
ER
7. Explain the Morphological, Syntactic & Semantic phase of natural language processing.
ANSWERS ➖
D
2. What is Artificial Intelligence? Discuss Three Problems Solved by Artificial Intelligence
Artificial Intelligence (AI) refers to the branch of computer science that is concerned with creating
O
machines that can perform tasks that typically require human intelligence. These tasks include learning,
reasoning, problem-solving, language understanding, perception, and decision-making. AI systems can
analyze data, recognize patterns, make predictions, and even interact with humans through natural
language processing.
C
Three Problems Solved by Artificial Intelligence:
U
1. Game Playing (e.g., Chess, Go): AI has been successful in solving complex problems in
strategic games. Chess-playing AI, such as IBM's Deep Blue, defeated the world champion
Garry Kasparov in 1997. Later, Google's AlphaGo defeated the world champion in Go, a game
PT
considered far more complex than chess. AI algorithms analyze a vast number of possible moves
and use heuristics to make the most strategic decisions.
2. Medical Diagnosis: AI has significantly contributed to medical fields by assisting in diagnosis
and treatment. IBM Watson for Oncology, for example, can analyze medical data, research
papers, and patient information to recommend personalized cancer treatment plans. AI models
also help in detecting diseases like breast cancer through image recognition techniques.
@
3. Autonomous Vehicles: Self-driving cars are one of the most well-known applications of AI.
Companies like Tesla and Waymo use AI systems to solve the problem of autonomous driving.
These systems rely on sensors, cameras, machine learning algorithms, and real-time
decision-making to navigate roads, avoid obstacles, and follow traffic rules without human
intervention.
A production system is a framework used in AI for problem-solving. It is based on a set of rules and
includes three essential components:
58
● States: Represent the possible configurations of the problem.
● Operators (or Actions): Actions that change the state, moving from one state to another.
● Goal: The desired state that the system aims to reach.
1. Rules (Production Rules): The production system operates by applying rules, typically in the
form of "if-then" statements. For example, "If the light is on, then the switch is closed."
2. State Space: The state space represents all possible states of the problem. The system
searches through the state space to find a path from the initial state to the goal state.
3. Control Strategy: The control strategy determines the order in which rules are applied. It can be:
○ Forward Chaining: Starting from the initial state, the system applies rules to reach the
goal.
ER
○ Backward Chaining: Starting from the goal state, the system works backward to find the
conditions that led to the goal.
4. Inference Mechanism: The inference mechanism is the process of deriving new knowledge or
making decisions based on the production rules and current state. It is used to guide the system
toward the solution.
5. Conflict Resolution: Sometimes multiple rules can be applicable at the same time. The system
D
needs a conflict resolution strategy to decide which rule to apply first, such as choosing the rule
with the highest priority.
O
4. a) Discuss Various Applications of Artificial Intelligence
C
Applications of Artificial Intelligence are diverse and span across many industries. Some important
applications include:
1. Healthcare:
U
2. Finance:
○ AI is widely used for fraud detection, credit scoring, algorithmic trading, and customer
service (through chatbots). AI algorithms analyze financial data to make real-time
decisions and detect suspicious activities.
3. Customer Service:
@
○ Chatbots and virtual assistants like Siri, Alexa, and Google Assistant use AI to provide
customer support. AI can answer questions, handle requests, and assist in
troubleshooting, improving customer experience.
4. Autonomous Vehicles:
○ Self-driving cars use AI to navigate, detect objects, and make decisions. AI systems like
computer vision and machine learning enable vehicles to drive without human
intervention.
5. Natural Language Processing (NLP):
○ AI is used in NLP for tasks such as machine translation, speech recognition, sentiment
analysis, and language generation. Google Translate and speech-to-text technologies are
prominent examples.
6. Manufacturing and Robotics:
59
○ AI is used to optimize production processes, automate tasks, and improve quality control.
Industrial robots powered by AI can assemble products, inspect for defects, and perform
other tasks that would be dangerous or repetitive for humans.
Designing a search problem involves creating an environment that allows an AI system to efficiently
explore possible solutions. Key issues in the design of a search problem include:
ER
a clear structure for the state space (e.g., tree, graph, or matrix).
2. Choice of Search Strategy:
○ Deciding on the search strategy (e.g., breadth-first search, depth-first search, A* search).
The strategy determines how the system explores the state space. Different strategies
have different strengths in terms of memory use, time complexity, and completeness.
3. Search Space Size:
D
○ The size of the search space can be enormous. One challenge is to reduce the size of the
search space through pruning or using heuristics, especially in problems with a large
number of possible states, like in chess or the traveling salesman problem.
4. Heuristics:
O
○ A well-designed heuristic can dramatically improve search efficiency by guiding the search
towards promising areas of the search space. It is important to define a good heuristic that
C
approximates the distance to the goal state.
5. Time and Space Complexity:
○ The search algorithm must balance between time efficiency (speed of finding a solution)
U
and space efficiency (memory usage). Some algorithms can be very time-efficient but use
a lot of memory, while others may be more space-efficient but slower.
6. Handling Incompleteness or Uncertainty:
PT
○ Some problems involve uncertainty, such as when the state space is not fully observable,
or the actions do not always lead to predictable results. Designing a search problem to
handle uncertainty or incomplete information (e.g., in games like poker) is a key challenge.
@
1. Expressiveness: The knowledge representation scheme should be able to represent all relevant
knowledge of the domain, including facts, relationships, and rules.
2. Efficiency: It should allow for efficient processing and retrieval of information.
3. Scalability: The system should scale as the knowledge base grows.
4. Interoperability: It should be able to work with different systems or represent knowledge in a
way that can be easily shared across platforms.
5. Uncertainty Handling: It should be able to handle incomplete or uncertain information.
ER
between them, typically used for knowledge sharing.
D
Weak Slot and Filter Structures are used in knowledge representation to handle uncertainty and
variability in the information:
● Slot: A slot is an attribute of an object that can have different values. In the context of weak slots,
O
they allow for flexible or incomplete information. For example, a "Person" object might have a slot
"Age," but the value could be unspecified or range from "young" to "old."
● Filter: Filters are used to specify constraints or conditions that must be met for a slot to take a
C
certain value. For example, a filter might restrict the "Age" slot to a certain range (e.g., between
18 and 65) or might only allow certain types of values (e.g., numerical).
U
Weak Slot Structures provide flexibility in representation, allowing for uncertain or incomplete
knowledge, while Filter structures help impose restrictions on the values slots can take.
PT
The process of Natural Language Processing (NLP) can be divided into three primary phases:
@
ER
on its context.
■ Sentiment Analysis: Identifying the sentiment or emotional tone of the text.
These three phases work together to process and understand natural language, from recognizing word
components to extracting meaning from full sentences.
HAPPY ENDING BY
D
➖ SAHIL RAUNIYAR & PTUCODER !! 😀
O
C
U
PT
@