Docsity

Coursework in Algorithmic Problem Solving: Nervous Couples and Fuse Clocks, Study notes of Mathematics

Toggle sidebar
bg1
G51APS, Algorithmic Problem Solving
Coursework 1, 2010–2011
School of Computer Science
University of Nottingham
October 1, 2010
This coursework does NOT count towards the final assessment. However, if submitted
by the deadline, it will be marked and returned for feedback purposes. The first part of
the coursework is about the nervous-couples problem. Refer to the lecture notes for the
statement of the problem and how it is solved for different combinations of the number
of couples and the capacity of the boat. The second part on fuse clocks has not been
discussed in lectures.
Nervous Couples
(2 marks) How many states are there in the state-transition diagram for the problem of
four couples?
How many states are there in the state-transition diagram for the problem of five
couples?
Justify your answer in each case. (You should not need to construct the diagrams to
determine the number of states.) One mark will be awarded for two correct answers.
The second mark will be awarded for a clear justification.
(4 marks) Construct the state-transition diagram for the problem of four couples with a
boat of capacity three.
(2 marks) How many different ways are there of getting 4 couples across the river in a
boat of capacity 3 using the minimum number of crossings?
One mark will be awarded for the correct answer. The second mark will be awarded if
you make clear in your answer how to exploit the left-right symmetry in the transition
diagram.
(2 marks) Suppose each president and each bodyguard is named (eg. Ann and Bob, Con
and Dan, etc.) and states are distinguished by the names of the individuals on each
side of the river. How many states would there then be in the state-transition diagram
for the problem of four couples with a boat of capacity three?
1
pf2

Partial preview of the text

Download Coursework in Algorithmic Problem Solving: Nervous Couples and Fuse Clocks and more Study notes Mathematics in PDF only on Docsity!

G51APS, Algorithmic Problem Solving

Coursework 1, 2010–

School of Computer Science

University of Nottingham

October 1, 2010

This coursework does NOT count towards the final assessment. However, if submitted by the deadline, it will be marked and returned for feedback purposes. The first part of the coursework is about the nervous-couples problem. Refer to the lecture notes for the statement of the problem and how it is solved for different combinations of the number of couples and the capacity of the boat. The second part on fuse clocks has not been discussed in lectures.

Nervous Couples

(2 marks) How many states are there in the state-transition diagram for the problem of four couples? How many states are there in the state-transition diagram for the problem of five couples? Justify your answer in each case. (You should not need to construct the diagrams to determine the number of states.) One mark will be awarded for two correct answers. The second mark will be awarded for a clear justification.

(4 marks) Construct the state-transition diagram for the problem of four couples with a boat of capacity three.

(2 marks) How many different ways are there of getting 4 couples across the river in a boat of capacity 3 using the minimum number of crossings? One mark will be awarded for the correct answer. The second mark will be awarded if you make clear in your answer how to exploit the left-right symmetry in the transition diagram.

(2 marks) Suppose each president and each bodyguard is named (eg. Ann and Bob, Con and Dan, etc.) and states are distinguished by the names of the individuals on each side of the river. How many states would there then be in the state-transition diagram for the problem of four couples with a boat of capacity three?

Fuse Clocks

This part of the coursework is about making timing devices out of fuses. A fuse, when lit at one end, burns for a specified period of time. For example, a 1 - minute fuse will burn for exactly one minute. The rate at which a fuse burns is irregular. If an m -minute fuse is cut into two pieces, one of the pieces will burn for n minutes and the other for m−n minutes, but there is no way of determining n. Suppose you have a 45 -minute fuse and a 10 -minute fuse. Then it is possible to clock 20 minutes as follows. Light the 45 -minute fuse at one end and the 10 -minute fuse at both ends. Start timing when the 10 -minute fuse has burnt out; simultaneously light the other end of the 45 -minute fuse. When this has burnt out, 20 minutes have elapsed from when the timing started.

(2 marks) If an m -minute fuse is lit and when it has burnt out an n -minute fuse is lit, what is the total time that has elapsed? If an m -minute fuse and an n -minute fuse are both lit simultaneously, and timing is started when the m -minute fuse has burnt out, how long remains before the n -minute fuse burns out? (Assume that m is greater than n .) If an m -minute fuse is lit at both ends, how long will it burn? Note: answering this question should help you to answer the remaining questions.

(3 marks) Suppose you have a 20 -minute fuse and a 120 -minute fuse. Show how to clock 140 , 130 , 100 , 65 , and 50 minutes.

(5 marks) Suppose you are given a 28 -minute fuse and a 32 -minute fuse. Construct as many different clocks as you can. Explain your construction.

What to Submit and When

Your solutions should be submitted by 3.00pm on Friday, 29th October. Work submitted after this deadline will not be marked. A feedback lecture on the coursework has been provisionally scheduled for Wednesday, 3rd November. Solutions may be hand- written, in which case they should be submitted to the School Office, or in electronic form. In the latter case, instructions on how to submit will be given later. Clear, well-written solutions will be rewarded. Conversely, sloppy, badly-spelt or poorly- written solutions will be penalised. Some allowance for incorrect grammar will be made for those whose native language is not English, but every effort should be made to ensure that, for example, spelling is correct. Make sure your solutions are clearly identified. If hand-written, write your name and student id clearly on the cover page.