Cryptarithmetic problem in artificial intelligence, Computer Engineering

Assignment Help:

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.


Related Discussions:- Cryptarithmetic problem in artificial intelligence

What about page footer, By default, this page is quite barren. Though, go e...

By default, this page is quite barren. Though, go explore the Query Page some more; you will search that you can store numerous queries on the server, so if you regularly run a cer

Client server using c, client server or multithreaded client-server, where ...

client server or multithreaded client-server, where server will create pool of worker threads (say 5) to provide services to pool of clients (say 5 ).Server should be behaving as a

Dataset accept changes and data adapter update method, Explain Dataset Acce...

Explain Dataset Accept Changes and Data Adapter Update methods?  Data Adapter Update method Calls the respective INSERT, UPDATE, or DELETE statements for every inserted, update

Show the reset and submit buttons in html, Reset and Submit are special typ...

Reset and Submit are special types of input buttons. Submit is used to send data to the server and Reset resets/clears the form.

Describe about physical systems, Q. Describe about Physical Systems? Ph...

Q. Describe about Physical Systems? Physical Systems are tangible entities which may be dynamic or static.   Computer Systems, Buildings,Vehicles etc. are illustrations of p

Microprocessor, how to stud for subject microprocessor

how to stud for subject microprocessor

What is the draw back of access-3 code, Q. What is the draw back of Access-...

Q. What is the draw back of Access-3 Code? Give suggestion to over come this drawback.

Important parameters for transmitting data, For this project, we hope to us...

For this project, we hope to use the basic idea of InfraRed (IR) communication for our television in ES103.  In ES103, we have a Sony large-screen television that we hope to commun

Medical diagnosis program, Diagnosis: Medical diagnosis program bases on p...

Diagnosis: Medical diagnosis program bases on probabilistic analysis have been able to perform at the level of an expert physician tin several areas of medicine. Heckerman(1981)

Explain the concept behind pre-compositing adobe, Question 1: (a) Expl...

Question 1: (a) Explain the concept behind Pre-Compositing Adobe After Effects. (b) Briefly describe the Wiggler function in Animation help in Adobe After Effects. (c)

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd