 |
|
|
|
 |
Resnick
Supreme tranceaddict
Registered: Feb 2003
Location: Toronto
|
|
|
| quote: | Originally posted by DigiNut
Res bud, that one's already been answered! Read back a few posts. |
ya i know, but they said the answer is 15...which i dont see how it can be
edit BWAHHAHA sorry ive done too much programming, the answer is 14, but thats because u can use elimination to say that u dont have to test the last case, because it has to be that..so u can just assume its that...where in, say java u still have to do it..my bad
but the answer is log[base 2] of 100, u just multiply by 2 since theere are 2 eggs
___________________
it was the greatest feeling of nothingness i have ever experienced...
|
|
Oct-11-2003 17:47
|
|
|
 |
 |
DigiNut
You kids get off my lawn!

Registered: Dec 2002
Location: Toronto, Self-proclaimed Centre of the Universe
|
|
|
| quote: | Originally posted by Resnick
ya i know, but they said the answer is 15...which i dont see how it can be |
I thought it was 14. The answer's been explained: drop the first egg at floor 14, then 27, 39, 50, 60, 69, 77, 84, 90, 95, 99. Then once it breaks, just count up from the last floor where it didn't break (or from 96 if it never broke). The max you'll ever have to do is 14.
___________________
My party schedule:
2009-02-21 - DJ Attention @ I'm So Popular
2009-06-18 - DJ Annoying @ People Need To Know Where I'll Be
2012-11-32 - DJ Insufferable ɸ Or At Least the Stalkers I Complain About
2048-06-66 - Spastic & Whocares ¶ Although I'm Actually Flattered
9999-45-81 - Tweaker Gimp ☼ I Probably Won't Even Go To This But I Have To Make Sure I Fill Up All The Available Space Here
|
|
Oct-11-2003 17:51
|
|
|
 |
 |
Resnick
Supreme tranceaddict
Registered: Feb 2003
Location: Toronto
|
|
|
| quote: | Originally posted by DigiNut
I thought it was 14. The answer's been explained: drop the first egg at floor 14, then 27, 39, 50, 60, 69, 77, 84, 90, 95, 99. Then once it breaks, just count up from the last floor where it didn't break (or from 96 if it never broke). The max you'll ever have to do is 14. |
nah too complicated, drop 1 at 50, if it breaks do it at 25...and so on...do it for both
edit* check my last post's edie..lol sorry too lazy to repost
___________________
it was the greatest feeling of nothingness i have ever experienced...
|
|
Oct-11-2003 17:53
|
|
|
 |
 |
Flyboy217
Senior tranceaddict

Registered: Aug 2003
Location: In DEEP SPACE... Space... space... sp...
|
|
|
| quote: | Originally posted by Resnick
ok how is the first building one not log n??
first of all, is N unique to both eggs or each egg has its own different height? cuz it doesnt really say, if it is not unique, then its logn of each...
taking worse case, log[base2] n = 8 ..*2 = 16 which is the right answer |
First, the problem says that each breaks from the height N (i.e., they are the same). See DigiNut's reply for a solution requiring only 14 drops. Also, log2(100) = 7. This solution would work if you had 7 eggs, but you don't. Try actually devising a solution using binary search and you'll see why it fails (both of your eggs will be broken before you learn anything).
| quote: |
the genie one, u can just do anything and assume at inf it will work out???? i dunno
|
This is a tempting (but wrong) assumption. It is true that a random solution will work approaching 100% probability, but this is not a "guaranteed" solution. As an analogy, imagine the real number line. If I ask you to pick a point on it at random, you will with 100% probability choose a non-integer (or, for that matter, irrational) value. This does not preclude you from picking an integer though. Similarly, 100% of the integers contain the digit "3", but this doesn't mean that they all do. It's an interesting and widely-misunderstood point in mathematics...
| quote: |
and the coin one depends on the coins you choose.... it asks for the most expensive u can buy with exact change?? so if u pick coin A = 10^10 $ then thats more expensive than a lower denomination
edit* ok i read the question wrong, but it still depends on the coins, for instance, if u pick 2,3, then most expensive is 1$ cuz anything after that u have exact change for, now if u pick 10$ and 9$ u can buy 11$ and u wont have exact change, but 11>A>b , but in first case 1$ |
Yes, the value is dependent on A and B; I'm looking for a value in terms of A and B. (You may tell me, for example, that the value of the most expensive item you can't buy is A*B-3. But that's not right :-))
|
|
Oct-11-2003 17:56
|
|
|
 |
 |
Resnick
Supreme tranceaddict
Registered: Feb 2003
Location: Toronto
|
|
|
| quote: | Originally posted by Flyboy217
First, the problem says that each breaks from the height N (i.e., they are the same). See DigiNut's reply for a solution requiring only 14 drops. Also, log2(100) = 7. This solution would work if you had 7 eggs, but you don't. Try actually devising a solution using binary search and you'll see why it fails (both of your eggs will be broken before you learn anything).
|
oh i though u had infinite eggs...k
___________________
it was the greatest feeling of nothingness i have ever experienced...
|
|
Oct-11-2003 17:58
|
|
|
 |
 |
Resnick
Supreme tranceaddict
Registered: Feb 2003
Location: Toronto
|
|
|
| quote: | Originally posted by Flyboy217
This is a tempting (but wrong) assumption. It is true that a random solution will work approaching 100% probability, but this is not a "guaranteed" solution. As an analogy, imagine the real number line. If I ask you to pick a point on it at random, you will with 100% probability choose a non-integer (or, for that matter, irrational) value. This does not preclude you from picking an integer though. Similarly, 100% of the integers contain the digit "3", but this doesn't mean that they all do. It's an interesting and widely-misunderstood point in mathematics...
|
wtf? why would it be 100% prob that i pick a non-integer? why cant i pick 3 or 4or 5?
| quote: | Originally posted by Flyboy217
Yes, the value is dependent on A and B; I'm looking for a value in terms of A and B. (You may tell me, for example, that the value of the most expensive item you can't buy is A*B-3. But that's not right :-)) |
but re-read my post, i just proved that u cant find a general solution in terms of A and B , so either someothings wrong with the questino, or with my proof
___________________
it was the greatest feeling of nothingness i have ever experienced...
|
|
Oct-11-2003 18:02
|
|
|
 |
 |
DigiNut
You kids get off my lawn!

Registered: Dec 2002
Location: Toronto, Self-proclaimed Centre of the Universe
|
|
|
I think I figured out the answer to number 2, it's 5 weights.
If you have a weight, there are 3 things you can do with it: put it on the left, put it on the right, or put it nowhere. This gives you 3^n (where n is the number of weights) possible options AT MOST. You also have to account for the fact that doing nothing with all weights gets you zero, which won't balance anything, and that for each setup there's also a mirror image setup. So the maximum number of different total weights you can get from n weights is (3^n - 1)/2. Obviously to get the maximum, you have to pick the proper weights...
For 4 weights, this gets 40; for 5, it gets you 121, which is enough.
Flyboy, you didn't say we had to actually identify the weights, and I'm not sure how to go about doing that... I'm pretty sure my answer above is correct, though.
Edit: actually, I think it would make sense to pick those weights as powers of 3, i.e. 1, 3, 9, 27, and 81... would that do it?
___________________
My party schedule:
2009-02-21 - DJ Attention @ I'm So Popular
2009-06-18 - DJ Annoying @ People Need To Know Where I'll Be
2012-11-32 - DJ Insufferable ɸ Or At Least the Stalkers I Complain About
2048-06-66 - Spastic & Whocares ¶ Although I'm Actually Flattered
9999-45-81 - Tweaker Gimp ☼ I Probably Won't Even Go To This But I Have To Make Sure I Fill Up All The Available Space Here
Last edited by DigiNut on Oct-11-2003 at 18:10
|
|
Oct-11-2003 18:02
|
|
|
 |
 |
|  |
All times are GMT. The time now is 13:36.
Forum Rules:
You may not post new threads
You may not post replies
You may not edit your posts
|
HTML code is ON
vB code is ON
[IMG] code is ON
|
|
|
|
|
|
Contact Us - return to tranceaddict
Powered by: Trance Music & vBulletin Forums
Copyright ©2000-2026, Jelsoft Enterprises Ltd.
Privacy Statement / DMCA
|