Rocky goes on a run to train for
the big fight
.
Every mile, Rocky inspires more people to join him, instantly doubling the current amount of people running with Rocky (counting Rocky).
If Rocky runs 10 miles, what is the combined number of miles ran by everyone at the finish line?
Inspiration :
https://www.youtube.com/watch?v=Hj0jzepk0WA
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
I must say , your solutions are always impressive.
Log in to reply
And I must say, you flatter me more than I deserve. And I deserve none. Nonetheless, I'm still going to upvote your comment. :3
By the way, a more generalized solution can also be made where the multiplying happens after every t miles and 0 < t < k . I was going to do that but then I got bored of writing and hence avoided that part. :P
He runs 10 miles, so the the total sum is 2 0 + 2 1 + … + 2 9 . Note that this does not include 2 1 0 because 0-10 is a total of 11 miles instead of 10. This sum is equal to 2^10-1 = 1023
After Rocky will run 1 mile 1 person will join him. After running another mile the no. of persons will be the double i.e. 2 person will join him. Then after running one more mile the no. of people joining him will become 4. This pattern will continue and
Thus, combined number of miles ran by everyone = 1 0 + 9 × 1 + 8 × 2 + 7 × 4 + 6 × 8 + 5 × 1 6 + 4 × 3 2 + 3 × 6 4 + 2 × 1 2 8 + 1 × 2 5 6
Therefore, the answer is 1 0 2 3 m i l e s
Let N be the number of miles Rocky runs.
Let M be the total miles ran by the whole crowd.
Let C be the size of the crowd at the finish after running N miles. ( The crowd doubles as they arrive at the finish line. )
C = 2 N (If you want to calculate the crowd just before the finish, use 2 N − 1 )
M = C − 1
If Rocky runs 10 miles, that makes M = 2 1 0 − 1 , and so the answer is 1 0 2 3 miles.
For fun, here's a Python simulation, too:
1 2 3 4 5 6 7 8 |
|
2 0 → 2 1 0 (useful for visualization):
powers of 2
Problem Loading...
Note Loading...
Set Loading...
This is a generalized solution for the problem.
Let f ( x ) denote the number of people that started running from the x th mile. Suppose that the running population gets multiplied by a after every mile. We have the following recurrence:
f ( x + 1 ) = a f ( x ) , f ( 0 ) = 1 ⟹ f ( x ) = a x
Since the multiplying of people happens after every single mile, we can say that the total miles ran by the people from the k th mile to the ( k + 1 ) th mile is equal to f ( k ) .
Let the total amount of miles ran by all when they reach the k th mile be D ( k ) . We then have,
D ( k ) = i = 0 ∑ k − 1 f ( i ) ⟹ D ( k ) = i = 0 ∑ k − 1 ( a i )
The formula for summation of a finite GP comes to the rescue. We get,
D ( k ) = a − 1 a k − 1
For the following problem, we have a = 2 (since doubling takes place) and k = 1 0 (since Rocky runs 10 miles).
Hence, D ( 1 0 ) = 2 − 1 2 1 0 − 1 = 1 0 2 3