Skip to content

Commit

Permalink
CTCI 6.06: BlueEyedIsland.groovy
Browse files Browse the repository at this point in the history
  • Loading branch information
Pap Lőrinc committed Mar 6, 2016
1 parent 30295d8 commit b91727f
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package Ch06_MathAndLogicPuzzles

/** Q: All (>0) blue eyed people must leave from an island ASAP.
* Nobody knows their own eye color, just others'.
* How many days will it take them to leave? */

/** A: We will assume that
* 1) all blue eyed people will fit on a single flight
* 2) all people are intelligent (or have worked out a plane beforehand).
* Since everybody can assume, that if the plane didn't leave after as many days as the number of blue eyed people
* the given person sees, she must have a blue eye also.
* Therefore they will leave the day after that. */

0 comments on commit b91727f

Please sign in to comment.