Prolog program

Assignment Help Basic Computer Science
Reference no: EM13547577

Prolog program
1- Write a Prolog program for solving the crypt-arithmetic puzzle AM + PM = DAY. That is, write predicate solve([A, M, P, D, Y]) which binds each of the variables [A, M, P, D, Y] with values from 0 to 9 such that it satisfies the equation AM + PM = DAY. Make sure that all the variables have a different value assignment and A, P, D cannot take the value 0.


2- Write a Prolog program for performing Merge Sort. That is, write predicate mergesort(L, R) which succeeds when R is the sorted (using merge sort) list for the input list L. [HINT: First split L into two halves say L1 and L2. Then recursively mergesort L1 to get R1 and L2 to get R2. Now merge R1 and R2 to get R (remember that R1 and R2 are sorted).]

Reference no: EM13547577

Questions Cloud

Write a literature review - develop a research question : Draw on the additional resources for course for guidance in understanding the concepts
Round-robin scheduling is used to execute the processes : a) If round-robin scheduling is used to execute the processes, how many items will each process have produced and consumed at the end of 10 time quanta? Assume that the initial run queue order is P1, P2, P3, C1.
Estimate the average power delivered to the entire circuit : A series ac circuit contains a 350 ohm resistor, a 17.0 mH inductor, a 3.10 uF capacitor, Find the average power delivered to the entire circuit
How far behind the mirror is the image located : An object that is 35 cm in front of a convex mirror has an image located 20 cm behind the mirror. How far behind the mirror is the image located
Prolog program : Prolog program
Estimate the normal force exerted by the floor on each hand : Assume L1 = 0.844 m and L2 = 0.401 m. Calculate the normal force exerted by the floor on each hand
Create a view that lists the isbn and title for each book : Create a view that lists the ISBN and title for each book in inventory along with the name and phone number of the person to contact if the book needs to be reordered. Name the view REORDERINFO
A modem that uses qam-64 modulations. : My ADSL provider's twisted-pair lines provide a total bandwidth of 1.1M hertz and the provider provides me with a modem that uses QAM-64 modulations.
Transport layer : Transport layer

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Cybersquatting collapse

Local challenges Collapse . What are the issues and challenges facing your country regarding information security, spam, Internet governance and data? How would you approach a solution to the problem?

  Explaining publication of material in foreign languages

Which of the given statements about publication of material in foreign languages is not right? it is competitive neccessity or it must be accurate.

  Approach to organizing and funding it organization

What would be the best approach to organizing and funding their IT organization? Describe at least one alternative approach. Provide justification for why your proposed approach is the best one.

  Describe the scope and analyze how to control the scope

Describe the project including the describe the scope and analyze how to control the scope and identify possible risks, constraints, and assumptions.

  Write a java for file processing according to rules

The file is read into memory, all of it in one buffer, and the buffer is reversed, then the file is overwritten. For simplicity, we may assume that the maximum size of the file is 200000 bytes. If no file was selected an error message is displayed..

  Create the directory structure

The project team is ready to create the directory structure for the Web site. You are tasked with creating the directories and implementing the security mechanism. For this assignment, you need to create the following directory structure and p..

  Perform a computer forensic investigation

Is it easier to perform a computer forensic investigation if the suspect's computer is a Linux or UNIX system instead of Windows? Does the type of operating system affect the process at all? Consider all flavors of Linux/UNIX and Windows.

  Programming in mpi

What advantages are gained by programming in MPI as opposed to using threads? Is there a disadvantage to MPI? What?

  Who are the stakeholders

Probe into resulting consequence between stakeholders and management as a result of security incidents. Who are the stakeholders?

  Stage of ec purchase decision-making process

Banner advertising on Websites helps trigger a realization taht there is a gap between reality and a desired state, which occurs in the ______ stage of the EC purchase decision-making process.

  Design a logic component

Design a Logic Componentt that compares 2 inputs (A and B) each of which contains a binary number and produces a logical 1 whenever A is greater than B

  Determine relation of m and n-existence of a hash function

Determine the most general relation of m and n that guarantees the existence of a hash function in H that causes no collision when hashing [n] into [m].

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