Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the generalization of the bridge crossing puzzle in which we have n > 1 people whose bridge crossing times are t 1 , t

Consider the generalization of the bridge crossing puzzle in which we have n >1 people
whose bridge crossing times are t1, t2,..., tn. It is night, and they have one flashlight. A
maximum of two people can cross the bridge at one time. Any party that crosses, either
one or two people, must have the flashlight with them. The flashlight must be walked
back and forth and it cannot be thrown. For example, suppose there are four people who
want to cross a bridge and they all begin on the same side. Person 1 takes 1 minute to
cross the bridge, person 2 takes 2 minutes, person 3 takes 5 minutes, and person 4 takes
10 minutes. If person 1 and person 4 walk across first, 10 minutes have elapsed when
they get to the other side of the bridge. If person 4 returns the flashlight, a total of 20
minutes have passed.
Design a greedy algorithm for this problem and find how long it will take to cross the
bridge by using this algorithm. Does your algorithm yields a minimum crossing time for
every instance of the problem? If it does, prove it; if it does not, find an instance with
the smallest number of people for which this happens.

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_2

Step: 3

blur-text-image_3

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

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions