Artificial Intelligence Tutorial

Introduction to Artificial Intelligence Intelligent Agents

Search Algorithms

Problem-solving Uninformed Search Informed Search Heuristic Functions Local Search Algorithms and Optimization Problems Hill Climbing search Differences in Artificial Intelligence Adversarial Search in Artificial Intelligence Minimax Strategy Alpha-beta Pruning Constraint Satisfaction Problems in Artificial Intelligence Cryptarithmetic Problem in Artificial Intelligence

Knowledge, Reasoning and Planning

Knowledge based agents in AI Knowledge Representation in AI The Wumpus world Propositional Logic Inference Rules in Propositional Logic Theory of First Order Logic Inference in First Order Logic Resolution method in AI Forward Chaining Backward Chaining Classical Planning

Uncertain Knowledge and Reasoning

Quantifying Uncertainty Probabilistic Reasoning Hidden Markov Models Dynamic Bayesian Networks Utility Functions in Artificial Intelligence

Misc

What is Artificial Super Intelligence (ASI) Artificial Satellites Top 7 Artificial Intelligence and Machine Learning trends for 2022 8 best topics for research and thesis in artificial intelligence 5 algorithms that demonstrate artificial intelligence bias AI and ML Trends in the World AI vs IoT Difference between AI and Neural Network Difference between Artificial Intelligence and Human Intelligence Virtual Assistant (AI Assistant) ARTIFICIAL INTELLIGENCE PAINTING ARTIFICIAL INTELLIGENCE PNG IMAGES Best Books to learn Artificial Intelligence Certainty Factor in AI Certainty Factor in Artificial Intelligence Disadvantages of Artificial Intelligence In Education Eight topics for research and thesis in AI Engineering Applications of Artificial Intelligence Five algorithms that demonstrate artificial intelligence bias 6th Global summit on artificial intelligence and neural networks Acting Humanly In Artificial Intelligence AI and ML Trends in the World AI vs IoT Artificial Communication Artificial intelligence assistant operating system Artificial Intelligence in Pharmacy Artificial Intelligence in Power Station Artificial Intelligence in Social Media Artificial Intelligence in Supply Chain Management Artificial Intelligence in Transportation Artificial Intelligence Interview Questions and Answers Artificial Intelligence Jobs in India For Freshers Integration of Blockchain and Artificial Intelligence Interesting Facts about Artificial Intelligence Machine Learning and Artificial Intelligence Helps Businesses Operating System Based On Artificial Intelligence SIRI ARTIFICIAL INTELLIGENCE SKILLS REQUIRED FOR ARTIFICIAL INTELLIGENCE Temporal Models in Artificial Intelligence Top 7 Artificial Intelligence and Machine Learning trends for 2022 Types Of Agents in Artificial Intelligence Vacuum Cleaner Problem in AI Water Jug Problem in Artificial Intelligence What is Artificial Super Intelligence (ASI) What is Logic in AI Which language is used for Artificial Intelligence Essay on Artificial Intelligence Upsc Flowchart for Genetic Algorithm in AI Hill Climbing In Artificial Intelligence IEEE Papers on Artificial Intelligence Impact of Artificial Intelligence On Everyday Life Impact of Artificial Intelligence on Jobs

Cryptarithmetic Problem in AI

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.

The rules or constraints on a cryptarithmetic problem are as follows:

  • There should be a unique digit to be replaced with a unique alphabet.
  • The result should satisfy the predefined arithmetic rules, i.e., 2+2 =4, nothing else.
  • 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., lefthand side (L.H.S), or righthand side (R.H.S)

Let’s understand the cryptarithmetic problem as well its constraints better with the help of an example:

  • Given a cryptarithmetic problem, i.e., S E N D + M O R E = M O N E Y
Send More money

In this example, add both terms S E N D and M O R E to bring M O N E Y as a result.

Follow the below steps to understand the given problem by breaking it into its subparts:

  • 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.
cryptarithmetic problem

Hence, we get a satisfactory result by adding up the terms and got an assignment for O as O->0 as well.

  • Now, move ahead to the next terms E and O to get N as its output.
move ahead to the next terms E and O to get N

Adding E and O, which means 5+0=0, which is not possible because according to cryptarithmetic constraints, we cannot assign the same digit to two letters. So, we need to think more and assign some other value.

Adding E and O

Note: When we will solve further, we will get one carry, so after applying it, the answer will be satisfied.                       

  • Further, adding the next two terms N and R we get,
next two terms N and R

But, we have already assigned E->5. Thus, the above result does not satisfy the values

because we are getting a different value for E. So, we need to think more.                           

Again, after solving the whole problem, we will get a carryover on this term, so our answer will be satisfied.        

after solving the whole problem

            where 1 will be carry forward to the above term

Let’s move ahead.

  • Again, on adding the last two terms, i.e., the rightmost terms D and E, we get Y as its result.
rightmost terms D and E, we get Y as its result

                    where 1 will be  carry forward to the above term

  • Keeping all the constraints in mind, the final resultant is as follows:
Keeping all the constraints
  • Below is the representation of the assignment of the digits to the alphabets.
representation of the assignment of the digits to the alphabets

More examples of cryptarithmatic problems can be:

examples of cryptarithmatic problems
we can also perform multiplication on the cryptarithmatic problem.

Similarly, we can also perform multiplication on the cryptarithmatic problems.