Before the introduction, some motivation courtesy of Wikipedia:
“...decimal representation has some problems. One problem is that many rational numbers lack finite representations in this system. For example, the number 13 is represented by the infinite sequence (0,3,3,3,3,…). Another problem is that the constant 10 is an essentially arbitrary choice, and one which biases the resulting representation toward numbers that have some relation to the integer 10. For example, 1371600 has a finite decimal representation, while 13 does not, not because 1371600 is simpler than 13, but because 1600 happens to divide a power of 10 (106=1600×625). Continued fraction notation is a representation of the real numbers that avoids both these problems. Let us consider how we might describe a number like 41593, which is around 4.4624. This is approximately 4. Actually it is a little bit more than 4, about 4+12. But the 2 in the denominator is not correct; the correct denominator is a little bit more than 2 about 2+16, so 41593 is approximately 4+12+16. But the 6 in the denominator is not correct; the correct denominator is a little bit more than 6, actually 6+17. So 41593 is actually 4+12+16+17. This is exact...”With this in mind, one can define an infinite continued fraction to be a0+1a1+1a2+⋱. With the denominators a0,a1,a2,…, we can define a recurrence for the finite approximations (convergents) of this value. For example, the zeroth is a0 and the first is a0+1a1=a0a1+1a1.
The other motivation (the one I actually learned first in real life) for continued fractions comes from √2 being represented by an infinite continued fraction. (Instead of saying a probability of 0.01876, people would rather say a 1 in 53 chance.) So we try to write √2=1.41421356… as 1+12.414. But, instead, notice that √2=1+(√2−1)=1+1√2+1. Plugging this into itself, we have √2=1+11+1+1√2+1=1+11+1+11+1+1√2+1 and notice it can be represented by (1;2,2,2,…).
Define the nth convergent to be hnkn, so above we have h0=a0,k0=1 and h1=a0a1+1,k0=a1.
Claim: hn and kn satisfy hn=anhn−1+hn−2kn=ankn−1+kn−2 along with h−1=1,h−2=0 and k−1=0,k−2=1.
Proof: The fraction hnkn is converted into hn+1kn+1 simply by changing an to an+1an+1 in the final denominator. Since hnkn=anhn−1+hn−2ankn−1+kn−2 we similarly have hn+1kn+1=(an+1an+1)hn−1+hn−2(an+1an+1)kn−1+kn−2=an+1(anhn−1+hn−2)+hn−1an+1(ankn−1+kn−2)+kn−1=an+1hn+hn−1an+1kn+kn−1
Thus hn+1 and kn+1 satisfy the same recurrence.
It remains to check the initial conditions work, but note h0=a0h−1+h−2=a0⋅1+0=a0k0=a0k−1+k−2=a0⋅0+1=1 and h1=a1h0+h−1=a0a1+1k1=a1k0+k−1=a1⋅1+0=a1 as we checked above. ◻
Check out my next post, where I actually accomplish something with fractions (or at least prepare to accomplish something).
No comments:
New comments are not allowed.