Approximate Pythagoras

Calculus Level 4

A pretty good approximation for the hypotenuse of a right triangle is to add half of the length of the shorter leg to that of the longer leg. b + a / 2 c b + a/2 \approx c

For what ratio of the legs b a \frac{b}{a} is the approximation worst?

How poor is this approximation when expressed as b + a / 2 c \frac{b + a/2}{c} ?

The first ratio can be written with coprime integers a a and b b the worst approximation can be written as p q \frac{\sqrt{p}}{q} with p p a squarefree integer and q q an integer.

Enter the total of a + b + p + q a+b+p+q


The answer is 10.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Jeremy Galvagni
Oct 8, 2018

Let a = 1 a=1 then the approximation, which is always an overestimate, can be written as b + 0.5 1 + b 2 b+0.5 \approx \sqrt{1+b^{2}}

We then need to maximize f ( b ) = b + 0.5 1 + b 2 f(b)=\frac{b+0.5}{\sqrt{1+b^{2}}}

Which has derivative f ( b ) = 1 1 + b 2 b ( b + 0.5 ) ( 1 + b ) 3 / 2 f'(b)= \frac{1}{\sqrt{1+b^{2}}}-\frac{b(b+0.5)}{(1+b)^{3/2}}

Solving f ( b ) = 0 f'(b)=0 gives b = 2 b=2 and f ( 2 ) = 5 2 f(2)=\frac{\sqrt{5}}{2}

So a = 1 a=1 , b = 2 b=2 , p = 5 p=5 , q = 2 q=2 and a + b + p + q = 10 a+b+p+q=\boxed{10}


If this problem is of interest to you, the harder follow-up is A better approximate Pythagoras

I have heard tales of software developers using this trick back in the early microprocessor days, in order to economically calculate magnitudes of complex numbers.

https://brilliant.org/problems/poor-mans-euclidean-norm/?ref_id=1237494

Steven Chase - 2 years, 8 months ago

Log in to reply

Back in the days before latex to judge by your solution ;-)

I've never seen the phrase Euclidean Norm and I hope you see my conceptualization of the problem as a slight improvement.

I also have a follow-up coming if I can work out the answer.

Jeremy Galvagni - 2 years, 8 months ago

Log in to reply

Yeah, I don't think I started using Latex heavily until mid-2017 or so. I've also wondered about using constants other than 1/2, and maybe doing some sort of optimization to figure out which constant would be "best".

Steven Chase - 2 years, 8 months ago

Log in to reply

@Steven Chase Solved. Submitting now.

Jeremy Galvagni - 2 years, 8 months ago

Log in to reply

@Jeremy Galvagni Cool, you were thinking the same thing

Steven Chase - 2 years, 8 months ago
Satyarth Singh
Oct 16, 2018

From the fig., keeping C constant, as θ is varied, b and a vary,

Difference, δ = (b + a/2) - c

or, δ = ccosθ + 0.5csinθ – c

Differentiating with respect to θ we get,

cotθ = 2, or b/a = 2

∴(b+a/2)/c =√5/2

∴ a + b + p + q = 10

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...