• Hey Guest. Check out your NeoGAF Wrapped 2025 results here!

Can't solve this riddle

Status
Not open for further replies.
I did. I got as far as
in the case of two, having prisoner "A" and "B" with the number n and m, respectively. A would guess m, B would guess n+1.
From there I couldn't figure out why before I peeked :(
That counts as an attempt, I just feel a bit bad putting a stop to the cool collaborative puzzle solving that was going on...
 
Okay, that solution is genius and quite elegant. I had to reread it a couple times because the only thing I ever use modulus for it to make programs run in circles.
As it happens, Friendly Monster is a fellow game dev ^^ (or at least he was, he never posts anymore! ; ;)
 
I have a puzzle!

When it is solved, I'll expand upon it!

A caterpillar is crawling along a 1 meter long bungee line. When the caterpillar has crawled 1 cm, the line is spanned out to 2 meters. When it has crawled another centimeter, it is spanned out to three meters, and so it continues. For each centimetre the caterpillar has crawled, the line is spanned out one meter.

Will the caterpillar ever reach the other side?

The explanation to the answer is the real answer to the puzzle.
 
Couldn't the prisoners give them selves each a number, 1 to 10, designate which one of the prisoners will be identified, that prisoner then watches which of the other 9 writes sown a number? They each are numbered, one that matches the target prisoner is the one to write down first, target prisoner then writes what his number is?
 
I have a puzzle!

When it is solved, I'll expand upon it!

A caterpillar is crawling along a 1 meter long bungee line. When the caterpillar has crawled 1 cm, the line is spanned out to 2 meters. When it has crawled another centimeter, it is spanned out to three meters, and so it continues. For each centimetre the caterpillar has crawled, the line is spanned out one meter.

Will the caterpillar ever reach the other side?

The explanation to the answer is the real answer to the puzzle.
Can you elaborate on the term "spanned out"? Length is added to the end of the line which does not affect the caterpillar's position relative to the beginning of the line?

wait... Friendly Monster is a he? I figured only a woman would address the prisoners as 'she'... my mistake then!
I guess I'm not sure? Head canon and all that. Apologies to FM if I was mistaken.
 
As it happens, Friendly Monster is a fellow game dev ^^ (or at least he was, he never posts anymore! ; ;)

Ah, it figures!

Couldn't the prisoners give them selves each a number, 1 to 10, designate which one of the prisoners will be identified, that prisoner then watches which of the other 9 writes sown a number? They each are numbered, one that matches the target prisoner is the one to write down first, target prisoner then writes what his number is?

Nope. They have no communication after figuring out the initial strategy.
 
Couldn't the prisoners give them selves each a number, 1 to 10, designate which one of the prisoners will be identified, that prisoner then watches which of the other 9 writes sown a number? They each are numbered, one that matches the target prisoner is the one to write down first, target prisoner then writes what his number is?
They don't get to see each other write down numbers.
 
Can you elaborate on the term "spanned out"?

As you do with a bungee. Imagine the bungee being infinitely "spannable", so that it doesn't ever reach a max length, like a bungee normally would. You could visualize it with two people holding the bungee, then moving apart after the caterpillar has crawled a new centimetre.
 
I have a puzzle!

When it is solved, I'll expand upon it!

A caterpillar is crawling along a 1 meter long bungee line. When the caterpillar has crawled 1 cm, the line is spanned out to 2 meters. When it has crawled another centimeter, it is spanned out to three meters, and so it continues. For each centimetre the caterpillar has crawled, the line is spanned out one meter.

Will the caterpillar ever reach the other side?

The explanation to the answer is the real answer to the puzzle.

With the caterpillar always crawling forward, the line will continue extending on into infinity. 1 meter, then 2 meters, then 3. We need to add up what the total length will be as the line approaches infinity, essentially the sum of all integers. As everyone knows, the sum of all integers equals -1/12, so the caterpillar merely has to turn around and travel 1/12th of a meter backwards to reach the end of the line.
 
With the caterpillar always crawling forward, the line will continue extending on into infinity. 1 meter, then 2 meters, then 3. We need to add up what the total length will be as the line approaches infinity, essentially the sum of all integers. As everyone knows, the sum of all integers equals -1/12, so the caterpillar merely has to turn around and travel 1/12th of a meter backwards to reach the end of the line.

The caterpillar has to move forward.
 
As you do with a bungee. You hold at each end and pull it until it is a meter longer.

was about to ask the same question as Feep. Basically if you interpret the expansion in the physical sense then to an external observer the caterpillar's rate of movement is higher than 1 cm per second.
 
was about to ask the same question as Feep. Basically if you interpret the expansion in the physical sense then to an external observer the caterpillar's rate of movement is higher than 1 cm per second.

In this puzzle, imagine it in bursts. The caterpillar crawls 1 cm, then stops. The bungee is expanded. Then the caterpillar continues. After another centimetre, the caterpillar again stops.
 
In this puzzle, imagine it in bursts. The caterpillar crawls 1 cm, then stops. The bungee is expanded. Then the caterpillar continues. After another centimetre, the caterpillar again stops.

the caterpillar's length is not zero though... it must be resting on a positive length of bungee cord that expands too.



edit: if we can assume the caterpillar's length is zero, then to an outside observer it continues to move forward even when resting, as it is "attached" to a point on the cord at that moment.
 
In this puzzle, imagine it in bursts. The caterpillar crawls 1 cm, then stops. The bungee is expanded. Then the caterpillar continues. After another centimetre, the caterpillar again stops.

My guess is yes. The stretching does nothing but 'zoom in' and makes the step to the next zoom half as long.

This is effectively a rewrite of the paradox of walking halfway before you reach the end and so on. This has been proven wrong because it excludes time.

Could be very wrong though.
 
If you mean position, then yes, that is true.

I think you mean the same thing as my edit, if I understand correctly?

Otherwise the caterpillar would stretch too.





edit: just saw your edit - then basically the caterpillar moves at 1 cm per second while the cord is not stretching, and at 1 meter per second while the cord is stretching.
 
My guess is yes. The stretching does nothing but 'zoom in' and makes the step to the next zoom half as long.

This is effectively a rewrite of the paradox of walking halfway before you reach the end and so on. This has been proven wrong because it excludes time.

Could be very wrong though.

It is not the halving paradox.

I think you mean the same thing as my edit, if I understand correctly?

Otherwise the caterpillar would stretch too.

Yeah, you can treat the caterpillar as being a point.
 
Well, I will say that after ten million steps, the caterpillar has crossed 15.8% of the bungie. ^^

I'm really rusty on convergence problems.
 
My guess is yes. The stretching does nothing but 'zoom in' and makes the step to the next zoom half as long.

This is effectively a rewrite of the paradox of walking halfway before you reach the end and so on. This has been proven wrong because it excludes time.

Could be very wrong though.

Zeno's paradox is essentially an attempt to understand based on intuition how infinite series may converge. However if you interpret the terms of the series in this question naively, as Uncle Sporky demonstrated, then this series does not converge.
 
With the prisoner thing I got as far as solving it for two prisoners but I can't extrapolate my answer out for three let alone ten. It's no fair if the solution needs advanced maths when you said it could be done with logic.
 
Well, I will say that after ten million steps, the caterpillar has crossed 15.8% of the bungie. ^^

I'm really rusty on convergence problems.

The caterpillar's speed while the cord is expanding should be proportional to the length of cord that has already been covered, if I'm not mistaken. The top of the cord is assumed to be static if I understand correctly, and the bottom of the cord is assumed to travel at a rate of 1 meter per second.
 
With the prisoner thing I got as far as solving it for two prisoners but I can't extrapolate my answer out for three let alone ten. It's no fair if the solution needs advanced maths when you said it could be done with logic.
It does not need advanced math(s).
 
edit: just saw your edit - then basically the caterpillar moves at 1 cm per second while the cord is not stretching, and at 1 meter per second while the cord is stretching.

If it moved at one meter per second, it would cross the bungee when it got stretched. In the earlier visualization example of two people holding the bungee, a specification that might make the visualization easier is to say that the person at the far end of the bungee is the one that moves away.

Remember, speed is irrelevant. The caterpillar can take all the time it wants. It is only after it has completed another centimetre that the bungee is expanded. At that, when the expansion of the bungee happens, the caterpillar is stationary, and as such, the time it takes is irrelevant.

Well, I will say that after ten million steps, the caterpillar has crossed 15.8% of the bungie. ^^

I'm really rusty on convergence problems.

Then, yeah, I can divulge to people of mathematical inclination that this is a problem of whether or not this is a converging series.
 
Jesus christ I'm an idiot. Of course the caterpillar would reach the end, because I've played with this exact same effect with progress bars.

Originally:

wvqLrEM.png


But then you make the window larger and hey look the amount of progress made is also larger

LjRRLZ2.png


Caterpillar moves 1cm on a 100cm rope, has made 1/100 progress. Stretching that rope to 200cm also stretches the part the caterpillar already crawled through, meaning he has now made 2/100 progress.

I hope.
 
Zeno's paradox is essentially an attempt to understand based on intuition how infinite series may converge. However if you interpret the terms of the series in this question naively, as Uncle Sporky demonstrated, then this series does not converge.

Does each step-stretch cycle not result in the dot being further along the line in percentage terms? This will converge at the end of the line, will it not?

Edit: Or maybe it converges at 2% across the line?
 
With the prisoner thing I got as far as solving it for two prisoners but I can't extrapolate my answer out for three let alone ten. It's no fair if the solution needs advanced maths when you said it could be done with logic.

It doesn't need advanced math. But knowing more math always helps.
 
The caterpillar's speed while the cord is expanding should be proportional to the length of cord that has already been covered, if I'm not mistaken. The top of the cord is assumed to be static if I understand correctly, and the bottom of the cord is assumed to travel at a rate of 1 meter per second.
It's not a constant expansion. It happens in steps.
 
If it moved at one meter per second, it would cross the bungee when it got stretched. In the earlier visualization example of two people holding the bungee, a specification that might make the visualization easier is to say that the person at the far end of the bungee is the one that moves away.

yeah, I made that correction in the next post.
 
was about to ask the same question as Feep. Basically if you interpret the expansion in the physical sense then to an external observer the caterpillar's rate of movement is higher than 1 cm per second.
d meaning distance left til the end of the rope. Assuming that when the rope is stretched out 1 m the caterpiller remains at it's relative position, so if the caterpillar has scaled 20% of the rope, it has scaled 20% of the expanded rope as well.

d(0) = 1
d(n) = d(n-1) - 0.01 + (d(n-1) - 0.01) / n ⇔ d(n) = (d(n-1) - 0.01)(1 + 1 / n)

When n→∞, 1+1/n → 1, meaning d(n) → d(n-1) - 0.01, meaning it decreases.
 
Okay, I got it. It's pretty easy if you think about it the right way.

The series is divergent, and therefore he will reach it.

We think about what fraction of the bungee the caterpillar will cross at each step. First is 1/100, of course. Then an additional 1/200 on the next bit. Then 1/300. And so on. These terms must be summed.

Factoring out a 1/100, we get the ever-familiar harmonic series: 1/1 + 1/2 + 1/3 + 1/4...

That series is divergent, therefore, the caterpillar can cross the rope no matter how long it is. Hooray!
 
It's not a constant expansion. It happens in steps.

What I'm trying to say doesn't contradict the fact that it happens in steps. I'm saying that whenever the cord is stretched, the "amount of cord added" at a certain point is proportional to that point's distance from the origin.
 
d meaning distance left til the end of the rope. Assuming that when the rope is stretched out 1 m the caterpiller remains at it's relative position, so if the caterpillar has scaled 20% of the rope, it has scaled 20% of the expanded rope as well.

d(0) = 1
d(n) = d(n-1) - 0.01 + (n - d(n-1) - 0.01) * 1 ⇔ d(n) = d(n-1) - 0.01 + n - d(n-1) - 0.01 ⇔ d(n) = 2*d(n-1) + n - 0.02

If 2*d(n-1) + n > 0.02, d(n) > d(n-1). Since d(1) > d(0), this means the function is increasing. No, the caterpillar will never scale the rope.

Okay, I got it. It's pretty easy if you think about it the right way.

The series is divergent, and therefore he will reach it.

We think about what percentage the caterpillar will cross at each step. First is 1/100, of course. Then an additional 1/200 on the next bit. Then 1/300. And so on. These terms must be summed.

Factoring out a 1/100, we get the ever-familiar harmonic series: 1/1 + 1/2 + 1/3 + 1/4...

That series is divergent, therefore, the caterpillar can cross the rope no matter how long it is. Hooray!

One of these answers is correct. You may ask one question to me to figure out which it is. What question do you ask?

Feep is correct, and that's a great spot, there, about the harmonic series
 
It does not need advanced math(s).

It doesn't need advanced math. But knowing more math always helps.

Any advice on how to get from two to three then? My guess was
one prisoner agrees to be 'agree guy' and one is 'opposite guy'. Agree guy writes what the other guys number is, and opposite guy contradicts the number he sees. That guarantees one of them will get it. I'm assuming that I have what they do right, but being opposite guy and agree guy doesn't work when there's three dudes, so they must be doing something else. Are they odd guy and even guy? Prime guy and non prime guy?
 
One of these answers is correct. You may ask one question to me to figure out which it is. What question do you ask?

is the caterpillar "attached" to the cord as it expands, or does it feel the cord "slipping away" underneath it?



edit: as Feep has proven, the caterpillar will reach the end of the cord regardless, I was just thinking about a different scenario in which the equation of movement contained an exponential term.

edit2: d'oh! Feep's version and my version are one and the same! :P
 
Jesus christ I'm an idiot. Of course the caterpillar would reach the end, because I've played with this exact same effect with progress bars.

Originally:

wvqLrEM.png


But then you make the window larger and hey look the amount of progress made is also larger

LjRRLZ2.png


Caterpillar moves 1cm on a 100cm rope, has made 1/100 progress. Stretching that rope to 200cm also stretches the part the caterpillar already crawled through, meaning he has now made 2/100 progress.

I hope.

Not quite.

1/100 -> 2/200
3/200 -> 4.5/300
5.5/300 -> 7.333/400
8.333/400 -> 9.1666/500
10.1666/500 -> 11/600

And so on. It's making progress, but not much, and it's slowing down. I'd write a program to iterate this for me but I'm not at my main computer at the moment.

edit: bah, it's already been solved. I need to refresh the page before posting!
 
OK, so let me explain this one:

As Feep pointed out, the caterpillar will remain in its relative position when the bungee is expanded. As such, the caterpillar will traverse 1/100 of the bungee with its first centimetre. The second centimetre will give it 1/200 of the length.
As it's pointed out, this is a divergent series. It means that 1/(1 * 100) + 1/(2 * 100) + 1 / (3 * 100) ... + 1 / (n * 100) = 1.

Let's expand it further!

Given that the caterpillar moves 1 cm per second, and the expansion happens instantaneously, how long will it take for it to reach the other side?
That's a math-heavy question, and my high-school math teacher applauded me and basically gave me the rest of the year off when I managed to solve it, so it might be a bit esoteric.
 
Not quite.

1/100 -> 2/200
3/200 -> 4.5/300
5.5/300 -> 7.333/400
8.333/400 -> 9.1666/500
10.1666/500 -> 11/600

And so on. It's making progress, but not much, and it's slowing down. I'd write a program to iterate this for me but I'm not at my main computer at the moment.

There was no time limit on this though. As long as he doesn't slow down to zero, it still works.
 
I'd write a program to iterate this for me but I'm not at my main computer at the moment.
Hahahah, that was the first thing I did when I saw the problem. = D

Code:
int a;
int iterations = 10000000;
float b = 0.0f;

for (a = 1; a < iterations; a++)
{
    b += 1.0f;
    b *= ((float)a + 1) / a;
}

Console.WriteLine("Percentage crawled is " + (b / (a * 100)));
 
is the caterpillar "attached" to the cord as it expands, or does it feel the cord "slipping away" underneath it?

It is sitting on top of the bungee, so it'd be hard to slip backwards. That's the key to solving the puzzle, that its relative position (after 1 cm being 1%, after another cm, it being 1.5%) remains the same after the expansion that gives us the understanding.
 
Hahahah, that was the first thing I did when I saw the problem. = D

Code:
int a;
int iterations = 10000000;
float b = 0.0f;

for (a = 1; a < iterations; a++)
{
    b += 1.0f;
    b *= ((float)a + 1) / a;
}

Console.WriteLine("Percentage crawled is " + (b / (a * 100)));

Yeah, I assumed as much, but then I saw you second-guessing yourself, so I thought maybe you had the wrong formula.
 
Oh, yeah, if you try to write a program to calculate the time it would take for it to reach the other side, I think it would take some years before it returned an answer.
 
Any advice on how to get from two to three then? My guess was
one prisoner agrees to be 'agree guy' and one is 'opposite guy'. Agree guy writes what the other guys number is, and opposite guy contradicts the number he sees. That guarantees one of them will get it. I'm assuming that I have what they do right, but being opposite guy and agree guy doesn't work when there's three dudes, so they must be doing something else. Are they odd guy and even guy? Prime guy and non prime guy?

You're in the right direction. Once you find the right way to extrapolate from 2 to 3, you've essentially solved the riddle. Try to think of the options for the 2 prisoner version in terms of how they relate to the number 2.


Feep said:
b *= ((float)a + 1) / a;
this line is the crucial part.
 
I returned to this thread too late to have a proper go at efyu's latest puzzle, but I do feel obliged to acknowledge that it is, in fact, a doozy.
 
You're in the right direction. Once you find the right way to extrapolate from 2 to 3, you've essentially solved the riddle. Try to think of the options for the 2 prisoner version in terms of how they relate to the number 2.

Okay. Logically, if they're choosing their number based of the other one, then the three person version must involve choosing you're number based off something involving the other two numbers, right? So if opposite guy and agree guy are each doing something different, are they actually taking two different positions on some property of all the numbers as a group? So the three person version must be a version where that property has three possible values, and each prisoner becomes value one guy, value two guy, and value three guy. Then when he sees the other two numbers he chooses his number so that all the numbers as a group have the value he's championing.
 
Okay. Logically, if they're choosing their number based of the other one, then the three person version must involve choosing you're number based off something involving the other two numbers, right? So if opposite guy and agree guy are each doing something different, are they actually taking two different positions on some property of all the numbers as a group? So the three person version must be a version where that property has three possible values, and each prisoner becomes value one guy, value two guy, and value three guy. Then when he sees the other two numbers he chooses his number so that all the numbers as a group have the value he's championing.

keep going!
 
Status
Not open for further replies.
Top Bottom