10
$\begingroup$

There's an old Tamil statement that predicts the hypotenuse of a right angle triangle to a reasonable level of accuracy considering it doesn't involve roots. This is how it goes:

“Odum Neelam Thanai Ore Ettu Kooru thaaki Koorilae Ondrai Thalli Kundrathil Paadhiyai Saerthal Varuvathu Karnam Thane”

This translates to something like -

"Subtract one eight of the length (longer side) from the length, and add a half of the height to get the hypotenuse". This approximates quite well to the hypotenuse. Seems like an interesting subject to elaborate on.

Hypotenuse = 7/8* base + height/2    

How is 7/8*base + height/2 somewhat equivalent to sqrt(a^2 + b^2)

$\endgroup$
  • 12
    $\begingroup$ What do you consider 'astonishing accuracy?' The algorithm works for 3,4,5 triangles and multiples. But it fails for something like 9,40,41 where it predicts the hypotenuse shorter than the longest leg! $\endgroup$ – John Molokach Jul 6 '15 at 19:14
  • 2
    $\begingroup$ @JohnMolokach Nice fallacy that you pointed out! Also here are the reasons I find it astonishing: The prediction for the triplet 1980, 9801 & 9999 is within 5% accuracy - that is pretty astonishing. This was a prediction made before pythagoras' great great grand dad was conceived - that is pretty astonishing as well. $\endgroup$ – rtindru Jul 6 '15 at 19:34
  • 2
    $\begingroup$ @rtindru A 5% discrepancy is not very astonishing. As John points out this approximation is smaller than the other side of the triangle for the case 1980, 9801, 9999 that you describe, which is remarkably poor. There is some evidence that ancient Babylonians had knowledge of Pythagoras's theorem several centuries earlier. $\endgroup$ – Erick Wong Jul 6 '15 at 21:57
  • 4
    $\begingroup$ There is a genuine question hidden in here, which is "what linear combination of (ordered) side lengths gives the smallest relative error?". The one in the OP can be as bad as 12.5%, which I suspect can be improved substantially. $\endgroup$ – Erick Wong Jul 6 '15 at 22:04
  • 2
    $\begingroup$ I wish my comments hadn't been deleted by some anonymous moderator. They made all these obvious points far more pithily. $\endgroup$ – TonyK Jul 6 '15 at 22:25
14
$\begingroup$

Let the legs measure $a$ and $ka$ with $k>1$. Then the approximation given is:

$\frac{7ka}{8}+\frac{4a}{8}=\frac{(7k+4)a}{8}$.

The real measure is $\sqrt{k^2a^2+a^2}=\sqrt{k^2+1}a$.

So how does $\frac{7k+4}{8\sqrt{k^2+1}}$ behave? Not that bad.

Here is a graph:

enter image description here

So as the graph shows, in the interval $(1,\infty)$ the best approximation occurs at $k=1$ for which we get $\frac{7+4}{8\sqrt{2}}=\frac{11}{2\sqrt2}\approx 0.972$. After this the ratio becomes smaller and smaller, the limit is $\frac{7}{8}=0.875$.

Can this be improved? yes it can, the formula always gives us a length shorter than the actual length, so we can obtain a better aproximation by taking slightly larger coefficients.

A better question is which is the best aproximation for $\sqrt{a^2+b^2}$ that is of the form $la+mb+n$ with $l,m,n\in \mathbb Q$. Now, the value of $l$ is going to be irrelevant because when $a$ and $b$ are large enough the $l$ won't matter much.

So we need to approximate $\sqrt{a^2+b^2}$ with $la+mb$. If we write $b$ as $ka$ then we need to approximate $\sqrt{k^2+1}a$ with $l+mk(a)$. So essentially what we need to do is approximate $\sqrt{k^2+1}$ with $l+mk$. This is the real problem.

The approximation for $\sqrt{k^2+1}$ provided in the question is $\frac{7k+4}{8}$. Now, if we were to approximate $\sqrt{k^2+1}$ by $mk+l$ I would think it would be in our best interest to make $m=1$ (so that at least when $k$ goes to infinity the limit becomes $1$. Then it is only a matter of finding a good $l$.

I didn't think a lot but taking $l=\frac{3}{7}$ seems to give a good result. Here is the graph of $\frac{k+3/7}{\sqrt{k^2+1}}$

enter image description here

This is a better approximation, the ratio of the correct measurement, versus the actual measurement when $k\geq 1$ reaches a maximum of approximately $1.088$ when $k=2.\overline 3$, this is the worst it gets, it improves when $k$ approaches $1$, reaching the minimum of $1.01$ and it also improves as $k$ goes to infinity, with a limit of $1$. (as an opposite of the first approximation this approximation always gives a hypotenuse longer than it actually is, which again tells us this is not actually the best approximation)

So a better way to approximate the hypotenuse is to add the longer leg's length plus three sevenths of the shorter leg's length.

$\endgroup$
  • $\begingroup$ Isosceles right triangle of side $1$ gives $1.375$, reasonably good. $\endgroup$ – André Nicolas Jul 6 '15 at 19:15
  • $\begingroup$ @dREaM Actually for equal lengths its pretty good as well - assuming its 5 on each side, the difference is 0.2 $\endgroup$ – rtindru Jul 6 '15 at 19:24
  • $\begingroup$ Yeah, I updated it with some stuff. Hope to come back to interesting material when I get home. $\endgroup$ – Jorge Fernández Hidalgo Jul 6 '15 at 19:28
5
$\begingroup$

The method provides a not-so-great approximation when the two catheti are roughly of the same length. In this case, $$\frac{7}{8}a+\frac{1}{2}b\approx\frac{7}{8}a+\frac{1}{2}a=\frac{11}{8}a=1\mathrm.375 a\approx(1\mathrm.414...)a=\sqrt{2}{a}\approx\sqrt{a^2+b^2}.$$

$\endgroup$
5
$\begingroup$

Numerical optimization reveals how truly astonishing the approximation is:

Taking a hint from @dREaM's answer and normalizing the length of the shortest side, for side lengths $1$ and $k$ we are interested in the ratio

$$\frac{ak+b}{\sqrt{k^2+1}}$$

as a function of the coefficients $a$ and $b$ (in the Tamil approximation, $a=7/8$ and $b=1/2$). We want the ratio to be as close to $1$ as possible for a large number of side lengths. Some experimentation shows that it is the region $k \in [1,3]$ that is the most problematic, so it makes sense to minimize the integral

$$ \int_1^3 \left(1- \frac{ak+b}{\sqrt{k^2+1}}\right)^2 \>dk $$

for $a,b$. Numerically, the minimum lies near

$$ \begin{align} a &= 0.871079 \\ b &= 0.509221 \end{align} $$

which is very close to the values given in the original text. In fact, plotting the integrand for the original (orange) versus the numerically obtained (blue) coefficients shows that the values are very near optimal in the range $[1,3]$, and most of the discrepancy happens where the side lengths are close to each other (that is, where $k$ is close to $1$):

Coefficients

If we assume that most practical right triangles have short sides that are within a factor of $3$ of each other, then given the very simple fractions used there can be no doubt that the original approximation is "optimal" in a practical sense.

$\endgroup$
  • $\begingroup$ Interested by the way you approached the problem, I worked the analytical solution which, for sure, leads to your numerical results. I added this as an "answer" (too long for a comment). $\endgroup$ – Claude Leibovici Jul 7 '15 at 13:24
  • $\begingroup$ Oh, I hadn't thought of minimizing the integral, that is very interesting. Of course there is the problem that when $k$ goes to infinity the proposed approximation gets worse and worse, approaching $\frac{7}{8}$'ths of what it should be. $\endgroup$ – Jorge Fernández Hidalgo Jul 7 '15 at 15:03
2
$\begingroup$

This is not an answer but it is too long for a comment.

Interested by pew's answer, I focused on $$I=\int_1^3 \left(1- \frac{ak+b}{\sqrt{k^2+1}}\right)^2 \>dk$$ Using a CAS, $$I=\frac{1}{4} a^2 \left(8+\pi -4 \tan ^{-1}(3)\right)+a \left(b \log (5)-2 \sqrt{2} \left(\sqrt{5}-1\right)\right)+b^2 \left(\tan ^{-1}(3)-\frac{\pi }{4}\right)+2 b \left(\sinh ^{-1}(1)-\sinh ^{-1}(3)\right)+2$$ Taking derivatives $$I'_a=\frac{1}{2} a \left(8+\pi -4 \tan ^{-1}(3)\right)+b \log (5)-2 \sqrt{2} \left(\sqrt{5}-1\right)$$ $$I'_b=a \log (5)+2 b \left(\tan ^{-1}(3)-\frac{\pi }{4}\right)+2 \left(\sinh ^{-1}(1)-\sinh ^{-1}(3)\right)$$ Setting the derivatives to zero and solving, we obtain easily the analytical expressions for $a$ anf $b$ (the numerical values of them are given in pew's answer). Their expressions are really ugly !

$\endgroup$
  • $\begingroup$ +1 and thanks! Your question on another ancient Indian approximation has been one of my favourite pieces of MSE ever since I first laid eyes on it. As for speculating how these approximations were derived in the first place, I wouldn't be surprised if someone simply evaluated the integrals at a large number of sample points and then wrote down the small fraction closest to the minimum once a suitable precision had been reached. Not exactly elegant, but effective, and it should not take someone skilled in hand computation more than a few days. $\endgroup$ – user139000 Jul 7 '15 at 13:55
  • $\begingroup$ @pew. Thank you ! May I confess that "discovering" this 1400 years old approximation for sine has been an emotional shock ! The original title of my post was something like "Share my fascination for this 1400 years old approximation" but someone changed it. Cheers. $\endgroup$ – Claude Leibovici Jul 7 '15 at 14:04
1
$\begingroup$

If we start with the following pythagorean triplet $$ m^2 + n^2 , m^2 - n^2 , 2mn$$ Then your method produces, $$ m^2+n^2=\frac{7}{8} \times(m^2-n^2)+mn$$ $$\frac{m^2}{8}+\frac{15}{8}\times n^2 - mn=0$$ $$m^2-8mn+15n^2=0$$ $$(m-3n)(m-5n)=0$$ So, the method above will work perfectly for above pythagorean triplets with m=3n or m=5n.

$\endgroup$
  • 2
    $\begingroup$ Here, I used m^2-n^2 as base. We get another set of answers using 2mn as base. $\endgroup$ – Green monster Jul 6 '15 at 21:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.