# n*2^n = 2^53 HOw to solve?

• Feb 18th 2007, 11:17 AM
tea217
n*2^n = 2^53 HOw to solve?
n*2^n = 2^53

HOw to solve for n??

thank you
• Feb 18th 2007, 12:15 PM
CaptainBlack
Quote:

Originally Posted by tea217
n*2^n = 2^53

HOw to solve for n??

thank you

Formula iteration will solve this with a bit of cunning:

Rewrite the equation as:

n=ln[(2^55)/n]/log(2)

Then iterate:

n(r+1)=ln[(2^55)/n(r)]/log(2)

where n(r) is the r-th iterate.

Then with n(0)=1, we get:

n(1)=53,
n(2)=47.2721,
n(3)=47.4371,
n(4)=47.4321
n(5)=47.4322
n(6)=47.4322

With n=47.4322 the two sides of the original equation agree to 5 significant digits.

RonL
• Feb 18th 2007, 01:10 PM
CaptainBlack
Quote:

Originally Posted by tea217
n*2^n = 2^53

HOw to solve for n??

thank you

This can also be solved with the LamberW function.

If A=w*e^w, then W=LambertW(A).

Your equation may be written:

n* e^(ln(2) n)=2^53,

or:

[ln(2)*n] e^[ln(2)*n]=ln(2)*2^53,

so:

ln(2)*n=LambertW(ln(2)*2^53),

or:

n=LambertW(ln(2)*2^53)/ln(2).

Now LambertW(ln(2)*2^53)~=32.8775, so n=32.8775/ln(2) ~=47.4322.

RonL
• Feb 18th 2007, 10:11 PM
tea217
Quote:

Originally Posted by CaptainBlack
Formula iteration will solve this with a bit of cunning:

Rewrite the equation as:

n=ln[(2^55)/n]/log(2)

Then iterate:

n(r+1)=ln[(2^55)/n(r)]/log(2)

where n(r) is the r-th iterate.

Then with n(0)=1, we get:

n(1)=53,
n(2)=47.2721,
n(3)=47.4371,
n(4)=47.4321
n(5)=47.4322
n(6)=47.4322

With n=47.4322 the two sides of the original equation agree to 5 significant digits.

RonL

"n=ln[(2^55)/n]/log(2)"

how did u get this statement?
why is there a ln and log? what base is log(2) ?

this method seems easier to understand than the other one, which i have never used that function before.

But i really appricate your help.
• Feb 19th 2007, 02:53 AM
chogo
that lambert w function is incredible
• Feb 19th 2007, 03:16 AM
CaptainBlack
Quote:

Originally Posted by tea217
"n=ln[(2^55)/n]/log(2)"

how did u get this statement?
why is there a ln and log? what base is log(2) ?

this method seems easier to understand than the other one, which i have never used that function before.

But i really appricate your help.

Typo, default base for log is e, so when I forget to type ln and type log
I usually mean log base e.

We have:

n 2^n = 2^53

which we may rewrite as:

n e^(n ln(2))=2^53

so:

e^(n ln(2))=(2^53)/n

Now taking logs (ln's) gives:

n ln(2)= ln((2^53)/n)

n= ln((2^53)/n)/ln(2)

The equation is reorganised in this manner so that formula iteration
will converge (with the obvious rearrangement iteration diverges)

RonL