• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 06:07
CEST 12:07
KST 19:07
  • 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
RSL Season 1 - Final Week6[ASL19] Finals Recap: Standing Tall15HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0
Community News
Esports World Cup 2025 - Brackets Revealed19Weekly Cups (July 7-13): Classic continues to roll8Team TLMC #5 - Submission extension3Firefly given lifetime ban by ESIC following match-fixing investigation17$25,000 Streamerzone StarCraft Pro Series announced7
StarCraft 2
General
Why doesnt SC2 scene costream tournaments Esports World Cup 2025 - Brackets Revealed The GOAT ranking of GOAT rankings Who will win EWC 2025? Heaven's Balance Suggestions (roast me)
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament Sea Duckling Open (Global, Bronze-Diamond) FEL Cracov 2025 (July 27) - $8000 live event RSL: Revival, a new crowdfunded tournament series $5,100+ SEL Season 2 Championship (SC: Evo)
Strategy
How did i lose this ZvP, whats the proper response
Custom Maps
External Content
Mutation # 482 Wheel of Misfortune Mutation # 481 Fear and Lava Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome
Brood War
General
Flash Announces (and Retracts) Hiatus From ASL BGH Auto Balance -> http://bghmmr.eu/ Soulkey Muta Micro Map? BW General Discussion [ASL19] Finals Recap: Standing Tall
Tourneys
[Megathread] Daily Proleagues 2025 ACS Season 2 Qualifier [BSL 2v2] ProLeague Season 3 - Friday 21:00 CET CSL Xiamen International Invitational
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread CCLP - Command & Conquer League Project The PlayStation 5
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
Things Aren’t Peaceful in Palestine US Politics Mega-thread The Games Industry And ATVI Russo-Ukrainian War Thread Stop Killing Games - European Citizens Initiative
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Movie Discussion! Anime Discussion Thread [Manga] One Piece Korean Music Discussion [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023 NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Ping To Win? Pings And Their…
TrAiDoS
momentary artworks from des…
tankgirl
from making sc maps to makin…
Husyelt
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 624 users

[Math Puzzle] Day4

Blogs > evanthebouncy!
Post a Reply
Normal
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
Last Edited: 2009-04-30 11:13:25
April 30 2009 10:14 GMT
#1
So day 4!

Previous day's puzzle was first solved by Abydos1 or Hamster1800. Abydos1 has very good intuition but Hamster1800's answer is more precise.
+ Show Spoiler [solution] +

define a function f to be the difference in heights of 2 opposite points, x and x+pi. f(x) = height(x) - height(x+pi) where x is an angle, range from 0 to 2pi.

f(0) can either be >0, <0, or = 0.
If f(0)=0, then we're done.
The case of f(0)>0 and f(0)<0 is symmetrical, so we'll suppose f(0)>0.

f(0)>0 means height(0)-height(pi)>0.
However, since height(0)=height(2pi) because the track is continuous, we'll also have
height(2pi)-height(pi)>0 by substitution.
Rearranging we find that f(pi)=height(pi)-height(2pi)<0
Therefore we have a function f, moving from f(0)>0 to f(pi)<0, then at some point between 0 and pi, say c, f(c)=0.
That is to say, height(c)=height(c+pi), for some c, and that those 2 point are the opposite point with same height.


Today's puzzle is this:
You have n prisoners, and a warden who has a wardrobe. In this wardrobe there are hats of n colors, with many hats for each color(>n).
For example, if there are 3 prisoners, there will be 3 different colors of hats, say red hats, green hats, and blue hats, with more than 3 each, Say 10 red hats, 4 green hats, and 6 blue hats, for instance.

The game:
-Warden will put one hat(any color the warden wishes) on each of a prisoner's head, a prisoner cannot see the color of his own hat, but can see everyone else's hats.
-The prisoner cannot communicate to each other when the game starts.
-The prisoner will write down on a piece of paper what color hat he thinks he himself is wearing.
-If AT LEAST 1 prisoner guesses his own hat's color correctly, they all get to be free.

Your job:
Devise a strategy for the prisoners before the game starts, so at least 1 person would guess his own hat color correctly.

Extra information:
-Warden will also know the strategy as well, and he will try to put hats in a certain way if your strategy can fail.

Clarifications:
On April 30 2009 19:49 MasterReY wrote:
do prisoners know how many hats of a certain color are in the wardrobe before/after warden puts the hats on the prisoners?

No, but they do know it is greater than n, and they cannot see the wardrobe before/after.

On April 30 2009 20:03 Nytefish wrote:
Do they know what colours are possible?

On April 30 2009 20:03 Zona wrote:
Do the prisoners know before what the specific colors are?

-Yes. They will know the n possible colours beforehand.

Again, put answers in spoiler tags, and clarification will be given as needed.

GL HF!

*****
Life is run, it is dance, it is fast, passionate and BAM!, you dance and sing and booze while you can for now is the time and time is mine. Smile and laugh when still can for now is the time and soon you die!
Spenguin
Profile Blog Joined November 2007
Australia3316 Posts
April 30 2009 10:27 GMT
#2
+ Show Spoiler +
Don't break the law.
< TeamLiquid CJ Entusman #46 > I came for the Brood War, I stayed for the people.
freelander
Profile Blog Joined December 2004
Hungary4707 Posts
April 30 2009 10:46 GMT
#3
so anyone can get an any coloured hat, and they can't communicate in any way
This is HARD.
And all is illuminated.
MasterReY
Profile Blog Joined August 2007
Germany2708 Posts
April 30 2009 10:49 GMT
#4
do prisoners know how many hats of a certain color are in the wardrobe before/after warden puts the hats on the prisoners?
https://www.twitch.tv/MasterReY/ ~ Biggest Reach fan on TL.net (Don't even dare to mention LR now) ~ R.I.P Violet ~ Developer of SCRChart
TL+ Member
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
Last Edited: 2009-04-30 11:00:05
April 30 2009 10:58 GMT
#5
On April 30 2009 19:49 MasterReY wrote:
do prisoners know how many hats of a certain color are in the wardrobe before/after warden puts the hats on the prisoners?

No, but they do know it is greater than n, and they cannot see the wardrobe before/after.
Life is run, it is dance, it is fast, passionate and BAM!, you dance and sing and booze while you can for now is the time and time is mine. Smile and laugh when still can for now is the time and soon you die!
Nytefish
Profile Blog Joined December 2007
United Kingdom4282 Posts
April 30 2009 11:03 GMT
#6
Do they know what colours are possible?
No I'm never serious.
Zona
Profile Blog Joined May 2007
40426 Posts
April 30 2009 11:03 GMT
#7
Do the prisoners know before what the specific colors are?
"If you try responding to those absurd posts every day, you become more damaged. So I pay no attention to them at all." Jung Myung Hoon (aka Fantasy), as translated by Kimoleon
kOre
Profile Blog Joined April 2009
Canada3642 Posts
April 30 2009 11:07 GMT
#8
This is how they get released.
+ Show Spoiler +
All the prisoners take their pencil/pens and attack the warden all at once.

P.S. Saving this post for when I figure out the answer
http://www.starcraftmecca.net - Founder
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
April 30 2009 11:11 GMT
#9
On April 30 2009 20:03 Nytefish wrote:
Do they know what colours are possible?


On April 30 2009 20:03 Zona wrote:
Do the prisoners know before what the specific colors are?


Yes. They will know the n possible colours beforehand.
Life is run, it is dance, it is fast, passionate and BAM!, you dance and sing and booze while you can for now is the time and time is mine. Smile and laugh when still can for now is the time and soon you die!
kOre
Profile Blog Joined April 2009
Canada3642 Posts
Last Edited: 2009-04-30 11:13:46
April 30 2009 11:13 GMT
#10
http://www.starcraftmecca.net - Founder
peanutter
Profile Joined February 2009
Australia165 Posts
April 30 2009 11:18 GMT
#11
i've solved this kind of problem twice before already and still forget how to do it
Malongo
Profile Blog Joined November 2005
Chile3472 Posts
April 30 2009 11:19 GMT
#12
+ Show Spoiler +
Help me! im still improving my English. An eye for an eye makes the whole world blind. M. G.
raiame
Profile Joined December 2007
United States421 Posts
April 30 2009 11:23 GMT
#13
Why am I still up...
+ Show Spoiler +
n colors, assign each color a different number from 1 to n. also, assign each person a number from 1 to n. have each person add up the values of the colors of each hat he sees, and we'll call this number s(k), where k is the number of the prisoner. Have prisoner k say the color corresponding to k - s(k) (mod n). This works because for each person, s(k) plus the color of their own hat is the same total sum, so subtracting s(k) from this total sum gives your own hat. You make sure that each possible total sum (mod n) is accounted for by assigning each prisoner a different number to subtract from.
datscilly
Profile Blog Joined November 2007
United States528 Posts
April 30 2009 11:23 GMT
#14
+ Show Spoiler +
There are n colors. Assign a different number from 1 to n for each of the colors. Take the sum of all the hats (numbers) on all of the n prisoners, and mod n this sum. This sum mod n is a number from 0 to n-1.
Each prison cannot see their own hat, of course, so they do not know what the sum mod n is. However, if each prison guesses a different answer for the sum mod n, one of them will be correct. And if you have the correct sum mod n then it is possible to figure out your own hat color.
kOre
Profile Blog Joined April 2009
Canada3642 Posts
April 30 2009 11:25 GMT
#15
But you only know the colour of the hats, not how many of each you have.
http://www.starcraftmecca.net - Founder
Loanshark
Profile Blog Joined December 2008
China3094 Posts
April 30 2009 11:34 GMT
#16
One guy writes YOUR HAT IS N COLOR on his paper and shows it to the prisoner he just wrote about.
No dough, no go. And no mercy.
freelander
Profile Blog Joined December 2004
Hungary4707 Posts
April 30 2009 11:35 GMT
#17
On April 30 2009 20:23 raiame wrote:
Why am I still up...
+ Show Spoiler +
n colors, assign each color a different number from 1 to n. also, assign each person a number from 1 to n. have each person add up the values of the colors of each hat he sees, and we'll call this number s(k), where k is the number of the prisoner. Have prisoner k say the color corresponding to k - s(k) (mod n). This works because for each person, s(k) plus the color of their own hat is the same total sum, so subtracting s(k) from this total sum gives your own hat. You make sure that each possible total sum (mod n) is accounted for by assigning each prisoner a different number to subtract from.


but they can't communicate at all
And all is illuminated.
Rhaegar99
Profile Blog Joined September 2008
Australia1190 Posts
Last Edited: 2009-04-30 11:52:09
April 30 2009 11:50 GMT
#18
+ Show Spoiler +
Each colour will be assigned a number from 1 to n. Every prisioner will write whatever colour onto the paper except for the two who are chosen last. The second last person will take 5X seconds to write down on his piece of paper, where X is the number that was assigned to the colour on the last prisioner's hat. The last prisioner will count how long the second person takes, and will then know which colour hat he is wearing.
stet_tcl
Profile Blog Joined May 2008
Greece319 Posts
Last Edited: 2009-04-30 12:13:40
April 30 2009 12:12 GMT
#19
On April 30 2009 20:35 freelander wrote:
Show nested quote +
On April 30 2009 20:23 raiame wrote:
Why am I still up...
+ Show Spoiler +
n colors, assign each color a different number from 1 to n. also, assign each person a number from 1 to n. have each person add up the values of the colors of each hat he sees, and we'll call this number s(k), where k is the number of the prisoner. Have prisoner k say the color corresponding to k - s(k) (mod n). This works because for each person, s(k) plus the color of their own hat is the same total sum, so subtracting s(k) from this total sum gives your own hat. You make sure that each possible total sum (mod n) is accounted for by assigning each prisoner a different number to subtract from.


but they can't communicate at all


If I'm not mistaken they can communicate before the game starts.

Also
On April 30 2009 20:50 Rhaegar99 wrote:
+ Show Spoiler +
Each colour will be assigned a number from 1 to n. Every prisioner will write whatever colour onto the paper except for the two who are chosen last. The second last person will take 5X seconds to write down on his piece of paper, where X is the number that was assigned to the colour on the last prisioner's hat. The last prisioner will count how long the second person takes, and will then know which colour hat he is wearing.

LOL
stenole
Profile Blog Joined April 2004
Norway868 Posts
April 30 2009 12:13 GMT
#20
On April 30 2009 20:23 raiame wrote:
Why am I still up...
+ Show Spoiler +
n colors, assign each color a different number from 1 to n. also, assign each person a number from 1 to n. have each person add up the values of the colors of each hat he sees, and we'll call this number s(k), where k is the number of the prisoner. Have prisoner k say the color corresponding to k - s(k) (mod n). This works because for each person, s(k) plus the color of their own hat is the same total sum, so subtracting s(k) from this total sum gives your own hat. You make sure that each possible total sum (mod n) is accounted for by assigning each prisoner a different number to subtract from.


I bet the warden didn't see that one coming. Sounds like you've been in this situation before prisoner raiame.
Nytefish
Profile Blog Joined December 2007
United Kingdom4282 Posts
April 30 2009 13:01 GMT
#21
On April 30 2009 20:35 freelander wrote:
Show nested quote +
On April 30 2009 20:23 raiame wrote:
Why am I still up...
+ Show Spoiler +
n colors, assign each color a different number from 1 to n. also, assign each person a number from 1 to n. have each person add up the values of the colors of each hat he sees, and we'll call this number s(k), where k is the number of the prisoner. Have prisoner k say the color corresponding to k - s(k) (mod n). This works because for each person, s(k) plus the color of their own hat is the same total sum, so subtracting s(k) from this total sum gives your own hat. You make sure that each possible total sum (mod n) is accounted for by assigning each prisoner a different number to subtract from.


but they can't communicate at all


I think when he said "say" he meant "write".
No I'm never serious.
raiame
Profile Joined December 2007
United States421 Posts
April 30 2009 14:46 GMT
#22
On April 30 2009 21:13 stenole wrote:
Show nested quote +
On April 30 2009 20:23 raiame wrote:
Why am I still up...
+ Show Spoiler +
n colors, assign each color a different number from 1 to n. also, assign each person a number from 1 to n. have each person add up the values of the colors of each hat he sees, and we'll call this number s(k), where k is the number of the prisoner. Have prisoner k say the color corresponding to k - s(k) (mod n). This works because for each person, s(k) plus the color of their own hat is the same total sum, so subtracting s(k) from this total sum gives your own hat. You make sure that each possible total sum (mod n) is accounted for by assigning each prisoner a different number to subtract from.


I bet the warden didn't see that one coming. Sounds like you've been in this situation before prisoner raiame.

I have! Except we didn't have the wonderful hats last time.
Also, the last time I was the one who correctly guessed my own. I hope to do so again.
Bebop Berserker
Profile Joined April 2009
United States246 Posts
Last Edited: 2009-04-30 17:13:51
April 30 2009 17:11 GMT
#23
+ Show Spoiler +

On April 30 2009 20:23 raiame wrote:
Why am I still up...
+ Show Spoiler +
n colors, assign each color a different number from 1 to n. also, assign each person a number from 1 to n. have each person add up the values of the colors of each hat he sees, and we'll call this number s(k), where k is the number of the prisoner. Have prisoner k say the color corresponding to k - s(k) (mod n). This works because for each person, s(k) plus the color of their own hat is the same total sum, so subtracting s(k) from this total sum gives your own hat. You make sure that each possible total sum (mod n) is accounted for by assigning each prisoner a different number to subtract from.



+ Show Spoiler +

Maybe I don't understand but that's isn't right at all. Example: there are three hats red blue and white(1 2 and 3 respectively.) There are three prisoners(1 2 and 3.) 1 is wearing white 2 is wearing white and 3 is wearing blue. Now your theory states I should take 3 -5 % n. so, prisoner 1 is blue prisoner 2 is red and prisoner 3 is white. Therefore they all die.




+ Show Spoiler +

Rhaegar99 is who i agree with. Everyone chooses a different color beforehand and everyone memorizes everyone's color. Then they pick an interval(10 or 15 seconds is more realistic) Then we warden says go they wait 10 seconds everyone who doesn't see their color writes down their color. Everyone who does see their color waits 10x seconds were x is the the number of hats their color. Now out of the people who are left they have to watch to make sure everyone remaining doesn't write down at the same time(i.e. the warden doesn't put one of every color hat on the persons head who doesn't have that color.(there are more examples.) If he sees everyone writing down at the same time he can see tell what color hat he has on and he writes that down.(for example there are 4 prisoners and two have blue and two have red. the blue and red would wait thirty seconds and then write down both their colors. since the other two wrote down their colrs at ten seconds they know their are no other colors. they then know there are 2 red and 2 blue. so they write down the color they see only one of.)
Whatever happens, happens.
Nytefish
Profile Blog Joined December 2007
United Kingdom4282 Posts
Last Edited: 2009-04-30 17:45:47
April 30 2009 17:42 GMT
#24
Doesn't waiting to see when people start writing count as communicating though?

And to above poster, + Show Spoiler +
It's n - 5 (mod 3) so I think person 2 writes the correct colour.
No I'm never serious.
Normal
Please log in or register to reply.
Live Events Refresh
Sparkling Tuna Cup
10:00
Weekly #98
CranKy Ducklings35
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
ProTech95
StarCraft: Brood War
Hyuk 1931
Barracks 1273
BeSt 765
Larva 639
Mini 358
actioN 352
firebathero 295
Dewaltoss 272
Soma 169
Leta 161
[ Show more ]
PianO 121
ToSsGirL 103
Bonyth 73
Shinee 47
Backho 43
Sharp 37
Last 20
Sacsri 19
Noble 16
NotJumperer 11
sorry 8
EffOrt 7
Dota 2
XcaliburYe760
XaKoH 622
canceldota152
League of Legends
JimRising 458
Counter-Strike
Stewie2K4892
x6flipin273
Super Smash Bros
Westballz64
Heroes of the Storm
Khaldor213
Other Games
Happy343
SortOf210
Organizations
Other Games
gamesdonequick2529
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• Berry_CruncH242
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• lizZardDota2231
League of Legends
• Jankos1413
Other Games
• WagamamaTV319
Upcoming Events
Online Event
5h 53m
BSL 2v2 ProLeague S3
7h 53m
Esports World Cup
1d 23h
ByuN vs Astrea
Lambo vs HeRoMaRinE
Clem vs TBD
Solar vs Zoun
SHIN vs Reynor
Maru vs TriGGeR
herO vs Lancer
Cure vs ShoWTimE
Esports World Cup
2 days
Esports World Cup
3 days
Esports World Cup
5 days
CranKy Ducklings
5 days
BSL20 Non-Korean Champi…
6 days
BSL20 Non-Korean Champi…
6 days
Bonyth vs Sziky
Dewalt vs Hawk
Hawk vs QiaoGege
Sziky vs Dewalt
Mihu vs Bonyth
Zhanhun vs QiaoGege
QiaoGege vs Fengzi
FEL
6 days
Liquipedia Results

Completed

2025 ACS Season 2
RSL Revival: Season 1
Murky Cup #2

Ongoing

BSL 2v2 Season 3
Copa Latinoamericana 4
Jiahua Invitational
BSL20 Non-Korean Championship
CSL Xiamen Invitational
Championship of Russia 2025
Underdog Cup #2
FISSURE Playground #1
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25

Upcoming

CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
BSL Season 21
RSL Revival: Season 2
SEL Season 2 Championship
uThermal 2v2 Main Event
FEL Cracov 2025
Esports World Cup 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 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.