Introduction to combinatorics (CSCI 2824, Spring 2015)In this lecture we start the chapter on combinatoics, the art of counting discrete objects. This page covers the following topics:
(Sections 5.1, 5.2 of the textbook) Recap: Four different structure types in combinatoricsAs we saw in the last lecture,
when we talk about counting the number of combinations
of elements from a set
These two features defines four different basic discrete structures relevant to combinatorics:
Case study: drawing two numbers from
Today, we consider the following situation: suppose we have a set
Category 1: Ordered listsIf we draw two integers from This question concerns the number of distinct length-2 ordered lists whose entries are drawn from
So the answer is simply the cardinality of the set Category 2: Unordered listsIf we draw two integers from This question concerns the number of distinct length-2 unordered lists whose entries are drawn from
So the answer is given by the cardinality of this set, which is
Category 3: PermutationIf we draw two integers from This question concerns the number of permutations of 2 objects from
So the answer is given by Category 4: SetsIf we draw two inregers from This question concerns the number of size-2 subsets of
which has Basic Rules for CountingIn this section, we mention some basic rules for counting, via set intersection/union. These rules look simple, but knowing how to apply them in practice can be really tricky! The product ruleProduct rule
If More generally, given any sets
Example 1We have 3 tee shirts with colors { red, green, blue } and 2 caps with labels {A,B}. How many possible ways are there of choosing a tee shirt and a cap? Example 2Let us say that in a tournament teams A, B and C play matches against each other in a round robin. How many matches are played? How many possible outcomes are there for the tournament? Solution To count matches is easy, we know that there are three matches to be played M1: A vs. B, M2: A vs. C and M3: B vs. C. Each match has two outcomes. Winner1 = {A,B}, Winner2 = {A,C}, Winner3 = {B,C}. Therefore, applying the product rule are 2 2 2 = 8 outcomes overall. The sum ruleSum rule
If Example 3We are allowed to make up a positive integer from the digits {1,3,5,7}. Each digit is to be used at most once (we may decide to skip a digit).
Question: How many numbers can we make? Solution: We split the problem into 4 disjoint counts: count all one digit numbers, two digit numbers, three digit and four digit numbers that can be formed. Together, using the rule of sums, we can simply add these counts and get the required overall count.
Adding them up we have Inclusion-exclusion principleWe have seen the formula for counting the elements in Inclusion-exclusion principle
For any sets
Example 4How many bit strings of length 10 either begin with three 1's or end with two 0's? Rule of ComplementsRule of complements
Let Example 5How many odd numbers are there between Solution First let us just count the even numbers
There are a total of Therefore, odd number count is Example 6Let us say we toss a coin ten times. Each time we toss, we get a head or a tail.
|