Cryptarithmetic problem in artificial intelligence, Computer Engineering

Solve the following cryptarithmetic problem using Prolog:

P I N G
P O N G
+ F U N
---------
I G N I P

Each of the 7 different letters stands for a different digit. The aim is to find a substitution of digits for the letters such that the resulting sum is arithmetically correct. Your program should find ALL answers, that do not have leading zeros.

It should be possible to query your solution in this manner:

?- crypt(P,I,N,G,O,F,U).

Your solution should then produce all of the combinations of the digits that satisfy the addition problem above. Don't get
confused between the letter "O" and the number "0" (zero).

HINT - use generate-and-test.

HINT - make sure you never let P=N, or G=F, etc... all of the
distinct letters have to stand for distinct digits.

2. Assume that you have a set of facts about airline flights in the following format:
flight(Number,Source,Dest,Leaves,Arrives).
for example:
flight(22,la,ny,10,15).
means that flight #22 leaves "la" at 10am and arrives
in "ny" at 3pm (assume a 24-hr clock, integers only).

Write the following rules:

-- long(Number,Time)
is true for flights which are in the air longer than Time.
-- route(Source,Dest)
is true for each pair of cities for which there is some sequence of flights starting at Source and ending at Dest.
(it doesn't have to display the route, just be true if there is a route).

You may assume that all flights are completed within the 0-24 time period.... that is, you DON'T have to worry about flights
which arrive after the clock "wraps around" back to zero.
The best solutions are queryable.

Posted Date: 2/21/2013 5:43:07 AM | Location : United States







Related Discussions:- Cryptarithmetic problem in artificial intelligence, Assignment Help, Ask Question on Cryptarithmetic problem in artificial intelligence, Get Answer, Expert's Help, Cryptarithmetic problem in artificial intelligence Discussions

Write discussion on Cryptarithmetic problem in artificial intelligence
Your posts are moderated
Related Questions
In cyclic redundancy checking CRC is the? Checking CRC, in cyclic redundancy is the remainder. Normal 0 false false false EN-IN X-NONE X-NONE

What is the difference between wire and reg Wire Wire is used for designing combinational logic, as we all know that this type of logic cannot store a value.  As  you  can

Problem: A company requires a software application to calculate the weekly payment for its employees. The information about the employees (employees' data) is kept in a file.

What is Open Database Connectivity (ODBC) It happens that in addition to conventional or most popular database management systems, many companies go for proprietary software c

Explain the disadvantages Off-the-shelf -  can be over-complex since it tries to cover as many characteristics as possible (for example most users of Word only utilise about

What is a Multiplexer Tree? Ans Multiplexer Tree: The largest available MUX IC is 16 to 1. Meeting the larger input requires there must be a provision to expand this. It

Set Value is ready to ActiveX Object from the form. Let Value is retried to ActiveX Object from the form. Get- Assigns the value of an expression to a variable or property.

Compute minimum value of the horizontal force: Block A of weight 520N rest on horizontal top of block B having weight of 700N as shown in the figure given below. Block A

Explain the operation of 8:1 multiplexer. Ans: In this multiplexer 8 Input and 1 Output and three select lines i.e. S 2 , S 1 , S 0 are given. Any one of the inputs will be

Q. Find simplified function F and implement that function using only NAND gates. 1. F(A,B,C) = (A+B) (A'+B+C') (A'+B'+C') 2. F (A,B,C) = A'B'C'+B'CD'+A'BCD'+AB'C' 3. F(X,Y