A student John starts with the
familiar series 1 + 1/2 + 1/4 + 1/8 + . . . .
He then takes the average
of each adjacent pair of terms and
inserts it between the terms to
obtain the new series 1 + 3/4 + 1/2 + 3/8 + 1/4 + . . . .
He divides this by
two, because there are now twice as
many terms as before. That gives
1/2 + 3/8 + 1/4 + 3/16 + 1/8 + ...
He repeats
the process indefinitely. For example, the next pair of steps gives
1/2 + 7/16 + 3/8 + 5/16 + 1/4 + 7/32 + 3/16 + 5/32 + 1/8 + ...
then
1/4 + 7/32 + 3/16 + 5/32 + 1/8 + 7/64 + 3/32 + 5/64 + 1/16 + ...
What exact
limit will the series approach?
Appears to converge to 1.5
1.7499999999999996
1.625
1.5625
1.53125
1.515625
1.5078125
1.50390625
1.501953125
1.5009765625
1.50048828125
1.500244140625
1.5001220703125
1.50006103515625
1.500030517578125
1.5000152587890625
-----------
length = 100
reps = 15
serieses = [[2**-n for n in range(length)]]
for iteration in range(reps):
base = serieses[-1]
aver = []
for i,v in enumerate(base):
if i == 0:
continue
aver.append((base[i-1] + v)/2)
interpolated = []
for i,v in enumerate(base):
if i == 0:
interpolated.append(v)
else:
interpolated.append(aver[i-1])
interpolated.append(v)
halved = []
for v in interpolated:
halved.append(v/2)
serieses.append(halved)
print(sum(halved))
|
Posted by Larry
on 2024-06-12 08:02:25 |