• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 23:14
CEST 05:14
KST 12: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
Serral wins EWC 202543Tournament Spotlight: FEL Cracow 202510Power Rank - Esports World Cup 202580RSL Season 1 - Final Week9[ASL19] Finals Recap: Standing Tall15
Community News
Weekly Cups (Jul 28-Aug 3): herO doubles up6LiuLi Cup - August 2025 Tournaments4[BSL 2025] H2 - Team Wars, Weeklies & SB Ladder10EWC 2025 - Replay Pack4Google Play ASL (Season 20) Announced63
StarCraft 2
General
The GOAT ranking of GOAT rankings RSL Revival patreon money discussion thread Official Ladder Map Pool Update (April 28, 2025) Weekly Cups (Jul 28-Aug 3): herO doubles up Clem Interview: "PvT is a bit insane right now"
Tourneys
LiuLi Cup - August 2025 Tournaments WardiTV Mondays RSL Season 2 Qualifier Links and Dates StarCraft Evolution League (SC Evo Biweekly) Global Tourney for College Students in September
Strategy
Custom Maps
External Content
Mutation # 485 Death from Below Mutation # 484 Magnetic Pull Mutation #239 Bad Weather Mutation # 483 Kill Bot Wars
Brood War
General
ASL Season 20 Ro24 Groups Google Play ASL (Season 20) Announced BW General Discussion StarCraft player reflex TE scores BGH Auto Balance -> http://bghmmr.eu/
Tourneys
[Megathread] Daily Proleagues KCM 2025 Season 3 [ASL20] Online Qualifiers Day 2 [CSLPRO] It's CSLAN Season! - Last Chance
Strategy
Fighting Spirit mining rates [G] Mineral Boosting Simple Questions, Simple Answers Muta micro map competition
Other Games
General Games
Stormgate/Frost Giant Megathread Total Annihilation Server - TAForever Nintendo Switch Thread 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 Things Aren’t Peaceful in Palestine The Games Industry And ATVI Russo-Ukrainian War Thread European Politico-economics QA Mega-thread
Fan Clubs
INnoVation Fan Club SKT1 Classic Fan Club!
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread [\m/] Heavy Metal Thread Korean Music Discussion
Sports
2024 - 2025 Football Thread Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023
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
[Girl blog} My fema…
artosisisthebest
Sharpening the Filtration…
frozenclaw
ASL S20 English Commentary…
namkraft
The Link Between Fitness and…
TrAiDoS
momentary artworks from des…
tankgirl
from making sc maps to makin…
Husyelt
Customize Sidebar...

Website Feedback

Closed Threads



Active: 669 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 7h 46m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
NeuroSwarm 202
RuFF_SC2 128
StarCraft: Brood War
Backho 182
ggaemo 84
NaDa 51
Bale 32
Noble 20
ajuk12(nOOB) 14
JulyZerg 9
Icarus 5
Stormgate
WinterStarcraft325
Nina198
Dota 2
monkeys_forever851
LuMiX1
League of Legends
JimRising 682
Counter-Strike
PGG 91
Other Games
summit1g23964
shahzam950
C9.Mang0235
Maynarde100
ViBE88
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 18 non-featured ]
StarCraft 2
• Berry_CruncH333
• davetesta49
• practicex 28
• OhrlRock 1
• Kozan
• Migwel
• sooper7s
• AfreecaTV YouTube
• intothetv
• IndyKCrew
• LaughNgamezSOOP
StarCraft: Brood War
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
League of Legends
• Doublelift4415
• Rush944
• Stunt253
Other Games
• Scarra1055
Upcoming Events
LiuLi Cup
7h 46m
uThermal 2v2 Circuit
11h 46m
RSL Revival
22h 46m
RSL Revival
1d 6h
SC Evo League
1d 8h
uThermal 2v2 Circuit
1d 11h
CSO Cup
1d 12h
Sparkling Tuna Cup
2 days
uThermal 2v2 Circuit
2 days
Wardi Open
3 days
[ Show More ]
RotterdaM Event
3 days
Replay Cast
3 days
RSL Revival
4 days
The PondCast
6 days
Replay Cast
6 days
Liquipedia Results

Completed

ASL Season 20: Qualifier #2
FEL Cracow 2025
CC Div. A S7

Ongoing

Copa Latinoamericana 4
Jiahua Invitational
BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Qualifiers
uThermal 2v2 Main Event
HCC Europe
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025

Upcoming

ASL Season 20
CSLPRO Chat StarLAN 3
BSL Season 21
BSL 21 Team A
RSL Revival: Season 2
Maestros of the Game
SEL Season 2 Championship
WardiTV Summer 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
BLAST Bounty Fall 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.