Rules of Counting#
Combinatorics is the study of counting a systems that can be represented as a finite sets.
Without Replacement#
A system without replacement can be counted either with permutation or combination,
First Rule of Counting (Ordered Counting) This counting can be thought of as fixing the position of \(k\) slots where the first slot picks out of \(n\), the next slots now have \(n-1\) to choose from, and so on; this gives,
\[ |\text{ordered k out of n possible choices}| = (n)(n-1)\cdots(n-1+k)\]More commonly, this expression is called permutation $\( P(n,k) = \frac{n!}{(n-k)!} \)$
Second Rule of Counting (Unordered Counting) $\( C(n,k) = {n\choose k} = \frac{n!}{k!(n-k)!} \)$
With Replacement#
Say there are a set of length \(n\) and we wish to create subset of length \(k\)
Third Rule of Counting (Ordered)#
Fourth Rule of Counting (Unordered)#
Example#
Let’s say you want to invest into \(k\) stocks of the \(n\) companies. An outcome space can be generated out of the sequence of companies
Derangement#
A derangement set \(D\) of two sets \(A\) and \(B\) is,
The size of the deranged set depends on three characteristics:
Are the elements of \(D\) distinguishable
Are we sampling with or without replacement.
Are objects ordered or not.
We can solve for this recursion letting \(Q_n := D_n - nD_{n-1}\) and noticing \(Q_n = -Q_{n-1}\) thus \(Q_n = (-1)^{n}\) and then,