![]() |
#101 |
Banned
Join Date: Aug 2008
Posts: 1,134
|
![]() ethiopia
|
![]() |
![]() |
![]() |
#102 |
Hunger Games Hunty
![]() |
![]() For the glass ball thing I'd get a friend to help. Then I'd have them drop the ball on floor 1 as I dropped it from 10. If neither ball broke then I'd move up to floor 20, and my friend could go to 11. In the worst case scenario I'd go 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, and in these ten actions, my friend would be simultaneously at 91 with me. Then together we'd drop 92 and 93 together, 94 and 95 together, until we got to 98 and 99 together. This would take us 14 drops total working together.
Edit: And I just decided that this sucks because if my ball broke at 90 or something, then we'd only have one ball to go up from 81-89. >=/ The maximum here is still 18 though... Last edited by Jtehanonymous; 10-13-2009 at 05:53 PM.. |
![]() |
![]() |
![]() |
#103 |
FFR Player
|
![]() Hahahaha. sorry...
|
![]() |
![]() |
![]() |
#104 |
FFR Player
Join Date: Jun 2007
Posts: 974
|
![]() gg_guru as if I couldn't have any less respect for you
you went and proved me wrong
__________________
(´・ω・`) |
![]() |
![]() |
![]() |
#105 |
Let em' do what they want
![]() Join Date: Mar 2006
Posts: 3,219
|
![]() Umm thanks?
I'm honored? ??? ?????
__________________
![]() |
![]() |
![]() |
![]() |
#106 |
I am leonid
![]() ![]() ![]() ![]() ![]() Join Date: Oct 2008
Location: MOUNTAIN VIEW
Age: 35
Posts: 8,080
|
![]() I wasn't able to solve this problem within 15 minutes how dumb =/
Is fourteen the optimal expected number of drops? Just to check whether I'm on the right track.. edit: nvm Last edited by leonid; 10-13-2009 at 06:07 PM.. |
![]() |
![]() |
![]() |
#107 |
FFR Player
Join Date: Jun 2007
Posts: 974
|
![]() also another math problem:
Prove ![]() using induction.
__________________
(´・ω・`) |
![]() |
![]() |
![]() |
#108 |
FFR Player
![]() Join Date: Dec 1969
Location: New York City, New York
Posts: 8,340
|
![]()
Yes
__________________
https://www.youtube.com/watch?v=0es0Mip1jWY |
![]() |
![]() |
![]() |
#109 |
I am leonid
![]() ![]() ![]() ![]() ![]() Join Date: Oct 2008
Location: MOUNTAIN VIEW
Age: 35
Posts: 8,080
|
![]() Does this work?
Let x be the bottom floor of current searching space. Divide current searching space into seven and drop the ball from the top of the bottommost divided area. Call it floor y. If it breaks, drop the second ball through floor x to floor y-1. If it doesn't break, set the searching space from y+1 to 100 and repeat the process. Begin by setting searching space from floor 1 to 100 Last edited by leonid; 10-13-2009 at 06:16 PM.. |
![]() |
![]() |
![]() |
#110 | |
FFR Player
![]() Join Date: Dec 1969
Location: New York City, New York
Posts: 8,340
|
![]() Quote:
The idea is that you are locking things into a worst-case drop of 14 no matter how many intervals you go up -- for each wasted "first-sphere drop" you expend with the interval search, you compensate by simply making the search space smaller for the second sphere. Why 14? Because the sum from 1-14 is when you first break 100. You're starting at 14 and working your way down... by the time you reach the end of the process, you've gone through all possible floors.
__________________
https://www.youtube.com/watch?v=0es0Mip1jWY |
|
![]() |
![]() |
![]() |
#111 |
I am leonid
![]() ![]() ![]() ![]() ![]() Join Date: Oct 2008
Location: MOUNTAIN VIEW
Age: 35
Posts: 8,080
|
![]() Damn apparently I thought way too complicatedly on this problem
|
![]() |
![]() |
![]() |
#112 |
(╯°□°)╯︵ ┻━┻
![]() ![]() ![]() |
![]() |
![]() |
![]() |
![]() |
#113 |
I am leonid
![]() ![]() ![]() ![]() ![]() Join Date: Oct 2008
Location: MOUNTAIN VIEW
Age: 35
Posts: 8,080
|
![]() BTW, that algorithm I stated should probably work. Except that I had to calculate the expected number of drops with computer >_> so I wouldn't be able to get it right on the interview.
I'll work on that red/black deck problem.. Looks fun and awfully difficult. I've always wanted to be a good problem solver, but I'm still not there x( Last edited by leonid; 10-13-2009 at 06:29 PM.. |
![]() |
![]() |
![]() |
#114 |
FFR Player
![]() Join Date: Dec 1969
Location: New York City, New York
Posts: 8,340
|
![]() The algorithm seems okay btw, but I'm not confident in it because I don't understand how you derived it -- I personally just go for the "compensation logic" approach and finding the first top-floor-breaking 1-through-X sum.
__________________
https://www.youtube.com/watch?v=0es0Mip1jWY |
![]() |
![]() |
![]() |
#115 |
FFR Player
![]() Join Date: Dec 1969
Location: New York City, New York
Posts: 8,340
|
![]() Interested to know how you came about the div-7 logic in your algorithm... that seems really interesting to me.
I mean, like, 100/7 = roughly 14, so drop at 14. Say it doesn't break. So you drop at 14+(100-14)/7 = 26 (versus my 27)?
__________________
https://www.youtube.com/watch?v=0es0Mip1jWY |
![]() |
![]() |
![]() |
#116 |
I am leonid
![]() ![]() ![]() ![]() ![]() Join Date: Oct 2008
Location: MOUNTAIN VIEW
Age: 35
Posts: 8,080
|
![]() I haven't thoroughly tested edge cases. Could be 26 (if you get floor(14+(100-14)/7)) or 27 (if you get ceiling(14+(100-14)/7)).
I just went through div-2 to div-20 or something, calculating the expected value in floating number form, and div-7 happened to have smallest such value. So yeah it required me a computer -_- |
![]() |
![]() |
![]() |
#117 | |
FFR Player
![]() Join Date: Dec 1969
Location: New York City, New York
Posts: 8,340
|
![]() Quote:
__________________
https://www.youtube.com/watch?v=0es0Mip1jWY |
|
![]() |
![]() |
![]() |
#118 |
FFR Player
![]() Join Date: Dec 1969
Location: New York City, New York
Posts: 8,340
|
![]() Also for floor versus ceiling scenarios:
14 15 26 27 36 37 45 46 52 53 58 59 64 64 69 69 73 73 76 76 79 79 82 82 84 84 86 86 88 88 89 89 90 90 91 91 92 92 93 93 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 Unless I am misunderstanding your algo lol
__________________
https://www.youtube.com/watch?v=0es0Mip1jWY |
![]() |
![]() |
![]() |
#119 |
I am leonid
![]() ![]() ![]() ![]() ![]() Join Date: Oct 2008
Location: MOUNTAIN VIEW
Age: 35
Posts: 8,080
|
![]() Looks like treating integers as real numbers caused a disaster -_-
I'll conclude that this algorithm works only if we have infinite number of floors **** (of course the optimal solution won't be div-7 in this case) Last edited by leonid; 10-13-2009 at 07:01 PM.. |
![]() |
![]() |
![]() |
#120 |
FFR Player
![]() Join Date: Dec 1969
Location: New York City, New York
Posts: 8,340
|
![]() Do you mean "continuous floors" as opposed to discrete ones? lol
Reminds me of that one movie... can't remember the name of it. The one where there's like a Floor 7.5 or something (Being John Malkovich?)
__________________
https://www.youtube.com/watch?v=0es0Mip1jWY |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|