Problem Decomposition: Goal Trees, Rule Based Systems, Rule Based Expert Systems. Planning:
STRIPS, Forward and Backward State Space Planning, Goal Stack Planning, Plan Space Planning,
A Unified Framework For Planning. Constraint Satisfaction : N-Queens, Constraint Propagation,
Scene Labeling, Higher order and Directional Consistencies, Backtracking and Look ahead
Strategies.
1. Topic To Be Covered:
Crypt-Arithmetic Problem in AI
Jagdamba Education Society's
SND College of Engineering & Research Centre
Department of Computer Engineering
SUBJECT: Artificial Intelligence & Robotics
Lecture No-13(UNIT-02)
Prof.Dhakane Vikas N
2. Crypt-Arithmetic Problem in AI
What is Crypt-Arithmetic Problem in AI???
It is type of constrained satisfaction problem in Ai
The Crypt-Arithmetic problem in Artificial Intelligence is a type of
encryption problem in which the written message in an alphabetical form
which is easily readable and understandable is converted into a numeric
form which is neither easily readable nor understandable.
In simpler words, the crypt-arithmetic problem deals with the converting
of the message from the readable plain text to the non-readable cipher
text.
The constraints which this problem follows during the conversion is as
follows:
3. Crypt-Arithmetic Problem in AI
What is Crypt-Arithmetic Problem in AI???
The rules or constraints For a crypt-arithmetic problem are as follows:
There should be a unique digit to be replaced for a unique alphabet.
Digits should be from 0-9 only.
There should be only one carry forward, while performing the addition
operation on a problem.
The problem can be solved from both sides, i.e., left-hand side (L.H.S), or
right-hand side (R.H.S) .
There must be only on solution to problem.
Numbers must not begin with zero(e.g.0234 it is incorrect).
Numerical base is 10 to be considered if required
The result should satisfy the predefined arithmetic rules, i.e., 2+2 =4,
nothing else.
4. Crypt-Arithmetic Problem in AI
Let’s understand the crypt arithmetic
problem as well as its constraints
better with the help of an example:
Example:-01(TO+GO=OUT)
STEP-01:
-These alphabets are replaced by numbers
such that all the constraints are satisfied. So
initially we have all blank spaces.
-We start from leftmost side ,there we have
leftmost symbol is:O
-It is the letter which is generated by carrying.
So, carry generated can be only one. SO, we
have O=1.
-When we are doing addition of n letters &
result of adding of letters is n+1 letters ,then
resulted letter value is always 1 as carry.
LETTER DIGIT
T
O 1
G
U
5. Crypt-Arithmetic Problem in AI
Let’s understand the crypt arithmetic
problem as well its constraints better
with the help of an example:
Example:-01(TO+GO=OUT)
STEP-02:
-Next we have T+G=U & O+O=T
-We will go for O+O=T first.
-We have o=1, so O+O(1+1)=2(T)
LETTER DIGIT
T 2
O 1
G
U
6. Crypt-Arithmetic Problem in AI
Let’s understand the crypt arithmetic
problem as well its constraints better
with the help of an example:
Example:-01(TO+GO=OUT)
STEP-03:
-Next we have T+G=U
-We T=2
-So,2+G=U
-Now here, We know U must generate carry
so,2+G Must be 10 or Greater that 10
-Means we must add such number in 2 so,
that it we can get carry generated(or we can
addition 10 or more than 10)
LETTER DIGIT
T 2
O 1
G
U
7. Crypt-Arithmetic Problem in AI
Let’s understand the crypt arithmetic
problem as well its constraints better
with the help of an example:
Example:-01(TO+GO=OUT)
STEP-03:
-Now here, We know U must generate carry
so,2+G Must be 10 or Greater that 10
-Means we must add such number in 2 so, that
it we can get carry generated(or we can
addition 10 or more than 10)
-We have first Option(If we consider G=9):2+G
as 2+9(G)=11,her we get U=1
-But we cant chose U=1 as 1 is already assigned
to O.
-
LETTER DIGIT
T 2
O 1
G
U
8. Crypt-Arithmetic Problem in AI
Let’s understand the crypt arithmetic
problem as well its constraints better
with the help of an example:
Example:-01(TO+GO=OUT)
STEP-03:
-We have second Option(If we consider
G=8):2+G as 2+8(G)=10,her we get U=0
-Which can be chosen & then we can tally the
answer as follows:
2 1
+ 8 1
-------------------
1 0 2
LETTER DIGIT
T 2
O 1
G 8
U 0
9. Crypt-Arithmetic Problem in AI
Let’s understand the crypt arithmetic problem
as well its constraints better with the help of
an example:
Example:-02(SEND+MORE=MONEY)
STEP-01:
-These alphabets then are replaced by numbers
such that all the constraints are satisfied. So
initially we have all blank spaces.
-We start from leftmost side ,there we have
leftmost symbol is:M
-It is the letter which is generated by carrying.
So, carry generated can be only one. SO, we
have M=1.
-When we are doing adding of n letters & result
of adding of letters is n+1 letters ,then resulted
letter value is always 1 as carry.
LETTER DIGIT
S
E
N
D
M 1
O
R
Y
10. Crypt-Arithmetic Problem in AI
Let’s understand the crypt arithmetic problem
as well its constraints better with the help of
an example:
Example:-02(SEND+MORE=MONEY)
STEP-02:
-Next we have S+M=O,WE KNOW M=1 ,SO WE
We have equation s+1=o(here s+m=O has to
generate carry as we have M=1)
-When s=8 ,carry cant be generated (as 8+1=9)
-Only when S=9 carry can be generated so we
have (9+1=10) and hence S=9 & O=0
LETTER DIGIT
S 9
E
N
D
M 1
O 0
R
Y
11. Crypt-Arithmetic Problem in AI
Let’s understand the crypt arithmetic problem
as well its constraints better with the help of
an example:
Example:-02(SEND+MORE=MONEY)
STEP-03:
-Next we have E+O=N(here we have O=0)
-if we do E+0=N(In this case we are having E &
N having same value as anything get added in 0
result will be 0 only.)
-But we cant have E & N with same value
,according to constraint of cryptarithmatic
-So ,there must be carry generated above E,
which will get added at E.
-So, here we assume E+0+1=N i.e. E+1=N(N &
E are differ by 1)—exp(1)
LETTER DIGIT
S 9
E
N
D
M 1
O 0
R
Y
12. Crypt-Arithmetic Problem in AI
Let’s understand the crypt arithmetic problem
as well its constraints better with the help of
an example:
Example:-02(SEND+MORE=MONEY)
STEP-04:
-Next we N+R=E
-Now here addition of N & R must generate
carry as we have assume carry need to be
generated above E.
-So, we need to add such a two numbers such
that they can generate carry, here we cant use
9 number as it is already used.
-So, we can have relation as follow
-N+R=E+10(10,here to represent carry)
-But there might be carry as well over the N so,
we write relation as N+R(+1)=E+10exp(2)
LETTER DIGIT
S 9
E
N
D
M 1
O 0
R
Y
13. Crypt-Arithmetic Problem in AI
Let’s understand the crypt arithmetic problem
as well its constraints better with the help of
an example:
Example:-02(SEND+MORE=MONEY)
STEP-04:
--N+R=E+10(10,here to represent carry)
-But there might be carry as well over the N so,
we write relation as N+R(+1)=E+10— exp(2)
-So now we substitute expression(1) in exp(2)
-we get E+1+R(+1)=E+10
-If here we don’t consider carry R=9
-which is not possible because S=9
-so we need to consider carry her & so R=8
-We still cant have value of N so we go forward.
LETTER DIGIT
S 9
E
N
D
M 1
O 0
R 8
Y
14. Crypt-Arithmetic Problem in AI
Let’s understand the crypt arithmetic problem
as well its constraints better with the help of
an example:
Example:-02(SEND+MORE=MONEY)
STEP-05:
--R=8
-We still cant have value of N so we go forward.
-Next we have D+E=Y has to be such that ,it
can generate carry because we have know carry
has to be generated above N
-Here we know Y must be greater than 11
because 0 and 1 value already taken for O and
M.
-So possibilities are 7+6 or 7+5
-If we take 7+5=12(D=7 & E=5 ,so Y=2)
-N=6
LETTER DIGIT
S 9
E 5
N 6
D 7
M 1
O 0
R 8
Y 2
15. Crypt-Arithmetic Problem in AI
Let’s understand the crypt arithmetic problem
as well its constraints better with the help of
an example:
Example:-02(SEND+MORE=MONEY)
STEP-05:
-
9 5 6 7
+ 1 0 8 5
---------------------------------
1 0 6 5 2
LETTER DIGIT
S 9
E 5
N
D 7
M 1
O 0
R 9
Y 2