EXAMPLES for Combinatorics
------------------------------
COMBINATION
-------------
values: n,k :
= sum of groups consisting of k-number of elements in
a set of n-number of elements
where the order of elements is not considered ;
each element in a group is unique, does not recur
Formula:
n!
C(n,k) = -----------
(n-k)!k!
Examples:
1. elements A,B,C (n=3) in couples (k=2)
n=3, k=2, C(n,k)=3
AB
BC
AC
2. elements A,B,C,D (n=4) in trios (k=3)
n=4, k=3, C(n,k)=4
ABC
ABD
BCA
BCD
3. elements A,B,C,D,E (n=5) in groups of 5 (k=5)
n=5, k=5, C(n,k)=1
ABCDE
There are no other possible combinations because the order of elements
in a group is neglected, so these listings are complete ;
the combinations of AB and BA are identical,
so expressed only once as AB.
VARIATION
-----------
values: n,k :
= sum of groups consisting of k-number of elements in
a set of n-number of elements
where the order of elements is considered ;
each element in a group is unique, does not recur
Formula:
n!
V(n,k) = -----------
(n-k)!
Examples:
1. elements A,B,C (n=3) in couples (k=2)
n=3, k=2, V(n,k)=6
AB BA
BC CB
AC CA
2. elements A,B,C,D (n=4) in trios (k=3)
n=4, k=3, V(n,k)=24
ABC ACB ABD ADB ACD ADC
BAC BCA BAD BDA BCD BDC
CAB CBA CAD CDA CBD CDB
DAB DBA DAC DCA DBC DCB
3. elements A,B,C,D (n=4) in couples (k=2)
n=4, k=2, V(n,k)=12
AB AC AD
BA BC BD
CA CB CD
DA DB DC
Notice that the order of elements in a group is considered ;
the variations of AB and BA are not identical.
PERMUTATION
-------------
value: n :
= sum of groups consisting of n-number of elements in
a set of n-number of elements
where the order of elements is considered ;
each element in a group is unique, does not recur ;
= equivalent to operation of variation if n=k
Formula:
P(n) = n!
Examples:
1. elements A,B (n=2)
n=2, P(n)=2 (the same as )
2. elements A,B,C (n=3)
n=3, P(n)=6 (the same as variations where n=3, k=3)
ABC ACB
BAC BCA
CAB CBA
3. elements A,B,C,D (n=4)
n=4, P(n)=24 (the same as variations where n=4, k=4)
ABCD ABDC ACBD ACDB ADBC ADCB
BACD BADC BCAD BCDA BDAC BDCA
CABD CADB CBAD CBDA CDAB CDBA
DABC DACB DBAC DBCA DCAB DCBA
VARIATION WITH RECURRENCE
---------------------------
values: n,k :
= sum of groups consisting of k-number of elements in
a set of n-number of elements
where the order of elements is considered ;
elements can recur in a group
Formula:
k
Vr(n,k) = n
(k-power of n)
Examples:
1. elements A,B (n=2) in couples (k=2)
n=2, k=2, Vr(n,k)=4
AA AB
BA BB
2. elements A,B,C (n=3) in couples (k=2)
n=3, k=2, Vr(n,k)=9
AA AB AC
BA BB BC
CA CB CC
3. elements A,B,C (n=3) in trios (k=3)
n=3, k=3, Vr(n,k)=27
AAA AAB AAC
ABA ABB ABC
ACA ACB ACC
BAA BAB BAC
BBA BBB BBC
BCA BCB BCC
CAA CAB CAC
CBA CBB CBC
CCA CCB CCC
PERMUTATION WITH RECURRENCE
---------------------------
values: n,r :
= sum of groups consisting of n-number of elements in
a set of n-number of elements
where the order of elements is considered ;
each element in a group is unique, does not recur ;
elements in the total set (not in a group) can occur r-times,
it means r-number of elements are identical
Formula:
n!
Pr(n,r) = ----
r!
Examples:
1. elements A,A (n=2) - two are identical (r=2)
n=2, r=2, Pr(n,r)=1
AA
2. elements A,A,B (n=3) - two are identical (r=2)
n=3, r=2, Pr(n,r)=3
AAB ABA BAA
3. elements A,A,A,B (n=4) - three are identical (r=3)
n=4, r=3, Pr(n,r)=4
AAAB AABA
ABAA BAAA
---------------------------------------------------
-- RETURN --