Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started