1.
Sample
Space
and
Probability
Part
III:
Coun8ng‐1
ECE
302
Fall
2009
TR
3‐4:15pm
Purdue
University,
School
of
ECE
Prof.
Ilya
Pollak
Discrete
Uniform
Law
Coun8ng
principle
• r
stages
• ni
choices
at
stage
i
• Number
of
choices
is
n1n2…nr
1st stage,
n1 choices
2nd stage,
n2 choices
Examples
• Number
of
license
plates
with
three
leRers
followed
by
four
digits:
26
∙
26
∙
26
∙
10
∙
10
∙
10
∙
10
=
175,760,000.
• If
repe88on
is
prohibited,
26
∙
25
∙
24
∙
10
∙
9
∙
8
∙
7
=
78,624,000.
Example:
Permuta8ons
• Permuta8ons:
number
of
ways
of
ordering
n
objects
Example:
Permuta8ons
• Permuta8ons:
number
of
ways
of
ordering
n
objects
=
n
∙
(n‐1)
∙
(n‐2)
∙
…
∙
2
∙
1
=
n!
(called
“n
factorial”).
Example:
Permuta8ons
• Permuta8ons:
number
of
ways
of
ordering
n
objects
=
n
∙
(n‐1)
∙
(n‐2)
∙
…
∙
2
∙
1
=
n!
(called
“n
factorial”).
• k‐permuta8ons:
number
of
dis8nct
k‐object
sequences
out
of
n
objects
Example:
Permuta8ons
• Permuta8ons:
number
of
ways
of
ordering
n
objects
=
n
∙
(n‐1)
∙
(n‐2)
∙
…
∙
2
∙
1
=
n!
(called
“n
factorial”).
• k‐permuta8ons:
number
of
dis8nct
k‐object
sequences
out
of
n
objects
=
n
∙
(n‐1)
∙
…
∙
(n‐k+1)
=
n!/(n‐k)!
Example:
Birthday
Problem
(p.
67)
• What
is
the
probability
that
n
randomly
chosen
people
all
have
different
birthdays
(day
and
month)?
Example:
Birthday
Problem
• What
is
the
probability
that
n
randomly
chosen
people
all
have
different
birthdays
(day
and
month)?
• Simplifying
assump8ons:
– Everyone
is
equally
likely
to
be
born
on
any
day
of
the
year,
independently
of
others.
– No
leap
years.
Example:
Birthday
Problem
• What
is
the
probability
that
n
randomly
chosen
people
all
have
different
birthdays
(day
and
month)?
• Simplifying
assump8ons:
– Everyone
is
equally
likely
to
be
born
on
any
day
of
the
year,
independently
of
others.
– No
leap
years.
• n=57
is
the
number
of
people
registered
for
this
class
at
the
8me
this
slide
was
made
up
Example:
Birthday
Problem
• What
is
the
probability
that
n
randomly
chosen
people
all
have
different
birthdays
(day
and
month)?
• Simplifying
assump8ons:
– Everyone
is
equally
likely
to
be
born
on
any
day
of
the
year,
independently
of
others.
– No
leap
years.
• n=57
is
the
number
of
people
registered
for
this
class
at
the
8me
this
slide
was
made
up
• If
someone
bets
$20
that
there
are
at
least
two
people
in
this
class
with
the
same
birthday,
how
much
would
you
bet
against
them?
Birthday
problem:
discussion
• Without
making
any
calcula8ons,
most
people
would
bet
about
$100
(or
somewhat
less)
against
$20
Birthday
problem:
discussion
• Without
making
any
calcula8ons,
most
people
would
bet
about
$100
(or
somewhat
less)
against
$20
• This
solves
a
slightly
different
problem:
– 57
people
in
a
room:
Jack
and
56
others
– what’s
the
probability
that
no
one
else
in
the
room
has
the
same
birthday
as
Jack?
Birthday
problem:
discussion
• Without
making
any
calcula8ons,
most
people
would
bet
about
$100
(or
somewhat
less)
against
$20
• This
solves
a
slightly
different
problem:
– 57
people
in
a
room:
Jack
and
56
others
– what’s
the
probability
that
no
one
else
in
the
room
has
the
same
birthday
as
Jack?
– answer:
(364/365)56
≈
1
–
56/365
≈
0.85,
using
the
first
two
terms
in
the
Taylor
series
expansion
Birthday
problem:
discussion
• Without
making
any
calcula8ons,
most
people
would
bet
about
$100
(or
somewhat
less)
against
$20
• This
solves
a
slightly
different
problem:
– 57
people
in
a
room:
Jack
and
56
others
– what’s
the
probability
that
no
one
else
in
the
room
has
the
same
birthday
as
Jack?
– answer:
(364/365)56
≈
1
–
56/365
≈
0.85,
using
the
first
two
terms
in
the
Taylor
series
expansion
– a
fair
bet
against
$20
would
be
$20
∙
0.85/0.15
≈
$113
Birthday
problem:
discussion
• Without
making
any
calcula8ons,
most
people
would
bet
about
$100
(or
somewhat
less)
against
$20
• This
solves
a
slightly
different
problem:
– 57
people
in
a
room:
Jack
and
56
others
– what’s
the
probability
that
no
one
else
in
the
room
has
the
same
birthday
as
Jack?
– answer:
(364/365)56
≈
1
–
56/365
≈
0.85,
using
the
first
two
terms
in
the
Taylor
series
expansion
– a
fair
bet
against
$20
would
be
$20
∙
0.85/0.15
≈
$113
– bekng
anything
below
$113
would
give
you
advantage
Birthday
problem:
discussion
• Without
making
any
calcula8ons,
most
people
would
bet
about
$100
(or
somewhat
less)
against
$20
• This
solves
a
slightly
different
problem:
– 57
people
in
a
room:
Jack
and
56
others
– what’s
the
probability
that
no
one
else
in
the
room
has
the
same
birthday
as
Jack?
– answer:
(364/365)56
≈
1
–
56/365
≈
0.85,
using
the
first
two
terms
in
the
Taylor
series
expansion
– a
fair
bet
against
$20
would
be
$20
∙
0.85/0.15
≈
$113
– bekng
anything
below
$113
would
give
you
advantage
• Even
though
the
two
problems
look
similar,
the
answers
are
very
different!
Birthday
Problem:
Solu8on
• Total
number
of
outcomes:
365n.
Birthday
Problem:
Solu8on
• Total
number
of
outcomes:
365n.
• How
many
outcomes
with
all
different
birthdays?
Birthday
Problem:
Solu8on
• Total
number
of
outcomes:
365n.
• How
many
outcomes
with
all
different
birthdays?
– Birthday
choices
for
1st
person:
365.
Birthday
Problem:
Solu8on
• Total
number
of
outcomes:
365n.
• How
many
outcomes
with
all
different
birthdays?
– Birthday
choices
for
1st
person:
365.
– Acceptable
birthday
choices
for
2nd
person:
364.
– Etc,
total
#
of
acceptable
outcomes:
365
∙
364
∙
…
∙
(366
–
n)
Birthday
Problem:
Solu8on
• Total
number
of
outcomes:
365n.
• How
many
outcomes
with
all
different
birthdays?
– Birthday
choices
for
1st
person:
365.
– Acceptable
birthday
choices
for
2nd
person:
364.
– Etc,
total
#
of
acceptable
outcomes:
365
∙
364
∙
…
∙
(366
–
n)
Birthday
Problem:
Solu8on
• Total
number
of
outcomes:
365n.
• How
many
outcomes
with
all
different
birthdays?
– Birthday
choices
for
1st
person:
365.
– Acceptable
birthday
choices
for
2nd
person:
364.
– Etc,
total
#
of
acceptable
outcomes:
365
∙
364
∙
…
∙
(366
–
n)
• For
n=2,
this
is
0.0027.
• For
n=23,
there
is
more
than
50%
chance
to
have
two
people
with
the
same
birthday.
Birthday
Problem:
Solu8on
• Total
number
of
outcomes:
365n.
• How
many
outcomes
with
all
different
birthdays?
– Birthday
choices
for
1st
person:
365.
– Acceptable
birthday
choices
for
2nd
person:
364.
– Etc,
total
#
of
acceptable
outcomes:
365
∙
364
∙
…
∙
(366
–
n)
• For
n=2,
this
is
0.0027.
• For
n=23,
there
is
more
than
50%
chance
to
have
two
people
with
the
same
birthday.
• For
n=57,
the
probability
is
0.99.
Bet
about
20
cents
against
$20.
P(at
least
two
with
the
same
birthday)
as
a
func8on
of
n
Full curve
Zoomed in
Example:
Size
of
the
power
set
of
a
finite
set
• Power
set
of
A
is
the
set
of
all
subsets
of
A.
• What
is
the
number
of
subsets
of
{1,2,…,n}?
• Each
element
can
either
be
included
in
a
n.
subset
or
not:
2
∙
2
∙
2
∙
…
∙
2
=
2
n times
€
Example:
Playing
dice
• What
is
the
probability
that
six
independent
rolls
of
a
fair
six‐sided
die
all
give
different
numbers?
• Number
of
outcomes
that
make
the
event
happen:
6
∙
5
∙
4
∙
3
∙
2
∙
1
=
6!
=
720.
• Size
of
the
sample
space:
6
∙
6
∙
6
∙
6
∙
6
∙
6
=
66.
• Answer:
6!/66
=
5/324.
Example:
Combina8ons
• Combina8ons:
k‐element
subsets
of
a
given
n‐element
set.
Example:
Combina8ons
• Combina8ons:
k‐element
subsets
of
a
given
n‐element
set.
• Different
from
k‐permuta8ons
since
there
is
no
ordering.
Example:
Combina8ons
• Combina8ons:
k‐element
subsets
of
a
given
n‐element
set.
• Different
from
k‐permuta8ons
since
there
is
no
ordering.
• For
one
k‐combina8on,
k!
different
k‐permuta8ons.
Example:
Combina8ons
• Combina8ons:
k‐element
subsets
of
a
given
n‐element
set.
• Different
from
k‐permuta8ons
since
there
is
no
ordering.
• For
one
k‐combina8on,
k!
different
k‐permuta8ons.
Example:
Combina8ons
• Combina8ons:
k‐element
subsets
of
a
given
n‐element
set.
• Different
from
k‐permuta8ons
since
there
is
no
ordering.
• For
one
k‐combina8on,
k!
different
k‐permuta8ons.
This
number
is
called
“n
choose
k”
Example:
Combina8ons
• Combina8ons:
k‐element
subsets
of
a
given
n‐element
set.
• Different
from
k‐permuta8ons
since
there
is
no
ordering.
• For
one
k‐combina8on,
k!
different
k‐permuta8ons.
This
number
is
called
“n
choose
k”
An
interes8ng
consequence:
(a + b)
n
= (a
+
b) ⋅…⋅
b)
+
b)(a
(a
+
n times
n n−1 n n−2 2
n 2 n−2 n n−1
n
= a +
a b +
a b + … + a b + ab + b
n −1
n − 2
2
1
n
Coefficient of a k = number of ways we can choose k a's from
the n terms in parentheses
€
(a + b)
n
= (a
+
b) ⋅…⋅
b)
+
b)(a
(a
+
n times
n n−1 n n−2 2
n 2 n−2 n n−1
n
= a +
a b +
a b + … + a b + ab + b
n −1
n − 2
2
1
n
Coefficient of a k = number of ways we can choose k a's from
the n terms in parentheses
n
Convention : = 1
0
€
(a + b)
n
= (a
+
b) ⋅…⋅
b)
+
b)(a
(a
+
n times
n n−1 n n−2 2
n 2 n−2 n n−1
n
= a +
a b +
a b + … + a b + ab + b
n −1
n − 2
2
1
n
Coefficient of a k = number of ways we can choose k a's from
the n terms in parentheses
n
Convention : = 1
0
n
n
n
n
k
n−k
For example, 2 = (1+ 1) = ∑ ⋅1 ⋅1 = ∑
k
k
k= 0
k= 0
n
€
€
n
Pascal’s
triangle
Pascal’s
triangle
Pascal’s
triangle
Pascal’s
triangle
Pascal’s
triangle
Pascal’s
triangle:
Deriva8on
n n
n!
n!
+
=
+
k −1 k (k −1)!(n − (k −1))! k!(n − k)!
€
Pascal’s
triangle:
Deriva8on
n n
n!
n!
+
=
+
k
−1
k (k −1)!(n − (k −1))! k!(n − k)!
k ⋅ n!
(n − k + 1) ⋅ n!
=
+
k
⋅ (k
− k)!⋅(n
− k+
1)
−1)!
(n − k + 1)! k!(n
= k!
(n−k +1)!
Pascal’s
triangle:
Deriva8on
n n
n!
n!
+
+ =
k −1 k (k −1)!(n − (k −1))! k!(n − k)!
k ⋅ n!
(n − k + 1) ⋅ n!
=
+
k
⋅ (k
− k)!⋅(n
− k+
1)
−1)!
(n − k + 1)! k!(n
= k!
=
(k + n − k + 1) ⋅ n!
k!(n − k + 1)!
(n−k +1)!
Pascal’s
triangle:
Deriva8on
n n
n!
n!
+
=
+
k
−1
k (k −1)!(n − (k −1))! k!(n − k)!
k ⋅ n!
(n − k + 1) ⋅ n!
=
+
k
⋅ (k
− k)!⋅(n
− k+
1)
−1)!
(n − k + 1)! k!(n
= k!
(k + n − k + 1) ⋅ n!
k!(n − k + 1)!
(n + 1) ⋅ n!
=
k!(n − k + 1)!
=
€
(n−k +1)!
Pascal’s
triangle:
Deriva8on
n n
n!
n!
+
=
+
k −1 k (k −1)!(n − (k −1))! k!(n − k)!
k ⋅ n!
(n − k + 1) ⋅ n!
=
+
k
⋅ (k
− k)!⋅(n
− k+
1)
−1)!
(n − k + 1)! k!(n
= k!
(k + n − k + 1) ⋅ n!
k!(n − k + 1)!
(n + 1) ⋅ n!
=
k!(n − k + 1)!
(n + 1)!
=
k!(n − k + 1)!
=
€
(n−k +1)!
Pascal’s
triangle:
Deriva8on
n n
n!
n!
+
=
+
k
−1
k (k −1)!(n − (k −1))! k!(n − k)!
k ⋅ n!
(n − k + 1) ⋅ n!
=
+
k
⋅ (k
− k)!⋅(n
− k+
1)
−1)!
(n − k + 1)! k!(n
= k!
(k + n − k + 1) ⋅ n!
k!(n − k + 1)!
(n + 1) ⋅ n!
=
k!(n − k + 1)!
(n + 1)!
=
k!(n − k + 1)!
n + 1
=
k
=
€
(n−k +1)!
© Copyright 2026 Paperzz