AI3391 ARTIFICAL INTELLIGENCE
(II YEAR (III Sem))
Department of Artificial Intelligence and Data
Science
Session 22
by
Asst.Prof.M.Gokilavani
NIET
1/24/2024 Department of AI & DS 1
TEXTBOOK:
• Artificial Intelligence A modern Approach, Third Edition,
Stuart Russell and Peter Norvig, Pearson Education.
REFERENCES:
• Artificial Intelligence, 3rd Edn, E. Rich and K.Knight
(TMH).
• Artificial Intelligence, 3rd Edn, Patrick Henny Winston,
Pearson Education.
• Artificial Intelligence, Shivani Goel, Pearson Education.
• Artificial Intelligence and Expert Systems- Patterson,
Pearson Education.
1/24/2024 Department of AI & DS 2
Topics covered in session 22
1/24/2024 Department of AI & DS 3
• Game theory
• optimal decision in games
• alpha beta Search
• Monte Carlo tree search
• stochastic games
• partially observed games
• Constraint satisfaction problem
• Constraint propagation
• Backtracking search for CSP
• Local search for CSP
• structure of CSP.
Cryptarithmetic Problem
• Cryptarithmetic Problem is a type of constraint
satisfaction problem where the game is about digits and
its unique replacement either with alphabets or other
symbols.
• In cryptarithmetic problem, the digits (0-9) get
substituted by some possible alphabets or symbols.
• The task in cryptarithmetic problem is to substitute
each digit with an alphabet to get the result
arithmetically correct.
• We can perform all the arithmetic operations on a given
cryptarithmetic problem.
1/24/2024 4
Department of AI & DS
Constraints for cryptarithmetic
problem
• Unique digit to be replaced with a unique alphabet
(no repeated digits).
• The result should satisfy the predefined arithmetic
rules, i.e., 2+2 =4
• Digits should be from 0-9 only.
• In addition operation only one carry forward.
• The problem can be solved from both sides,
i.e., lefthand side (L.H.S), or right-hand side
(R.H.S)
1/24/2024 5
Department of AI & DS
Example 1
• Given a cryptarithmetic problem, i.e., S E N D
+ M O R E = M O N E Y.
1/24/2024 6
Department of AI & DS
Step 1
1/24/2024 7
Department of AI & DS
• Starting from the left hand side (L.H.S) , the terms
are S and M. Assign a digit which could give a
satisfactory result. Let’s assign S->9 and M->1.
Hence, we get a satisfactory result by adding up the
terms and got an assignment for O as O->0 as well.
Step 2
• Now, move ahead to the next terms E and O to
get N as its output.
1/24/2024 8
Department of AI & DS
Adding E and O, which means 5+0=0, which is not
possible because we cannot assign the same digit to
two letters.
• Add carry 1 to the value E to change the
value of alphabet.
1/24/2024 9
Department of AI & DS
Step 3
1/24/2024 10
Department of AI & DS
• Further, adding the next two terms N and R we get,
But, we have already assigned E->5. Not possible with 5 to E
Again, after solving the whole problem, we will get a
carryover on this term, so our answer will be satisfied.
Step 4
• Again, on adding the last two terms, i.e., the
rightmost terms D and E, we get Y as its result.
1/24/2024 11
Department of AI & DS
• Keeping all the constraints in mind, the final resultant
is as follows:
1/24/2024 12
Department of AI & DS
Alphabets Values
S 9
E 5
N 6
D 7
M 1
O 0
R 8
Y 2
Example 2
1/24/2024 13
Department of AI & DS
Example 3
1/24/2024 14
Department of AI & DS
Topics to be covered in next session 23
• Backtracking CSP’s
Thank you!!!
1/24/2024 Department of AI & DS 15

AI3391 Artificial intelligence Session 22 Cryptarithmetic problem.pptx

  • 1.
    AI3391 ARTIFICAL INTELLIGENCE (IIYEAR (III Sem)) Department of Artificial Intelligence and Data Science Session 22 by Asst.Prof.M.Gokilavani NIET 1/24/2024 Department of AI & DS 1
  • 2.
    TEXTBOOK: • Artificial IntelligenceA modern Approach, Third Edition, Stuart Russell and Peter Norvig, Pearson Education. REFERENCES: • Artificial Intelligence, 3rd Edn, E. Rich and K.Knight (TMH). • Artificial Intelligence, 3rd Edn, Patrick Henny Winston, Pearson Education. • Artificial Intelligence, Shivani Goel, Pearson Education. • Artificial Intelligence and Expert Systems- Patterson, Pearson Education. 1/24/2024 Department of AI & DS 2
  • 3.
    Topics covered insession 22 1/24/2024 Department of AI & DS 3 • Game theory • optimal decision in games • alpha beta Search • Monte Carlo tree search • stochastic games • partially observed games • Constraint satisfaction problem • Constraint propagation • Backtracking search for CSP • Local search for CSP • structure of CSP.
  • 4.
    Cryptarithmetic Problem • CryptarithmeticProblem is a type of constraint satisfaction problem where the game is about digits and its unique replacement either with alphabets or other symbols. • In cryptarithmetic problem, the digits (0-9) get substituted by some possible alphabets or symbols. • The task in cryptarithmetic problem is to substitute each digit with an alphabet to get the result arithmetically correct. • We can perform all the arithmetic operations on a given cryptarithmetic problem. 1/24/2024 4 Department of AI & DS
  • 5.
    Constraints for cryptarithmetic problem •Unique digit to be replaced with a unique alphabet (no repeated digits). • The result should satisfy the predefined arithmetic rules, i.e., 2+2 =4 • Digits should be from 0-9 only. • In addition operation only one carry forward. • The problem can be solved from both sides, i.e., lefthand side (L.H.S), or right-hand side (R.H.S) 1/24/2024 5 Department of AI & DS
  • 6.
    Example 1 • Givena cryptarithmetic problem, i.e., S E N D + M O R E = M O N E Y. 1/24/2024 6 Department of AI & DS
  • 7.
    Step 1 1/24/2024 7 Departmentof AI & DS • Starting from the left hand side (L.H.S) , the terms are S and M. Assign a digit which could give a satisfactory result. Let’s assign S->9 and M->1. Hence, we get a satisfactory result by adding up the terms and got an assignment for O as O->0 as well.
  • 8.
    Step 2 • Now,move ahead to the next terms E and O to get N as its output. 1/24/2024 8 Department of AI & DS Adding E and O, which means 5+0=0, which is not possible because we cannot assign the same digit to two letters.
  • 9.
    • Add carry1 to the value E to change the value of alphabet. 1/24/2024 9 Department of AI & DS
  • 10.
    Step 3 1/24/2024 10 Departmentof AI & DS • Further, adding the next two terms N and R we get, But, we have already assigned E->5. Not possible with 5 to E Again, after solving the whole problem, we will get a carryover on this term, so our answer will be satisfied.
  • 11.
    Step 4 • Again,on adding the last two terms, i.e., the rightmost terms D and E, we get Y as its result. 1/24/2024 11 Department of AI & DS
  • 12.
    • Keeping allthe constraints in mind, the final resultant is as follows: 1/24/2024 12 Department of AI & DS Alphabets Values S 9 E 5 N 6 D 7 M 1 O 0 R 8 Y 2
  • 13.
  • 14.
  • 15.
    Topics to becovered in next session 23 • Backtracking CSP’s Thank you!!! 1/24/2024 Department of AI & DS 15