• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 06:21
CET 12:21
KST 20:21
  • 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 Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
ComeBackTV's documentary on Byun's Career !8Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win4Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump1Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15
StarCraft 2
General
When will we find out if there are more tournament ComeBackTV's documentary on Byun's Career ! Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win RSL Revival - 2025 Season Finals Preview Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump
Tourneys
$5,000+ WardiTV 2025 Championship RSL Offline Finals Info - Dec 13 and 14! Master Swan Open (Global Bronze-Master 2) Winter Warp Gate Amateur Showdown #1: Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 504 Retribution Mutation # 503 Fowl Play Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress
Brood War
General
FlaSh on: Biggest Problem With SnOw's Playstyle screp: Command line app to parse SC rep files How Rain Became ProGamer in Just 3 Months BGH Auto Balance -> http://bghmmr.eu/ [BSL21] RO8 Bracket & Prediction Contest
Tourneys
Small VOD Thread 2.0 [Megathread] Daily Proleagues [BSL21] WB SEMIFINALS - Saturday 21:00 CET [BSL21] RO8 - Day 2 - Sunday 21:00 CET
Strategy
Game Theory for Starcraft Current Meta Simple Questions, Simple Answers Fighting Spirit mining rates
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread General RTS Discussion Thread Dawn of War IV
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
Mafia Game Mode Feedback/Ideas Survivor II: The Amazon Sengoku Mafia TL Mafia Community Thread
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread Things Aren’t Peaceful in Palestine The Games Industry And ATVI YouTube Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
TL+ Announced Where to ask questions and add stream?
Blogs
The (Hidden) Drug Problem in…
TrAiDoS
I decided to write a webnov…
DjKniteX
James Bond movies ranking - pa…
Topin
Thanks for the RSL
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1817 users

Interesting maths problem - Page 3

Blogs > MakkurtE
Post a Reply
Prev 1 2 3 All
MakkurtE
Profile Blog Joined July 2009
United States46 Posts
November 10 2009 23:24 GMT
#41
you decrease the the number you go up by when an egg doesn't break by one each time, which cancels out the extra drop caused by it not breaking.

wow, now thats a sentence you can justifiyable rip me for how little sense it makes
Opinions in the above post are less informed then they appear
igotmyown
Profile Blog Joined April 2009
United States4291 Posts
November 10 2009 23:46 GMT
#42
1:
+ Show Spoiler +

10+9+8+7+6+5+4+1=50
gzealot
Profile Blog Joined November 2008
Singapore238 Posts
November 11 2009 00:33 GMT
#43
I had the exact same question for my programming homework. It is simply binary searching.

if both eggs are breakable start from half the max height and towards the max floor. Every iteration, divide the search space by two and drop the egg from that floor. Once the first egg breaks, u know the the max floor on which the egg is breakable is in between the last known safe floor and the floor which the egg broke on. then u run a linear search from the last known safe floor to find the actual number.

Or for an amortized best worst-case algorithm, use steps of sqrt(maxfloor) for your first egg, and when the first egg breaks, run linear search on the second egg.


i.e. you have 50 stories, and the egg breaks on 37 floor. Then u would test in this order:
1st egg: 25 -> 37 (oops the egg breaks!)
2nd egg: 26,27,28,29,30,31,32,33,34,35,36,37(breaks, therefore the egg's value is 36)
There isnt any real shortcut to this problem.
MakkurtE
Profile Blog Joined July 2009
United States46 Posts
November 11 2009 00:50 GMT
#44
what if you drop your first egg from 25 and it breaks - you'd have to work your way up from 1 - potentially 25 drops. did you read the theory of how to do it just as well in less then half that number?
Opinions in the above post are less informed then they appear
gzealot
Profile Blog Joined November 2008
Singapore238 Posts
November 11 2009 01:11 GMT
#45
yea well that is the main failing with the binary search. like i said you could try steps of sqrt(max_floor) but i could also say the same if the egg broke on the 43rd floor, binary search could reach that very fast. each algorithm has it best and worse case scenario.
Cloud
Profile Blog Joined November 2004
Sexico5880 Posts
Last Edited: 2009-11-11 03:21:57
November 11 2009 03:20 GMT
#46
Binary search :/ on a problem that you're supposed to solve without pen or paper?

It's an interview question ffs.

Even if you could use pen and paper, you have only 2 eggs. Binary search is way too risky.
BlueLaguna on West, msg for game.
EsX_Raptor
Profile Blog Joined February 2008
United States2802 Posts
November 11 2009 05:59 GMT
#47
#1 = 7
starfries
Profile Blog Joined July 2009
Canada3508 Posts
November 11 2009 07:33 GMT
#48
Wow, my friend interviewed for a similar position and he got the exact same question (#1). Must be a standard interview question or something...
DJ – do you like ramen, Savior? Savior – not really. Bisu – I eat it often. Flash – I’m a maniac! | Foxer Fighting!
2on2
Profile Joined April 2009
United States142 Posts
Last Edited: 2009-11-11 14:46:16
November 11 2009 14:44 GMT
#49
So whats the answer to #1 and the formula?! Im still stuck on whether or not the eggs will break

Imo if your drop @ 50 and it doesnt break..done..but its an egg and it will break @ 1 so...

But its a math problem and Im no genious so I cant be right
Nytefish
Profile Blog Joined December 2007
United Kingdom4282 Posts
Last Edited: 2009-11-11 15:02:58
November 11 2009 15:00 GMT
#50
Well for #1 it seems like you can easily derive the formula if you know it's triangle numbers, but is there a way to show this has to be the optimum (e.g. equispaced drops will always be equal or worse)? Apart from computing it?

I suppose if you only consider the worst case, triangle numbers win out. The way the question is phrased seems to imply that's what you're looking for too.
No I'm never serious.
Hyperionnn
Profile Blog Joined September 2007
Turkey4968 Posts
November 11 2009 16:33 GMT
#51
#1
+ Show Spoiler +
Drop first egg from 10,19,27,34,40,45,49th floor, when your egg broke in floor 34, then drop your 2nd egg starting with 28 and going on, so my answer is 10


#2
+ Show Spoiler +
8^3=512
Kiarip
Profile Joined August 2008
United States1835 Posts
November 13 2009 00:16 GMT
#52
On November 11 2009 06:44 gyth wrote:
Show nested quote +
For all integers 4x^2 + x = 3y^2 + y


Are there any non zero solutions to that equation?


Yeah there are.

for example: (26,30)
gyth
Profile Blog Joined September 2009
657 Posts
November 13 2009 04:28 GMT
#53
I need another envelope, I can only show x has to be even =_=

y^2 = (4y +4x +1)(y -x)
x^2 = (3y +3x +1)(y -x)
The plural of anecdote is not data.
Luddite
Profile Blog Joined April 2007
United States2315 Posts
November 13 2009 05:12 GMT
#54
#1+ Show Spoiler +
25, 38, 44, 47, 49, 50. That's 6 drops, assuming no breaks. If there's a break somewhere, just search in between that range in the same way. i don't know why people are trying to make this so difficult, and saying 10.
Can't believe I'm still here playing this same game
Impervious
Profile Blog Joined March 2009
Canada4212 Posts
November 13 2009 05:41 GMT
#55
On November 13 2009 14:12 Luddite wrote:
#1+ Show Spoiler +
25, 38, 44, 47, 49, 50. That's 6 drops, assuming no breaks. If there's a break somewhere, just search in between that range in the same way. i don't know why people are trying to make this so difficult, and saying 10.


What if it breaks on 25, then breaks on 12/13 (whichever you choose to drop on)? How do you find out what floor it really breaks on then?

You only have 2 eggs to drop. If the first one breaks on 25, you have to do a linear search from 1-24. That's a potential for 25 drops. The 10 drop method will find it in 10 drops or less.
~ \(ˌ)im-ˈpər-vē-əs\ : not capable of being damaged or harmed.
imDerek
Profile Blog Joined August 2007
United States1944 Posts
Last Edited: 2009-11-13 06:55:37
November 13 2009 06:52 GMT
#56
if you have two eggs, then you should drop the first egg in a way such that it only takes roughly sqrt(N) drops to get to floor N, so you can do either f(n) = sqrt(N)*n or f(n) = n^2, the former is better if the answer is close to N, but the latter works better if the answer is small compared to N, so let's say you use the first one, and you broke it at some floor f(k), then you know the answer N' is within f(k-1) < N' <= f(k), so you use the second egg, start from f(k-1)+1, go up by 1 floor each time until you get the right answer. At the worst case (floor 49), this will require 14 drops if we pick f(n) = 7*n (7,14,21,28,35,42,49,43,44,45,46,47,48,49)


This is also generalizable to if you're given an arbitrarily number of eggs E, then the number of drops required is O(N^(1/E))
Least favorite progamers: Leta, Zero, Mind, Shine, free, really <-- newly added
Jonoman92
Profile Blog Joined September 2006
United States9104 Posts
November 13 2009 07:07 GMT
#57
On November 13 2009 15:52 imDerek wrote:
if you have two eggs, then you should drop the first egg in a way such that it only takes roughly sqrt(N) drops to get to floor N, so you can do either f(n) = sqrt(N)*n or f(n) = n^2, the former is better if the answer is close to N, but the latter works better if the answer is small compared to N, so let's say you use the first one, and you broke it at some floor f(k), then you know the answer N' is within f(k-1) < N' <= f(k), so you use the second egg, start from f(k-1)+1, go up by 1 floor each time until you get the right answer. At the worst case (floor 49), this will require 14 drops if we pick f(n) = 7*n (7,14,21,28,35,42,49,43,44,45,46,47,48,49)


This is also generalizable to if you're given an arbitrarily number of eggs E, then the number of drops required is O(N^(1/E))


Well done, that seems right to me.
Prev 1 2 3 All
Please log in or register to reply.
Live Events Refresh
WardiTV 2025
11:00
Playoffs
ByuN vs CreatorLIVE!
Clem vs Rogue
Scarlett vs Spirit
ShoWTimE vs Cure
WardiTV384
ComeBackTV 290
TaKeTV 141
Rex70
IndyStarCraft 48
IntoTheiNu 22
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SortOf 157
Rex 70
IndyStarCraft 48
BRAT_OK 38
StarCraft: Brood War
Britney 17214
Calm 4233
GuemChi 3083
Rain 1753
Bisu 784
Horang2 744
actioN 633
Stork 339
Mini 338
Shuttle 298
[ Show more ]
Soma 200
Larva 119
sorry 112
JYJ 99
Rush 96
firebathero 92
Dewaltoss 73
Killer 63
ggaemo 63
ZerO 56
Bale 49
Mind 49
hero 47
ToSsGirL 38
Barracks 37
Mong 34
Sacsri 33
soO 25
Sea.KH 22
zelot 15
910 14
Shinee 14
Terrorterran 13
ajuk12(nOOB) 13
Shine 11
SilentControl 9
Noble 9
Icarus 2
Dota 2
singsing1709
Gorgc1354
XcaliburYe156
League of Legends
C9.Mang0392
JimRising 366
Counter-Strike
olofmeister1403
shoxiejesuss882
allub116
Other Games
crisheroes350
Fuzer 182
XaKoH 161
Trikslyr19
ZerO(Twitch)5
Organizations
StarCraft: Brood War
lovetv 12
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 12 non-featured ]
StarCraft 2
• Light_VIP 46
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• iopq 2
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Upcoming Events
OSC
2h 39m
Big Brain Bouts
5h 39m
YoungYakov vs Jumy
TriGGeR vs Spirit
The PiG Daily
9h 39m
SHIN vs ByuN
Reynor vs Classic
TBD vs herO
Maru vs SHIN
TBD vs Classic
CranKy Ducklings
22h 39m
WardiTV 2025
23h 39m
Reynor vs MaxPax
SHIN vs TBD
Solar vs herO
Classic vs TBD
SC Evo League
1d 1h
Ladder Legends
1d 7h
BSL 21
1d 8h
Sziky vs Dewalt
eOnzErG vs Cross
Sparkling Tuna Cup
1d 22h
Ladder Legends
2 days
[ Show More ]
BSL 21
2 days
StRyKeR vs TBD
Bonyth vs TBD
Replay Cast
2 days
Wardi Open
3 days
Monday Night Weeklies
3 days
WardiTV Invitational
5 days
Replay Cast
5 days
WardiTV Invitational
6 days
ByuN vs Solar
Clem vs Classic
Cure vs herO
Reynor vs MaxPax
Liquipedia Results

Completed

Acropolis #4 - TS3
RSL Offline Finals
Kuram Kup

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
Slon Tour Season 2
CSL Season 19: Qualifier 1
WardiTV 2025
META Madness #9
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22

Upcoming

CSL Season 19: Qualifier 2
CSL 2025 WINTER (S19)
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Big Gabe Cup #3
OSC Championship Season 13
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
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.