You are on page 1of 20

:

Discrete Mathematical Structures


Cs173 - Spring 2004
CS 173
Announcements

Homework 8 available. Due 03/26, 8a.
Exam 2, Apr 4, 7-9p, Loomis 141. Email Cinda
with conflicts.
Todays lecture covers material from Rosen,
sections 4.4-4.5.
Cs173 - Spring 2004
CS 173
Binomial Coefficients
(a + b)
2
= a
2
+ 2ab + b
2

(a + b)
3
= a
3
+ 3ab
2
+ 3a
2
b + b
3
(a + b)
4
= a
4
+ 4ab
3
+ 6a
2
b
2
+ 4a
3
b + b
4
Why am I showing
this to you?
1. Beautiful patterns
2. Recursive defn
3. New type of proof
4. Applications in more
complex counting
techniques
Cs173 - Spring 2004
CS 173
Binomial Coefficients
(a + b)
2
= a
2
+ 2ab + b
2

(a + b)
3
= a
3
+ 3a
2
b + 3ab
2
+ b
3
(a + b)
4
= a
4
+ 4a
3
b + 6a
2
b
2
+ 4ab
3
+ b
4
What is coefficient
of a
9
b
3
in (a + b)
12
?
A. 36
B. 220
C. 15
D. 6
E. No clue
Cs173 - Spring 2004
CS 173
Binomial Coefficients
(a + b)
4
= (a + b)(a + b)(a + b)(a + b)
= a
4


4
0
|
\

|
.
|
+ a
3
b



4
1
|
\

|
.
|
+ a
2
b
2


4
2
|
\

|
.
|
+ ab
3


4
3
|
\

|
.
|
+ b
4


4
4
|
\

|
.
|
Binomial Theorem: Let x and y be variables, and let
n be any nonnegative integer. Then


(x + y)
n
=
n
j
|
\

|
.
|
j =0
n

x
nj
y
j
Cs173 - Spring 2004
Binomial Theorem: Let x and y be variables, and let
n be any nonnegative integer. Then


(x + y)
n
=
n
j
|
\

|
.
|
j =0
n

x
nj
y
j
CS 173
Binomial Coefficients
What is the coefficient of a
8
b
9
in the expansion of (3a +2b)
17
?
What is n?
17
What is j?
9
What is x?
3a
What is y?
2b

17
9
|
\

|
.
|
(3a)
8
(2b)
9
=
17
9
|
\

|
.
|
3
8
2
9
a
8
b
9
Cs173 - Spring 2004
CS 173
Binomial Coefficients
(a + b)
4
= (a + b)(a + b)(a + b)(a + b)
= a
4


4
0
|
\

|
.
|
+ a
3
b



4
1
|
\

|
.
|
+ a
2
b
2


4
2
|
\

|
.
|
+ ab
3


4
3
|
\

|
.
|
+ b
4


4
4
|
\

|
.
|
A.
10
C
6

B.
9
C
4

C.
9
C
5

D.
8
C
4
+
8
C
5

E. No clue
Cs173 - Spring 2004


(x + y)
n
=
n
j
|
\

|
.
|
j =0
n

x
nj
y
j
CS 173
Binomial Coefficients
Sum each row of Pascals Triangle:
Powers of 2
Two proofs that


n
j
|
\

|
.
|
j =0
n

= 2
n
Suppose you have a set of
size n. How many
subsets does it have?
2
n

How many subsets of size 0
does it have?
n
C
0

How many subsets of size 1
does it have?
n
C
1

How many subsets of size 2
does it have?
n
C
2

Count all subsets in this way, and we have the result!
Cs173 - Spring 2004


(x + y)
n
=
n
j
|
\

|
.
|
j =0
n

x
nj
y
j
CS 173
Binomial Coefficients
Sum each row of Pascals Triangle:
Powers of 2
Two proofs that


n
j
|
\

|
.
|
j =0
n

= 2
n
Let x=1 and y=1 in Binomial
Theorem.
Done


n
j
|
\

|
.
|
j =0
n

1
nj
1
j
= (1 +1)
n


n
j
|
\

|
.
|
j =0
n

= 2
n
Cs173 - Spring 2004
CS 173
Pascals Identity
A relationship between the entries in Pascals .
Suppose T is a set, |T|=n. Let
a be an element in T, and let
S = T - {a}. Lets count the
n
C
j
subsets of size j. Note
that some of these contain
a, and some dont.
How many contain a?
How many dont?


n
j
|
\

|
.
|
=
n-1
C
j-1


n -1
j -1
|
\

|
.
|
+
n -1
j
|
\

|
.
|
n-1
C
j
Cs173 - Spring 2004
CS 173
Vandermondes Identity
Let m, n, and r be nonnegative integers with r not
exceeding either m or n. Then
A
m items



m+n
r
|
\

|
.
|
=
m
r- j
|
\

|
.
|
n
j
|
\

|
.
|
j=0
r

B
n items
To choose r items,
take some from A
and some from B.
All possible ways
of doing this gives
the result.
This is an example

of
a combinatorial
proof. We
describe the
set counted by
the LHS and
RHS of the eqn,
and argue that
they count the
same thing.
Look in Rosen.
Cs173 - Spring 2004
CS 173
Combinations with repetition
Suppose you want to buy 5 bags of chips from the
3 kinds you like at Meijer. In how many
different ways can you stock up?
Out of 7 items, we
are choosing 2 to
be bars.
From that, and our
understanding of
the model, we can
report the answer.



7
2
|
\

|
.
|
=
7
5
|
\

|
.
|
Cs173 - Spring 2004
CS 173
Combinations with repetition
There are
n+r-1
C
r
, r-sized combinations from a set
of n elements when repetition is allowed.
Example: How many solutions are there to the equation


When the variables are nonnegative integers?



x
1
+x
2
+x
3
+x
4
=10


1+3+ 6+ 0 =10
13
C
3
Cs173 - Spring 2004
CS 173
Permutations with indistinguishable objects
How many different strings can be made from the
letters in the word rat?
6
How many different strings can be made from the
letters in the word egg?
3
Cs173 - Spring 2004
CS 173
Permutations with indistinguishable objects
How many different strings can be made from the
letters in the phrase nano-nano?
Key thoughts: 8 positions, 3 kinds of letters to place.
In how many ways can we place the ns?
8
C
4
, now 4 spots are left
In how many ways can we place the as?
4
C
2
, now 2 spots are left
In how many ways can we place the os?
2
C
2
, now 0 spots are left

8
4
|
\

|
.
|
4
2
|
\

|
.
|
2
2
|
\

|
.
|
=
8!
4!4!

4!
2!2!

2!
2!0!
=
8!
4!2!2!
Cs173 - Spring 2004
CS 173
Permutations with indistinguishable objects
How many distinct permutations are there of the
letters in the word APALACHICOLA?


12!
4!2!2!
How many if the two Ls must appear together?


11!
4!2!
How many if the first letter must be an A?


11!
3!2!2!
Cs173 - Spring 2004
CS 173
A little practice
A turtle begins at the upper left corner of an n x m
grid and meanders to the lower right corner.
How many routes could she take if she only moves
right and down?
Cs173 - Spring 2004
CS 173
A little practice
A turtle begins at the upper left corner of a m x n
grid and meanders to the lower right corner.
How many routes could she take if she only moves
right and down, and if she must pass through the
dot at point (a,b)?


a +b
a
|
\

|
.
|

m- a +n -b
m- a
|
\

|
.
|
Cs173 - Spring 2004
CS 173
A little practice
In how many ways can 11 identical computer science
books and 8 identical psychology books be
distributed among 5 students?
Hint: forget about the psychology books for the moment.
Hint: how can you combine your soln for the CS books with
your soln for the Psych books?


15
11
|
\

|
.
|

12
8
|
\

|
.
|
Cs173 - Spring 2004
CS 173
A little practice
In an RNA chain of 20 bases, there are 4 As, 5 Us,
6 Gs, and 5Cs. If the chain begins either AC or
UG, how many such chains are there?
Let A denote the set of chains beginning with AC, and U
denote the set of chains beginning with UG. Count them
separately, and then sum.
First find |A|: 18 bases, 3 As, 5 Us, 6 Gs, and 4Cs.
(This is like the MISSISSIPPI problem.)
|A| = 18!/(3!5!6!4!)

You might also like