[ Prev ] [ Index ] [ Next ]

Probability Functions

Created Saturday 15 August 2020

Probability functions:

PROB='define fact(n) { p=1; while( n>1 ) { p*=n; n-=1 }; return p }
define perm(m,n) { return fact(m)/fact(m-n) }
define comb(m,n) { return perm(m,n)/fact(n) }'

echo $PROB'perm(10,4)' | bc