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

Show the properties of frame tag, Q. Show the properties of Frame Tag? ...

Q. Show the properties of Frame Tag? This tag is used for placing an HTML file in the frame created. We should now tell browser what to put in every frame.

Define the system analysis of object oriented modelling, Define the System ...

Define the System Analysis of Object oriented modelling System Analysis: In this stage a statement of the queries is formulated and a model is designed by the analyst in enc

What is meant by "method-wars" in programming, Before 1994 there were dissi...

Before 1994 there were dissimilar methodologies like Rumbaugh, Booch, Jacobson, and Meyer etc who followed their own notations to mould the systems. The developers were in a di

Describe the roles of association, Describe the roles of association No...

Describe the roles of association Note that each association has roles. For instance, in Figure we can see that two classes, Student and University, have their predefined roles

What are limitations of assembly language, What are limitations of assembly...

What are limitations of assembly language? i. It is changed to machine language using assembler which is time consuming when compared with machine language. ii. It is comple

Concept of temporal parallelism, Concept of Temporal Parallelism In ord...

Concept of Temporal Parallelism In order to describe what is meant by parallelism inherent in the answer of a problem, let us talk about an example of submission of electricity

Computer, How does computer started?

How does computer started?

What is the function of cu, What is the function of CU? The control uni...

What is the function of CU? The control unit works as the nerve center that coordinates all the computer operations. It issues timing signals that governs the data transfer.

Combinatorial and scheduling problems, Combinatorial and Scheduling Proble...

Combinatorial and Scheduling Problems: One class of problems is concerned with specifying optimal scheduled. A classical example is the Travelling Salesperson Problem where

Describe how a mobile terminating call, Problem: (a) Describe how a Mob...

Problem: (a) Describe how a Mobile Terminating call, from a PSTN phone, is processed in a GSM network. Illustrate your answer with a diagram. (b) What is a GPRS Support node

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