Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 8 [10] Consider a group of ten friends who want to visit a new city somewhere in the world They vote on seven potential

image text in transcribed

Question 8 [10] Consider a group of ten friends who want to visit a new city somewhere in the world They vote on seven potential destinations Cairo London Beijing Moscow Mumbai Nairobi Jakarta Result: One city received four votes, two cities received two votes each, two cities received one vote each, and the remaining two cities received zero votes We need to determine how many votes each of the cities received We also have some other infomation about the voting to help us figure this out Rule 1 Beijing and Cairo got different numbers of votes Rule 2 Moscow either got the most votes, or it got zero votes Rule 3 Cairo got more votes than Jakarta did. Rule 4 Either Jakarta got one fewer vote than London did, or it got one fewer vote than Beijing did Rule 5 In the list of cities above, each of the two cities that got two votes has a city that got no votes immediately above it in the list. (a) In the partially completed Prolog code below, fill in the clauses for the result of the voting and Rules 1 to 4. Hint Use the built in predicate permutation/2 to generate the permutations of possible numbers of votes for each city. (6) votesFor ([Cairo, London, Beijing, Moscow, Mumbai, Nairobi, Jakarta]) .- result rule 1 rule 2 rule 3 rule 4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions

Question

Find the slope and y-intercept of each line, and graph it. 4y = -3x

Answered: 1 week ago

Question

3.2 Discuss the strategic importance of technology in HRM.

Answered: 1 week ago

Question

2. How much time should be allocated to the focus group?

Answered: 1 week ago