0
$\begingroup$

While trying to write a program that finds triangular square pentagonal numbers, I needed to solve the following inequality: $$ \frac{1}{3}*2^{4n-3}*[[(1+\sqrt 3)^{4n-1}-(1-\sqrt 3)^{4n-1}]^2-[(1+\sqrt 3 + \epsilon)^{4n-1}-(1-\sqrt 3 - \epsilon)^{4n-1}]^2]< 0.5 $$

Given a value of n (which is very large, around $ 10^{100} $, how can I figure out a value for $\epsilon$?

$\endgroup$
  • $\begingroup$ Try binary search. $\endgroup$ – Peter Sep 8 '16 at 22:13
0
$\begingroup$

If $n$ is large, then $(1-\sqrt 3)^{4n-1}\approx 0$ and $(1-\sqrt 3 - \epsilon)^{4n-1}\approx 0$

Your inequality simplifies to $$ \frac{1}{3}*2^{4n-3}*[(1+\sqrt 3)^{8n-2}-(1+\sqrt 3 + \epsilon)^{8n-2}]< 0.5 $$

Rewrite as: $$ \frac{1}{3}*2^{4n-3}*(1+\sqrt 3)^{8n-2}*[1-(1 + \frac\epsilon{1+\sqrt 3})^{8n-2}]< 0.5 $$

Use binomial expansion to say (first order approximation)

$$ \frac{1}{3}*2^{4n-3}*(1+\sqrt 3)^{8n-2}*\left [1-\left (1 + \frac{\epsilon({8n-2})}{1+\sqrt 3}\right )\right ]< 0.5 $$

Looks like $\epsilon$ will be negative?

$$ \frac{1}{3}*2^{4n-3}*(1+\sqrt 3)^{8n-3}*({2-8n})(-\epsilon)< 0.5 $$

$$ (-\epsilon)< \frac{1.5}{2^{4n-3}*(1+\sqrt 3)^{8n-3}*({8n-2})} $$

$\endgroup$
  • $\begingroup$ I let $\epsilon$ represent the inaccuracy in the floating point representation of sqrt(3), thank you so much! $\endgroup$ – Husnain Raza Sep 8 '16 at 22:49

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.