• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 16:43
CEST 22:43
KST 05:43
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL20] Ro24 Preview Pt1: Runway112v2 & SC: Evo Complete: Weekend Double Feature2Team Liquid Map Contest #21 - Presented by Monster Energy9uThermal's 2v2 Tour: $15,000 Main Event18Serral wins EWC 202549
Community News
Weekly Cups (Aug 11-17): MaxPax triples again!5Weekly Cups (Aug 4-10): MaxPax wins a triple6SC2's Safe House 2 - October 18 & 195Weekly Cups (Jul 28-Aug 3): herO doubles up6LiuLi Cup - August 2025 Tournaments7
StarCraft 2
General
Weekly Cups (Aug 11-17): MaxPax triples again! What mix of new and old maps do you want in the next 1v1 ladder pool? (SC2) : RSL Revival patreon money discussion thread Team Liquid Map Contest #21 - Presented by Monster Energy Would you prefer the game to be balanced around top-tier pro level or average pro level?
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament RSL: Revival, a new crowdfunded tournament series LiuLi Cup - August 2025 Tournaments SEL Masters #5 - Korea vs Russia (SC Evo) Enki Epic Series #5 - TaeJa vs Classic (SC Evo)
Strategy
Custom Maps
External Content
Mutation # 487 Think Fast Mutation # 486 Watch the Skies Mutation # 485 Death from Below Mutation # 484 Magnetic Pull
Brood War
General
New season has just come in ladder ASL 20 HYPE VIDEO! [ASL20] Ro24 Preview Pt1: Runway BW General Discussion Which top zerg/toss will fail in qualifiers?
Tourneys
[ASL20] Ro24 Group A BWCL Season 63 Announcement Cosmonarchy Pro Showmatches KCM 2025 Season 3
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates [G] Mineral Boosting Muta micro map competition
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Total Annihilation Server - TAForever Beyond All Reason [MMORPG] Tree of Savior (Successor of Ragnarok)
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine European Politico-economics QA Mega-thread The Games Industry And ATVI
Fan Clubs
INnoVation Fan Club SKT1 Classic Fan Club!
Media & Entertainment
Movie Discussion! [Manga] One Piece Anime Discussion Thread [\m/] Heavy Metal Thread Korean Music Discussion
Sports
2024 - 2025 Football Thread TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion
World Cup 2022
Tech Support
Gtx660 graphics card replacement Installation of Windows 10 suck at "just a moment" Computer Build, Upgrade & Buying Resource Thread
TL Community
TeamLiquid Team Shirt On Sale The Automated Ban List
Blogs
The Biochemical Cost of Gami…
TrAiDoS
[Girl blog} My fema…
artosisisthebest
Sharpening the Filtration…
frozenclaw
ASL S20 English Commentary…
namkraft
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1563 users

Math Puzzle - 7 Hats - Page 5

Blogs > Slithe
Post a Reply
Prev 1 2 3 4 5 6 7 Next All
tofucake
Profile Blog Joined October 2009
Hyrule19059 Posts
September 09 2010 21:56 GMT
#81
On September 10 2010 06:54 KarlSberg~ wrote:
First I really thought that would be going to be something retarded, but that's actually a very nice problem.
I think this is the strategy, even though I have a hard time proving it
+ Show Spoiler +

Assign a number to each color (0..6)
Assign a number to each prisoner (0..6)
Each prisonner adds the colors he sees on all other guys + his number
Sum%7 gives the color the prisoner has to announce
In any possible case one (exactly one) prisoner will be right.

And once again, what if the King has a 120 pack of Crayolas? Also, the OP states there could be 2 reds and 1 of 5 other colors.
Liquipediaasante sana squash banana
tofucake
Profile Blog Joined October 2009
Hyrule19059 Posts
September 09 2010 21:56 GMT
#82
On September 10 2010 06:55 tissue wrote:
Dear diary,

Today I lost a goodish amount of faith in the intelligence and reading comprehension of the posters on TL.net. Was it like this before starcraft 2?

Quite. SC2 Strategy is the worst forum. Stick to blogs and you should be okay.
Liquipediaasante sana squash banana
BottleAbuser
Profile Blog Joined December 2007
Korea (South)1888 Posts
September 09 2010 21:56 GMT
#83
Let me put this another way.

By definition, if events X and Y are independent, the probability of X doesn't change if Y happens, or Y doesn't happen.

Now, it's obvious that if the prisoners' guesses are independent of each others', then there is absolutely no way to guarantee that they will survive.

So, we must conclude that they are dependent.

However, for this dependency to exist, the guesses must be made BEFORE they are seated at the table, because otherwise the information from one guess cannot be passed to the next prisoner. Then, they have absolutely no clue about the distribution of hats.

It's impossible.
Compilers are like boyfriends, you miss a period and they go crazy on you.
Slithe
Profile Blog Joined February 2007
United States985 Posts
September 09 2010 21:57 GMT
#84
On September 10 2010 06:54 KarlSberg~ wrote:
First I really thought that would be going to be something retarded, but that's actually a very nice problem.
I think this is the strategy, even though I'm having a hard time proving it
+ Show Spoiler +
Assign a number to each color (0..6)
Assign a number to each prisoner (0..6)
Each prisonner adds the colors he sees on all other guys + his number
Sum%7 gives the color the prisoner has to announce
In any possible case one (exactly one) prisoner will be right.


ding ding ding, we have an answer.
Trump
Profile Joined April 2010
United States350 Posts
September 09 2010 21:57 GMT
#85
Well you can do it for 2 people / 2 hats as shown earlier.

The key is finding a solution for 3 people / 3 hats, then working that up to 4 people / 4 hats, and I'm fairly sure eventually you'd be able to do 7 people / 7 hats.

I'm lazy to solve 3 people / 3 hats, but that's probably how you'd get to it.


(the key is of course that the king doesn't have a 120 pack of crayolas, it's that there are 7 specific colors in the pool)
Friendship is Magic! <3
KarlSberg~
Profile Blog Joined September 2003
731 Posts
September 09 2010 21:57 GMT
#86
On September 10 2010 06:56 tofucake wrote:
Show nested quote +
On September 10 2010 06:54 KarlSberg~ wrote:
First I really thought that would be going to be something retarded, but that's actually a very nice problem.
I think this is the strategy, even though I have a hard time proving it
+ Show Spoiler +

Assign a number to each color (0..6)
Assign a number to each prisoner (0..6)
Each prisonner adds the colors he sees on all other guys + his number
Sum%7 gives the color the prisoner has to announce
In any possible case one (exactly one) prisoner will be right.

And once again, what if the King has a 120 pack of Crayolas? Also, the OP states there could be 2 reds and 1 of 5 other colors.

The king has 7 colors as stated in the OP.
About the second remark... well yes he could. So what?
There are 01 kind of people who know binary. Those who understand little endian and those who don t.
Slithe
Profile Blog Joined February 2007
United States985 Posts
September 09 2010 21:57 GMT
#87
On September 10 2010 06:56 tofucake wrote:
Show nested quote +
On September 10 2010 06:54 KarlSberg~ wrote:
First I really thought that would be going to be something retarded, but that's actually a very nice problem.
I think this is the strategy, even though I have a hard time proving it
+ Show Spoiler +

Assign a number to each color (0..6)
Assign a number to each prisoner (0..6)
Each prisonner adds the colors he sees on all other guys + his number
Sum%7 gives the color the prisoner has to announce
In any possible case one (exactly one) prisoner will be right.

And once again, what if the King has a 120 pack of Crayolas? Also, the OP states there could be 2 reds and 1 of 5 other colors.


They know ahead of time what the 7 possible colors are.
tofucake
Profile Blog Joined October 2009
Hyrule19059 Posts
September 09 2010 21:58 GMT
#88
So I won? Sweet.

This problem actually does seem like a mashup of several problems. All of the "prisoners with hats" problems I've heard were limited to a set of 1 color and a set of another color (usually red/blue or black/white) and they would be in a line, not a circle. IE: There would be 4 red and 3 blue.
Liquipediaasante sana squash banana
LeoTheLion
Profile Blog Joined July 2006
China958 Posts
Last Edited: 2010-09-09 22:23:24
September 09 2010 22:00 GMT
#89
this is a really nice problem. we need to find a one to one mapping between the distribution of hats and the distribution of guesses.

i think the way to solve is to break it down into simpler case, for two hats, three hats, and then generalize to 7.

EDIT
SOLUTION FOR THREE HATS:


+ Show Spoiler +

Let's say three colors, color 1, color 2, and color 3. The prisoners arrange themselves as prisoner 1, 2 and 3. Each prisoner has a different strategy, which combined will let them live.

Case 1: both hats you see are same color (11, 22, or 33)
prisoner 1 writes down the same color
prisoner 2 writes down color of one greater
prisoner 3 writes down color of two greater

for example, if you see that the other hats are both color 1, (if you see 11):
--prisoner 1 writes down hat 1 (same)
--prisoner 2 writes down hat 2 (one greater)
--prisoner 3 writes down hat 3 (two greater)

If you see 22
--prisoner 1 writes down 2 (same)
--prisoner 2 writes down 3 (one greater)
--prisoner 3 writes down 1 (two greater)

If you see 33
--prisoner 1 writes down 3
--2 writes down 1
--3 writes down 2


Case 2: if the hats you see are different color (12, 23, or 31)
prisoner 1 writes down the remaining color
prisoner 2 writes down the the left color
prisoner 3 writes down the right color

*note i don't mean traditional left and write.

for example if you see 12
--1 writes down 3
--2 writes down 1
--3 writes down 2

if you see 23
--1 writes down 1
--2 writes down 2
--3 writes down 3

if you see 31
--1 writes down 2
--2 writes down 3
--3 writes down 1


This strategy will cover all 3^3 = 27 possibilities.

for cases where all numbers are same, prisoner 1 guesses right
111, 222, 333

for cases where all numbers are different, prisoner 1 guesses right
123, 231, 312
132, 213, 321 (symmetrical to first)

for cases where two numbers are same, then either prisoner 2 or prisoner 3 will guess right
(prisoner 2 first case, prisoner 3 second case)
121, 113 (prisoner 2 sees 11, so he guesses 2. prisoner 3 sees 11, so he guesses 3)
232, 221
313, 332

112, 131 (prisoner 2 sees 12, so he guesses 1. prisoner 3 sees 31, so he guesses 1)
223, 212
331, 323

211, 311 (symmetrical to case above, since person 2 still sees 12, person 3 still sees 31)
322, 122
133, 233

And those are all the cases.
Communism is not love. Communism is a hammer which we use to crush the enemy. -Chairman Mao
The_Pacifist
Profile Blog Joined May 2010
United States540 Posts
September 09 2010 22:00 GMT
#90
The riddle is impossible because here's what would really happen:

King: ...But there is a mathematical method where your chances of survival are 100%
Prisoners: Great! Let's solve it
*5 blog pages later*
Prisoners: ...Screw it. The king's just trolling us, so let's just get this over with and start guessing.
tofucake
Profile Blog Joined October 2009
Hyrule19059 Posts
Last Edited: 2010-09-09 22:02:06
September 09 2010 22:00 GMT
#91
On September 10 2010 06:57 Slithe wrote:
Show nested quote +
On September 10 2010 06:56 tofucake wrote:
On September 10 2010 06:54 KarlSberg~ wrote:
First I really thought that would be going to be something retarded, but that's actually a very nice problem.
I think this is the strategy, even though I have a hard time proving it
+ Show Spoiler +

Assign a number to each color (0..6)
Assign a number to each prisoner (0..6)
Each prisonner adds the colors he sees on all other guys + his number
Sum%7 gives the color the prisoner has to announce
In any possible case one (exactly one) prisoner will be right.

And once again, what if the King has a 120 pack of Crayolas? Also, the OP states there could be 2 reds and 1 of 5 other colors.


They know ahead of time what the 7 possible colors are.

Didn't you also state that there could be multiples?
So would this make sense:
Possible
red, orange, yellow, green, blue, indigo, violet
Actual
red, red, red, yellow, blue, indigo, indigo

Or would it have to be
Possible
red, red, red, yellow, blue, indigo, indigo
Actual
red, red, red, yellow, blue, indigo, indigo
Liquipediaasante sana squash banana
Lark
Profile Joined December 2009
United States24 Posts
September 09 2010 22:02 GMT
#92
After thinking about the problem for a while, I'm convinced there's actually hundreds (of thousands?) of solutions (just like there are 2 solutions to the 2 person problem), based on people picking a certain color based solely on the colors of their opponents. So maybe if he saw colors 1,1,3,6,5,3 in that order he'd pick color 2, and then person 2 would pick 7 and person 3 would pick... etc until someone got it right. And they'd come up with combinations for every situation. All 7^7 of them. We could plug that into a supercomputer and find one of the many answers, but the trick is finding the "simplest" solution. (One that the prisoners could memorize).

So far I've had no luck, but it has to be simple enough that there is a pattern involved, otherwise the puzzle would be nearly impossible.
KarlSberg~
Profile Blog Joined September 2003
731 Posts
September 09 2010 22:02 GMT
#93
@Tofucake
The first one is possible, 7 colors are announced but not all of them have to be present in the actual set.
There are 01 kind of people who know binary. Those who understand little endian and those who don t.
KazeHydra
Profile Blog Joined August 2010
Japan2788 Posts
Last Edited: 2010-09-09 22:06:03
September 09 2010 22:03 GMT
#94
I'm not sure if this is considered communicating so maybe it's not correct, but it should be on the right track at the very least.

+ Show Spoiler +
before sitting down, everyone agrees to only consider one person's hat, person A. Then, they will each assign each other a color based on the 7 colors available. If person A is wearing red, person B will be the first to give his paper to the king; it doesn't matter what person B guesses. Then person A knows his hat is red. If person A's hat is orange, person C will be the first to give his paper to the king, and person A will know his hat is orange, and so on. If person A is wearing the 7th color that is assigned to him, nobody will turn in the paper to the king and person A will know his hat is the 7th color.


edit: aww I guess I was beaten while thinking/writing this up. At least I was kind of close.
"Because I know this promise that won’t disappear will turn even a cause of tears into strength. You taught me that if I can believe, there is nothing that cannot come true." - Nana Mizuki (Yakusoku) 17:36 ils kaze got me into nana 17:36 ils by his blog
Pufftrees
Profile Joined March 2009
2449 Posts
September 09 2010 22:04 GMT
#95
On September 10 2010 06:54 KarlSberg~ wrote:
First I really thought that would be going to be something retarded, but that's actually a very nice problem.
I think this is the strategy, even though I'm having a hard time proving it
+ Show Spoiler +
Assign a number to each color (0..6)
Assign a number to each prisoner (0..6)
Each prisonner adds the colors he sees on all other guys + his number
Sum%7 gives the color the prisoner has to announce
In any possible case one (exactly one) prisoner will be right.



Nice work
Chance favors the prepared mind.
Lark
Profile Joined December 2009
United States24 Posts
September 09 2010 22:05 GMT
#96
@Kaze

They each guess individually, otherwise that would be communicating.
Seth_
Profile Blog Joined July 2010
Belgium184 Posts
September 09 2010 22:05 GMT
#97
On September 10 2010 06:54 KarlSberg~ wrote:
+ Show Spoiler +
Assign a number to each color (0..6)
Assign a number to each prisoner (0..6)
Each prisonner adds the colors he sees on all other guys + his number
Sum%7 gives the color the prisoner has to announce
In any possible case one (exactly one) prisoner will be right.

nice solution
Why didn't I notice the (small hint for people who want to solve it themselves)+ Show Spoiler +
modulo 2
in the 2-player solution.

The next challenge: prove that the solution by KarlSberg is correct :-)
Slithe
Profile Blog Joined February 2007
United States985 Posts
Last Edited: 2010-09-09 22:10:51
September 09 2010 22:07 GMT
#98
Let me try and explain Karlsberg's solution a little bit

+ Show Spoiler [solution] +

We assign each color a number from 0-6

Now we can say that the prisoners are essentially getting a number, c0,c1,c2,c3,c4,c5,c6.

S = (c0 + c1 + c2 + c3 + c4 + c5 + c6) modulo 7

S has seven possible values, 0-6

At this point, what each prisoner is doing is trying to guess what S is, and solving for their own number to match S.

Prisoner 0 assumes S = 0, and solves the equation c0 = S - (c1+c2+c3+c4+c5+c6)
Prisoner 1 assumes S = 1, and solves the equation c1 = S - (c0+c2+c3+c4+c5+c6)
and so on..

At least one of the 7 prisoners will assume the correct S value. That prisoner will be able to guess the correct number for their own hat.
madnessman
Profile Blog Joined May 2009
United States1581 Posts
September 09 2010 22:07 GMT
#99
On September 10 2010 06:58 tofucake wrote:
So I won? Sweet.

This problem actually does seem like a mashup of several problems. All of the "prisoners with hats" problems I've heard were limited to a set of 1 color and a set of another color (usually red/blue or black/white) and they would be in a line, not a circle. IE: There would be 4 red and 3 blue.


yeah i'm familiar with that kind of hat problem but i've never heard of a problem with 7 hat colors before.
LastPrime
Profile Blog Joined May 2010
United States109 Posts
September 09 2010 22:11 GMT
#100
Guys this is really easy:
+ Show Spoiler +

Assign each color a value 0-6. Each person takes sum of all the colors he sees and says the result in mod 7 (says the corresponding color to the sum). If you let a_1 be the first person's color, a_2 second guy's, etc, and S the sum of all, the first person will say S-a_1 (mod 7), second S-a_2, etc. Now it is possible to express all a_2, a_3, ... a_7 in terms of a_1. Add all values (expressed in terms of a_1) and you get 7a_1 + X, for some X. X = S (mod 7). Now the only thing the last person has to do is subtract and get his color.
Prev 1 2 3 4 5 6 7 Next All
Please log in or register to reply.
Live Events Refresh
Next event in 3h 18m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
UpATreeSC 108
ProTech93
Nathanias 88
StarCraft: Brood War
Britney 19566
Calm 3468
Horang2 504
ggaemo 239
firebathero 129
LaStScan 115
Rock 24
soO 23
Dota 2
syndereN437
Counter-Strike
fl0m1952
Stewie2K207
PGG 49
Super Smash Bros
hungrybox412
PPMD98
Heroes of the Storm
Liquid`Hasu493
Other Games
Grubby2652
FrodaN1093
RotterdaM958
Mlord494
mouzStarbuck487
C9.Mang0265
SteadfastSC76
ZombieGrub72
Trikslyr68
Sick15
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 19 non-featured ]
StarCraft 2
• kabyraGe 297
• davetesta42
• LaughNgamezSOOP
• sooper7s
• AfreecaTV YouTube
• intothetv
• Migwel
• Kozan
• IndyKCrew
StarCraft: Brood War
• Eskiya23 20
• 80smullet 12
• Pr0nogo 5
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota21727
Counter-Strike
• Shiphtur304
Other Games
• imaqtpie1594
• WagamamaTV653
Upcoming Events
OSC
3h 18m
Replay Cast
13h 18m
Afreeca Starleague
13h 18m
JyJ vs TY
Bisu vs Speed
WardiTV Summer Champion…
14h 18m
PiGosaur Monday
1d 3h
Afreeca Starleague
1d 13h
Mini vs TBD
Soma vs sSak
WardiTV Summer Champion…
1d 14h
Online Event
2 days
The PondCast
2 days
WardiTV Summer Champion…
2 days
[ Show More ]
Replay Cast
3 days
LiuLi Cup
3 days
BSL Team Wars
3 days
Team Hawk vs Team Dewalt
Korean StarCraft League
4 days
CranKy Ducklings
4 days
SC Evo League
4 days
WardiTV Summer Champion…
4 days
[BSL 2025] Weekly
4 days
Sparkling Tuna Cup
5 days
SC Evo League
5 days
BSL Team Wars
5 days
Team Bonyth vs Team Sziky
Afreeca Starleague
6 days
Queen vs HyuN
EffOrt vs Calm
Wardi Open
6 days
Liquipedia Results

Completed

Proleague 2025-08-13
uThermal 2v2 Main Event
HCC Europe

Ongoing

Copa Latinoamericana 4
Jiahua Invitational
BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Qualifiers
ASL Season 20
CSL Season 18: Qualifier 1
SEL Season 2 Championship
WardiTV Summer 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025

Upcoming

CSLAN 3
CSL 2025 AUTUMN (S18)
LASL Season 20
BSL Season 21
BSL 21 Team A
RSL Revival: Season 2
Maestros of the Game
PGL Masters Bucharest 2025
Thunderpick World Champ.
MESA Nomadic Masters Fall
CS Asia Championships 2025
Roobet Cup 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.