Combinatorics (Fall 2010)/Basic enumeration: Difference between revisions
imported>WikiSysop |
|||
Line 50: | Line 50: | ||
=== Subsets of fixed size === | === Subsets of fixed size === | ||
We then count the number of subsets of fixed size of a set. | We then count the number of subsets of fixed size of a set. Again, let <math>S=\{x_1,x_2,\ldots,x_n\}</math> be an <math>n</math>-set. We define <math>{S\choose k}</math> to be the set of all <math>k</math>-elements subsets (or '''<math>k</math>-subsets''') of <math>S</math>. Formally, <math>{S\choose k}=\{T\subseteq S\mid |T|=k\}</math>. The set <math>{S\choose k}</math> is sometimes called the '''<math>k</math>-uniform''' of <math>S</math>. | ||
We denote that <math>{n\choose k}=\left|{S\choose k}\right|</math>. The notation <math>{n\choose k}</math> is read "<math>n</math> choose <math>k</math>". | |||
{{Theorem|Theorem| | |||
:<math>{n\choose k}=\frac{n(n-1)\cdots(n-k+1)}{k(k-1)\cdots 1}=\frac{n!}{k!(n-k)!}</math>. | |||
}} | |||
{{Proof| | |||
The number of '''ordered''' <math>k</math>-subsets of an <math>n</math>-set is <math>n(n-1)\cdots(n-k+1)</math>. Every <math>k</math>-subset has <math>k!=k(k-1)\cdots1</math> ways to order it. | |||
}} | |||
;Some notations | |||
* <math>n!=n(n-1)(n-2)\cdots 1</math>, read "<math>n</math> factorial". A convention is that <math>0!=1</math>. | |||
* <math>n(n-1)\cdots(n-k+1)=\frac{n!}{(n-k)!}</math> is usually denoted as <math>(n)_k</math>, read "<math>n</math> lower factorial <math>k</math>". | |||
{{Theorem|Proposition| | |||
:<math>{n\choose k}={n\choose n-k}</math>. | |||
}} | |||
{{Proofbox| | |||
'''Proof 1 (numerical proof).''' | |||
:<math>{n\choose k}=\frac{n!}{k!(n-k)!}={n\choose n-k}</math>. | |||
}} | |||
{{Proofbox| | |||
'''Proof 2 (combinatorial proof).''' | |||
:Choosing <math>k</math> elements from an <math>n</math>-set is equivalent to choosing the <math>n-k</math> elements to leave out. Formally, every <math>k</math>-subset <math>T\in{S\choose k}</math> is uniquely specified by its complement <math>S\setminus T\in {S\choose n-k}</math>, and the same holds for <math>(n-k)</math>-subsets, thus we have a bijection between <math>{S\choose k}</math> and <math>{S\choose n-k}</math>. | |||
}} | |||
== Permutations and Partitions == | == Permutations and Partitions == |
Revision as of 06:52, 9 July 2010
Counting Problems
Functions and Tuples
Sets and Multisets
Subsets
We want to count the number of subsets of a set.
Let
We give a combinatorial proof that
The map
We know that
Since there is a bijection between
There are two elements of this proof:
- Find a 1-1 correspondence between subsets of an
-set and -bit vectors.
- An application of this in Computer Science is that we can use bit-array as a data structure for sets: any set defined over a universe
can be represented by an array of bits.
- The rule of bijection: if there is a 1-1 correspondence between two sets, then their cardinalities are the same.
Many counting problems are solved by establishing a bijection between the set to be counted and some easy-to-count set. This kind of proofs are usually called (non-rigorously) combinatorial proofs.
We give an alternative proof that
Lemma .
Proof. Fix an element
, let be the set of subsets of that contain and let be the set of subsets of that do not contain . It is obvious that and are disjoint (i.e. ) and , because any subset of either contains or does not contain but not both.We apply "the rule of sum": for any disjoint finite sets
and , the cardinality of the union .Therefore,
.
The next observation is that
, because is exactly the , and is the set resulting from add to every member of . Therefore, .
The elementary case
Subsets of fixed size
We then count the number of subsets of fixed size of a set. Again, let
We denote that
Theorem .
Proof. The number of ordered
-subsets of an -set is . Every -subset has ways to order it.
- Some notations
, read " factorial". A convention is that . is usually denoted as , read " lower factorial ".
Proposition .
Proof 1 (numerical proof).
.
Proof 2 (combinatorial proof).
- Choosing
elements from an -set is equivalent to choosing the elements to leave out. Formally, every -subset is uniquely specified by its complement , and the same holds for -subsets, thus we have a bijection between and .
- Choosing
Permutations and Partitions
The twelvfold way
Elements of |
Elements of |
Any |
Injective (1-1) |
Surjective (on-to) |
---|---|---|---|---|
distinguishable | distinguishable | |||
indistinguishable | distinguishable | |||
distinguishable | indistinguishable | |||
indistinguishable | indistinguishable |