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
« One From Five and Three
Six Shoes and Twenty-Four Socks »

Ten Gnomes

By laran | Published: 2007/10/30

The Problem

Ten gnomes are about to be executed. Although they don’t like the idea, they are each selfless and want to do anything (even by sacrificing themselves) in order to help their fellow gnomes. They are told what will happen to them: They will each be lined up single file, so that they are each facing the gnome in front of them. Each of them will be given a red or a white hat on their head, and from the back of the line (the gnome who can see everyone else) they will ask him to state his hat color, ‘red’ or ‘white.’ If he can state it correctly (he cannot see his own hat, only those in front of him), he is allowed to live. Knowing what is going to happen to them, they are allowed to devise a strategy beforehand. How many people can they guarantee to save, and what strategy will ensure this? (There are NOT five reds and five whites necessarily!)

The Solution

The fact that they’re willing to sacrifice themselves is a hint. There is a 50/50 chance of saving 10. 9 can be saved for sure. Each gnome will shout the color of the hat on the head of the gnome in front of them. If the color of the hat on the gnome at the back of the line is the same as the color of the hat on the head of the gnome in front of him all 10 gnomes will be saved. Otherwise only the front-most 9 will live.

This entry was posted in Puzzles and tagged Puzzles. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
« One From Five and Three
Six Shoes and Twenty-Four Socks »

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.