Loading [MathJax]/jax/output/HTML-CSS/jax.js
Ask Your Question
0

Calculating very complex probability equation

asked 1 year ago

jacop gravatar image

I want to calculate the probability of following statement. It will be very close to 1 ,but I need to see how close it is. I could not calculate it using standart python, so I need very sensitive tool. I think that sage can handle it. However, I could not take proper solution. Maybe, i am missing something. (39×1096)!(39×109616×109)!×(39×1096)16×109

Preview: (hide)

Comments

@maxalekseyev, stirling formula is good for factorial, but sage could not calculate the exponential expression in the denominator. If you can calculate them,can you please share your code with me ?

jacop gravatar imagejacop ( 1 year ago )

You don't need to calculate it explicitly to get an estimation. It sounds more like a homework pen-and-paper problem than a computational one.

Max Alekseyev gravatar imageMax Alekseyev ( 1 year ago )

it is pen and paper problem with mandatory computation

jacop gravatar imagejacop ( 1 year ago )

1 Answer

Sort by » oldest newest most voted
2

answered 1 year ago

dan_fulea gravatar image

The first rule of a computer algebra system is that the human must go humaly as far as possible, the program a humanly meaningful path and result. In our case...


Let N be the number 391096, and let k be the number 16109. You want to calculate: A=N(N1)(N2)(Nk+1)NNNN=1(11N)(12N)(1k1N) . We can try to estimate and approximate. For instance, the product is between 1 and (1kn)k, and for the last power use Bernoulli in order to not use the computer. So a lower bound is 1k2N.

But we can do better: log(1x)=x+12x2+13x3+14x4+ so that it is for values of x in our range, |x|k/N, between x and x+x2. (We may want to refine later, if this does not work.) Then: exx2(1x)ex . So our product is between the following numbers: A0:=exp1j<kjN+j2N2=exp(1Nk(k1)1N2k(k1)(2k1)) ,A1:=exp1j<kjN=exp(1Nk(k1)) . It is time to use the computer:

k, N = 16. * 10^9, 39. * 10^96
A1 = exp( -k*(k-1)/N )
A0 = A1 * exp( -k*(k-1)*(2*k-1) / N^2 )
print(f"A0 = {A0}")
print(f"A1 = {A1}")

And we get of course:

A0 = 1.00000000000000
A1 = 1.00000000000000

Because A1 is in fact the exponential of the tiny number

sage: -k*(k-1)/N
-6.56410256369231e-78

and in order to also have A0 we need the contribution of the tiny-tiny number...

sage: -k*(k-1)*(2*k-1)/N^2
-5.38593030850230e-165
Preview: (hide)
link

Comments

Using numerical computations with 100 decimals precision in GP/Pari one can check that the product A is equal

0.9999999999999999999999999999999999999999999999999999999999999999999999999999967179487158974358974359
achrzesz gravatar imageachrzesz ( 1 year ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 1 year ago

Seen: 285 times

Last updated: Nov 20 '23