3 ms·
Looking at the comments, you can iterate this, and eventually you will get a better approximation than both a/b and c/d. But sure enough, after a single iterati
by GuB-42 4y ago
Looking at the comments, you can iterate this, and eventually you will get a better approximation than both a/b and c/d. But sure enough, after a single iteration, (a+c)/(b+d) is not always better.
- madcaptenor 4y agoIf you iterate this, I think you get the continued fraction convergents, which are the "best" rational approximation to the irrational you're trying to approximate. (I did some numerical experiments and this looks true; I didn't prove it.)
- geysersam 4y agoI found the thing about iteration quite strange. To iterate, we need to know if our mediant is larger or smaller than the true value. How do we know that? Edit: elsewhere in the thread someone explained that the purpose of iterating is to find an approximation with small denominator.
- madcaptenor 4y agoe isn't the best example for this, because you would need a good decimal expansion. But say we're trying to approximate sqrt(2) by this method. Say we've already established that it's in the interval [7/5, 10/7]. We can verify because 7^2 < 2*5^2 and 10^2 > 2*7^2. Then the mediant is 17/12, and since 17^2 = 289 > 288 = 2*12^2, we know 17/12 > sqrt(2). So [7/5, 17/12] is a smaller interval containing sqrt(2). Repeating this, [24/17, 17/12] is even better, and so on.