I'm trying to calculate entropies for an absolutely giant system by counting states, and this means I have to use some obscenely large numbers. I'm running
Nn = 5*10^20
- 1.381 * 10^-23 Log[Multinomial[Nn/3, Nn/3, Nn/3]]
and (of COURSE) it comes out to an obscenely large number. Honestly, I would be alright with just the order of magnitude without having to do each factorial estimation separately by hand... Are there any little tricks to getting around this Overflow[]
? I'm sure Mathematica has some workarounds for avoiding machine precision errors.... there's no way this number is eating all my 8 gigs of ram.
For reference, the output of $MaxNumber
is 1.605216761933662*10^1355718576299609
.
LogGamma[1 + Nn] - 3 LogGamma[1 + Nn/3]
is quite huge ($\approx 5.5\times 10^{20}$); no wonder you're hitting overflow when it's the exponent. $\endgroup$Log[Multinomial[Nn/3, Nn/3, Nn/3]]
;LogGamma[]
is often the thing to use in situations like yours. $\endgroup$