• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 02:31
CET 08:31
KST 16:31
  • 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
Rongyi Cup S3 - Preview & Info3herO wins SC2 All-Star Invitational14SC2 All-Star Invitational: Tournament Preview5RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0
Community News
Weekly Cups (Jan 19-25): Bunny, Trigger, MaxPax win3Weekly Cups (Jan 12-18): herO, MaxPax, Solar win0BSL Season 2025 - Full Overview and Conclusion8Weekly Cups (Jan 5-11): Clem wins big offline, Trigger upsets4$21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7)38
StarCraft 2
General
StarCraft 2 not at the Esports World Cup 2026 Weekly Cups (Jan 19-25): Bunny, Trigger, MaxPax win Oliveira Would Have Returned If EWC Continued herO wins SC2 All-Star Invitational PhD study /w SC2 - help with a survey!
Tourneys
$21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7) OSC Season 13 World Championship $70 Prize Pool Ladder Legends Academy Weekly Open! SC2 All-Star Invitational: Jan 17-18 Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Simple Questions Simple Answers
Custom Maps
[A] Starcraft Sound Mod
External Content
Mutation # 510 Safety Violation Mutation # 509 Doomsday Report Mutation # 508 Violent Night Mutation # 507 Well Trained
Brood War
General
Bleak Future After Failed ProGaming Career BW General Discussion BGH Auto Balance -> http://bghmmr.eu/ [ASL21] Potential Map Candidates Gypsy to Korea
Tourneys
[Megathread] Daily Proleagues Small VOD Thread 2.0 Azhi's Colosseum - Season 2 [BSL21] Non-Korean Championship - Starts Jan 10
Strategy
Zealot bombing is no longer popular? Current Meta Simple Questions, Simple Answers Soma's 9 hatch build from ASL Game 2
Other Games
General Games
Path of Exile Battle Aces/David Kim RTS Megathread Nintendo Switch Thread Mobile Legends: Bang Bang Beyond All Reason
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Provigil(modafinil) pills Cape Town+27 81 850 2816
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Canadian Politics Mega-thread YouTube Thread European Politico-economics QA Mega-thread
Fan Clubs
The herO Fan Club! The IdrA Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece
Sports
2024 - 2026 Football Thread
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
How Esports Advertising Shap…
TrAiDoS
My 2025 Magic: The Gathering…
DARKING
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
James Bond movies ranking - pa…
Topin
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1579 users

Nifty Math Puzzle

Blogs > Slithe
Post a Reply
Slithe
Profile Blog Joined February 2007
United States985 Posts
April 18 2008 09:48 GMT
#1
This one's not too hard, but pretty cool imo.

There is a room with a cross-shaped table in it. The cross-shaped table can spin around, but it always stops spinning with the arms of the cross facing north, south, east, and west. (i.e. after every spin, the cross will be in one of 4 possible orientations). At the end of each arm of the cross is a cup, either right-side up or upside down, at random.

Now you are in a separate room and cannot see the table, while your friend is in the room with the table. You can command your friend to flip over certain cups by telling him which directions to flip (i.e. if you say flip over the north cup, then your friend will flip the cup on the north arm from right-side up to upside down or vice versa). After your friend flips the cups, he will either say you're done because all the cups are right-side up, or he will spin the table. After he spins it, you can once again give him another command, and the process continues until all the cups are right-side up.

Your goal is to flip all the cups right-side up. Figure out a way to do this in as few spins as possible, and prove that it is optimal.

Daigomi
Profile Blog Joined May 2006
South Africa4316 Posts
April 18 2008 12:53 GMT
#2
Are the spins random (eg. it can spin 90 degrees or 270 degrees) or are the always exactly one spin to a side?
Moderator
Polemarch
Profile Joined August 2005
Canada1564 Posts
Last Edited: 2008-04-18 13:03:33
April 18 2008 12:58 GMT
#3
Nice problem.

edit: I interpreted it as spins can be totally random {0, 90, 180, 270}. Also it seems worth pointing out more clearly that the OP says you can flip any number of cups in any of the directions, not just one cup each go.

+ Show Spoiler [Solution] +

I'll use the notation e.g. 0000 to mean all cups are upside down, and 1010 to mean that either North/South or East/West are right-side up; and the analogous notation to indicate which cups to flip. Let X be the initial configuration.

Here's one way with 16 worst-case flips. (Numbered from 0 due to not thinking of one case initially and not wanting to edit step numbers.)

0. Flip none of the cups. If X=1111 then done and your friend is a sneaky bastard.
1. Flip all 4 cups. If X=0000 then done. So now you've eliminated the possibility that all four of the cups had the same initial parity.
2. Now try to eliminate X=1010. This configuration wouldn't have been changed by flip 1. Flip 1010. X=1010 would now give you either 1111 (done) or 0000.
3. Flip all 4 cups. X=1010 is now eliminated.
4. Now try to eliminate X=1100. This configuration wouldn't have been changed by flips 1-3. Flip 1100. Now if X=1100, then the current possibilities are 1111, 1010, or 0000. So in steps 5-7, follow steps 1-3 by which we eliminated those possibilities previously.
5. Flip all 4 cups.
6. Flip 1010.
7. Flip all four cups. Now X=1100 is eliminated. Now all possibilities with X having an even number of 1's are eliminated.
8. Now the only possibilities left are X having an odd number of 1's. This property would be invariant under the flips 1-7. Flip 1000. Now the current configuration must have an even number of 1's.
9-15. Follow steps 1-7.

To prove that that's optimal, consider the simpler problem where there's no table spinning so the directions stay constant. This is a degenerate special case of the above in which every spin doesn't change anything, so solving this case is a necessary condition to being able to solve the general case. There are 2^4 = 16 possible initial configurations (each cup has 2 possibilities: up or down). For any given pattern choice of flips, you eliminate at most one initial configuration of cups per flip; so you need 16 flips.
I BELIEVE IN CAPITAL LETTER PUNISHMENT!!!!!
Fen
Profile Blog Joined June 2006
Australia1848 Posts
April 18 2008 16:09 GMT
#4
yeah, Im either interpretting this wrong, or its totally random whether or not you get it . Im hoping its an interpretation error. Could you please explain the situation in a little bit more detail.

Do all cups start in a certain orientation?
Does the table spin randomly?
How many cup turns do we get per cycle?
Slithe
Profile Blog Joined February 2007
United States985 Posts
Last Edited: 2008-04-18 18:20:05
April 18 2008 18:18 GMT
#5
the spins are random.

The cups' starting orientations are also random. They could all be right-side up, or only one is upside down, or however.

You tell you friend which cups you want to flip over by telling him which of the four directions to flip.
For example, if your table looks like this (1 means right side up, 0 means upside down):
1
0 0
0

The command "flip the north and south cup" gives you this:
0
0 0
1

This is the basic order of events.
1) Tell him which cups you want flipped over
2) Your friend flips the cups you designated
3) If they're all right-side up, your friend says you're done. Otherwise, he spins the table
4) The table randomly stops in a new random position
5) Go back to step 1
goldrush
Profile Blog Joined June 2004
Canada709 Posts
Last Edited: 2008-04-18 18:49:52
April 18 2008 18:48 GMT
#6
nvm, thought it through a bit more, your solution makes sense.
Please log in or register to reply.
Live Events Refresh
Next event in 2h 30m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SortOf 194
Nina 84
FoxeR 5
StarCraft: Brood War
Sea 1921
Mong 242
Shuttle 62
Bale 35
GoRush 29
Icarus 9
NotJumperer 6
Dota 2
XaKoH 507
NeuroSwarm114
League of Legends
JimRising 705
C9.Mang0406
Heroes of the Storm
Khaldor90
Other Games
WinterStarcraft624
KnowMe225
Mew2King189
febbydoto25
minikerr14
Organizations
Other Games
gamesdonequick996
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• Berry_CruncH104
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• iopq 10
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Rush1331
Upcoming Events
The PondCast
2h 30m
HomeStory Cup
1d 4h
Korean StarCraft League
1d 19h
HomeStory Cup
2 days
Replay Cast
2 days
HomeStory Cup
3 days
Replay Cast
3 days
Replay Cast
4 days
Wardi Open
5 days
WardiTV Invitational
6 days
Liquipedia Results

Completed

Proleague 2026-01-27
OSC Championship Season 13
Underdog Cup #3

Ongoing

CSL 2025 WINTER (S19)
KCM Race Survival 2026 Season 1
Acropolis #4 - TS4
Rongyi Cup S3
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025

Upcoming

Escore Tournament S1: W6
Escore Tournament S1: W7
Acropolis #4
IPSL Spring 2026
uThermal 2v2 2026 Main Event
Bellum Gens Elite Stara Zagora 2026
LiuLi Cup: 2025 Grand Finals
HSC XXVIII
Nations Cup 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
PGL Cluj-Napoca 2026
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 © 2026 TLnet. All Rights Reserved.