Question: 5. Professor McGonagall has provided the young wizard Ron with three magical batteries whose sizes are 42,27,and 16 morts, respectively. (A mort is a unit

5. Professor McGonagall has provided the young wizard Ron with three magical batteries whose sizes are 42,27,and 16 morts, respectively. (A mort is a unit of wizard energy). The 27-mort and 16-mort batteries are fully charged (containing 27 and 16 morts of energy, respectively), while the 42-mort battery is empty, with 0 morts. McGonagall says that Ron is only allowed to use, repeatedly, if necessary, the mort transfer spell when working with these batteries. This spell transfers all the morts in one battery to another battery, and it halts the transfer either when the source battery has no morts remaining or when the destination battery is fully charged(whichever comes first). McGonagall challenges Ron to determine whether there exists a sequence of mort-transfer spells that leaves exactly 12 morts either in the 27-mort or in the 16-mort battery.

a. Ron knows this is actually a graph problem. Give a precise definition of how to model this problem as a graph, and state the specific question about this graph that must be answered.

b.What algorithm should Ron aply to solve the graph problem?

c.Appy that algorithm to McGonagall's question. Report and justify your answer.

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!