Laran Evans
I develop software people love to use.
  • Home
  • About
  • Contact
  • Resume
  • Testimonials
Skip to content
  • Entrepreneurship
    • Leadership
    • Project Management
    • Team Development
    • Time Management
  • Puzzles
  • Software Architecture
    • Cloud Computing
  • Software Development
    • Algorithms
    • CSS
    • Java
    • Javascript
    • MySQL
    • PHP
    • Python
    • Ruby and Rails
    • System Administration
« Four Jars of Pills
All Files Recursively »

Bridge Crossing

By laran | Published: 2007/10/31

The Problem

There are 4 women who want to cross a bridge. They all begin on the same side. You have 17 minutes to get all of them across to the other side. It is night. There is one flashlight. A maximum of two people can cross at one time. Any party who crosses, either 1 or 2 people, must have the flashlight with them. The flashlight must be walked back and forth, it cannot be thrown, etc. Each woman walks at a different speed. A pair must walk together at the rate of the slower woman’s pace.

  • Woman 1: 1 minute to cross
  • Woman 2: 2 minutes to cross
  • Woman 3: 5 minutes to cross
  • Woman 4: 10 minutes to cross

For example if Woman 1 and Woman 4 walk across first, 10 minutes have elapsed when they get to the other side of the bridge. If Woman 4 then returns with the flashlight, a total of 20 minutes have passed and you have failed the mission. What is the order required to get all women across in 17 minutes? Now, what’s the other way?

The Solution

Let’s think about this. How many different ways can we add the numbers 1, 2, 5 and 10 together to get 17? There’s only one combination that works: 10, 2, 2, 2, 1. This tells us a few things.First, ten and five cross exactly once and they cross together (ten “masks” the five because ten is larger/slower). We also know that the exercise will take place in five steps. We know that two crosses three times and one crosses at least once (because it could cross with two and therefore be “masked”). I use the term masking, but it’s kinda like big-O notation in a way.

That all said, here are the two solutions.

Send over women one and two. Send back woman two. Woman two sends women three and four across the bridge together. Woman one then returns for woman two. Women one and two then cross back over together. Total time == 10 + 2 + 2 + 2 + 1 == 17 minutes.

Send over women one and two. Send back woman one. Woman one sends women three and four across the bridge together. Woman two then returns for woman one. Women one and two then cross back over together. Total time == 10 + 2 + 2 + 2 + 1 == 17 minutes.

This entry was posted in Puzzles and tagged Puzzles. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
« Four Jars of Pills
All Files Recursively »

Post a Comment

Click here to cancel reply.

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • About Me

    I've got a masters degree in computer science and over 10 years of experience building web-based systems using Java/J2EE, Ruby, Rails and PHP. I'm a strong believer in the effectiveness of Agile Methods. Read more »

  • Subscribe

  • Table of Contents
    • The Problem
    • The Solution
  • Similar Posts
    • 100 Bright Ideas
    • The Manhole Cover
    • Seven Days of Gold
    • Spinning Disc
    • Analog Clock
Hello world
  • From Around the Web

    • Chopper Girl @ The 2010 Brass Balls Long Road Party (Uploads from BRASS BALLS BOBBERS)
    • Web App Business Models: User Needs and What People Pay For (Box UK Blog)
    • Blog Writing Tips from the World’s Most Famous Authors (Blogsessive.com)
    • How to get exponential success on your blog (CatsWhoBlog.com)
    • The Four Stages of Growing a Blog (Daily Blog Tips)
    Shared Items
  • Recent Posts

    • 80 pages of Ruby on Rails Performance Optimization Tips
    • Ruby Garbage Collection In-Depth
    • Binary Logic Basics
    • Kuali in Nacubo Magazine
    • Ruby Blocks, Procs, Lambda
  • Older Posts By Month

    Let's Talk

    Ask a question below. You'll be prompted for your name and email after you click the "Ask" button.

Know more. Accomplish more. Succeed.