• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 07:20
CEST 13:20
KST 20:20
  • 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
Code S Season 1 - RO8 Preview4[ASL21] Ro8 Preview Pt2: Progenitors8Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun13[ASL21] Ro8 Preview Pt1: Inheritors16[ASL21] Ro16 Preview Pt2: All Star10
Community News
Maestros of The Game 2 announcement and schedule !7Weekly Cups (April 27-May 4): Clem takes triple0RSL Revival: Season 5 - Qualifiers and Main Event12Code S Season 1 (2026) - RO12 Results12026 GSL Season 1 Qualifiers25
StarCraft 2
General
Code S Season 1 - RO8 Preview Behind the Blue - Team Liquid History Book Weekly Cups (April 27-May 4): Clem takes triple Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Code S Season 1 (2026) - RO12 Results
Tourneys
Sea Duckling Open (Global, Bronze-Diamond) Maestros of The Game 2 announcement and schedule ! GSL Code S Season 1 (2026) RSL Revival: Season 5 - Qualifiers and Main Event Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players
External Content
Mutation # 524 Death and Taxes The PondCast: SC2 News & Results Mutation # 523 Firewall Mutation # 522 Flip My Base
Brood War
General
Quality of life changes in BW that you will like ? BGH Auto Balance -> http://bghmmr.eu/ RepMastered™: replay sharing and analyzer site Tulbo's ASL S21 Ro8 Post-Review Why there arent any 256x256 pro maps?
Tourneys
Escore Tournament StarCraft Season 2 [ASL21] Ro8 Day 4 [Megathread] Daily Proleagues Small VOD Thread 2.0
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates What's the deal with APM & what's its true value Any training maps people recommend?
Other Games
General Games
Stormgate/Frost Giant Megathread Daigo vs Menard Best of 10 Path of Exile Nintendo Switch Thread OutLive 25 (RTS Game)
Dota 2
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
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas TL Mafia Community Thread Five o'clock TL Mafia
Community
General
US Politics Mega-thread The Letting Off Steam Thread European Politico-economics QA Mega-thread UK Politics Mega-thread Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread McBoner: A hockey love story Formula 1 Discussion
World Cup 2022
Tech Support
streaming software Strange computer issues (software) [G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
How EEG Data Can Predict Gam…
TrAiDoS
ramps on octagon
StaticNine
Funny Nicknames
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1532 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
Canada4217 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 States9109 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 Invitational
11:00
Wardi Spring Cup
Krystianer vs TriGGeR
Cure vs Rogue
WardiTV208
LiquipediaDiscussion
RSL Revival
10:00
Season 5: Group C
ByuN vs ShamelessLIVE!
Bunny vs TBD
SHIN vs TBD
Tasteless985
IntoTheiNu 610
Ryung 335
Rex87
LiquipediaDiscussion
CranKy Ducklings
10:00
Sea Duckling Open #145
CranKy Ducklings31
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Tasteless 985
Ryung 335
Lowko228
Livibee 135
Rex 87
StarCraft: Brood War
Britney 41093
Sea 9308
Calm 8281
Horang2 900
firebathero 349
Zeus 340
BeSt 321
Mini 206
Sharp 182
Soulkey 152
[ Show more ]
Last 151
HiyA 149
ToSsGirL 134
Mind 127
Backho 93
PianO 92
EffOrt 88
Aegong 72
Pusan 66
Hyun 40
Liquid`Ret 37
Shinee 25
NaDa 25
Sacsri 21
Noble 17
yabsab 15
JulyZerg 15
sorry 14
GoRush 11
Dota 2
XcaliburYe430
NeuroSwarm180
League of Legends
summit1g6916
Counter-Strike
fl0m1956
zeus333
Heroes of the Storm
Khaldor102
MindelVK13
Other Games
gofns3375
singsing2457
monkeys_forever155
DeMusliM143
KnowMe120
ArmadaUGS30
Organizations
Counter-Strike
PGL18547
Other Games
gamesdonequick1994
StarCraft 2
ComeBackTV 479
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 17 non-featured ]
StarCraft 2
• LUISG 26
• Adnapsc2 17
• CranKy Ducklings SOOP3
• Dystopia_ 2
• IndyKCrew
• sooper7s
• Migwel
• LaughNgamezSOOP
• Kozan
• intothetv
• AfreecaTV YouTube
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Nemesis3009
• Jankos1183
• Stunt651
Upcoming Events
SC Evo League
1h 41m
uThermal 2v2 Circuit
3h 41m
BSL
7h 41m
Artosis vs TerrOr
spx vs StRyKeR
Replay Cast
12h 41m
Sparkling Tuna Cup
22h 41m
RSL Revival
22h 41m
Cure vs Zoun
Clem vs Lambo
WardiTV Invitational
23h 41m
BSL
1d 7h
Dewalt vs DragOn
Aether vs Jimin
GSL
1d 20h
Afreeca Starleague
1d 22h
Soma vs Leta
[ Show More ]
Wardi Open
2 days
Monday Night Weeklies
2 days
OSC
2 days
CranKy Ducklings
2 days
Afreeca Starleague
2 days
Light vs Flash
Replay Cast
3 days
Replay Cast
4 days
The PondCast
4 days
Replay Cast
5 days
RSL Revival
5 days
Korean StarCraft League
6 days
RSL Revival
6 days
Liquipedia Results

Completed

Escore Tournament S2: W6
WardiTV TLMC #16
Nations Cup 2026

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
KCM Race Survival 2026 Season 2
Acropolis #4
KK 2v2 League Season 1
SCTL 2026 Spring
RSL Revival: Season 5
2026 GSL S1
PGL Astana 2026
BLAST Rivals Spring 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2

Upcoming

BSL 22 Non-Korean Championship
YSL S3
Escore Tournament S2: W7
Escore Tournament S2: W8
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
Maestros of the Game 2
2026 GSL S2
BLAST Bounty Summer 2026: Closed Qualifier
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
IEM Atlanta 2026
Asian Champions League 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.