Artificial Intelegence
Artificial Intelegence
Artificial Intelegence
Intelligence is a complex and multifaceted concept that generally refers to the ability to
learn from experience, adapt to new situations, understand and handle abstract
concepts, and use knowledge to manipulate one's environment. It encompasses a
variety of cognitive processes and abilities.
History
The history of Artificial Intelligence (AI) began in antiquity, with myths, stories and
rumors of artificial beings endowed with intelligence or consciousness by master
craftsmen. The seeds of modern AI were planted by classical philosophers who
attempted to describe the process of human thinking as the mechanical manipulation
of symbols. This work culminated in the invention of the programmable digital
computer in the 1940s, a machine based on the abstract essence of mathematical
reasoning. This device and the ideas behind it inspired a handful of scientists to begin
seriously discussing the possibility of building an electronic brain. The field of AI
research was founded at a workshop held on the campus of Dartmouth College during
the summer of 1956. Those who attended would become the leaders of AI research for
decades. Many of them predicted that a machine as intelligent as a human being would
exist in no more than ageneration and they were given millions of dollars to make this
vision come true. Eventually, it became obvious that they had grossly underestimated
the difficulty of the project. In 1973, in response to the criticism from James Lighthill
and ongoing pressure from congress, the U.S. and British Governments stopped funding
undirected research into artificial intelligence, and the difficult years that followed would
later be known as an "AI winter". Seven years later, a visionary initiative by the Japanese
Government inspired governments and industry to provide AI with billions of dollars, but
by the late 80s the investors became disillusioned by the absence of the needed
computer power (hardware) and withdrew funding again. In the 1980s a form of AI
program called "expert systems" was adopted by corporations around the world and
knowledge became the focus of mainstream AI research. In those same years, the
Japanese government aggressively funded AI with its fifth generation computer project.
Another encouraging event in the early 1980s was the revival of connectionism in the
work of John Hopfield and David Rumelhart. Once again, AI had achieved success. In
the first decades of the 21st century, access to large amounts of data (known as "big
data"), cheaper and faster computers and advanced machine learning techniques were
successfully applied to many problems throughout the economy. In fact, McKinsey
Global Institute estimated in their famous paper "Big data: The next frontier for
innovation, competition, and productivity" that "by 2009, nearly all sectors in the US
economy had at least an average of 200 terabytes of stored data". By 2016, the market
for AI-related products, hardware, and software reached more than 8 billion dollars, and
the New York Times reported that interest in AI had reached a "frenzy". The applications
of big data began to reach into other fields as well, such as training models in ecology
and for various applications in economics. Advances in deep learning (particularly deep
convolutional neural networks and recurrent neural networks) drove progress and
research in image and video processing, text analysis, and even speech recognition.
Investment and interest in AI boomed in the first decades of the 21st century, when
machine learning was successfully applied to many problems in academia and industry
due to new methods, the application of powerful computer hardware, and the collection
of immense data sets.
Foundations of AI
◼ Foundation of AI is based on
❑ Mathematics
❑ Neuroscience
❑ Control Theory
❑ Linguistics
Toy Problem:
Developing a Tic-Tac-Toe AI
1. State Representation:
● Represent the game board as a 3x3 matrix or a 9-element list, where each
element can be 'X', 'O', or empty.
2. Move Generation:
● The AI generates a list of all possible moves by identifying empty spots on
the board.
3. Evaluation Function:
● The AI evaluates board states to determine which move is the best. This
can be done using a scoring system (e.g., +10 for a win, -10 for a loss, 0
for a draw).
4. Search Algorithm:
● Minimax Algorithm: A common algorithm used in game AI. The AI
simulates all possible moves (and the opponent's responses) to a given
depth and chooses the move that maximizes its chances of winning while
minimizing the opponent's chances.
● Alpha-Beta Pruning: An optimization of Minimax that eliminates branches
in the search tree that don't need to be explored because they cannot
affect the final decision.
2. css
3. Copy code
[X, O, X]
[O, X, ]
[ , , ]
4.
5. Possible Moves for 'O':
● Place 'O' at (1, 2)
● Place 'O' at (2, 0)
● Place 'O' at (2, 1)
● Place 'O' at (2, 2)
6. Simulate Each Move:
● For each possible move, simulate the resulting board state, then simulate
all possible responses by 'X', and so on.
7. Evaluate Outcomes:
● Calculate the score for each move using the evaluation function. For
example:
● If 'O' can win immediately by placing at (1, 2), that move scores +10.
● If the move leads to a draw after optimal play from both sides, it
scores 0.
● If the move leads to a loss, it scores -10.
8. Choose Best Move:
● Select the move with the highest score (or least negative score in the
worst-case scenario).
Problem Description
You are given two jugs with capacities of
a liters and
Example Solution
Consider two jugs with capacities 3 liters and 5 liters, and the goal is to measure exactly
4 liters:
1. Initial state:
2. (0,0)
3. (0,0)
4. Actions:
● Fill the 5-liter jug: (0,5)
● Pour from the 5-liter jug to the 3-liter jug: (3,2)
● Empty the 3-liter jug: (0,2)
● Pour from the 2 liters in the 5-liter jug to the 3-liter jug: (2,0)
● Fill the 5-liter jug again: (2,5)
● Pour from the 5-liter jug to the 3-liter jug until the 3-liter jug is full: (3,4)
(3,4)
(3,4), where the second jug contains exactly 4 liters, achieving the goal.
Agents:
In artificial intelligence, an agent is an entity that perceives its environment through
sensors and acts upon that environment through actuators to achieve specific goals.
Agents are a fundamental concept in AI and can range from simple programs to
complex systems with advanced reasoning capabilities. Here’s a detailed overview of
agents in AI:
Types of Agents
1. Simple Reflex Agents:
● Behavior: Act based on a set of predefined rules or conditions. They do not
consider the history of past states.
● Example: A thermostat that turns on the heater if the temperature drops
below a certain threshold.
2. Goal-Based Agents:
● Behavior: Act to achieve specific goals. They consider the future
consequences of their actions to decide the best course of action.
● Example: A chess-playing program that selects moves based on their
potential to lead to a winning position.
3. Utility-Based Agents:
● Behavior: Choose actions based on a utility function that measures the
preferred outcomes. This allows them to handle trade-offs and
uncertainties.
● Example: A recommendation system that suggests products to users
based on a balance of relevance and diversity.
Propositional Logic
● P: It is raining.
● Q: The ground is wet.
Applications in AI:
● Knowledge Representation: Propositional logic is used to represent knowledge in
AI systems, allowing them to reason about the world based on logical rules and
facts.
● Inference: AI systems use propositional logic to derive new knowledge from
existing knowledge, infer relationships between different propositions, and make
logical deductions.
● Problem Solving: Propositional logic provides a foundation for solving problems
using logical reasoning, search algorithms, and constraint satisfaction
techniques in AI applications.
Propositional Theorem
Proving Inference:
Inference refers to the process of deriving new knowledge or conclusions from existing
knowledge or premises. In propositional logic, proving inference involves showing that a
conclusion logically follows from a set of premises using valid rules of inference. Here's
how it works:
1. Premises:
● Premises are statements or propositions assumed to be true. They serve
as the starting point for logical reasoning.
2. Rules of Inference:
● These are logical rules or principles that allow us to derive new
conclusions from premises. Examples include modus ponens, modus
tollens, and hypothetical syllogism.
3. Logical Steps:
● To prove an inference, we apply the rules of inference step by step to the
premises until we reach the desired conclusion.
4. Validity:
● An inference is considered valid if the conclusion logically follows from
the premises according to the rules of inference.
● P→Q
● P
Conclusion:
Proof:
1. Given P→Q and
2. P Using modus ponens, we conclude Q.
Proofs:
Proofs are formal demonstrations or arguments that establish the truth of a proposition
or theorem based on logical reasoning and valid inference. In mathematics and logic,
proofs are used to demonstrate the validity of mathematical statements or logical
propositions. Here's how they work:
1. Hypothesis:
● A proof starts with a hypothesis, which is the statement or proposition to
be proved.
2. Logical Steps:
● The proof proceeds through a series of logical steps, each justified by
valid rules of inference or previously proven statements (lemmas).
3. Conclusion:
● The proof concludes with a statement that logically follows from the initial
hypothesis and the logical steps taken.
4. Rigor:
● Proofs are expected to be rigorous and complete, leaving no room for
doubt about the validity of the conclusion.
Example of a Proof:
Theorem: The sum of two even integers is always even.
Proof:
Proof by Resolution
Imagine you're trying to figure out if a bunch of statements are true or not. Proof by resolution is
like playing a game where you have to find out if all the statements make sense together or if
there's a problem.
You use resolution to resolve conflicts between these statements. If you end up with a
statement like "It's both raining and not raining," that's a big problem! It means something went
In essence, proof by resolution is like playing detective with logical statements. You're trying to
find out if they all fit together nicely or if there's a contradiction that shows they can't all be true
● Horn clauses are like basic rules or statements written in a special way for
logical thinking.
2. Fewer Options:
● They have at most one positive statement. It's like saying "I'll do this if that
3. Examples:
● Imagine a rule like "If it's raining, then I'll take an umbrella." This is a horn
clause because it has one positive statement ("I'll take an umbrella") and
a horn clause because it has one positive statement ("I'll go for a walk")
4. Usage:
● Problem Solving: Horn clauses are often used in solving logical puzzles or
Definite clauses are a specific type of logical statement that's used in various areas like
logic programming and automated reasoning. Let's simplify what definite clauses are
● Definite clauses are like rules you might follow in a game or in real life, but
2. Clear Structure:
4. Example:
● Imagine you have a rule that says "If it's not raining and the ground is wet,
then it must have rained." This rule is a definite clause. The condition is
"It's not raining and the ground is wet," and the conclusion is "It must have
rained."
conditions.
● Easy to Work With: Their clear structure makes them easier for computers to
Forward Chaining:
1. Starting Point:
● Forward chaining is like starting with what you know and moving forward
2. Building Up:
● You begin with the facts or rules you have and keep adding new
3. Example:
● Imagine you're trying to figure out if it's going to rain today. You start with
what you know: "If the clouds are dark, it might rain." Then you look
outside. If the clouds are dark, you conclude, "It might rain." Then, you
might check if you feel any drops, and if you do, you conclude, "It's
raining."
● You keep following these steps until you reach the conclusion you're
Backward Chaining:
1. Goal-Oriented:
2. Working Backward:
● You start with the goal you want to achieve and then look for the facts or
3. Example:
● Using the same example of figuring out if it's going to rain, if your goal is
to know if it's going to rain, you might start by asking, "What would make it
rain?" Then you think, "Dark clouds might make it rain." So, you check if the
previous one, until you either find the information you need or can't go any
further.
Comparison:
● Forward Chaining:
● Works well when you have lots of data or when you need to explore all
possibilities.
● Backward Chaining:
● Starts with a goal and works backward to find the information needed to
● Works well when you have a specific goal in mind or when you need to find
a solution efficiently.
First-Order logic:
c. Function: Father of, best friend, third inning of, end of, ......
a. Syntax
b. Semantics
first-order logic. The basic syntactic elements of first-order logic are symbols. We write
Connectives ∧, ∨, ¬, ⇒, ⇔
Equality ==
Quantifier ∀, ∃
Atomic sentences:
○ Atomic sentences are the most basic sentences of first-order logic. These
sentences are formed from a predicate symbol followed by a parenthesis with a
sequence of terms.
○ We can represent atomic sentences as Predicate (term1, term2, ......, term n).
Complex Sentences:
Consider the statement: "x is an integer.", it consists of two parts, the first part x is the
subject of the statement and second part "is an integer," is known as a predicate.
○ These are the symbols that permit to determine or identify the range and scope
of the variable in the logical expression. There are two types of quantifier:
1. Building Blocks:
2. Quantifiers:
● It uses quantifiers like "for all" ( ∀) and "there exists" ( ∃) to talk about
things in general or specific instances.
3. Variables and Constants:
● It has variables (like x or y) that can stand for any object, and constants
(like a or b) that represent specific objects.
4. Predicates:
● Predicates are statements about objects, like "is blue" or "is taller than."
They can be true or false depending on the objects involved.
5. Connectives:
● Connectives like "and" ( ∧), "or" ( ∨), and "not" ( ¬) are used to combine
statements and build more complex expressions.
Example:
Let's say we want to express the statement: "All dogs bark."
● D(x): x is a dog.
● B(x): x barks.
● Using quantifiers and predicates, we can write:
● ∀x(D(x)→B(x)).
● This means "For all x, if x is a dog, then x barks."
from existing knowledge or premises using the rules of logic. It involves making logical
deductions based on the relationships and properties defined within the logical
1. Starting Point:
● Inference starts with a set of premises, which are statements or facts that
● Using logical rules and principles, we analyze the premises to derive new
3. Logical Steps:
make deductions.
4. Example:
Unit-II
Uncertain Knowledge and Reasoning:
Uncertain knowledge and reasoning deal with situations where we don't have complete or precise
information, leading to uncertainty about the truth of statements or outcomes. This uncertainty can arise
due to various factors such as incomplete information, noise in data, or probabilistic events.
Basic probability
Generally, the possibility of analyzing the occurrence of any event concerning previous data is called
probability. For example, if a fair coin is tossed, what is the chance that it lands on the head? These types
Probability measures the likelihood of an event’s occurrence. In situations where the outcome of an event
is uncertain, we discuss the probability of specific outcomes to understand their chances of happening.
The study of events influenced by probability falls under the domain of statistics.
uncertainty.
2. Likelihood of Events:
3. Representing Uncertainty:
● In AI, we use probabilities to represent uncertain information, such as the
4. Making Decisions:
and choose the action with the highest expected utility or probability of
success.
Bayes' theorem
Bayes' theorem allows updating the probability prediction of an event by observing new
● Bayes' rule helps us update our beliefs about the likelihood of different
2. Prior Beliefs:
hypotheses before observing any new evidence. These are called prior
probabilities.
3. New Evidence:
4. Probabilistic Reasoning:
observed evidence.
Where:
● P(H∣E) is the posterior probability of hypothesis H given evidence
● P(E∣H) is the likelihood of observing evidence E given hypothesis
● P(H) is the prior probability of hypothesis H
● H.P(E) is the probability of observing evidence
● E (also known as the marginal likelihood or evidence).
Belief Networks
Belief networks, also known as Bayesian networks or probabilistic graphical models, are
relationships between variables and make probabilistic inferences. Let's break down
2. Graphical Representation:
3. Probabilistic Inference:
4. Conditional Independence:
● The structure of a belief network captures conditional independence
reasoning.
2. Edges:
on A.
● Each node has associated conditional probability tables that specify the
edges.
Default Reasoning
Default reasoning is a type of reasoning in artificial intelligence (AI) and logic that deals
2. Fallback Strategy:
3. Common Patterns:
impractical or impossible.
● Real-World Applications: Default reasoning is used in various real-world
automated reasoning.
Example:
Consider a smart home system that adjusts the temperature based on the time of day:
● Default Assumption:
● During the daytime, the default assumption may be that people are active
● During the nighttime, the default assumption may be that people are
● Default Reasoning:
The 'Fuzzy' word means the things that are not clear or are vague. Sometimes, we
cannot decide in real life that the given problem or statement is either true or false. At
that time, this concept provides many values between the true and false and gives the
flexibility to find the best solution to that problem.
● In traditional sets, things are either in the set or not (like a light switch: it's
either on or off).
● Fuzzy sets are more flexible. They allow things to be partially in the set.
2. Degrees of Membership:
● Membership values range from 0 (not in the set at all) to 1 (fully in the
set).
3. Example:
● Take the set of "tall people." In a traditional set, someone is either tall (in
statements.
● It's like how humans reason. We often use words like "warm," "cold," "fast,"
2. Linguistic Variables:
● Fuzzy logic uses linguistic variables, which represent qualitative terms like
● These terms are fuzzy because they can cover a range of values instead
of a specific one.
3. Fuzzy Rules:
● Fuzzy logic uses rules that are based on these linguistic variables. For
4. Fuzzy Inference:
decisions or draw conclusions. It's a bit like how humans reason through
fuzzy concepts.
Structured Knowledge
effectively. It involves organizing data and information into a format that is easily
Associative Networks
Associative networks, also known as associative memory or associative networks, are a
type of data structure used in artificial intelligence to represent and retrieve information
based on associations or connections between data items. They are inspired by the way
human memory works, where memories are often triggered or recalled by related
● Each item in the network is linked to other items that are related to it in
some way.
2. Memory Recall:
● Like how remembering one thing can trigger memories of related things,
associations.
● When given a cue or input, the network retrieves related information stored
in its structure.
3. Flexible Retrieval:
4. Applications:
between data items, aiding in tasks like image recognition or natural language
processing.
● Memory-like Behavior: They mimic the way human memory works, allowing AI
Example:
Consider an associative network used for storing information about animals:
● Connections: Each animal (e.g., dog, cat, bird) is connected to related concepts
such as its characteristics (e.g., furry, feathers), habitat (e.g., forest, ocean), and
● Retrieval: When given a cue like "pet with fur," the network retrieves animals like
dogs and cats that are associated with the concept of fur.
Frame Structures
Frame structures are a way to organize knowledge in artificial intelligence (AI) by
format. They provide a way to model complex entities and their characteristics, allowing
AI systems to reason about and manipulate knowledge effectively. Let's simplify frame
structures in AI:
● Each frame represents an entity (object or concept) and contains slots for
● For example, a frame representing a car might have attributes like "model,"
3. Hierarchical Organization:
4. Behavior Representation:
● These behaviors describe how objects interact with each other or respond
Conceptual dependencies and scripts are two related concepts used in artificial
intelligence (AI) and cognitive science to represent and understand the structure of
knowledge and events in the world. They provide a way to organize and reason about
complex information in a structured format. Let's break down conceptual dependencies
events.
● They describe how different pieces of information are related and how
2. Semantic Relationships:
3. Hierarchical Organization:
knowledge structures.
concepts.
routines, or procedures.
2. Elements of Scripts:
● Scripts consist of elements such as roles (e.g., actor, object), actions (e.g.,
order.
3. Common Scenarios:
actions.
Unit III
1. Breadth-first Search:
○ Breadth-first search is the most common search strategy for traversing a tree or
graph. This algorithm searches breadthwise in a tree or graph, so it is called
breadth-first search.
○ BFS algorithm starts searching from the root node of the tree and expands all
successor node at the current level before moving to nodes of next level.
Advantages:
○ If there are more than one solutions for a given problem, then BFS will provide the
minimal solution which requires the least number of steps.
Disadvantages:
○ It requires lots of memory since each level of the tree must be saved into
memory to expand the next level.
○ BFS needs lots of time if the solution is far away from the root node.
Example:
In the below tree structure, we have shown the traversing of the tree using BFS
algorithm from the root node S to goal node K. BFS search algorithm traverse in layers,
so it will follow the path which is shown by the dotted arrow, and the traversed path will
be:
1. S---> A--->B---->C--->D---->G--->H--->E---->F---->I---->K
Time Complexity: Time Complexity of BFS algorithm can be obtained by the number of
nodes traversed in BFS until the shallowest Node. Where the d= depth of shallowest
Space Complexity: Space complexity of BFS algorithm is given by the Memory size of
Completeness: BFS is complete, which means if the shallowest goal node is at some
Optimality: BFS is optimal if path cost is a non-decreasing function of the depth of the
node.
Depth-first Search
○ Depth-first search isa recursive algorithm for traversing a tree or graph data
structure.
○ It is called the depth-first search because it starts from the root node and follows
each path to its greatest depth node before moving to the next path.
Note: Backtracking is an algorithm technique for finding all possible solutions using
recursion.
Advantage:
○ DFS requires very less memory as it only needs to store a stack of the nodes on
the path from root node to the current node.
○ It takes less time to reach to the goal node than BFS algorithm (if it traverses in
the right path).
Disadvantage:
○ There is the possibility that many states keep re-occurring, and there is no
guarantee of finding the solution.
○ DFS algorithm goes for deep down searching and sometime it may go to the
infinite loop.
Example:
In the below search tree, we have shown the flow of depth-first search, and it will follow
It will start searching from root node S, and traverse A, then B, then D and E, after
traversing E, it will backtrack the tree as E has no other successor and still goal node is
not found. After backtracking it will traverse node C and then G, and here it will
Completeness: DFS search algorithm is complete within finite state space as it will
Where, m= maximum depth of any node and this can be much larger than d
Space Complexity: DFS algorithm needs to store only single path from the root node,
hence space complexity of DFS is equivalent to the size of the fringe set, which is
O(bm).
limit. Depth-limited search can solve the drawback of the infinite path in the Depth-first
search. In this algorithm, the node at the depth limit will treat as it has no successor
nodes further.
○ Standard failure value: It indicates that problem does not have any solution.
○ Cutoff failure value: It defines no solution for the problem within a given depth
limit.
Advantages:
○ It may not be optimal if the problem has more than one solution.
Example:
Completeness: DLS search algorithm is complete if the solution is above the depth-
limit.
graph. This algorithm comes into play when a different cost is available for each edge.
The primary goal of the uniform-cost search is to find a path to the goal node which has
the lowest cumulative cost. Uniform-cost search expands nodes according to their path
costs form the root node. It can be used to solve any graph/tree where the optimal cost
gives maximum priority to the lowest cumulative cost. Uniform cost search is
equivalent to BFS algorithm if the path cost of all edges is the same.
Advantages:
○ Uniform cost search is optimal because at every state the path with the least
cost is chosen.
Disadvantages:
○ It does not care about the number of steps involve in searching and only
concerned about path cost. Due to which this algorithm may be stuck in an
infinite loop.
Example:
Completeness:
Uniform-cost search is complete, such as if there is a solution, UCS will find it.
Time Complexity:
Let C* is Cost of the optimal solution, and ε is each step to get closer to the goal node.
Then the number of steps is = C*/ε+1. Here we have taken +1, as we start from state 0
Space Complexity:
The same logic is for space complexity so, the worst-case space complexity of Uniform-
Uniform-cost search is always optimal as it only selects a path with the lowest path
cost.
search algorithm finds out the best depth limit and does it by gradually increasing the
This algorithm performs depth-first search up to a certain "depth limit", and it keeps
increasing the depth limit after each iteration until the goal node is found.
This Search algorithm combines the benefits of Breadth-first search's fast search and
The iterative search algorithm is useful for uninformed search when the search space is
Advantages:
○ It Combines the benefits of BFS and DFS search algorithm in terms of fast search
and memory efficiency.
Disadvantages:
○ The main drawback of IDDFS is that it repeats all the work of the previous phase.
Example:
Following tree structure shows the iterative deepening depth-first search. The IDDFS
algorithm performs various iterations until it does not find the goal node. The iteration
1'st Iteration-----> A
2'nd Iteration----> A, B, C
3'rd Iteration------>A, B, D, E, C, F, G
4'th Iteration------>A, B, D, H, I, E, C, F, K, G
In the fourth iteration, the algorithm will find the goal node.
Completeness:
Let's suppose b is the branching factor and depth is d then the worst-case time
complexity is O(bd).
Space Complexity:
Optimal:
IDDFS algorithm is optimal if path cost is a non- decreasing function of the depth of the
node.
called as forward-search and other from goal node called as backward-search, to find
the goal node. Bidirectional search replaces one single search graph with two small
subgraphs in which one starts the search from an initial vertex and other starts from
goal vertex. The search stops when these two graphs intersect each other.
Bidirectional search can use search techniques such as BFS, DFS, DLS, etc.
ADVERTISEMENT
Advantages:
Disadvantages:
○ Implementation of the bidirectional search tree is difficult.
Example:
In the below search tree, bidirectional search algorithm is applied. This algorithm
divides one graph/tree into two sub-graphs. It starts traversing from node 1 in the
forward direction and starts from goal node 16 in the backward direction.
guide the search process efficiently. Greedy Best-First Search was one such algorithm,
but it did not guarantee optimality for finding the shortest path.
Hill Climbing:
○ It is also called greedy local search as it only looks to its good immediate
neighbor state and not beyond that.
○ A node of hill climbing algorithm has two components which are state and value.
○ In this algorithm, we don't need to maintain and handle the search tree or graph
as it only keeps a single current state.
function/Cost.
On Y-axis we have taken the function which can be an objective function or cost
function, and state-space on the x-axis. If the function on Y-axis is cost then, the goal of
search is to find the global minimum and local minimum. If the function of Y-axis is
Objective function, then the goal of the search is to find the global maximum and local
maximum.
Different regions in the state space landscape:
Local Maximum: Local maximum is a state which is better than its neighbor states, but
Global Maximum: Global maximum is the best possible state of state space landscape.
Flat local maximum: It is a flat space in the landscape where all the neighbor states of
Simple hill climbing is the simplest way to implement a hill climbing algorithm. It only
evaluates the neighbor node state at a time and selects the first one which optimizes
current cost and set it as a current state. It only checks it's one successor state, and if
it finds better than the current state, then move else be in the same state. This algorithm
○ Step 1: Evaluate the initial state, if it is goal state then return success and Stop.
○ Step 2: Loop Until a solution is found or there is no new operator left to apply.
b. Else if it is better than the current state then assign new state as a current
state.
c. Else if not better than the current state, then return to step2.
○ Step 5: Exit.
algorithm examines all the neighboring nodes of the current state and selects one
neighbor node which is closest to the goal state. This algorithm consumes more time
○ Step 1: Evaluate the initial state, if it is goal state then return success and stop,
else make current state as initial state.
○ Step 2: Loop until a solution is found or the current state does not change.
a. Let SUCC be a state such that any successor of the current state will be
better than it.
e. If the SUCC is better than the current state, then set current state to
SUCC.
○ Step 5: Exit.
Stochastic hill climbing does not examine for all its neighbor before moving. Rather, this
search algorithm selects one neighbor node at random and decides whether to choose
than each of its neighboring states, but there is another state also present which is
Solution: Backtracking technique can be a solution of the local maximum in state space
landscape. Create a list of the promising path so that the algorithm can backtrack the
2. Plateau: A plateau is the flat area of the search space in which all the neighbor states
of the current state contains the same value, because of this algorithm does not find
any best direction to move. A hill-climbing search might be lost in the plateau area.
Solution: The solution for the plateau is to take big steps or very little steps while
searching, to solve the problem. Randomly select a state which is far away from the
current state so it is possible that the algorithm could find non-plateau region.
3. Ridges: A ridge is a special form of the local maximum. It has an area which is higher
than its surrounding areas, but itself has a slope, and cannot be reached in a single
move.
Simulated Annealing:
A hill-climbing algorithm which never makes a move towards a lower value guaranteed
to be incomplete because it can get stuck on a local maximum. And if algorithm applies
a random walk, by moving a successor, then it may complete but not efficient.
temperature then cooling gradually, so this allows the metal to reach a low-energy
crystalline state. The same process is used in simulated annealing in which the
algorithm picks a random move, instead of picking the best move. If the random move
improves the state, then it follows the same path. Otherwise, the algorithm follows the
path which has a probability of less than 1 or it moves downhill and chooses another
path.
Genetic Algorithm?
Before understanding the Genetic algorithm, let's first understand basic terminologies to
Pause
Next
Unmute
Current TimeÂ
6:23
DurationÂ
18:10
Loaded: 40.36%
Â
Fullscreen
○ Population: Population is the subset of all possible or probable solutions, which
can solve the given problem.
○ Allele: Allele is the value provided to the gene within a particular chromosome.
○ Selection
After calculating the fitness of every existent in the population, a selection process is
used to determine which of the individualities in the population will get to reproduce and
○ Event selection
So, now we can define a genetic algorithm as a heuristic search algorithm to solve
optimization problems.
quality solutions. These algorithms use different operations that either enhance or
It basically involves five phases to solve the complex optimization problems, which are
given as below:
○ Initialization
○ Fitness Assignment
○ Selection
○ Reproduction
○ Termination
1. Initialization
The process of a genetic algorithm starts by generating the set of individuals, which is
called population. Here each individual is the solution for the given problem. An
combined into a string and generate chromosomes, which is the solution to the
problem. One of the most popular techniques for initialization is the use of random
binary strings.
ADVERTISEMENT
2. Fitness Assignment
Fitness function is used to determine how fit an individual is? It means the ability of an
individual to compete with other individuals. In every iteration, individuals are evaluated
based on their fitness function. The fitness function provides a fitness score to each
individual. This score further determines the probability of being selected for
reproduction. The high the fitness score, the more chances of getting selected for
reproduction.
3. Selection
The selection phase involves the selection of individuals for the reproduction of
offspring. All the selected individuals are then arranged in a pair of two to increase
reproduction. Then these individuals transfer their genes to the next generation.
○ Rank-based selection
4. Reproduction
After the selection process, the creation of a child occurs in the reproduction step. In
this step, the genetic algorithm uses two variation operators that are applied to the
parent population. The two operators involved in the reproduction phase are given
below:
○ Crossover: The crossover plays a most significant role in the reproduction phase
of the genetic algorithm. In this process, a crossover point is selected at random
within the genes. Then the crossover operator swaps genetic information of two
parents from the current generation to produce a new individual representing the
offspring.
The genes of parents are exchanged among themselves until the crossover point
is met. These newly generated offspring are added to the population. This
process is also called or crossover. Types of crossover styles available:
○ Two-point crossover
○ Livery crossover
○ Gaussian mutation
○ Exchange/Swap mutation
5. Termination
After the reproduction phase, a stopping criterion is applied as a base for termination.
The algorithm terminates after the threshold fitness solution is reached. It will identify
○ Genetic algorithms are not efficient algorithms for solving simple problems.
possible path and then expanding the path with the lowest cost.
● The heuristic function takes into account the cost of the current path
● If the cost of the current path is lower than the estimated cost of the
1) We are starting from A , so from A there are direct path to node B( with
2) So as per best first search algorithm choose the path with lowest
will go from A to C.
3) Now from C we have direct paths as C to F( with heuristics value of 17 )
5) So now the goal node G has been reached and the path we will follow is
A->C->F->G .
limited memory.
optima, meaning that the path chosen may not be the best possible
path.
As the first step to converting this maze into a search problem, we need to
define these six things.
Explore the Artificial Intelligence syllabus for various courses offered by Great
Learning
In the open list, find the square with the lowest F cost, which denotes the
current square. Now we move to the closed square.
Consider 8 squares adjacent to the current square and Ignore it if it is on the
closed list or if it is not workable. Do the following if it is workable.
Check if it is on the open list; if not, add it. You need to make the current
square as this square’s a parent. You will now record the different costs of the
square, like the F, G, and H costs.
If it is on the open list, use G cost to measure the better path. The lower the G
cost, the better the path. If this path is better, make the current square as the
parent square. Now you need to recalculate the other scores – the G and F
scores of this square.
– You’ll stop:
If you find the path, you need to check the closed list and add the target
square to it.
There is no path if the open list is empty and you cannot find the target
square.
Step 3. Now you can save the path and work backward, starting from the
target square, going to the parent square from each square you go, till it takes
you to the starting square. You’ve found your path now.
The task is to take the unit you see at the bottom of the diagram to the top of
it. You can see that nothing indicates that the object should not take the path
denoted with pink lines. So it chooses to move that way. As and when it
reaches the top, it has to change its direction because of the ‘U’ shaped
obstacle. Then it changes direction and goes around the obstacle to reach the
top. In contrast to this, A* would have scanned the area above the object and
found a short path (denoted with blue lines). Thus, pathfinder algorithms like
A* help you plan things rather than waiting until you discover the problem.
They act proactively rather than reacting to a situation. The disadvantage is
that it is a bit slower than the other algorithms. You can use a combination of
both to achieve better results – pathfinding algorithms give a bigger picture
and long paths with obstacles that change slowly, and movement algorithms
for a local picture and short paths with obstacles that change faster.
When A* enters into a problem, firstly, it calculates the cost to travel to the
neighboring nodes and chooses the node with the lowest cost. If The f(n)
denotes the cost, A* chooses the node with the lowest f(n) value. Here ‘n’
denotes the neighboring nodes. The calculation of the value can be done as
shown below:
f(n)=g(n)+h(n)f(n)=g(n)+h(n)
g(n) = shows the shortest path’s value from the starting node to node n
h(n) = The heuristic approximation of the value of the node
The heuristic value has an important role in the efficiency of the A* algorithm.
To find the best solution, you might have to use different heuristic functions
according to the type of the problem. However, the creation of these functions
is a difficult task, and this is the basic problem we face in AI.
A heuristic is simply called a heuristic function that helps rank the alternatives
given in a search algorithm at each of its steps. It can either produce a result
on its own or work in conjugation with a given algorithm to create a result.
Essentially, a heuristic function helps algorithms to make the best decision
faster and more efficiently. This ranking is based on the best available
information and helps the algorithm decide the best possible branch to follow.
Admissibility and consistency are the two fundamental properties of a heuristic
function.
The numbers written on edges represent the distance between the nodes,
while the numbers written on nodes represent the heuristic values. Let us find
the most cost-effective path to reach from start state A to final state G using
the A* Algorithm.
UNIT IV
Natural Language Processing (NLP) is a field of artificial intelligence that focuses on the
interaction between computers and humans through natural language. The ultimate
Grammers
In the context of natural language processing (NLP), grammars refer to formal systems
that describe the structure and syntax of languages. Grammars in NLP help define the
rules and patterns that govern how words and phrases are combined to form valid
sentences in a language. These grammars serve as the foundation for various NLP
tasks, such as parsing, text generation, and syntactic analysis. Let's delve deeper into
Types of Grammars
1. Phrase Structure Grammar (PSG):
● Each rule specifies how one or more phrases can be combined to form a
larger phrase.
sentence.
3. Transformational Grammar:
another.
Parsing
Parsing in the context of natural language processing (NLP) refers to the process of
components and their relationships. The primary goal of parsing is to understand the
structure of sentences according to the rules defined by a formal grammar. Let's break
Steps in Parsing
1. Tokenization:
● The first step is to tokenize the input text into smaller units, such as words
or tokens. This step breaks the text into individual elements that can be
analyzed further.
4. Tree Representation:
meaning of the sentence beyond its syntactic structure. This step may
semantic roles
Pattern Recognition
in data. These patterns can exist in various forms, including images, sounds, texts,
signals, and other types of data. The goal of pattern recognition is to make sense of
involve gathering images, recordings, texts, or other types of data from various
sources.
are extracted from it. These features could be visual attributes like shapes and
texts.
3. Pattern Representation: The extracted features are then used to represent the
patterns in the data in a meaningful way. This could involve encoding the
category to each pattern based on its features. This is typically done using
or decision trees, which learn from labeled examples to classify new patterns
accurately.
5. Pattern Recognition and Interpretation: Once the patterns are classified, the
results are interpreted to make sense of the data. This could involve identifying
involve retraining the algorithms with new data, refining the feature extraction
Recognition:
a. Recognition is the process of identifying or categorizing an object, pattern,
memory.
recognized object.
Classification:
or classes.
(i.e., data points with known categories) and then using this model to
Theoretic classification
among the items being classified. In the context of artificial intelligence and machine
learning, theoretic classification involves the use of formal theories to guide the
Syntactic classification
that classifies objects based on their structural or syntactic properties. Unlike other
classification methods that might rely purely on statistical features or numerical data,
Learning classification patterns is a way for computers to learn how to sort things into
Key Concepts
1. Training Data:
example is labeled with the correct category. For instance, pictures of cats
2. Features:
● Features are the important pieces of information from each example that
help in making the decision. For a picture, features could be things like the
shape of the ears, the color of the fur, or the presence of a tail.
3. Model:
● The model is what the computer learns from the training data. It’s a set of
4. Classification:
● This is the process of using the model to assign a new example to one of
the categories. For example, after learning from many pictures, the
computer uses its model to decide whether a new picture is a cat or a dog.
interpret spoken language, just like humans do. Here's a simple breakdown:
Recognizing Speech
1. Listening:
2. Signal Processing:
● The recorded speech is converted into digital data through signal
3. Feature Extraction:
● Important features like the frequency of sound waves and the duration of
sounds are extracted from the audio data. These features help in
4. Pattern Matching:
phrases.
5. Recognition:
● Based on the closest match between the extracted features and stored
patterns, the system recognizes the spoken words and converts them into
text.
Understanding Speech
1. Language Processing:
● After recognizing the words, the system processes the text to understand
2. Contextual Understanding:
● When you say, "Hey, virtual assistant," the system recognizes the wake
2. Understanding Intent:
● After recognizing the wake word, the system processes the following
words to understand the intent. For example, if you say, "What's the
3. Retrieving Information:
4. Providing Response:
● Finally, the system converts the response into synthesized speech and
Challenges
● Noise and Variability: Speech recognition systems must deal with background
and to provide decision-making ability like a human expert. It performs this by extracting
knowledge from its knowledge base using the reasoning and inference rules according
The expert system is a part of AI, and the first ES was developed in the year 1970, which
was the first successful approach of artificial intelligence. It solves the most complex
issue as an expert by extracting the knowledge stored in its knowledge base. The
system helps in decision making for compsex problems using both facts and heuristics
specific domain and can solve any complex problem of that particular domain. These
systems are designed for a specific domain, such as medicine, science, etc.
The performance of an expert system is based on the expert's knowledge stored in its
knowledge base. The more knowledge stored in the KB, the more that system improves
Below is the block diagram that represents the working of an expert system:
Note: It is important to remember that an expert system is not used to replace the human
experts; instead, it is used to assist the human in making a complex decision. These
systems do not have human capabilities of thinking and work on the basis of the knowledge
○ MYCIN: It was one of the earliest backward chaining expert systems that was
designed to find the bacteria causing infections like bacteraemia and meningitis.
It was also used for the recommendation of antibiotics and the diagnosis of
blood clotting diseases.
○ PXDES: It is an expert system that is used to determine the type and level of lung
cancer. To determine the disease, it takes a picture from the upper body, which
looks like the shadow. This shadow identifies the type and degree of harm.
○ CaDeT: The CaDet expert system is a diagnostic support system that can detect
cancer at early stages.
○ High Performance: The expert system provides high performance for solving any
type of complex problem of a specific domain with high efficiency and accuracy.
○ Highly responsive: ES provides the result for any complex query within a very
short period of time.
○ User Interface
○ Inference Engine
○ Knowledge Base
1. User Interface
With the help of a user interface, the expert system interacts with the user, takes queries
as an input in a readable format, and passes it to the inference engine. After getting the
response from the inference engine, it displays the output to the user. In other words, it
is an interface that helps a non-expert user to communicate with the expert system to
find a solution.
○ The inference engine is known as the brain of the expert system as it is the main
processing unit of the system. It applies inference rules to the knowledge base to
derive a conclusion or deduce new information. It helps in deriving an error-free
solution of queries asked by the user.
○ With the help of an inference engine, the system extracts the knowledge from the
knowledge base.
○ Forward Chaining: It starts from the known facts and rules, and applies the
inference rules to add their conclusion to the known facts.
○ Backward Chaining: It is a backward reasoning method that starts from the goal
and works backward to prove the known facts.
3. Knowledge Base
○ The knowledgebase is a type of storage that stores knowledge acquired from the
different experts of the particular domain. It is considered as big storage of
knowledge. The more the knowledge base, the more precise will be the Expert
System.
○ One can also view the knowledge base as collections of objects and their
attributes. Such as a Lion is an object and its attributes are it is a mammal, it is
not a domestic animal, etc.
domain knowledge, specifying the rules to acquire the knowledge from various experts,
Here, we will explain the working of an expert system by taking an example of MYCIN
○ Firstly, ES should be fed with expert knowledge. In the case of MYCIN, human
experts specialized in the medical field of bacterial infection, provide information
about the causes, symptoms, and other knowledge in that domain.
○ The KB of the MYCIN is updated successfully. In order to test it, the doctor
provides a new problem to it. The problem is to identify the presence of the
bacteria by inputting the details of a patient, including the symptoms, current
condition, and medical history.
○ The ES will need a questionnaire to be filled by the patient to know the general
information about the patient, such as gender, age, etc.
○ Now the system has collected all the information, so it will find the solution for
the problem by applying if-then rules using the inference engine and using the
facts stored within the KB.
○ In the end, it will provide a response to the patient by using the user interface.
and hence the same for the ES. Although we have human experts in every field, then
what is the need to develop a computer-based system. So below are the points that are
2. High Efficiency: If the knowledge base is updated with the correct knowledge,
then it provides a highly efficient output, which may not be possible for a human.
3. Expertise in a domain: There are lots of human experts in each domain, and they
all have different skills, different experiences, and different skills, so it is not easy
to get a final output for the query. But if we put the knowledge gained from
human experts into the expert system, then it provides an efficient output by
mixing all the facts and knowledge
4. Not affected by emotions: These systems are not affected by human emotions
such as fatigue, anger, depression, anxiety, etc.. Hence the performance remains
constant.
5. High security: These systems provide high security to resolve any query.
6. Considers all the facts: To respond to any query, it checks and considers all the
available facts and provides the result accordingly. But it is possible that a
human expert may not consider some facts due to any reason.
○ Advising: It is capable of advising the human being for the query of any domain
from the particular ES.
○ Interpreting the input: It is capable of interpreting the input given by the user.
○ Predicting results: It can be used for the prediction of a result.
○ They can be used for risky places where the human presence is not safe.
○ The response of the expert system may get wrong if the knowledge base
contains the wrong information.
○ Like a human being, it cannot produce a creative output for different scenarios.
○ For each domain, we require a specific ES, which is one of the big limitations.
characteristics
1. Knowledge Base
● Comprehensive: Contains a vast amount of domain-specific knowledge.
● Organized: Structured in a way that allows for efficient retrieval and application of
knowledge.
2. Inference Engine
● Logical Reasoning: Applies logical rules to the knowledge base to deduce new
advice or decisions.
4. Explanation Facility
● Transparent Reasoning: Can explain the reasoning process and how it arrived at
a particular conclusion.
● Educational: Helps users understand the domain and the logic behind the
5. Knowledge Acquisition
● Adaptable: Capable of integrating new knowledge without significant redesign.
● Updatable: Allows for easy updating and expansion of the knowledge base as
6. Performance
● Accuracy: Provides highly accurate solutions, often comparable to or exceeding
● Efficiency: Delivers solutions quickly, often much faster than a human expert
could.
7. Reliability
● Consistency: Offers consistent advice or decisions, free from human errors or
biases.
8. Domain Specificity
● Specialized: Designed for specific domains or fields (e.g., medical diagnosis,
financial advice).
domain.
laws are frequently expressed in human-friendly language, such as "if X is true, then Y is
true," to make them easier for readers to comprehend. Expert and decision support
systems are only two examples of the many applications in which rule-based systems
circumstances and deeds. For instance, if a patient has a fever, the doctor may
recommend antibiotics because the patient may have an infection. Expert systems,
decision support systems, and chatbots are examples of apps that use rule-based
systems.
Characteristics of Rule-based Systems in AI
The following are some of the primary traits of the rule-based system in AI:
● The rules are written simply for humans to comprehend, making rule-based
● Given a set of inputs, rule-based systems will always create the same output,
determinism.
system operates.
● Rule-based systems can be modified or updated more easily because the rules
of rules. The system first determines which principles apply to the inputs. If a rule is
applicable, the system executes the corresponding steps to generate the output. If no
guideline is applicable, the system might generate a default output or ask the user for
more details.
suggestion, directive, strategy, or heuristic. The rule is activated, and the action
portion is carried out as soon as the conditional portion of the rule is met.
2. The database:
The expert system uses the inference engine to derive the logic and arrive at a
conclusion. The inference engine's task is to connect the facts kept in the
database with the rules specified in the knowledge base. The semantic reasoner
necessary actions based on data and the rule base present in the knowledge
base. For example, the match-resolve-act loop used by the semantic reasoner
○ Match:
○ Conflict Resolution:
status.
○ Act:
The production instance chosen in the step before is carried out, changing
4. Explanations facilities:
The user can use the explanation facilities to question the expert system on how
expert system must be able to defend its logic, recommendations, analyses, and
conclusions.
5. User Interface:
The user interface is the channel through which the user interacts with the expert
system to find a solution to an issue. The user interface should be as simple and
possible.
Each of these five components is essential to any rule-based system in AI. These
form the basis of the rule-based structure. However, the mechanism might also
include a few extra parts. The working brain and the external interface are two
6. External connection:
An expert system can interact with external data files and programs written in
traditional computer languages like C, Pascal, FORTRAN, and Basic, thanks to the
external interface.
7. Active recall:
predefined sets of rules to make decisions or solve problems. These systems often use
other methods such as statistical models, machine learning, neural networks, and other
1. Neural Networks
Neural networks are inspired by the human brain's structure and function. They consist
of layers of interconnected nodes (neurons) that process data and learn patterns.
● Structure:
weighted connections.
● Learning:
autonomous driving.
2. Decision Trees
Decision trees use a tree-like model of decisions and their possible consequences. They
● Structure:
● Learning:
● Trees are constructed by splitting data into subsets based on the feature
or not.
● Structure:
classes.
● Support Vectors: Data points that are closest to the hyperplane and
● Learning:
● SVMs find the hyperplane that maximizes the margin between different
classes.
4. Bayesian Networks
Bayesian networks are probabilistic graphical models that represent a set of variables
● Structure:
● Learning:
systems.
5. Genetic Algorithms
Genetic algorithms are optimization algorithms inspired by the process of natural
selection.
● Structure:
● Learning:
6. Reinforcement Learning
Reinforcement learning involves learning by interacting with an environment to achieve
a goal.
● Structure:
● Learning:
● The agent learns to maximize cumulative rewards through trial and error.
systems.
● These systems can adapt and improve over time with new data, making
3. Complexity Handling:
4. Probabilistic Reasoning:
allowing them to deal with uncertainty and make more nuanced decisions.
Advantages
● Scalability: Can handle large and complex datasets.
● Efficiency: Often more efficient in making predictions and decisions once trained.
Challenges
● Data Dependency: Requires large amounts of data for training.
interpret.
especially expert systems. These processes ensure that the system has accurate,
reliable, and applicable knowledge to make decisions and solve problems effectively.
Knowledge Acquisition
Knowledge acquisition is the process of gathering, organizing, and integrating
decision-making processes.
2. Elicit Knowledge:
efficiently.
knowledge collaboratively.
3. Represent Knowledge:
formally.
4. Integrate Knowledge:
completeness.
integrating knowledge.
● Expert System Shells: Pre-built frameworks for developing expert systems, which
Knowledge Validation
Knowledge validation ensures that the acquired knowledge is correct, reliable, and
applicable. It involves testing and refining the knowledge base to meet the required
standards.
1. Internal Validation:
● Logical Validation: Check the logical correctness of the rules and their
execution flow.
2. External Validation:
3. Performance Evaluation:
● Usability Testing: Check if the system is user-friendly and meets the users'
needs.
Iterative Refinement
● Update and Maintenance: Regularly update the knowledge base to reflect new
patient records.
● Validation: Test the system with real patient cases and have doctors
economic models.
● Relevance: Keeps the system up-to-date with the latest knowledge and practices.
● Trust: Builds confidence among users that the system can be relied upon for
critical decisions.
artificial intelligence. Describe the Turing test for artificial intelligence and
that could successfully perform any intellectual task that a human being can. It's often
Narrow artificial intelligence (ANI), on the other hand, refers to AI systems that are
designed and trained for specific tasks or narrow domains. These systems excel at
performing a single task or a set of closely related tasks but lack the broad cognitive
abilities associated with human intelligence. Examples of ANI include voice assistants
The Turing test is a method of inquiry in artificial intelligence (AI) for determining
Alan Turing in 1950. The test involves a human evaluator interacting with both a human
and a machine (hidden from the evaluator), through text-based communication. If the
evaluator cannot reliably distinguish the machine's responses from the human's, then
The validity of the Turing test from a modern standpoint can be justified in several ways:
1. Behavioral Approach: The Turing test focuses on observable behavior rather than
from humans. In practical terms, this benchmark signifies that the AI is capable
pass the Turing test is more likely to respect social norms, understand human
inappropriate behavior.
4. Adaptability: The Turing test doesn't specify a fixed set of tasks or criteria for
domains and contexts. This adaptability makes the test applicable to a wide
While the Turing test has its limitations and critics argue that passing it doesn't
simple terms
General AI: Imagine a robot that's super smart and can do anything a person can do, like
solving puzzles, learning new things, and even having conversations like you and I are
Narrow AI: Now, think about your smartphone's voice assistant or a computer program
that recognizes faces in photos. They're really good at specific tasks, but they can't do
everything like a super-smart robot can. These are examples of Narrow AI.
Turing Test: Imagine you're chatting with someone online. You can't see them, and
you're not sure if they're a person or a computer program. If the responses you get are
so human-like that you can't tell if it's a person or a machine, then the machine passes
Why it matters: The Turing Test helps us see how close computers are to being as
smart as humans in conversations and understanding. If a computer can pass this test,
it's a big deal because it means it's really good at understanding and talking like
humans.
What is a production rule? Give an example and define two basic parts of
the
production rule.
Let's say we have a simple expert system for diagnosing car problems:
In this example:
1. Condition: "the engine won't start" is the condition that triggers the rule. It's the
2. Action: "check the battery and the starter motor" is the action that the system
takes if the condition is met. It's what the system does in response to the
● Condition: This is the part of the rule that describes the situation or state that
● Action: This is the part of the rule that specifies what the system should do if the
triggered.
What is fuzzy logic? Define main operations of fuzzy sets. Provide examples.
Fuzzy logic is a branch of mathematics and a form of reasoning that deals with
terms of strict true or false values (0 or 1), fuzzy logic allows for degrees of truth
between 0 and 1. It's particularly useful in situations where variables can have imprecise
or ambiguous values, making it more suitable for modeling human reasoning and
decision-making processes.
Example: Consider a fuzzy set representing "tall people" where the membership
who is 6 feet tall might have a membership value of 0.8, indicating a high degree
2. Fuzzy Set Union (OR): The union operation combines the membership values of
two fuzzy sets for each element, resulting in a new fuzzy set that includes
Example: Let's say we have two fuzzy sets representing "young" and "old" based
on age. The union operation combines these sets to create a new fuzzy set
have a high membership value in the "young" set and a lower membership value
in the "old" set, resulting in a combined membership value for the new set.
membership values of two fuzzy sets for each element, resulting in a new fuzzy
Example: Consider fuzzy sets representing "tall" and "old" individuals. The
representing "tall and old" individuals. If someone is both 6 feet tall and 70 years
old, they might have high membership values in both sets, resulting in a high
Design the class-frame for the object Student, determine its attributes and define
Sure, here's a simple design for a class-frame representing the object "Student" in
Python:
Python
class Student:
self.name = name
self.age = age
self.grade = grade
def display_info(self):
print("Name:", self.name)
print("Age:", self.age)
print("Grade:", self.grade)
print("Student 1:")
student1.display_info()
print("\nStudent 2:")
student2.display_info()
print("\nStudent 3:")
student3.display_info()
In this class-frame:
● Attributes:
object.
Then, we create instances (objects) of the Student class: student1, student2, and
student3. Each instance has its own set of attributes representing different students.
Finally, we call the display_info() method for each instance to print out the information
of each student.
1. Different Ways of Speaking: People speak in many different ways, like with
2. Background Noise: Sometimes there's noise in the background, like cars honking
or people talking. Computers have to filter out this noise to focus on what
someone is saying.
3. Words That Sound Alike: Some words sound the same but mean different things,
like "to" and "too." Computers need to figure out which word is being said based
on the context.
4. Stumbling Over Words: Sometimes people pause, repeat themselves, or say "um"
or "uh." Computers have to understand these pauses and not get confused by
them.
5. New Words: If someone says a word that the computer hasn't heard before, it
people speaking, and everyone speaks a bit differently. This can make it harder
tone of voice behind what someone is saying, like if they're happy, sad, or angry.
Imagine you're teaching a computer to understand what people say. People use all sorts
of words and sentences, but the computer needs to understand the main ideas behind
understand the main ideas in what people say, like who did what to whom and
computer looks at the big picture. It figures out the main concepts and
relationships between them. For example, if someone says "John gave Mary the
book because she loves to read," the computer understands that John gave Mary
the book because she loves reading, even if the words are a bit different.
3. Helping Computers Think: By breaking down language into concepts and
It helps them make logical deductions, answer questions, and have meaningful
4. Talking Back: Not only does conceptual dependency help computers understand
what people say, but it also helps them talk back in a way that makes sense.
Computers can generate responses that capture the main ideas of the
List and describe the five major players in the expert system development team. What is the role of
1. Domain Expert: The domain expert is someone who possesses extensive knowledge and
expertise in the specific field or domain that the expert system is being developed for. Their
role is to provide the necessary domain knowledge, rules, and insights to ensure that the
expert system accurately represents the knowledge and reasoning processes used by
2. Knowledge Engineer: The knowledge engineer acts as a liaison between the domain expert
and the technical team responsible for implementing the expert system. Their role is to elicit,
capture, and formalize the domain expert's knowledge into a format that can be understood
and utilized by the expert system. This involves tasks such as interviewing domain experts,
implementing the expert system based on the specifications provided by the domain expert
and knowledge engineer. They use programming languages and development tools to build
the software components of the expert system, including the inference engine, knowledge
4. User Interface Designer: The user interface designer focuses on creating an intuitive and
user-friendly interface for interacting with the expert system. Their role is to design screens,
menus, and interactions that enable users to input queries, receive responses, and navigate
through the system effectively. This involves considering factors such as usability,
5. Quality Assurance (QA) Tester: The QA tester is responsible for ensuring the quality and
reliability of the expert system by identifying and addressing any defects, errors, or
inconsistencies. Their role involves testing the system's functionality, performance, and
accuracy against a variety of test cases and scenarios. They work closely with the
development team to troubleshoot issues and verify that the system meets the requirements
The role of the knowledge engineer is to bridge the gap between the domain expert and the technical
team by translating domain knowledge into a format that can be used by the expert system. This
involves:
documentation.
● Structuring and organizing knowledge into a formal representation, such as rules, frames, or
● Validating and refining the knowledge representation through iterative feedback and testing
What is a production system model? List and define the five basic components of an expert
system.
(AI) and expert systems. It consists of a set of rules, known as productions, that guide
the behavior of the system. Each production consists of a condition (or set of
conditions) and an associated action (or set of actions) to be performed if the condition
1. Knowledge Base (KB): The knowledge base is where all the relevant information,
rules, facts, and heuristics about a specific domain are stored. It represents the
expertise of human specialists in the domain and serves as the foundation for
2. Inference Engine (IE): The inference engine is responsible for reasoning and
uses the rules and facts from the knowledge base to derive new conclusions,
3. User Interface (UI): The user interface provides a means for users to interact with
the expert system. It allows users to input queries, provide information, and
should be intuitive, user-friendly, and tailored to the specific needs of the users.
4. Explanation Facility (EF): The explanation facility provides explanations for the
reasoning and decisions made by the expert system. It helps users understand
base.
acquire, elicit, and update the knowledge stored in the knowledge base. It
provides tools and methods for domain experts and knowledge engineers to
input, edit, and validate the rules, facts, and heuristics that comprise the
knowledge base. This component is crucial for keeping the expert system up-to-