Professional Documents
Culture Documents
Chapter 3 Knowledge Representation
Chapter 3 Knowledge Representation
Crypt-arithmetic problem is where numbers are replaced by alphabets. Using arithmetic rules,
we need to get the numbers from the alphabet.
Example
S E N D
+ M O R E
M O N E Y
General Rules:
1. Each alphabet takes only one number from 0 to 9 uniquely. (A=1, B=5…)
2. Sum of two single digit numbers can be maximum 19 with carry and 18 without carry.
3. Maximum value of Carry in two number addition is always 1.
4. Try to solve leftmost digit in the given problem
Example:
if (a x b) = kb then finds out various possible solution of a, b and k.
solution:
1. (3 x 5) = 15 k=1, a=3, b=5
2. (7 x 5) = 35 k=3, a=7, b=5
3. (6 x 8) = 48 k=4, a=6, b=8
4. (6 x 4) = 24 k=2, a=6, b=4
5. (9 x 5) = 45 k=4, a=9, b=5
6. (6 x 2) = 12 k=1, a=6, b=2
First number J E
Second number X B B
J E
J E A
B A D E
First number 1 2
Second number X 2 3
3 6
2 4 0
0 2 7 6
(Above table shows multiplication of 12 and 23)
First number J E
Second number X 1 1
J E
J E 0
1 0 D E
First number J 4
Second number X 1 1
J 4
J 4 0
1 0 D 4
1 + J = 10 J = 10 -1 = 9
First number 9 4
Second number X 1 1
9 4
9 4 0
1 0 3 4
9 + 4 = 1D1D=13D=3
Que 4: If SEND + MORE = MONEY, then find the respective values of alphabets.
S E N D
+ M O R E
M O N E Y
S E N D
+ 1 O R E
1 O N E Y
9 E N D
+ 1 0 R E
1 0 N E Y
9 E N D
+ 1 0 8 E
1 0 N E Y
9 5 6 D
+ 1 0 8 5
1 0 6 5 Y
Assume D=7 so we obtained Y =2
9 5 6 7
+ 1 0 8 5
1 0 6 5 2
Que 5: From the table given below find the value of NAME.
First number H E
Second number X E H
H E
H H A
H N M E
HE x H = HE means H=1
First number 1 E
Second number X E 1
1 E
1 1 A
1 N M E
First number 1 E
Second number X E 1
1 E
1 1 9
1 2 0 E
First number 1 7
Second number X 7 1
1 7
1 1 9
1 2 0 7
So NAME = 2907
Que 6:
(a) If GO + TO = OUT, then O + U + T = ?
(b) If USA + USSR = PEACE. Find P + E + A + C + E.
(a)
G O
+ T O
O U T
Clearly you can say that O=1 because carry is generated and it is always 1.
G 1
+ T 1
1 U T
1 + 1 = T means T=2
G 1
+ 2 1
1 U 2
8 1
+ 2 1
1 0 2
Answer: O + U + T = 1 + 0 + 2 = 3
(b) If USA + USSR = PEACE. Find P + E + A + C + E.
- U S A
+ U S S R
P E A C E
Addition of 3 digit number and 4 digit number is 5 digit number means fifth digit is carry
which is always 1. Means P = 1.
- U S A
+ U S S R
1 E A C E
U = E which is not possible
1 + U = 10 + E is possible from this we can say that U = 9 and E = 0
- 9 S A
+ 9 S S R
1 0 A C 0
A + R = E = 0 with carry 1.
so, A = 2 and R = 8
U + S = A = 2 with carry 1, S = 3
S + S + 1 = C, 3 + 3 + 1 = c = 7
932 + 9338 = 10270
so,P + E + A + C + E = 1 + 0 + 2 + 7 + 0 = 10
Assume above figure is the map of country where there are 5 states.
We have to fill the colour in such a way that no two adjacent states / borders contain
same colour.
Draw the constraint graph for above map first to solve the problem.
1 2
4
5
Above figure is constraint graph of above map.
Nodes represent different states while edges represent boundary between two
states.
Constraints are of three types
o Unary constraint: It is having one variable only.
o Binary Constraint: It is having two variables only.
o Higher order Constraint: it is having multiple variables.
CSP are the problem which involves backtracking. It is an optimization of BFS and
DFS.
Various processes involved in solving CSP are
o filtering,
o ordering,
o structuring etc.
o below figure shows one of the possible solution of colour mapping
problem
Predicates are properties, additional information to better express the subject of the
sentence.
A quantified predicate is a proposition , that is, when you assign values to a predicate
with variables it can be made a proposition.
For example :
In P(x) : x>5, x is the subject or the variable and ‘>5’ is the predicate.
P(7) : 7>5 is a proposition where we are assigning values to the variable x, and it has
a truth value, i.e. True.
The set of values that the variables of the predicate can assume is called the Universe or
Domain of Discourse or Domain of Predicate.
Que 9: Give the Difference between Propositional Logic and Predicate Logic.
Scope analysis is not done in Predicate logic helps analyze the scope of
4
propositional logic. the subject over the predicate.
Propositions are combined with Logical Predicate Logic adds by introducing
5
Operators quantifiers
Monotonic Reasoning
Monotonic Reasoning is the process that does not change its direction or can say that it moves
in the one direction.
Monotonic Reasoning will move in the same direction continuously means it will either
move in increasing order or decrease.
But since Monotonic Reasoning depends on knowledge and facts, It will only increase and
will never decrease in this reasoning.
Example:
Sun rises in the East and sets in the West.
Non-monotonic Reasoning
Non-monotonic Reasoning is the process that changes its direction or values as the knowledge
base increases.
It is also known as NMR in Artificial Intelligence.
Non-monotonic Reasoning will increase or decrease based on the condition.
Since that Non-monotonic Reasoning depends on assumptions, It will change itself with
improving knowledge or facts.
Example:
Consider a bowl of water, If we put it on the stove and turn the flame on it
will obviously boil hot and as we will turn off the flame it will cool down
gradually.
Que 12: Give the differences between Monotonic Reasoning and Non-
Monotonic Reasoning.
The addition in knowledge won’t The addition in knowledge will change the
3 change the result. result.
Bayes' rule
Bayesian Statistics
Probability:
Probability can be defined as a chance that an uncertain event will occur. It is the numerical
measure of the likelihood that an event will occur. The value of probability always remains
between 0 and 1 that represent ideal uncertainties.
We can find the probability of an uncertain event by using the below formula.
Sample space: The collection of all possible events is called sample space.
Conditional probability:
Conditional probability is a probability of occurring an event when another event has already
happened.
Let's suppose, we want to calculate the event A when event B has already occurred, "the
probability of A under the conditions of B", it can be written as:
If the probability of A is given and we need to find the probability of B, then it will be given
as:
It can be explained by using the below Venn diagram, where B is occurred event, so sample
space will be reduced to set B, and now we can only calculate event A when event B is already
occurred by dividing the probability of P(A⋀B) by P( B ).
Que 14: In a class, there are 70% of the students who like English and 40% of
the students who likes English and mathematics, and then what is the percent
of students those who like English also like mathematics?
Solution:
Hence, 57% are the students who like English also like Mathematics.
Bayes' theorem is also known as Bayes' rule, Bayes' law, or Bayesian reasoning, which
determines the probability of an event with uncertain knowledge.
In probability theory, it relates the conditional probability and marginal probabilities of two
random events.
Bayes' theorem was named after the British mathematician Thomas Bayes. The Bayesian
inference is an application of Bayes' theorem, which is fundamental to Bayesian statistics.
It is a way to calculate the value of P(B|A) with the knowledge of P(A|B).
Bayes' theorem allows updating the probability prediction of an event by observing new
information of the real world.
Example: If cancer corresponds to one's age then by using Bayes' theorem, we can determine
the probability of cancer more accurately with the help of age.
Bayes' theorem can be derived using product rule and conditional probability of event A with
known event B:
The above equation (a) is called as Bayes' rule or Bayes' theorem. This equation is basic of
most modern AI systems for probabilistic inference.
Que 16: From a standard deck of playing cards, a single card is drawn. The
probability that the card is king is 4/52, then calculate posterior probability
P(King|Face), which means the drawn face card is a king card.
Solution:
Given Data:
A doctor is aware that disease meningitis causes a patient to have a stiff neck, and it occurs
80% of the time. He is also aware of some more facts, which are given as follows:
Let a be the proposition that patient has stiff neck and b be the proposition that patient has
meningitis. , so we can calculate the following as:
P(a|b) = 0.8
P(b) = 1/30000
P(a)= .02
Hence, we can assume that 1 patient out of 750 patients has meningitis disease with a stiff
neck.