You are on page 1of 4

CS 171

Lecture Outline
February 15, 2010

Example 1. Prove that


       
n n n n
− + − . . . + (−1)n =0
0 1 2 n

Solution. One way to solve this problem is by substituting x = −1 in the previous


example. When x = −1 the above equation becomes
n  
n
X n
0 =0= (−1)k .
k
k=0

A combinatorial argument however will give us more insight into what the expression means.
We now present a combinatorial proof of the claim. We want to prove that
           
n n n n n n
+ + + ... = + + + ...
0 2 4 1 3 5

Consider a set X = {x1 , x2 , x3 , . . . , xn }. We want to show that the total number of subsets
of X that have even size equals the total number of subsets of X that have odd size. We
will now show that both these quantities equal 2n−1 from which the claim follows.
An even-sized subset of X can be constructed as follows.

Step 1. Decide whether x1 belongs to the subset of not.


Step 2. Decide whether x2 belongs to the subset of not.
..
.
Step n. Decide whether xn belongs to the subset of not.

Note that there are 2 choices for each of the first n − 1 steps but exactly one choice for
performing step n. This is because if we have choose an even number of elements from
X \ {xn } then we must leave out xn otherwise we must include xn in the subset. Hence
using the multiplication rule the total number of even-sized subsets of X equals 2n−1 . Since
we know that the total number of subsets of X is 2n , the total number of odd-sized subsets
of X is 2n − 2n−1 = 2n−1 .
Before we move on to the next topic we will prove a couple of identities using counting
techniques. Specifically, we will use the following technique. To prove an identity we will
pose a counting question. We will then answer the question in two ways, one answer will
correspond to LHS and the other would correspond to the RHS.
Pn n
Example 2. Prove that k=0 k = 2n .
2 Lecture Outline February 15, 2010

Solution. We pose the following counting question.

Given a set S of n distinct elements how many subsets are there of the set S?

From Lecture 2 (Example 1) we know that the answer is 2n . This gives us the RHS.

Another way to compute the answer to the question is as follows. The set P (S) of all
possible subsets can be partitioned into S0 , S1 , . . . , Sn , where Si , 0 ≤ i ≤ n, is the set of all
subsets of S that have cardinality i. Thus

|P (S)| = |S0 | + |S1 | + . . . + |Sn |


     
n n n
= + + ... +
0 1 n
n
X n  
= = LHS
k
k=0

This proves the claim.


Pn n(n+1)
Example 3. Prove that k=1 k = 2 .

Solution. We pose the following counting question.

How many ways are there to choose two numbers from S = {0, 1, 2, . . . , n}?
 n(n+1)
By definition, there are n+1
2 = 2 distinct pairs of S. This gives us the RHS.

We can also compute the answer as follows. Let P be the set of all pairs of S. P can be
partitioned into S1 , S2 , . . . , Sn , where Si , 1 ≤ i ≤ n, is the set of pairs in which i is the
bigger element in the pair. Clearly,

|P | = |S1 | + |S2 | + . . . + |Sn |


= 1 + 2 + ... + n
Xn
= k = LHS
k=1

This proves the claim.

Functions
Definition. Let A and B be sets. A function f is a mapping from A to B such that each
element in A is mapped to exactly one element in B. We write f (x) = y where y ∈ B is
the unique element that a ∈ A is mapped to. We denote such a function by f : A → B.

Definition. Given a function f : A → B, A is called the domain of f and B is called the


co-domain of f . If f (x) = y then y is called the image of x and x is called the preimage of
February 15, 2010 Lecture Outline 3

y. The range of f is the set of all images of elements in A.

Definition. A function f is a one-to-one function if f (x) = f (y) implies x = y. For exam-


ple, the function f (x) = x2 from the set of integers to the set of integers is not one-to-one
because f (x1 ) = f (x2 ) when x1 = −2 and x2 = 2, however x1 6= x2 . On the other hand the
function f : R → R, defined by the rule f (x) = 4x − 1, for all real numbers x, is one-to-one.

Definition. A function f is a onto function if its range equals its co-domain. For example,
the function f (x) = x + 1 from the set of integers to the set of integers is an onto function.

Definition. A function f is a one-to-one correspondence, if it is both one-to-one and onto.

Definition. Let f be a one-to-one correspondence from the set A to the set B. The inverse
function of f is the function that assigns to an element b belonging to B the unique element
a in A such that f (a) = b. The inverse function of f is denoted by f −1 . Hence, f −1 (b) = a
when f (a) = b.

The Pigeonhole Principle


If k + 1 or more objects are distributed among k bins then there is at least one bin that has
two or more objects. For example, the pigeon hole principle can be used to conclude that
in any group of thirteen people there are at least two who are born in the same month.

Example 4. There are n pairs of socks. How many socks must you pick without looking
to ensure that you have at least one matches pair?

Solution. The pigeonhole principle can be applied by letting n bins correspond to the n
pairs of socks. If we select n + 1 socks and put each one in the box corresponding to the
pair it belongs to then there must be at least one box containing a matched pair.

The Generalized Pigeonhole Principle


If n objects are placed into k boxes, then there is at least one box containing at least ⌈n/k⌉
objects.

Proof: Assume otherwise, i.e., each box contains at most ⌈n/k⌉ − 1 objects. Then, the
total number of objects is at most
l n m  n 
k −1 <k +1−1 =n
k k
This is a contradiction as there are n objects.
4 Lecture Outline February 15, 2010

Using the generalized pigeonhole principle we can conclude that among 100 people, there
are at least ⌈100/12⌉ = 9 who are born in the same month.

Example 5. Suppose each point in the plane is colored either red or blue. Show that
there always exist two points of the same color that are exactly one feet apart.

Solution. Consider an equilateral triangle with the length of each side being one feet.
The three corners of the triangle are colored red or blue. By pigeonhole principle, two of
these three points must have the same color.

You might also like