home
history
links from
printable
login


Combinatorial Functions Webb  all rights reserved  ©2004

Author: Peter Koves
Download: Yeq1_Comb.PDB
A set of equations to compute basic combinatorial functions. The following functions are defined (the normal notation for functions with repetitions uses overbar, however HTML does not have that capability. Hence underbar is used instead):
n! The factorial of n.
P_{n} Permutations of n objects.
P(n_{1}, ... ,n_{k}) Permutations of n_{1} + ... + n_{k} objects such that there are n_{i} objects of type i.
V_{n}^{k} Variations of k objects selected from n objects without repetitions.
V_{n}^{k} Variations of k objects selected from n objects with repetitions.
C_{n}^{k} Combinations of k objects selected from n objects without repetitions.
Also called the binomial coefficient.
C_{n}^{k} Combinations of k objects selected from n objects with repetitions.
D_{n} Subfactorial. Orderings of n objects such that none stay in place.
D_{n,r} Subfactorial. Orderings of n objects such that exactly r stay in place.
The following are the actual functions defined:
_prod(n,k,p) = again(n>=k,p,n1,k,np)
Computes the product n(n1)...k
_eser(n,i,r,s) = again(n>=i,r,n,i+1,r+s/!(i),s)
Computes 1  1/1! + 1/2!  ... +(1)^{n}(1/n!).
The limiting sum of this series is 1/e; hence the name.
!(n) = _prod(n,1,1)
P(n) = !(n)
V(n,k) = _prod(n,nk+1,1)
Vr(n,k) = n^k
C(n,k) = V(n,k)/P(k)
Cr(n,k) = C(n+k1,k)
D(n) = !(n)_eser(n,1,1,1)
Dr(n,r) = C(n,r)D(nr)
Pr2(n1,n2) = !(n1+n2)/(!(n1)!(n2))
Pr3(n1,n2,n3) = !(n1+n2+n3)/(!(n1)!(n2)!(n3))
Pr4(n1,n2,n3,n4) = !(n1+n2+n3+n4)/(!(n1)!(n2)!(n3)!(n4))
Implementations of P(n_{1}, ... ,n_{k}) for k=2,3,4.
To be replaced by a single fuction when Equate provides variable number of arguments.
Back to Equations

