P is for Practical  
PerlMonks 
Getting Binomial Distribution under Math::Pari (log) and Combinatorial Methodby monkfan (Curate) 
on Mar 23, 2005 at 10:03 UTC ( #441728=perlquestion: print w/ replies, xml )  Need Help?? 
monkfan has asked for the
wisdom of the Perl Monks concerning the following question:
Hi,
I am attempting to compute a binomial distribution based on formulation here. Basically binomial distributions return the probability of an event occuring $k times. In $n attempts, where the probability of it occuring in a single attempt is $p. I tried two methods that should give the identical result. One subroutine using Math::Pari via its 'binomial' function plus logarithmic function and the other one using brute combinatorial method. In the end it's the logMath::Pari method which I intended to use, since it is able to handle large number. But however the result given by logMath::Pari function is different from the correct combinatorial Method. What's wrong with my logMath::Pari subroutine? It seems to me I have constructed log version mathematically in a right way. Or have I used the Math::Pari function wrongly?
Regards, Edward
Back to
Seekers of Perl Wisdom

