• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 01:14
CET 06:14
KST 14:14
  • 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
ByuL: The Forgotten Master of ZvT30Behind the Blue - Team Liquid History Book19Clem wins HomeStory Cup 289HomeStory Cup 28 - Info & Preview13Rongyi Cup S3 - Preview & Info8
Community News
2026 KongFu Cup Announcement4BGE Stara Zagora 2026 cancelled12Blizzard Classic Cup - Tastosis announced as captains15Weekly Cups (March 2-8): ByuN overcomes PvT block4GSL CK - New online series19
StarCraft 2
General
GSL CK - New online series BGE Stara Zagora 2026 cancelled Blizzard Classic Cup - Tastosis announced as captains BGE Stara Zagora 2026 announced ByuL: The Forgotten Master of ZvT
Tourneys
2026 KongFu Cup Announcement RSL Season 4 announced for March-April PIG STY FESTIVAL 7.0! (19 Feb - 1 Mar) Sparkling Tuna Cup - Weekly Open Tournament [GSL CK] Team Maru vs. Team herO
Strategy
Custom Maps
Publishing has been re-enabled! [Feb 24th 2026] Map Editor closed ?
External Content
Mutation # 517 Distant Threat The PondCast: SC2 News & Results Mutation # 516 Specter of Death Mutation # 515 Together Forever
Brood War
General
ASL21 General Discussion BSL 22 Map Contest — Submissions OPEN to March 10 BGH Auto Balance -> http://bghmmr.eu/ Are you ready for ASL 21? Hype VIDEO Gypsy to Korea
Tourneys
[Megathread] Daily Proleagues [BSL22] Open Qualifiers & Ladder Tours IPSL Spring 2026 is here! ASL Season 21 Qualifiers March 7-8
Strategy
Simple Questions, Simple Answers Soma's 9 hatch build from ASL Game 2 Fighting Spirit mining rates Zealot bombing is no longer popular?
Other Games
General Games
Path of Exile Stormgate/Frost Giant Megathread Nintendo Switch Thread PC Games Sales Thread No Man's Sky (PS4 and PC)
Dota 2
Official 'what is Dota anymore' discussion The Story of Wings Gaming
League of Legends
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
Five o'clock TL Mafia Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia TL Mafia Community Thread
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Mexico's Drug War Russo-Ukrainian War Thread NASA and the Private Sector
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! [Req][Books] Good Fantasy/SciFi books
Sports
Formula 1 Discussion 2024 - 2026 Football Thread General nutrition recommendations Cricket [SPORT] TL MMA Pick'em Pool 2013
World Cup 2022
Tech Support
Laptop capable of using Photoshop Lightroom?
TL Community
The Automated Ban List
Blogs
Funny Nicknames
LUCKY_NOOB
Money Laundering In Video Ga…
TrAiDoS
Iranian anarchists: organize…
XenOsky
FS++
Kraekkling
Shocked by a laser…
Spydermine0240
Unintentional protectionism…
Uldridge
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 3278 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 46m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
NeuroSwarm 199
ProTech149
StarCraft: Brood War
GuemChi 3753
ggaemo 102
Mong 61
Leta 53
ZergMaN 34
Noble 22
Icarus 8
Britney 0
Counter-Strike
Stewie2K782
Super Smash Bros
hungrybox522
Heroes of the Storm
Khaldor137
Other Games
summit1g6262
C9.Mang0276
Maynarde153
RuFF_SC2130
Organizations
Other Games
gamesdonequick742
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• practicex 52
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Lourlo1350
• Rush1326
• Stunt472
Upcoming Events
GSL
2h 46m
Wardi Open
6h 46m
Monday Night Weeklies
11h 46m
WardiTV Team League
1d 6h
PiGosaur Cup
1d 18h
Kung Fu Cup
2 days
OSC
2 days
The PondCast
3 days
KCM Race Survival
3 days
WardiTV Team League
3 days
[ Show More ]
Replay Cast
3 days
KCM Race Survival
4 days
WardiTV Team League
4 days
Korean StarCraft League
4 days
uThermal 2v2 Circuit
5 days
BSL
5 days
BSL
6 days
Replay Cast
6 days
Liquipedia Results

Completed

Proleague 2026-03-13
WardiTV Winter 2026
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
Jeongseon Sooper Cup
BSL Season 22
CSL Elite League 2026
RSL Revival: Season 4
Nations Cup 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual

Upcoming

ASL Season 21
Acropolis #4 - TS6
2026 Changsha Offline CUP
Acropolis #4
IPSL Spring 2026
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
NationLESS Cup
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 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.