• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 13:30
CET 19:30
KST 03:30
  • 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 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10[ASL20] Finals Preview: Arrival13
Community News
[TLMC] Fall/Winter 2025 Ladder Map Rotation13Weekly Cups (Nov 3-9): Clem Conquers in Canada4SC: Evo Complete - Ranked Ladder OPEN ALPHA8StarCraft, SC2, HotS, WC3, Returning to Blizzcon!45$5,000+ WardiTV 2025 Championship7
StarCraft 2
General
[TLMC] Fall/Winter 2025 Ladder Map Rotation Mech is the composition that needs teleportation t RotterdaM "Serral is the GOAT, and it's not close" RSL Season 3 - RO16 Groups C & D Preview TL.net Map Contest #21: Winners
Tourneys
RSL Revival: Season 3 Sparkling Tuna Cup - Weekly Open Tournament Constellation Cup - Main Event - Stellar Fest Tenacious Turtle Tussle Master Swan Open (Global Bronze-Master 2)
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened Mutation # 496 Endless Infection
Brood War
General
FlaSh on: Biggest Problem With SnOw's Playstyle BGH Auto Balance -> http://bghmmr.eu/ What happened to TvZ on Retro? SnOw's ASL S20 Finals Review BW General Discussion
Tourneys
[Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL21] RO32 Group D - Sunday 21:00 CET [BSL21] RO32 Group C - Saturday 21:00 CET
Strategy
PvZ map balance Current Meta Simple Questions, Simple Answers How to stay on top of macro?
Other Games
General Games
Path of Exile Clair Obscur - Expedition 33 Should offensive tower rushing be viable in RTS games? Stormgate/Frost Giant Megathread Nintendo Switch Thread
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
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Artificial Intelligence Thread Canadian Politics Mega-thread
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
Movie Discussion! [Manga] One Piece Anime Discussion Thread Korean Music Discussion Series you have seen recently...
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Dyadica Gospel – a Pulp No…
Hildegard
Coffee x Performance in Espo…
TrAiDoS
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Reality "theory" prov…
perfectspheres
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1944 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
Online Event
18:00
Coaches Corner 2v2
RotterdaM461
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 461
TKL 433
Clem_sc2 366
IndyStarCraft 163
SteadfastSC 121
BRAT_OK 79
Railgan 59
Vindicta 32
StarCraft: Brood War
Britney 20600
Horang2 1279
GuemChi 505
Dewaltoss 98
yabsab 36
zelot 33
scan(afreeca) 15
Dota 2
Gorgc7705
qojqva2365
Counter-Strike
fl0m1200
pashabiceps715
Heroes of the Storm
Khaldor570
Other Games
tarik_tv2542
B2W.Neo402
Beastyqt219
Organizations
Dota 2
PGL Dota 2 - Main Stream13545
Other Games
EGCTV1142
gamesdonequick427
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 19 non-featured ]
StarCraft 2
• davetesta19
• Reevou 6
• Migwel
• AfreecaTV YouTube
• sooper7s
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
StarCraft: Brood War
• blackmanpl 33
• FirePhoenix18
• HerbMon 13
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• Ler50
Other Games
• imaqtpie1032
• WagamamaTV392
• Shiphtur245
Upcoming Events
BSL 21
1h 30m
JDConan vs Semih
Dragon vs Dienmax
Tech vs NewOcean
TerrOr vs Artosis
IPSL
1h 30m
Dewalt vs WolFix
eOnzErG vs Bonyth
Replay Cast
4h 30m
Wardi Open
17h 30m
Monday Night Weeklies
22h 30m
Replay Cast
1d 4h
WardiTV Korean Royale
1d 17h
BSL: GosuLeague
2 days
The PondCast
2 days
Replay Cast
3 days
[ Show More ]
RSL Revival
3 days
BSL: GosuLeague
4 days
RSL Revival
4 days
WardiTV Korean Royale
4 days
RSL Revival
5 days
WardiTV Korean Royale
5 days
IPSL
5 days
Julia vs Artosis
JDConan vs DragOn
RSL Revival
6 days
Wardi Open
6 days
Liquipedia Results

Completed

Proleague 2025-11-14
Stellar Fest: Constellation Cup
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
BSL Season 21
CSCL: Masked Kings S3
SLON Tour Season 2
RSL Revival: Season 3
META Madness #9
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 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.