Professional Documents
Culture Documents
AI
AI
1
Artificial Intelligence
Artificial Agent
Agent is anything that can be viewed as
perceiving its environment through sensors Types of agent:
and acting upon that environment through Agent can be classified into five types.
actuators. They are:
Eg: Human Agent a) Table Driven Agent
Preceptor: Skin, Ear, Eyes etc.
Activator: limbs, mouth etc.
Robotic Agent
Preceptor: sensor, camera,
Antenna etc.
Activator: Arm, Legs, head etc.
The agent program runs on the physical - Fast but too simple
architecture to produce F. hence, agent is - No memory
combined form of agent architecture and - Fails if environment is partially
agent program. observable.
2
Artificial Intelligence
- Doesn’t learn
It keeps track of the world state as well as
of goal it tries to achieve and choose an
action that will (eventually) lead to the
achievement of its goal.
3
Artificial Intelligence
Task Environment
Task environment is accounted by four
parameters. They are: Performance
measure, Environment, Actuators and
Sensors of agent i.e. PEAS.
• Environment
- Road, traffic light, pedestrian,
vehicle.
• Actuators
- Steering wheels, wipers, headlight,
and horn.
• Sensors
- Radar, camera, fog sensor, fuel
sensor.
4
Artificial Intelligence
Example:
Chapter 3
Measuring Problem: measuring 4L
Problem Solving by using 5L and 3L jug
Solution Space:
(0,0) (0,5) (3,2) (0,2) (2,0)
(2,5) (3,4) (0.4)
5
Artificial Intelligence
d. Exploration Problem
Environment: Deterministic and accessible
- In this problem, agent discover and
learn about environment while A-B-C-D-E-F-G A-B-D-E-C-F-G
taking action.
Example: Maze game.
6
Artificial Intelligence
Breadth-First Search
BFS uses FIFO approach and expands
shallowest unexpected nodes. This search
method is complete if b is finite.
• Time complexity: �1 + 𝑏𝑏 + 𝑏𝑏 2 +
𝑏𝑏 3 + ⋯ … + 𝑏𝑏 𝑑𝑑 + (𝑏𝑏 2 + 1)� =
𝑂𝑂(𝑏𝑏 𝑑𝑑+1 )
• Space complexity: 𝑂𝑂(𝑏𝑏 𝑑𝑑+1 ) as
every node is kept in memory.
• Optimal: if cost = 1 per step.
• Space is bigger problem Step 1: Fringe [A]
is A goal?
Breadth first search is the
uniformed search strategy in which each
node are explore at a given depth before
moving on the next level. As it eventually
visits every node to a given depth
guaranteed to be complete. In this search,
optimum path cost is non decreasing
function of the depth of the node as nodes Step 2: Fringe [B, C]
explored in depth order, let us assume the is B goal?
expansion of tree checks 1000 nodes/sec.
and need 100 bytes/sec and b=10.
7
Artificial Intelligence
8
Artificial Intelligence
9
Artificial Intelligence
10
Artificial Intelligence
11
Artificial Intelligence
Step 3: Step 5:
Now,
Total path cost
∑ ℎ𝑛𝑛 = ℎ(𝑛𝑛𝐸𝐸 ) + ℎ(𝑛𝑛𝐹𝐹 ) + ℎ(𝑛𝑛𝐻𝐻 ) + ℎ(𝑛𝑛𝐼𝐼 )
= 300 + 220 + 120 + 0
= 640
Step 4:
Now,
Total distance cost
∑ 𝑔𝑔(𝑛𝑛) = 𝑔𝑔(𝑛𝑛𝐸𝐸 ) + 𝑔𝑔(𝑛𝑛𝐹𝐹 ) + 𝑔𝑔(𝑛𝑛𝐻𝐻 ) +
𝑔𝑔(𝑛𝑛𝐼𝐼 )
= 110 + 232 + 242 + 252
= 836
Now,
Total cost of search
∑ 𝑔𝑔(𝑛𝑛) + ∑ ℎ(𝑛𝑛)
= 836 + 640
= 1476
12
Artificial Intelligence
13
Artificial Intelligence
Step 1: Step 4:
Step 2:
Now,
Total distance cost
∑ 𝑔𝑔𝑛𝑛 = 110 + 200 + 300
= 610
Now,
Total cost of search
∑ ℎ𝑛𝑛 + ∑ 𝑔𝑔𝑛𝑛
Since, 𝑓𝑓(𝑛𝑛𝐺𝐺 ) is less than that of 𝑓𝑓(𝑛𝑛𝐹𝐹 ). so, = 540 + 610
we choose node G. = 1150
𝑖𝑖. 𝑒𝑒. 𝑓𝑓(𝑛𝑛𝐺𝐺 ) < 𝑓𝑓(𝑛𝑛𝐹𝐹 )
The path is:
14
Artificial Intelligence
Eg:
15
Artificial Intelligence
or, C2 + 2I = 1
Chapter 4 Since the sum of carry and 2I does not
Adversial Search generate carry the value of the I ranges from
Crypto-Arithmetic Problem 0 to 4 but it must provide the result to be A
i.e. 1 so, I can't be supposed to be 1,2,3, and
NINA 4 as well because it results other number
+ SING than 1 i.e. A . The only remaining in our
AGAIN range so it must be 0 i.e. we should consider
I be 0.
Soln
Variable Used (V) = {N,I,A,S,G} When the value of the I is substituted to the
Digit Available (D) = {0,1,2,3.......,9} equation then we get,
Carry Possible(C) = {0,1} C2 + 2 * 0= 1
(Since there is addition of two digit only Therefore, C2 = 1.
possible carry is 0 or 1.) Again, substituting the value of I,N and
C2 in equation 2 we get,
Generating Algebraic equation: C1 + 5+ 5 = 0+ 10*1
A + G = N + 10 C1 -----------1 or, C1 = 10 -10
C1 + N + N = I +10 C2 ---------2 Therefore, C1 = 0.
C2 + I +I = A +10 C3 ------------3 Again, Substituting the values of A,G,N
C3 + N + S = G + 10C4 ----------4 and C1 in Equation 1, we get
C4 = A 1 + 4 = 5 + 10 * 0
Since the last carry is A i.e. C4 and normally i.e. 5 = 5 which is true.
the initial digit of any number are not So our expected values are valid.
represented with the Zero and so the Hence, the required value of Variables are
possible carry for the given expression is 0 {N,I,A,S,G} = { 5, 0, 1, 9, 4}
and 1 so the value of A can be expected as
1.
Therefore, C4 = A = 1
Now, substituting the value of C4 in
equation 4 we get,
C3 + N + S= G + 10* 1
or, C3 + N + S = G + 10
It surely express that the sum of N + S
+C3 must give carry. So, their value ranges
from 5 to 9.
Let us consider that the value of S be 9 and
C3 be 0
So, S= 9 and C3 =0
Then, the equation becomes,
0 + N + 9 = G + 10
or, N = G + 10 – 9
or, N = G + 1
Now, let the value of the G be the 4 as the
value of the N and S ranges from 5 to 9.
Therefore, N = 4 + 1= 5
Again, Substituting the value of the A and
C3 in equation 3. we get,
C2 + I + I = A + 10 * 0
or, C2 + 2I = 1 + 0
16
Artificial Intelligence
17
Artificial Intelligence
18
Artificial Intelligence
WHO THE HE
IS TEN SEES
+THIS +MEN +THE
IDIOT MEET LIGHT
ON SEE
MONTY SEND
+PYTHON +TEN
SPIRIT THERE
BARREL MOSES
+BROOMS +MEETS
SHOVELS SALOME
19
Artificial Intelligence
Game Playing
Game can be deterministic which consist of
one or two or more players with perfect
information and turn taking simultaneous
action. It want algorithm for calculating a
strategy which recommends more in each
state.
Deterministic Game can be
mathematically characterized as
G(S,P,A,f,R) where
States: S (starts at sd)
Player: P = {1,……..N}
Action:A (may depend on player or state)
Transition function: f = S*A R
Note: solution for a player is a
Policy: S*PR
8 1 6
3 5 7
4 9 2
1 15 14 4
12 6 7 9
8 10 11 5
13 3 2 16
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 2
11 18 25 2 9
1 35 34 33 32 6
30 8 28 27 11 25
24 33 15 16 20 19
18 17 21 22 14 13
12 26 16 9 29 7
31 5 4 3 2 36
30 39 48 1 10 19 28
38 47 7 9 18 27 29
46 6 8 17 26 35 37
5 14 16 25 34 36 45
13 15 24 33 42 44 4
21 23 32 41 43 3 12
22 31 40 49 2 11 20
20
Artificial Intelligence
Game Tree
21
Artificial Intelligence
Sub-tree
22
Artificial Intelligence
Good Move
23
Artificial Intelligence
Algorithm
1. Generate game tree completely
2. Determine utility of each terminal
state
3. Propagate the utility values upward
in tree by applying MIN and MAX
operators on nodes in the current
level
4. At the root node use minimum
decision to select move max (of the
main) utility value.
Note: step (2) and (3) in the algorithm
assumes that the opponent will play
perfectly.
Mini-Max Tree
24
Artificial Intelligence
Step 1 Step 4
Step 5
Step 2
Step 6
Step 3
25
Artificial Intelligence
Step 7:
Step 11:
Step 12
Step 8:
𝑀𝑀𝑀𝑀𝑀𝑀 𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣
= max[min(3,12,8) , min(2,5,7) , min(14,5,2)]
= max[3,2,2]
=3
Property
• Optimal against a perfect player
Step 9: • Time Complexity : 𝑂𝑂(𝑏𝑏 𝑚𝑚 )
• Space Complexity: 𝑂𝑂(𝑏𝑏 𝑚𝑚 )
Example:
For chess, b ≈ 32, m ≈100
Exact solution is completely infeasible.
Resource Dimit
- Cannot search to leaves
- Depth Dimited search
Step 10: - Guarantee of optimal play
26
Artificial Intelligence
𝜶𝜶 − 𝜷𝜷 𝑷𝑷𝑷𝑷𝑷𝑷𝑷𝑷𝑷𝑷𝑷𝑷𝑷𝑷 Step 2:
The problem with min-max search
is that the number of game states it has to
examine in exponential in the exponent but
can effectively cut it in half we can borrow
the idea of pruning in order to eliminate
larger parts of the tree from consideration
and that technique is 𝛼𝛼 − 𝛽𝛽 𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃.
When applied to standard min-max tree it
returns the same moves as min – max would Step 3:
but prunes away branches that cannot
possibly influence the final decision.
Step 1:
27
Artificial Intelligence
• Fido is a dog
Dog (Fido)
Fig: Components of AI
28
Artificial Intelligence
d. Heuristic knowledge
- It is also referred as “Rule of
Thumb” and is empirical and
opposed to deterministic
Eg: if I start seeing shop. I am close to
market
a. Procedural Knowledge
- It describes how to do things as well
as provides a set of direction how to Fig: Types of Knowledge
perform
Eg: how to make coffee There are various method to represent
knowledge and choosing proper
representation method is important as it
helps in reasoning because knowledge is
power for drawing conclusion in given
domain.
29
Artificial Intelligence
Facts are building blocks/atomic units of Eg: if it is raining then I will not go to
knowledge which represents declarative college
knowledge. A proposition is considered as
facts which is the statement which Compound Rules
expresses truth value i.e. either true or false Eg: if it is raining and I have an umbrella
but not both. then I will go to home
Eg: P: It is raining. Rules can be classified as
1. Relationships
Facts can be classified as - Used to express a direct occurance
a. Single valued or multivalued relationship between two events.
- Each facts or attributes can take one Eg: if Nib is broken, then pen is not
or more than one values at the same working
time.
Eg: A person may have one hair color but 2. Recommendation
many cars. - Offers recommendation on the basis
of some known information
b. Uncertain Facts Eg: if it is raining then bring an umbrella
- It represents uncertain information
Eg: it will probably rain today 3. Directive
- Like recommendation rules but they
c. Fuzzy facts offers a specific lines of action as
- They can ambigious facts used to opposed to the “advice” of
represents unclear description and recommendation
uses certainity factor values to Eg: if it is raining and don’t have an
specific value of path umbrella then wait until the rain stops
Eg: I am heavy / light.
4. Variable
d. Object attribute Value triplet fact - If same type of rule is applied to
composed of three facts i.e. object, multiple object we use it.
attributes and value which are used
to assert a specify property of rules With variables Eg:
object. If X Is a Student
Eg: Ram’s Eyecolor is Black AND X’s GPA>3.8
O A V
Then place X on merit list
30
Artificial Intelligence
Tautology
Tautology is the condition of the statement
whose truth value is always true for
combination of each variables of given
domain.
31
Artificial Intelligence
Eg:
Male(Ram)
Male(Hari)
Parent(Ram,hari)
Father(x,y):- Parent(x,y),male
x,y are variables
Ram, Hari are constant
32
Artificial Intelligence
33
Artificial Intelligence
34
Artificial Intelligence
35
Artificial Intelligence
John likes all kind of food. Apple Semantic Nets and Frame
are food. Chicken are food. Semantic nets are the graph with
Anything anyone eats and isn’t nodes representing objects and arcs
killed by is food. Bill eats peanuts representing relationship between objects
and is still alive. Sue eats everything various type of relationship may be defined
Bill eats. Prove “John likes peanuts” using semantic Nets “is – a” i.e. inheritance
using resolution. and “has – a” i.e. ownership are two types
of most used relationship.
Every child loves Santa. Everyone
who loves Santa is loved by any
reindeer. Rudolph is a reindeer and
Rudolph has a red nose. Anything
which has red nose is weird or is a Fig: Vehicle Semantic Net
clown. No reindeer is clown.
Scrooge doesn’t love anything Semantic Nets are computationally
which is weird. Conclusion: expensive at runtime as we need to traverse
“Scrooge is not a child”. the network to answer some question. In
worst case, it may need to traverse the entire
Anyone whom Mary love is a network and then discover that the
football star. Any student who requested information doesn’t exist. It can’t
doesn’t pass doesn’t play. John is a model human associated memory as human
student. Any student who doesn’t brain consist of number of neuron (about
study doesn’t pass. Anyone who 1010 neuron) which are interlinked with
doesn’t play is not a football star. each other. Semantic nets are logically
Conclusion: “If John doesn’t study inadequate as they don’t have any
Mary doesn’t loves John” equivalent quantifier i.e. ∃, ∀.
Eg:
A person is a mammal.
36
Artificial Intelligence
Bimal Gharti Magar is in Nepali team. Frames are the data structure for
resonating stereo-typical knowledge of
same concept or object i.e. it is the
collection of attributes and associated
values that can be describe some entity in
Uniform color of Bimal Gharti Magar is real world. Frames are similar to schema
blue/red. in DBMS. They are developed from a
semantic nets and can be used to encode
knowledge and support reasoning. Frames
consists of various components and they
are termed as slots.
Combining all of above information. We
get, Frame Name: Frame Name:
Student Course
Properties: Properties:
Age: 19 C-Name: 19
GPA: 4.0 Credit Hr: 4.0
Ranking: 1 C-ID: BEG471CO
Fig: Student Frame Fig: Course Frame
Properties: Properties:
Age:19 C-Name: 19
GPA: 4.0 Credit Hr: 4.0
Ranking: 1 C-ID: BEG471CO
Fig: Student & course frame with
relationship
37
Artificial Intelligence
A person is a mammal.
38
Artificial Intelligence
Types of Learning.
Chapter 6
1. Learning by Analogy
2. Rote Learning
Machine Learning / Learning 3. Learning by Example
Concept of Learning 4. Explanation based Learning
One of the most often heard criticism of AI 5. Learning from the advice/influence
is that machine can’t be called intelligent of other
until they are able to do new things and to 6. Reinforcement Learning
adopt to new condition rather than simply
doing as they told to do. So, there can be
little queries that the ability to adopt to view 1. Learning by Analogy
surrounding and to solve new problem is a Analogy is a powerful interface tool
vital characteristics of intelligent agent. for a learning system.
Let us consider an example, consider the
Definition following sentence
Changes in a system that are adaptive in the Boys are like monkeys.
sense that they enable the system to do the One of the property of monkey is it
same task or takes down from some shows mischievous activities
population more efficiently the next time. Realizes that boys shows the
Learning covers large range phenomena, at mischievous activities and disturb
one end of the system is skill requirement others.
and other end of the spectrum lies
knowledge acquisition. Human often solve by making analogies to
things they already know/understand how
Skill Requirement to do. This process is more complex than
People get better at many task simply by string macro-operators, because the old
practicing and repeating the same task for problem may be different from the new
the multiple numbers of times. problem. The difficulty comes in
Eg: if you play chess or play football, you determining, what things are similar and
will be better to play next move. what are not.
Two methods of analogical problem
Knowledge Acquisition solving have been stored in AI.
As we have seen, many AI programs draw a. Transformational Analogy
heavily or knowledge as their source and b. Derivational Analogy
power knowledge acquired by experience.
Knowledge Acquisition includes many Transformational Analogy
various activities such as storing the Suppose you are asked to prove theorem in
computed information and utilizing the plane geometry you might look for a
information for the task intake. previous theorem that is very similar and
“copy” its proofs making substitution when
necessary. The idea is to transfer a solution
of previous problem into a solution for
current problem and figure below shows the
process.
39
Artificial Intelligence
Derivational Analogy
Transformational analogy doesn’t work at
how the old problem was solved. It only
looks at the final solution. The detail of a
problem solving episode is called its
Fig: Transformational Analogy derivation. Analogical learning that take
Eg: their histories into account is called
derivation analogy. It is necessary
component in transfer of skills complex
decision.
Old problem:
New Proof: BO = OA Radii
∠ABD = ∠EBC Given ∠OAB = ∠OBA Base ∠s of ∆
∠DBE = ∠EBD Reflexive ∠AOC = ∠OAB + Sum of 2 interior
∠ABD + ∠DBE = Additive ∠OBA ∠s of ∆ =
∠EBC + ∠EBD exterior angle
∠ABE = ∠DBC Transitive ∠AOC = ∠OBA + ∠OAB = ∠OBA
∠OBA
∠AOC = 2 ∠OBA
Derived: central angle twice inscribed.
40
Artificial Intelligence
41
Artificial Intelligence
Example 1:
Maximum Conditional Independence
If the hypothesis can be cast in a Bayesian
framework, try to maximize conditional
independence.
Fig: EBL Architecture
42
Artificial Intelligence
Latent variable
Fig: EBL System Schematic
Observation (o/p)
Unsupervised learning
In this approach all observation are
assumed to be caused by latent variable i.e.
the observation are assumed to be at the end
of the casual chain. It is not needed as long
as input are available, but if some of inputs
43
Artificial Intelligence
4. Analogical Reasoning:
Chapter 7
It works by drawing analogies between
two situations, looking for similarities and
Reasoning
difference.
Reasoning is the process of deriving logical
Eg: When you say riding a bicycle
conclusion from given facts where works
is just like scooter.
with knowledge, facts and problems
By analogy there must be
solving strategies.
similarities in riding but difference
in their characteristics.
Types:
1. Deductive Reasoning:
5. Common Sense Reasoning:
It is based on deducing new information
It is an informal form of reasoning that
from logically related known information.
uses rules gain through experience or rule
A deductive arguments offers assertion that
of thumb. It operates on heuristic
leads automatically to conclusion.
knowledge and heuristic loop.
Eg: If there is dry wood, oxygen and a spark
Eg: If I am seeing shop. I am near to
there will be fire.
market.
We deduce: there will be fire.
All kings are mortal. Birenda is a king.
6. Non-Monotonic Reasoning:
We deduce: Birendra is mortal.
It is used when facts of the case or likely
to change to change after sometime.
2. Inductive Reasoning:
It is based on forming or inducing
Eg: If the wind blows. The curtain sway.
generalization from a limited set of
When the wind stops the curtain should
observation and is based on experience.
sway no longer. However if we use
Eg:
monotonic reasoning this wouldn’t happen.
Observation: All the crow that, I have seen
The fact that the curtains are swaying
in my life are black.
would be retained even further and stopped
Conclusion: All crow are black.
blowing.
3. Abductive Reasoning:
In non-monotonic reasoning, have
Deduction is exact in the sense that
truth maintenance system which keeps
deduction follow in a logically provable
track of what caused a fact to become true
way from axioms. It is a form of deduction
and if cause is removed then fact is
that allows for plausible inference i.e. the
removed.
conclusion might be wrong.
Eg: She carries an umbrella if it is raining.
Axiom: She is carrying an umbrella.
Conclusion: It is raining.
Here, she might carry umbrella if it is
raining.
44
Artificial Intelligence
45
Artificial Intelligence
Eg:
0.2 Let us consider an example of a certain area
of Bkt which can detect earthquakes & fire
0.1
0.1 0.1 & it initialize the dorm. Then Saroj &
0 Sanskriti be the call operator & its graph
A B C D can be represented as:
Events
& ∑ 𝑃𝑃𝑃𝑃 = 1
The probability of any event must be
between o & 1 or equal to 0/1
Bayes theorem
Bayes theorem can be expressed as
𝐵𝐵
𝐴𝐴 𝑃𝑃 �𝐴𝐴 � 𝑃𝑃(𝐴𝐴) Let us consider probability for each:
𝑃𝑃 � � =
𝐵𝐵 𝑃𝑃(𝐵𝐵)
i.e.
𝐵𝐵
𝐴𝐴 𝑃𝑃 �𝐴𝐴 , 𝐸𝐸� 𝑃𝑃(𝐴𝐴, 𝐸𝐸)
𝑃𝑃 � , 𝐸𝐸� =
𝐵𝐵 𝑃𝑃(𝐵𝐵/𝐸𝐸)
where, E represents event
Statistical reasoning
There are several techniques that can be
used to augment knowledge representation
technique with statistical measures that
describes levels of evidence & belief. An
important goal for many evidence as the
system goes along & to modify its behavior, Retrieving probability from the conditional
we need a statistical theory of evidence. distribution
Bayesian statistics is such a theory of which 𝑃𝑃(𝑥𝑥1 , 𝑥𝑥2 , … … , 𝑥𝑥𝑛𝑛 )
stress the conditional probability as 𝑛𝑛
46
Artificial Intelligence
Soln
10% of patient entering have liver disease
𝑃𝑃(𝐿𝐿) = 0.1
5% of patient are alcoholic 𝑃𝑃(𝐴𝐴) = 0.05
7% of patient diagnosed with liver disease
are alcoholic 𝑃𝑃(𝐿𝐿 𝑛𝑛 𝐴𝐴) = 0.07
Probability of patient who are alcoholic that
𝐴𝐴
have chances of liver 𝑃𝑃 �𝐿𝐿 � =?
By Bayes theorem,
𝐿𝐿
𝐴𝐴 𝑃𝑃� �∗𝑃𝑃(𝐴𝐴)
𝐴𝐴
𝑃𝑃 �𝐿𝐿 � =
𝑃𝑃(𝐿𝐿)
47
Artificial Intelligence
Retrieve
Given a target problem, retrieve
form memory cases relevant to solve it. A
case consist of a problem, its solution and
annotation about how solution was derived.
Example: Sabin wants to prepare
cappuccino, being a novice, the most
relevant experience he can recall is one in
which he successfully made coffee.
Reuse:
Map the solution from the precious
cases to the target problem which may
involve adapting the solution as needed to
fit new situation. In above example, Sabin
must adapt his retrieved solution to include
how much the coffee is to be stirred.
48
Artificial Intelligence
iii. R1/XCON
It also term as EXCON which was
developed by Digital Equipment
Corporation which supports computer
49
Artificial Intelligence
4. Knowledge Base
It contains domain knowledge i.e. facts,
rules, concept and relationships. The
strength of expert system lies on the
richness of knowledge. So, knowledge
engineers are accounted to design
knowledge base. As knowledge engineer,
designer must overcome the knowledge
acquisition bottle neck and find an effective
way to get information from the expert and
encode it in the knowledge base, using
knowledge representation technique.
Fig: Structure of Expert System.
5. Working Memory
Components of Expert System It contains the problem facts that are
1. Domain Expert discovered during session. In this, user
2. Knowledge engineer presented facts about the situation are
3. System engineer stored in memory and using knowledge
4. Knowledge base stored in KB, new information is informed
5. Inference engine and also added to working memory:
6. Working memory Eg:
7. User Interface and user 𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀 (𝑅𝑅𝑅𝑅𝑅𝑅)
𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃 𝐹𝐹𝐹𝐹𝐹𝐹𝐹𝐹𝐹𝐹 �𝐹𝐹𝐹𝐹𝐹𝐹ℎ𝑒𝑒𝑒𝑒 (𝑅𝑅𝑅𝑅𝑅𝑅, 𝑆𝑆ℎ𝑦𝑦𝑦𝑦𝑦𝑦)
1. Domain Expert 𝐹𝐹𝐹𝐹𝐹𝐹ℎ𝑒𝑒𝑒𝑒 (𝑅𝑅𝑅𝑅𝑅𝑅, 𝐻𝐻𝐻𝐻𝐻𝐻𝐻𝐻)
Domain expert are the person who have
skills and knowledge to solve specific The presented facts are used to generate
problem in a manner superior to other. An new information or the knowledge which is
expert should have knowledge of given added in working memory let the
domain, good communication skills, information generated is brother (Shyam,
availability and rediness to cooperate Hari)
So, the content of WM is
2. Knowledge engineer 𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀 (𝑅𝑅𝑅𝑅𝑅𝑅)
Knowledge engineer is a person who 𝐹𝐹𝐹𝐹𝐹𝐹ℎ𝑒𝑒𝑒𝑒 (𝑅𝑅𝑅𝑅𝑅𝑅, 𝑆𝑆ℎ𝑦𝑦𝑦𝑦𝑦𝑦)
𝑁𝑁𝑁𝑁𝑁𝑁 𝐹𝐹𝐹𝐹𝐹𝐹𝐹𝐹𝐹𝐹 �
designs build and test an expert system. 𝐹𝐹𝐹𝐹𝐹𝐹ℎ𝑒𝑒𝑒𝑒 (𝑅𝑅𝑅𝑅𝑅𝑅, 𝐻𝐻𝐻𝐻𝐻𝐻𝑖𝑖)
He/she plays key role in identifying, 𝐵𝐵𝐵𝐵𝐵𝐵𝐵𝐵ℎ𝑒𝑒𝑒𝑒 (𝑆𝑆ℎ𝑦𝑦𝑦𝑦𝑦𝑦, 𝐻𝐻𝐻𝐻𝐻𝐻𝐻𝐻)
acquiring and encoding knowledge.
6. Inference Engine
3. End user it is the chief part of ES which matches the
All people who users ES are end user or facts contained in WM with domain
users knowledge presented in KB to draw
conclusion of problem. It acts with KB &
WM where both facts are presented in WM
to draw new information. Then, inference
engine matches the given facts, if match
found fires the conclusion of the rule i.e.
adds the conclusion to WM.
50
Artificial Intelligence
51
Artificial Intelligence
2.
Rule 1 If patient has deep cough
And we suspect an infection
Then patient has Pneumonia
Rule 2 If patient temp. is above 100oF
Then patient has fever
Rule 3 If patient has been sick for over
a fortnight
And the patient has fever
Then, we suspect infection
Facts:
Patient temp. is 103oF.
Patient has been sick for over a month
Patient has violent coughing fits.
Solution:
KB WM
(Knowledge Based) (Working Memory)
Rule1:
If patient has deep
cough
and we suspect and
infection
then the patient has
pneumonia.
Rule 2:
It the patients temp is
above 100oF,
then patient has fever.
Rule 3:
If the patient has been
sick for over a
fortnight
and patient has fever
then we suspect
infection.
1st Pass
Rule1:
If patient has deep
cough
and we suspect and
infection
then the patient has
pneumonia.
52
Artificial Intelligence
2nd Pass
Patient has deep cough.
The sub goal patient has deep cough is not
found in any part of the given rules
3rd Pass
We suspect an infection.
Rule 3:
If the patient has Patient has been sick
been sick for over a for over a fortnight.
fortnight and patient Patient has fever.
has fever then we
suspect infection.
53
Artificial Intelligence
4th Pass
Patient has been sick for over a fortnight
The sub goal is not found in the any part of
the given rules
5th Pass
Patient has fever
Rule 2:
It the patients temp is The patients temp
above 100oF, the n is above 100oF.
patient has fever.
6th Pass
The patients temp is above 100oF
The sub-goal is of found in any part of the
given rules.
7th Pass
• Patient has deep cough.
• Patient has been sick for over a
fortnight.
• The patients temp is above 100oF.
Conclusion
The patient has Patient has deep
pneumonia. cough.
Patient has been
sick for over a
fortnight.
The patients
temp is above
100oF.
54
Artificial Intelligence
55
Artificial Intelligence
OR Gate
A B F
0 0 0
0 1 1
1 0 1
1 1 1
AND Gate
A B F
0 0 0
0 1 0
1 0 0
1 1 1 Hebbian Learning Neural Network
Updating Function.
NOT Gate 𝑤𝑤𝑖𝑖 (𝑛𝑛𝑛𝑛𝑛𝑛) = 𝑤𝑤𝑖𝑖 (𝑜𝑜𝑜𝑜𝑜𝑜) + 𝑥𝑥𝑖𝑖 𝑡𝑡 t is target
A F value
0 1 𝑏𝑏(𝑛𝑛𝑛𝑛𝑛𝑛) = 𝑏𝑏(𝑜𝑜𝑜𝑜𝑜𝑜) + 𝑡𝑡 & b is bias
1 0 value
Multilayered Perceptron
The XOR is non-linearly separable i.e. two
lines or more likely are required to separate
data without in corporating errors. So
multilayered perceptron achieves a
properties to provide acceptable for these
problems by encompassing one or more
hidden layers where each neuron in the
56
Artificial Intelligence
57
Artificial Intelligence
58
Artificial Intelligence
59
Artificial Intelligence
60
Artificial Intelligence
Phase II:
Apply the value in network Now, applying 4th input as (-1, -1) and
target =-1
𝑦𝑦𝑖𝑖𝑖𝑖 = −0.1004 + 0.2476 ∗ (−1) +
0.3324 ∗ (−1)
= −0.6804
New weight
𝑏𝑏𝑛𝑛𝑛𝑛𝑛𝑛 = −0.1004 + 0.1(−1 + 0.6804)1
Now, applying 2nd input as (-1,1) and = 0.13236
target =-1 𝑤𝑤1𝑛𝑛𝑛𝑛𝑛𝑛 = 0.2476 + 0.1(−1 + 0.6804)
𝑦𝑦𝑖𝑖𝑖𝑖 = 0.14 + (0.24 ∗ −1) + (0.34 ∗ 1) ∗ (−1)
= 0.24 = 0.27956
New weight 𝑤𝑤2𝑛𝑛𝑛𝑛𝑛𝑛 = 0.3324 + 0.1(−1 + 0.6804)
𝑏𝑏𝑛𝑛𝑛𝑛𝑛𝑛 = 0.14 + 0.1(−1 − 0.24) ∗ (−1)
= 0.016 = 0.36436
𝑤𝑤1𝑛𝑛𝑛𝑛𝑛𝑛 = 0.24 + 0.1(−1 − 0.24). (−1) Maximum change is 0.03196
= 0.364
𝑤𝑤2𝑛𝑛𝑛𝑛𝑛𝑛 = 0.34 + 0.1(−1 − 0.24)1 After Phase IV
= 0.216 Continue from phase I until the change is
Maximum change is 0.124 lesser than 0.01
After 500 to 600 number of iteration, we
Phase III: get, 𝑏𝑏 = −0.5, 𝑤𝑤1 = 0.5, 𝑤𝑤2 = 0.5
Applying the value in network i.e. Divide the value of b, w1, w2 by 4 of
Hebbian Network
61