Question: ANSWER ONLY PART 1.2 AND PART 1.3 Part 1 On the left bank of a river are a ferryman, a goat, a boat big enough

ANSWER ONLY PART 1.2 AND PART 1.3

Part 1

On the left bank of a river are a ferryman, a goat, a boat big enough for four, and an equal number of Bluebeards and Zombies. The latter remain at peace except when one group outnumbers the other. When the ferryman is absent, Bluebeards and Zombies eat goats. Only the ferryman can operate the boat.

Part 1.1

Describe an algorithm, in terms of accumulating outcomes, for getting everyone to the right bank without conflict. Don't include a description of how to implement these outcomes (that's Part 1.2). Use n as the total number of Bluebeards (and Zombies). Remember that (1) outcomes may introduce variable(s) and (2) we assume that the code implementing each outcome will also restore all prior outcomes. Be precise and concise. You can assume that the boat is always in the same location as the ferryman, so there is no need to mention it. The formulation anticipated below divides the preconditions and postconditions in two, and uses three outcomes, but you are free to organize them differently if you wish.

Part 1.2

Describe how to implement these outcomes (i.e., in order). A typical line has the form Ferry X, Y, and Z to the right. Sometimes it's convenient to implement more than one outcome at a time. Remember to justify that prior outcomes remain true (i.e., that they accumulate). An example of a heading below is "Implementation of outcomes 1 and 2."

Implementation of Outcome(s) Please replace this:

Implementation of Outcome(s) Please replace this: Please replace this

Part 1.3 Calculate and explain the efficiency of your algorithm precisely. Please replace this

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!