Skip to content

Instantly share code, notes, and snippets.

@not-inept
Last active June 5, 2018 01:37
Show Gist options
  • Save not-inept/c9f20286d319f2433345cb858d30508f to your computer and use it in GitHub Desktop.
Save not-inept/c9f20286d319f2433345cb858d30508f to your computer and use it in GitHub Desktop.
not-inept (Jun, 2018)
I was watching brooklyn nine nine and figured I have a go at the brain teaser posed in s02 e19. I'm likely not the first or last to solve it, but it was fun :D
Question: Given 1 2 3 4 5 6 7 8 9 10 11 12, one of the 12 weighs more or less than the others with only 3 comparisons
A(1 2 3 4) vs B(5 6 7 8), with C(9 10 11 12) to the side
1a. Is balanced
The difference is in (9 10 11 12)
X(1 2) vs Y(11 12)
2a. Is balanced
We know X(1 2) is balanced, so the difference is in (9 10)
XX(1) vs YY(9)
3a. Is balanced
10 is the guilty number
3b. Is not balanced
9 is the guilty number
2b. Is not balanced
We know X(1 2) is balanced, so the difference is in (11 12)
XX(1) vs YY(11)
3a. Is balanced
12 is the guilty number
3b. Is not balanced
11 is the guilty number
1b. Is not balanced
Let's assume A > B (if not, just switch the groups as they are arbitrary)
This means either group A has a heavier element, or group B has a lighter element. A cannot contain a lighter element, and B cannot contain a heavier element. C is known to be neutral.
The difference must be in A(1 2 3 4) or B(5 6 7 8)
X(1 2 5) vs Y(3 4 6)
2a. Is balanced
The difference is in (7 8)
XX(1) vs YY(7)
3a. Is balanced
8 is the guilty number
3b. Is not balanced
7 is the guilty number
2b. Is not balanced
Each side contains two known heavier group elements, and one known lighter group element.
If either side is heavier, then it must be because either its heavier group elements contain a heavier element, or the other side's lighter group element is lighter.
The difference is in (1 2 6) or (3 4 5). We will assume (1 2 6), but the procedure is the same for either side.
XX(1 6) vs YY(11 12)
3a. Is balanced
2 is the guilty number
3b. XX > YY
We know that the number originally in set B (6) must be lighter if it is different. Therefore it must be the number in the check originating from set A.
1 is the guilty number
3c. XX < YY
We know that the number originally in set B (6) must be lighter if it is different. Therefore it must be the number in the check originating from set B.
6 is the guilty number
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment