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
Q. Define about Hyper-threading technology? Hyper-threading technology enables a single microprocessor to behave as two separate threaded processors to operating system and app

The use of Information Technology (IT) is well known. IT has turn into a must for survival of all business houses with growing information technology trends. Computer is main compo

Define bus. When a word of data is transferred among units, all the bits are transferred in parallel over a set of lines called bus. In addition to the lines that take the data

The grade of service is measured in (A) Percentage                                  (B)  Number (C)  Fractional Number                    (D)  Logarithmic Number  Ans

How many two input AND gates and two input OR gates are required to realize Y = BD+CE+AB ? Ans. Here three product terms, therefore three AND gates of two inputs are needed.

What are advantages and disadvantages of using EEPROM? The benefits are that EEPROM do not have to be removed for erasure. Also it is possible to delete the cell contents selec

Which of the best method between linear addressing and matrix addressing modes ? Ans: Best Method: Matrix Addressing is the suitable method, since this configuration on

What is precloud computing? Precloud computing is an email access was through a single computer, which also keeps all email messages. Example: Microsoft Outlook or Outlook Expr

contributes to violence in our society. Others point out that television contributes to the high level of obesity among children. Now, we may have to add financial problems to the

The max number of calling modes stacked at one time is? NINE