THis is a question that I remember when I was in the 5th grade that tested our logical reasoning skills. And it is a simple choice knowing that the pennies doubling every day is an exponential function, but I'm trying to figure out how to create a formula for this solution without adding everything up by hand.
I know this has to be some form of a recurrence relation, but I cant figure out how to solve it. so far I have written down
F(n)=2F(n−1) which wolframalpha solves for me as c12n−1 (I don't know what the c1 is, so I assume its a constant).
and then when I plug in
∑30n=12n−1 it spits out $1,073,741,823
Which is wrong because when I sum up all the days I get $10,737,418.23
I think the main problem is the recurrence relation I set up, but its been so long since my discrete math class, I've forgotten completely how to set that up.
Answer
Wolfram alpha is right, 1 penny is 0.01$ so c1=0.01. As it is a geometric series you could caluclate c1230−1 directly.
c1 is the value you get at the first day.
No comments:
Post a Comment