From: rconn

Sent: Monday, June 16, 2008 9:58 AM

Subject: RE: [Support-t-192] Re: Overflow?

> > Permutations and combinations of the number of subatomic particles in

> > the universe?

>

> Nope, still got that covered. 10^10000 is a REALLY big number ...

Actually I don't think you have got it covered. A conservative estimate of

the number of particles in the universe is 10^80. To count all of the

possible permutations of all of the subatomic particles in the universe, you

need to be able to store (10^80)! numerically. This is a REALLY, REALLY,

REALLY big number!

Stirling's approximation:

N! ~= sqrt(2 pi N) * (N/e)^N

N in this case is 10^80 -- 1 followed by 80 zeroes. Putting this into the

formula yields:

sqrt(2 pi 10^80) * (10^80 / e) ^ 10^80

The first factor breaks down to sqrt(2 pi) * sqrt(10^80), which is 10^40 *

sqrt(2 pi). The second factor takes a number marginally under 10^80 and puts

it to the power of 10^80. The exact base being exponentiated can be

determined as follows:

ln(10^80 / e)

10^80 / e = e

(ln(10^80) - ln(e))

= e

(184.2068 - 1)

= e

183.2068

= e

183.2068 / ln(10)

= 10

79.5657

= 10

This leaves us with:

_ _ 10^80

| 79.5657 | (79.5657 * 10^80)

| 10 | = 10

|_ _|

7.95657 * 10^81

= 10

This number is slightly less than 1 followed by (10^81 + 8) zeroes. There is

no way you could store this in a variable with room for 1 followed by 10,000

zeroes. 10^81 is significantly larger than 10^4. :-)

Jonathan Gilbert_

\\\ / / / \ |_) |_/

\\\/ \/ \__/ | \ | \

Software Systems