| + | - | × | ÷ |
How do we figure out a value for the expression 1+1/(1+1/(1+1/(1+1/(.... ? One way to get close is to write a short program to do it. We can apply the formula f(x) = (1+1/x) to itself over and over again. This is what the first couple of steps look like:
| 1 | 1 |
| 1+1/(1) | 2 |
| 1+1/(1+1/(1)) | 1.5 |
| 1+1/(1+1/(1+1/(1))) | 1.6666666666667 |
| 1+1/(1+1/(1+1/(1+1/(1)))) | 1.6 |
How about the expression sqrt(1+sqrt(1+sqrt(1+sqrt(1+.... ? We can do the same sort of program, except using the function f(x)=sqrt(1+x) instead.
| 1 | 1 |
| sqrt(1+1) | 1.4142135623731 |
| sqrt(1+sqrt(1+1)) | 1.55377397403 |
| sqrt(1+sqrt(1+sqrt(1+1))) | 1.5980531824786 |
| sqrt(1+sqrt(1+sqrt(1+sqrt(1+1)))) | 1.6118477541253 |
Now we can compare the two functions side by side. Are they the same? Do they get close to each other? Look at the results from the two programs run for a lot more steps below.
| iteration | f(x) = 1+1/x | f(x) = sqrt(1+x) |
| 0 | 1 | 1 |
| 1 | 2 | 1.4142135623731 |
| 2 | 1.5 | 1.55377397403 |
| 3 | 1.6666666666667 | 1.5980531824786 |
| 4 | 1.6 | 1.6118477541253 |
| 5 | 1.625 | 1.6161212065081 |
| 6 | 1.6153846153846 | 1.6174427985274 |
| 7 | 1.6190476190476 | 1.6178512906097 |
| 8 | 1.6176470588235 | 1.6179775309347 |
| 9 | 1.6181818181818 | 1.6180165422315 |
| 10 | 1.6179775280899 | 1.6180285974702 |
| 11 | 1.6180555555556 | 1.618032322752 |
| 12 | 1.618025751073 | 1.6180334739282 |
| 13 | 1.6180371352785 | 1.6180338296612 |
| 14 | 1.6180327868852 | 1.6180339395888 |
| 15 | 1.6180344478217 | 1.6180339735583 |
| 16 | 1.6180338134001 | 1.6180339840554 |
| 17 | 1.6180340557276 | 1.6180339872992 |
| 18 | 1.6180339631667 | 1.6180339883016 |
| 19 | 1.6180339985218 | 1.6180339886114 |
| 20 | 1.6180339850174 | 1.6180339887071 |
| 21 | 1.6180339901756 | 1.6180339887367 |
| 22 | 1.6180339882053 | 1.6180339887458 |
| 23 | 1.6180339889579 | 1.6180339887486 |
| 24 | 1.6180339886704 | 1.6180339887495 |
| 25 | 1.6180339887802 | 1.6180339887498 |
| 26 | 1.6180339887383 | 1.6180339887499 |
| 27 | 1.6180339887543 | 1.6180339887499 |
| 28 | 1.6180339887482 | 1.6180339887499 |
| 29 | 1.6180339887505 | 1.6180339887499 |
| 30 | 1.6180339887496 | 1.6180339887499 |
| 31 | 1.61803398875 | 1.6180339887499 |
| 32 | 1.6180339887499 | 1.6180339887499 |
| 33 | 1.6180339887499 | 1.6180339887499 |
| 34 | 1.6180339887499 | 1.6180339887499 |
| 35 | 1.6180339887499 | 1.6180339887499 |
| 36 | 1.6180339887499 | 1.6180339887499 |
| 37 | 1.6180339887499 | 1.6180339887499 |
| 38 | 1.6180339887499 | 1.6180339887499 |
| 39 | 1.6180339887499 | 1.6180339887499 |
| 40 | 1.6180339887499 | 1.6180339887499 |