• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 09:56
CET 15:56
KST 23:56
  • 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 !3Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win2Weekly 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
ComeBackTV's documentary on Byun's Career ! Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win Did they add GM to 2v2? RSL Revival - 2025 Season Finals Preview Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament $5,000+ WardiTV 2025 Championship StarCraft2.fi 15th Anniversary Cup RSL Offline Finals Info - Dec 13 and 14! Tenacious Turtle Tussle
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
BGH Auto Balance -> http://bghmmr.eu/ How Rain Became ProGamer in Just 3 Months FlaSh on: Biggest Problem With SnOw's Playstyle [BSL21] RO8 Bracket & Prediction Contest BW General Discussion
Tourneys
[Megathread] Daily Proleagues [BSL21] RO8 - Day 2 - Sunday 21:00 CET [ASL20] Grand Finals [BSL21] RO8 - Day 1 - Saturday 21:00 CET
Strategy
Game Theory for Starcraft Simple Questions, Simple Answers Current Meta Fighting Spirit mining rates
Other Games
General Games
Stormgate/Frost Giant Megathread General RTS Discussion Thread Dawn of War IV Nintendo Switch Thread PC Games Sales 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
Mafia Game Mode Feedback/Ideas Survivor II: The Amazon Sengoku Mafia TL Mafia Community Thread
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine YouTube Thread European Politico-economics QA Mega-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
How Sleep Deprivation Affect…
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: 1009 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
12:00
Playoffs
MaNa vs ShamelessLIVE!
MaxPax vs TBD
ByuN vs TBD
Spirit vs ShoWTimE
WardiTV1192
ComeBackTV 603
TaKeTV 284
IndyStarCraft 171
Rex98
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
IndyStarCraft 171
Rex 98
LamboSC2 90
ProTech50
BRAT_OK 32
DivinesiaTV 13
StarCraft: Brood War
Britney 30922
Horang2 3306
Bisu 2158
Jaedong 1788
Shuttle 1196
Larva 970
Mini 527
Soma 497
EffOrt 453
BeSt 333
[ Show more ]
Hyuk 277
Snow 270
ZerO 246
Sharp 210
Rush 160
Mong 156
Zeus 122
Killer 116
ggaemo 102
JYJ 78
Hyun 78
Mind 59
Aegong 52
PianO 49
Movie 38
soO 33
Trikslyr29
Rock 24
scan(afreeca) 15
yabsab 14
Shinee 12
Shine 10
Noble 9
Terrorterran 7
Dota 2
singsing3225
qojqva2429
Dendi769
syndereN131
League of Legends
rGuardiaN120
Counter-Strike
olofmeister1900
byalli318
edward168
oskar75
Other Games
B2W.Neo927
hiko527
Fuzer 383
RotterdaM209
Sick128
XaKoH 123
DeMusliM101
QueenE80
ArmadaUGS71
Mew2King66
Livibee52
Beastyqt23
ZerO(Twitch)22
Organizations
StarCraft: Brood War
Kim Chul Min (afreeca) 9
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• iopq 1
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV306
• Noizen38
League of Legends
• Jankos1828
• Nemesis1394
• TFBlade489
Upcoming Events
OSC
2h 4m
YoungYakov vs Mixu
ForJumy vs TBD
Percival vs TBD
Shameless vs TBD
The PondCast
19h 4m
WardiTV 2025
22h 4m
Cure vs Creator
TBD vs Solar
WardiTV 2025
1d 20h
OSC
1d 23h
CranKy Ducklings
2 days
SC Evo League
2 days
Ladder Legends
3 days
BSL 21
3 days
Sparkling Tuna Cup
3 days
[ Show More ]
Ladder Legends
4 days
BSL 21
4 days
Replay Cast
4 days
Monday Night Weeklies
5 days
WardiTV Invitational
6 days
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
WardiTV 2025
META Madness #9
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 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
eXTREMESLAND 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.