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
Vector reduction Instructions When operations on vector are being decreased to scalar items as a result then these are vector reduction instructions. These instructions are ref

Set up the minunit test framework examples in your environment (i.e. build or compile the code). Once you can run the example, use the minunit test framework to create and run a bo

General Considerations for Research -artificial intelligence: If we can specify the initial state, the operators or a consumer and the goal check for a search problem, that al

Which device changes from serial data to parallel data ? Ans. Demultiplexer is the device that changes from serial data to parallel data. Demultiplexer takes data in from on

Q. How to define a Filename in DOS? Each file is given a name so that it can be referred to later. This name is termed as Filename. The filename in DOS can be up to eight alpha

Q. Computation step in time complexity of an algorithm? So First in the computation step the local processor executes an arithmetic and logic operation. Afterwards the several

What are advantages and benefits to businesses by e-commerce over extranets? The advantages and benefits to businesses comprise: Less Paperwork: along with documents and bus

Q Develop a menu driven program to perform Binary addition and subtraction on two numbers that are inputted. Check that entered numbers are in base 2 or not else error messag

What is Reflection?  It extends the benefits of metadata by permitting developers to inspect and use it at runtime. For example, dynamically verify all the classes contained in

can u please tell me the assembly language program for carry look ahead adder that can run in 8086 emulator?? its urgent