chapter 6 counting arguments. the pigeonhole principle: pigeonhole principle: let k be a positive...
DESCRIPTION
Example: Joe needs to get up at 4am each morning to go to work. He needs to get a pair of matching socks from his drawer without turning on the light and disturbing his wife. He knows that there are socks of three different colours, unpaired and randomly distributed, in the drawer. How many socks should he grab so that he can be sure to have a pair of the same colours? Counting ArgumentsTRANSCRIPT
Chapter 6
Counting Arguments
The Pigeonhole Principle: Pigeonhole principle: let k be a
positive integer. Imagine that you are delivering k+1 letters to k mailboxes. Then it must be that some mailbox will receive two letters.
Counting Arguments
Example: Joe needs to get up at 4am each morning
to go to work. He needs to get a pair of matching socks from his drawer without turning on the light and disturbing his wife. He knows that there are socks of three different colours, unpaired and randomly distributed, in the drawer. How many socks should he grab so that he can be sure to have a pair of the same colours?
Counting Arguments
Solution: Call the sock colours red, green, and
yellow. If Joe grabs three socks then one could be red, one could be green, and one could be yellow. So that will not do.
The answer is that Joe should grab four socks (by the pigeonhole principle)
Counting Arguments
Example: Suppose that a standard dartboard
has radius 10 inches. We throw seven darts at the dartboard. Why is it true that two of the darts will be distance at most 10 inches apart?
Counting Arguments
Solution: Examine the dartboard divided into
six regions. But there are seven darts. By the pigeonhole principle, two of the darts must land in same region
Counting Arguments
Orders and Permutations: Suppose that we have n objects, in
how many different orders can they be presented?
a1, a2, a3,…, an
Counting Arguments
Example: Take n to be 3, in how many
different orders can we present these objects?
Look at the first position. We can put any of the n objects in that first position, so there are n possibilities for the first position. Next go to the second position.
Counting Arguments
A B C, A C B, B A C, B C A, C A B, C B A For the second position one object is used
up, so there are n-1 objects remaining. Any one of those n-1 objects can go into the second position. Now examine the third position.
There are n-2 can objects remaining ( since two of them are used up). So any of those n-2 can be in the third position. And so forth
Counting Arguments
To count the total number of possible ordering, we multiply together all these counts:
Number of permutation of n objects= n.(n-1).(n-2)….3.2.1 This expression is called n factorial,
and is written n!.
Counting Arguments
Example: In how many different ways can we
order five objects? Solution: The number of permutations of
five objects is 5!=5.4.3.2.1=120 There are 120 different
permutations of 5 objects.
Counting Arguments
Choosing and the Binomial Coefficients: Suppose that you have n objects and you
are going to choose k of them (0≤k≤n). In how many different ways can you do this?
Just to illustrate the idea, take n=3 and k=2. For convenience we have labelled the objects, A , B, C. The different ways that we can choose two from the three are:
{A,B}, {A,C}, {B,C}
Counting Arguments
Counting Arguments This is a very common expression
in mathematics, and we give it the name n choose k. We denote this quantity by
nk
nn k k
!
( ) ! !
Counting Arguments Example: In how many different ways can we
choose two objects from among five? Solution:
In fact if the five objects are a, b, c. d. and e then the five possible choices of two are: {a,b}, {a,c}, {a,d}, {a,e}, {b,c}, {b,d}, {b,e}, {c,d}, {c,e}, {d,e}.
52
55 2 2
1206 2
10
!( ) ! !
Counting Arguments Example: How many different 5-card poker
hands are there in a standard 52-card deck of cards?
Solution: The answer is
525
5252 5
2 598 960
!( ) !5!
, ,
Counting Arguments Other Counting Arguments: Mathematical summation
notation
a b cjj
n
jj
n
jj
, ,
1 5 1
Example: Draw a planar grid that is 31
squares wide and 17 squares high. How many different nontrivial (widths and height are positive) rectangles can be drawn, using the lines of the grid to determine the boundaries?
Counting Arguments
Counting Arguments Solution: The total of rectangles are
31X17=527 We can say
S j k
S j k
S j k jk
S
kj
j k
j k
( ) ( )
( ) ( )
( )
31 17
31 17
527 17 31
75888
0
16
0
30
0
30
0
16
0
30
0
16
Counting Arguments Geometric Sum:
1 3 3 3 3
1 12
12
12
2 3 10
2 3
. . .
( ) ( ) ( ) . . .
Counting Arguments Example: Let λ be a real number and k a
positive integer. Calculate the sum of the geometric
S k 1 2 . . .
Counting Arguments Solution:
S
S S
S
S
k
k
k
k k
2 3 1
1
1
1 1
1
1 1
11
11
. . .
( )
Counting Arguments So S
S
1 13
13
13
13
1
13
1
321 1
3
2 100
101
101
( ) ( ) . . . ( )
( )
( )( [ ] )
Counting Arguments Also
j
j
j
j
E xam ple
11
1 12
12
12
12
1
1 12
2
0
2 3
0
:
. . . .
Generating Functions Powerful technique of generating
functions. Example: Fibonacci sequence
1,1,2,3,5,8,13,21,34,55,…
a a a a a j
j j
1 2 3 41 1 2 3
1 52
1 52
5
, , , , . . . . ,
Solution: We shall use the method of
generating function, a powerful technique that is used throughout the mathematical sciences.
Generating Functions
Generating FunctionsF x a a x a x
xF x a x a x a x
x F x a x a x a x
F x xF x x F x a a a x
a a a x
x x F x F xx x
( ) . . .
( ) . . .
( ) . . .
( ) ( ) ( ) ( )
( ) . . .
( ) ( ) ( )( )
1 2 32
1 22
33
21
22
33
4
21 2 1
3 2 12
221 1 1
1
Generating Functions
F xx x
F xx x
( )
( )
1
1 21 5
1 21 5
5 510
1
1 21 5
5 510
1
1 21 5
Generating Functions
j
j
j
jj
j
j
jj
j
x so x
F x x x
0
00
00
11
21 5
21 5
5 510
21 5
5 510
21 5
( )
Generating Functions
F x x x
F x x
a x
j
jj
j
j j
j
j
jj
j
j j
( )
( )
5 510
21 5
5 510
21 5
5 510
21 5
5 510
21 5
5 510
21 5
5 510
21 5
00
0
0
x
or
a
j
j
j j1 52
1 52
5
A Few Words About Recursion Relations The sequences is list never stops. It is
frequently the case that we will have a rule that tells us the value of the jth element of the list in terms of some of the previous elements. This situation is called a recursion. The method of generating functions can sometimes be used to good effect to solve recursions.
Generating Functions
Generating Functions Example: A sequence is defined by the
rule
Use the method of generating functions to find a formula for
a a a a aj j j0 1 1 24 1 2 , , . . . . ,
a j
Generating Functions
a a
F x xF x x F x
F x xF x x F x a a a x
F x xx x
xx x
2 3
2
20 1 0
2
9 11
24 3
1 24 3
2 1 1
,
( ) , ( ) , ( )
( ) ( ) ( ) ( )
( )( )( )
Generating FunctionsF x
x x
F xx x
F x x x
F x x
j
j
j
j
j
j
j
( ) ( ) ( )
( ) ( ) ( )
( ) ( )
( ) ( )
53
12 1
73
11
53
11 2
73
11
53
2 73
53
2 73
0 0
0
Generating Functions This is the solution to our
recursion problem
F x a x
a
jj
j
jj
( )
( )
0
53
2 73
Generating Functions Use the method of generating
functions to find a formula for aj Q1: A sequence is defined by the
rule
Q2: A sequence is defined by the rule
a a and a a aj j j0 1 1 22 1 3 , ,
a a and a a aj j j0 1 1 20 1 3 2 , ,
Generating Functions Exercise (9) Solve the
recursion
a a and a a a for jj j j0 1 1 23 5 2 2 , ,
Probability This is a very common expression
in mathematics, and we give it the name n choose k. We denote this quantity by
nk
nn k k
!
( ) ! !
Probability If we are flipping a coin, then
there are two possible outcomes heads and tails
p p p pso
p
h t h t
jj
k
1 2 1 2 1
11
/ , / ,
Example: A girl flips a fair coin five times. What
is the probability that precisely three of the flips will come up heads?
Solution: Each flip has two possible outcomes.
So the total number of possible outcomes for five flips is
Probability
Probability 2.2.2.2.2=32 Now the number of ways that
three head flips can occur is the number of ways that three objects can be chosen from five. This is
53
52 3
10
!! . !
Probability We conclude that the answer to
the question is
p 1032
0 3125.
Conclude the probability that the girl in the last example will get zero heads, one head, two heads, three heads, four heads, five heads. Add up all these result. The answer should of course be 1.
Probability
Example: Eight slips of paper with the letters
A, B, C, D, E, F, G, and H written on them are placed into a bin. The eight slips are drawn one by one from the bin. What is the probability that the first four to come out are A, C, E, and H (in some order)
Probability
Probability The number of different ways to choose
four objects from among eight is
Of these different subsets of four, only one will be the set [A,C,E,H]. Thus the probability of the first four slips being the ones that we want will be 1/70
84
8 !4 4
8 7 6 54 3 2 1
70
! . !. . .. . .
Example: Suppose that you have 37 envelopes
and you address 37 letters to go with them. Closing your eyes, you randomly stuff one letter into each envelope. What is the probability that precisely two letters are in the wrong envelopes and all others in the correct envelope?
Probability
Probability
372
3735 2
37 362 1
666
66637
4 86 10 41
!! . !
..
!. .p
Exercises (4): There are 20 people sitting in a waiting
room. The functionary in charge must choose five of these people to go to the green sanctuary and three of these people to go to the red sanctuary. In how many different ways can she do this?
Probability
Probability
205
20 !15 5
15504
153
1512 3
455
15504 455 7054320
! . !
!! . !
The rule for forming Pascal’s triangle is this:
1) A 1 goes at the top vertex 2) Each term in each subsequent
row is formed by adding together the two numbers that are to the upper left and upper right of the given term.
Pascal’s Triangle
Exercises 1) There are 300 adult people in a
room, none of them obese. Explain why two of them must have the same weight (in whole numbers of pounds).
A1) Assuming that everyone is healthy, we may suppose that the weights of people in the room range from 75 pounds to 200 pounds. That is a range of 126 possible value. And each of 300 people will have one such value. So there are 300 letters and 126 mailboxes. It follows that two people will have the same weight.
Exercises
2) There are 50 people in a room, none of them obese. Explain why two of them must have the same waist measurement (in whole numbers of inches).
Exercises
A2) The waist measurements will be in the range 15 inches to 45 inches. That is a span of 31 values. But there are 50 people. Just as in the last problem, to people will have the same measurement.
Exercises
3) Explain why the answer to Exercise 2 changes if the waist measurement is change to whole numbers of millimetres.
Exercises
A3) If instead we measure waist size by millimetres, then the range will be from 15X25.4=381 to 45X25.4=1143. That is a span of 763 possible values. Since there are just 50 people, each person could have a different waist measurement in millimeters.
Exercises
5) In a standard deck of 52 playing cards, in how many different ways can you form two-of-a-kind?
Exercises
A5) Given any particular denomination of card (from two through ace), there are four cards of that kind. There are four different ways to choose three from among those. And 13 different denominations. Hence there are 4X13=52 different ways to form three-of-a-kind.
Exercises
6) In a standard deck of 52 playing cards, in how many different ways can you form four-of-a-kind.
Exercises
A6) The analysis here is similar to the last problem. Given any particular denomination, there is just one way to form four of that kind. And there are 13 different denominations. Thus there are 13 different ways to from four-of-a-kind.
Exercises
7) A standard dice used for gambling is a six-side cube, with the sides numbered 1 through 6. You usually roll two dice at a time, and the two face-up values are added together to give your score. What is the likelihood that you will roll a seven?
Exercises
A7) The only way to roll a 7 are 1-6, 6-1, 2-5, 5-2, 4-3, and 3-4 (where we are taking into account that there are two dice, so two ways to realize any particular score). And there are 6X6=36 possible outcomes altogether. So the likelihood is 6/36=1/6
Exercises
8) Refer to the last exercise for terminology. What is the chance that you will roll two dice and get a two? How about a 12? Are there any other values that give this same answer? Why or why not?.
Exercises
A8) The only way to get a 2 is 1-1. Thus the chances of getting a 2 are 1/36. Also there is only one way to get a 12. So the chances of getting a 12 are 1/36. Every other value can be achieved in more than one way, so these are the only two values for which the odds are 1/36.
Exercises
9) Again refer to Exercise 7 for terminology. Now suppose that you are rolling three dice. Your score is obtained by adding together the three face values. What is your probability of getting a 10?
Exercises
A9) The only ways to get a 10 are 1-3-6 1-4-5 2-2-6 2-3-5 2-4-4 3-3-4 6-1-3 And the six permutations of each of
these. So there are 6X7=42 rolls that give 10. There are 6X6X6=216 possible rolls. Thus the odds are 42/216=7/36.
Exercises