Return to Video

Can you solve the prisoner boxes riddle? - Yossi Elran

  • 0:07 - 0:10
    Your favorite band is great
    at playing music,
  • 0:10 - 0:13
    but not so great at being organized.
  • 0:13 - 0:16
    They keep misplacing
    their instruments on tour,
  • 0:16 - 0:19
    and it's driving their manager mad.
  • 0:19 - 0:21
    On the day of the big concert,
  • 0:21 - 0:23
    the band wakes up
    to find themselves tied up
  • 0:23 - 0:27
    in a windowless,
    soundproof practice room.
  • 0:27 - 0:29
    Their manager explains what's happening.
  • 0:29 - 0:32
    Outside, there are ten large boxes.
  • 0:32 - 0:34
    Each contains one of your instruments,
  • 0:34 - 0:39
    but don't be fooled by the pictures -
    they've been randomly placed.
  • 0:39 - 0:43
    I'm going to let you out one at a time.
  • 0:43 - 0:46
    While you're outside, you can look
    inside any five boxes
  • 0:46 - 0:50
    before security
    takes you back to the tour bus.
  • 0:50 - 0:52
    You can't touch the instruments
  • 0:52 - 0:56
    or in any way communicate what you find
    to the others.
  • 0:56 - 1:00
    No marking the boxes, shouting, nothing.
  • 1:00 - 1:02
    If each one of you
    can find your own instrument,
  • 1:02 - 1:04
    then you can play tonight.
  • 1:04 - 1:07
    Otherwise, the label is dropping you.
  • 1:07 - 1:11
    You have three minutes to think about it
    before we start.
  • 1:11 - 1:12
    The band is in despair.
  • 1:12 - 1:17
    After all, each musician only has a 50%
    chance of finding their instrument
  • 1:17 - 1:19
    by picking five random boxes.
  • 1:19 - 1:23
    And the chances that all ten will succeed
    are even lower -
  • 1:23 - 1:26
    just 1 in 1024.
  • 1:26 - 1:28
    But suddenly, the drummer comes up
    with a valid strategy
  • 1:28 - 1:33
    that has a better than 35% chance
    of working.
  • 1:33 - 1:36
    Can you figure out what it was?
  • 1:36 - 1:44
    Pause the video on the next screen
    if you want to figure it out for yourself!
  • 1:44 - 1:45
    Answer in: 3
  • 1:45 - 1:46
    Answer in: 2
  • 1:46 - 1:48
    Answer in: 1
  • 1:48 - 1:49
    Here's what the drummer said:
  • 1:49 - 1:53
    Everyone first open the box
    with the picture of your instrument.
  • 1:53 - 1:55
    If your instrument is inside, you're done.
  • 1:55 - 1:58
    Otherwise, look at whatever's in there,
  • 1:58 - 2:00
    and then open the box
    with that picture on it.
  • 2:00 - 2:04
    Keep going that way until you find
    your instrument.
  • 2:04 - 2:05
    The bandmates are skeptical,
  • 2:05 - 2:08
    but amazingly enough,
    they all find what they need.
  • 2:08 - 2:12
    And a few hours later, they're playing
    to thousands of adoring fans.
  • 2:12 - 2:15
    So why did the drummer's strategy work?
  • 2:15 - 2:17
    Each musician follows a linked sequence
  • 2:17 - 2:21
    that starts with the box whose outside
    matches their instrument
  • 2:21 - 2:25
    and ends with the box
    actually containing it.
  • 2:25 - 2:29
    Note that if they kept going,
    that would lead them back to the start,
  • 2:29 - 2:30
    so this is a loop.
  • 2:30 - 2:33
    For example, if the boxes
    are arranged like so,
  • 2:33 - 2:36
    the singer would open the first box
    to find the drums,
  • 2:36 - 2:38
    go to the eighth box to find the bass,
  • 2:38 - 2:41
    and find her microphone in the third box,
  • 2:41 - 2:44
    which would point back to the first.
  • 2:44 - 2:46
    This works much better
    than random guessing
  • 2:46 - 2:50
    because by starting with the box
    with the picture of their instrument,
  • 2:50 - 2:54
    each musician restricts their search to
    the loop that contains their instrument,
  • 2:54 - 2:58
    and there are decent odds, about 35%,
  • 2:58 - 3:02
    that all of the loops
    will be of length five or less.
  • 3:02 - 3:04
    How do we calculate those odds?
  • 3:04 - 3:08
    For the sake of simplicity,
    we'll demonstrate with a simplified case,
  • 3:08 - 3:13
    four instruments and no more than
    two guesses allowed for each musician.
  • 3:13 - 3:16
    Let's start by finding
    the odds of failure,
  • 3:16 - 3:20
    the chance that someone will need
    to open three or four boxes
  • 3:20 - 3:22
    before they find their instrument.
  • 3:22 - 3:24
    There are six distinct four-box loops.
  • 3:24 - 3:27
    One fun way to count them
    is to make a square,
  • 3:27 - 3:30
    put an instrument at each corner,
  • 3:30 - 3:32
    and draw the diagonals.
  • 3:32 - 3:35
    See how many unique loops you can find,
  • 3:35 - 3:38
    and keep in mind that these two
    are considered the same,
  • 3:38 - 3:40
    they just start at different points.
  • 3:40 - 3:42
    These two, however, are different.
  • 3:42 - 3:47
    We can visualize the eight distinct
    three-box loops using triangles.
  • 3:47 - 3:49
    You'll find four possible triangles
  • 3:49 - 3:52
    depending on which instrument
    you leave out,
  • 3:52 - 3:55
    and two distinct paths on each.
  • 3:55 - 3:58
    So of the 24 possible
    combinations of boxes,
  • 3:58 - 4:01
    there are 14 that lead to faliure,
  • 4:01 - 4:03
    and ten that result in success.
  • 4:03 - 4:08
    That computational strategy works for any
    even number of musicians,
  • 4:08 - 4:10
    but if you want a shortcut,
  • 4:10 - 4:14
    it generalizes to a handy equation.
  • 4:14 - 4:18
    Plug in ten musicians,
    and we get odds of about 35%.
  • 4:18 - 4:20
    What if there were 1,000 musicians?
  • 4:20 - 4:22
    1,000,000?
  • 4:22 - 4:26
    As n increases,
    the odds approach about 30%.
  • 4:26 - 4:32
    Not a guarantee, but with a bit of
    musician's luck, it's far from hopeless.
  • 4:32 - 4:36
    Hi everybody, if you liked this riddle,
    try solving these two.
Title:
Can you solve the prisoner boxes riddle? - Yossi Elran
Speaker:
Yossi Elran
Description:

View full lesson: http://ed.ted.com/lessons/can-you-solve-the-prisoner-boxes-riddle-yossi-elran

Your favorite band is great at playing music...but not so great at being organized. They keep misplacing their instruments on tour, and it’s driving their manager mad. Can you solve the brain-numbing riddle their manager assigns them and make sure the band stays on their label? Yossi Elran shows how.

Lesson by Yossi Elran, animation by Artrake Studio.

more » « less
Video Language:
English
Team:
closed TED
Project:
TED-Ed
Duration:
04:52

English subtitles

Revisions Compare revisions