CoWeb

find:
goto:
home

history
links from
printable

login
















Combinatorial Functions
Webb - all rights reserved - ©2004
spacer
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.
Pn                  Permutations of n objects.
P(n1, ... ,nk)  Permutations of n1 + ... + nk objects such that there are ni objects of type i.
Vnk                Variations of k objects selected from n objects without repetitions.
Vnk                Variations of k objects selected from n objects with repetitions.
Cnk                Combinations of k objects selected from n objects without repetitions.
                      Also called the binomial coefficient.
Cnk                Combinations of k objects selected from n objects with repetitions.
Dn                 Subfactorial. Orderings of n objects such that none stay in place.
Dn,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,n-1,k,np)
          Computes the product n(n-1)...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,n-k+1,1)

Vr(n,k) = n^k

C(n,k) = V(n,k)/P(k)

Cr(n,k) = C(n+k-1,k)

D(n) = !(n)_eser(n,1,1,-1)

Dr(n,r) = C(n,r)D(n-r)

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(n1, ... ,nk) for k=2,3,4.
          To be replaced by a single fuction when Equate provides variable number of arguments.

Back to Equations

0.0004 secs

top of page

Webb - all rights reserved - ©2004
powered by Spinneret 0.10