Download Chapter 6

Document related concepts

Ethnomathematics wikipedia , lookup

History of the function concept wikipedia , lookup

Addition wikipedia , lookup

Foundations of statistics wikipedia , lookup

Infinite monkey theorem wikipedia , lookup

Inductive probability wikipedia , lookup

Law of large numbers wikipedia , lookup

Risk aversion (psychology) wikipedia , lookup

Birthday problem wikipedia , lookup

Elementary mathematics wikipedia , lookup

Transcript
Chapter 6
Counting Arguments
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 n2 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

This is a very common expression in
mathematics, and we give it the name
n choose k. We denote this quantity
by
 n
n!
 
 k  (n  k )! k !
Counting Arguments




Example:
In how many different ways can we choose
two objects from among five?
Solution:
 5
5!
120

 10
 
 2 (5  2)! 2! 6  2
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}.
Counting Arguments




Example:
How many different 5-card poker hands
are there in a standard 52-card deck of
cards?
Solution:
The answer is
 52
52!
 2,598,960
 
 5  (52  5)!5!
Counting Arguments


Other Counting Arguments:
Mathematical summation notation
n
a
j 1

n
j
,
b , c
j
j 5
j 1
j
Counting Arguments


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



Solution:
The total of rectangles are 31X17=527
We can say
30
16
j0
k 0
S   (31  j )   (17  k )
30
S
j0
30
S
j0
16
 (31  j )  (17  k )
k 0
16
 (527  17 j  31k  jk )
k 0
S  75888
Counting Arguments

Geometric Sum:
1  3  3  3 ...3
2
3
10
1
1 2
1 3
1  ( )  ( )  ( ) ...
2
2
2
Counting Arguments


Example:
Let λ be a real number and k a positive
integer. Calculate the sum of the
geometric
S  1     ... 
2
k
Counting Arguments

Solution:
S    2  3 ... k 1
S  S  1  k 1
S (1   )  1  k 1
1  k 1 k 1  1
S

1 
 1
Counting Arguments

So
1
1 2
1 100
S  1  ( )  ( ) ... ( )
3
3
3
1 101
( ) 1
3
1 101
3
S
 (1  [ ] )
1
2
3
( ) 1
3
Counting Arguments

Also

 j 
j0
1
1 
Example:
1
 1
1
 
 2
2

 1
 

 2
j0
j

2
 1
 
 2
3
....
1
 2
 1
1  
 2
Generating Functions
Powerful technique of generating
functions.
 Example:
 Fibonacci sequence
1,1,2,3,5,8,13,21,34,55,…
j
j
1 5
 1 5

 

 2 
 2 
a1  1, a 2  1, a 3  2, a 4  3,...., a j 
5

Generating Functions


Solution:
We shall use the method of generating
function, a powerful technique that is
used throughout the mathematical
sciences.
Generating Functions
F ( x )  a1  a 2 x  a 3 x ...
2
xF ( x )  a1 x  a 2 x 2  a 3 x 3 ...
x 2 F ( x )  a1 x 2  a 2 x 3  a 3 x 4 ...
F ( x )  xF ( x )  x 2 F ( x )  a1  (a 2  a1 ) x 
(a 3  a 2  a1 ) x ...
2
1
(1  x  x ) F ( x )  1  F ( x ) 
(1  x  x 2 )
2
Generating Functions
F ( x) 
1
2 
 2 

x
x  1 
1 
 1  5  1  5 





 5 5 
1
1
5 5 
F ( x) 




2
2
10 
10 
x
1
x
1
 1  5 
 1  5 
Generating Functions

 j 
j0
1
1 
j
 2 
x so


j0  1  5 

F ( x) 
 2 
x


j0  1  5 

j
j
5 5   2 
5 5
x



10 j  0  1  5 
10

 2 
x


j0  1  5 

j
Generating Functions
F ( x) 
5 5
10
j
 2

x




1 5 
j0


5 5
10
 2

x




1 5 
j0


5  5   2 
F ( x)   



10
1 5
j0 

j
5 5   2 



10  1  5 
5  5   2 
 



10
1 5


j
j
5 5   2   j


 x
10  1  5  


a
j0
j
xj
or
aj 
 1 5


2 

j
 1 5


2 

5
j
j
 j
x


j
Generating Functions


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


Example:
A sequence is defined by the rule
a0  4, a1  1,...., a j  a j1  2a j2

Use the method of generating
functions to find a formula for
aj
Generating Functions
 a 2  9, a 3  11
2
F ( x ), xF ( x ), x F ( x )
F ( x )  xF ( x )  2 x F ( x )  a 0  (a1  a 0 ) x
2
4  3x
4  3x
F ( x) 

2
( 2 x  1)( x  1)
1  x  2x
Generating Functions
5
1
7
1
F ( x)  ( )
 ( )
3  2x  1
3 x 1
5
1
7
1
F ( x)  ( )
( )
3 1  2x
3 1 x

5 
7
F ( x )   ( 2 x ) j   x j
3 j0
3 j0

7 j
5
j
F ( x )    (  2)  x
3
j0  3
Generating Functions

This is the solution to our recursion
problem
F ( x) 

a
j
x
j
j0
aj
5
7
j
 (  2) 
3
3
Generating Functions


Use the method of generating
functions to find a formula for aj
Q1: A sequence is defined by the rule
a0  2, a1  1, and a j  3a j 1  a j  2

Q2: A sequence is defined by the rule
a0  0, a1  1, and a j  3a j 1  2a j  2
Generating Functions

Exercise (9) Solve the recursion
a0  3, a1  5, and a j  a j1  2a j2 for j  2
Probability

This is a very common expression in
mathematics, and we give it the name
n choose k. We denote this quantity
by
 n
n!
 
 k  (n  k )! k !
Probability

If we are flipping a coin, then there
are two possible outcomes heads
and tails
ph  1 / 2, pt  1 / 2, ph  pt  1
so
k
p
j 1
j
1
Probability




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


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
 5
5!
 10
 
 3 2!.3!
Probability

We conclude that the answer to the
question is
10
p
 0.3125
32
Probability

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

The number of different ways to choose four
objects from among eight is
 8
8!
8.7.6.5

 70
 
 4 4!.4! 4.3.2.1

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
Probability


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
 37
37!
37.36

 666
 
2.1
 2  35!.2!
666
 41
p
 4.8610
.
37!
Probability



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
 20
20!
 15504

 
15!.5!
5 
 15
15!
 455
  
12!.3!
3 
15504  455  7054320
Pascal’s Triangle



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.
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).
Exercises

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 threeof-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-akind.
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, 61, 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.