Quote:
Originally Posted by KnifeMissile
Because the Harmonic series diverges, we know that the tortoise will get to the flower and that it will do so the same number of times it will take the series to sum to three. Unfortunately, there's no simple formula to represent the sum of the Harmonic series, although it can be approximated by ln(n). This approximation is not very good for a sum as low as three but if the problem were just a little different, like stretching the elastic band twenty feet, instead of just three, then the number of iterations might be pretty close to e<sup>20</sup>...
|
Hmm...the method is beyond me right now, but a program could easily solve this, which makes me believe that a formula I once knew could as well.
Once the variable x is greater than or equal to 1, you take the n value and that is your number of iterations. The reason the x is only equal to 1 in this case and not 3 is because we are measuring the proportion, as KnifeMissile said:
x = 0;
y = 3;
n = 0;
while(x < 1){
x += 1/y;
y += 3;
n++;
}
Gah, that code looks horrible, I have to take some more CIS courses soon. But I think this is a solution, no?