Ruud H.G. van Tol on Mon, 28 Nov 2022 13:00:02 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: binomial() challenge (+thanks)



On 2022-11-26 19:09, Bill Allombert wrote:
On Sat, Nov 26, 2022 at 01:17:28PM +0100, Ruud H.G. van Tol wrote:

PARI binomial() challenge:

binom_1(n,k) = gamma(n+1) / gamma(k+1) / gamma(n-k+1)
binom_2(n,k) = exp(lngamma(n+1) - lngamma(k+1) - lngamma(n-k+1))
Ah! You had a one-time-in-a-life opportunity to use the factorial() function
and you blew it!
Heheh, I use factorials all the time,
for stuff like this:
https://en.wikipedia.org/wiki/Factorial_number_system

-- Ruud