|
I will check it out, thanks. I had trouble with the same subject.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
raddevus wrote: Big O notation The Story of O[^]
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Caution: I think the Wikipedia link is a different "O". Nice bait and switch
|
|
|
|
|
WORKS LIKE AN ANT
There is a meter long rope tight between two poles.
An ant starts running at the speed of 1 cm/s from one end of the rope to the other. At same time the poles are moving back a 1/2 m/s each, stretching the rope (the rope is magical and can be stretched infinitely).
Will the ant ever arrive?
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
The poles are moving away from each other at 500 cm/s?
|
|
|
|
|
Yes (that what I meant by 'back')...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
50cm I take it, though for some reason I think he meant .5cm/s.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
1/2 m = 50 cm...
And I meant that and not 0.5 cm...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
That's why I said 'I think' and not 'I correctly think'.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Durp! Said cm but gave the number for mm.
|
|
|
|
|
My mistake...
I somehow stopped at the 'each other' part and cleared the '500 cm/s'...
It is away - yes, but only at 50 cm/s... (but that's probably irrelevant anyway)
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
SO, each second the ant moves 1cm closer to his goal, which moves approx 50cm further away from him in the same second.(actually, I think in the first second it move 99.5cm away).
So, no, he's never going to reach it.
Truth,
James
|
|
|
|
|
Yes. The actual speeds are irrelevant to the solution as well. Each time the ant moves, more of the rope expands behind the ant than the previous move and less in front. Eventually when the ant reaches the mid-way point the rope is expanding equally in front and behind. As it moves closer to its destination more and more of the rope is expanding behind the ant. This means that eventually the ant will reach its destination because eventually less rope will expand in front of the ant than the ant can travel which will land the ant at his destination
|
|
|
|
|
Or in other words - it will be a very-very old ant when getting off the rope...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
Approximately 8.547e+35 years if my math is correct
|
|
|
|
|
Jon McKee wrote: Approximately 8.547e+35 years if my math is correct
So, that's still younger than @OriginalGriff then.
|
|
|
|
|
No, I only feel that old...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I could assure you that you act younger than I am now and then. And that's actually a good thing.
|
|
|
|
|
The problem did not specify that the ant is immortal. If it would take 8.547e+35 years then the answer is clearly no, the ant will not reach the other end. Ants don't generally live that long.
|
|
|
|
|
speed of rope at distance x from centre is x/(t+1) (ant starts at x=-50, t=0)
speed of ant is x/(t+1)+1 = dx/dt
x=c(t+1)+(t+1)log(t+1) so -50=c
ant arrives: 50=-50(t+1)+(t+1)log(t+1)
let u=t+1
50(u+1)=u log u
if u=exp(50), u log u = 50.u which is near enough
|
|
|
|
|
I say the ant will certainly arrive. Even if we say the ant is moving after the poles, even though they are separating at the same speed the ant is covering at least a part of the gap. As the gap is getting larger at the same rate as the ant is moving, because the ant is not at the end part of the expansion must be on the part already travelled. So if the gap increases uniformly the extra distance still to travel each second will always be less than 1cm.
veni bibi saltavi
|
|
|
|
|
Can you explain it magyarul?
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
Egyszer volt egy kiss hangyat, egyszer nem volt.
veni bibi saltavi
modified 15-Feb-17 17:08pm.
|
|
|
|
|
Once there was a kiss ants, not once was
Not sure if it's Google's Hungarian translator that's broken, or your Hungarian.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I missed an auto correct, kis not kiss. Once there was a little mouse, once there wasn't. Every Hungarian folk tale starts this way.
veni bibi saltavi
|
|
|
|