Combinatorial Mathematics
Combinatorial Mathematics
Instructor:
Time:
Objective:
Time
Day #1
Day #2
Day #3
Lecture #6:
Ordinary
generating functions. How
to use.
Lecture #7:
Generating
function example - trees
Lunch
Exercise #2
Lecture #8: Exponential
generating functions.
Lecture #9: Distributing
nondistinct objects into nondistinct cells.
Stirlings
numbers.
Lecture #10: Partitions of
integers.
Lunch
Exercise #3
Lecture #13: Asymptotic
approximations Lecture #14: Asymptotic
approximations - Finding
simple
closed
form
solutions.
Lecture #15: Example of
asymptotic approximations
Although 30
Instructor:
Jon T. Butler, Professor
Department of Electrical and Computer Engineering
Naval Postgraduate School, Code EC/Bu
Monterey, CA 93943-5121 U.S.A.
408-656-3299 (O) 408-656-2760 (FAX)
E-mail:
[email protected]
Homepage:
http://dubhe.cc.nps.navy/mil/~butler
Example
Suppose
Rule of sum:
If one event can occur in m ways and
another event can occur in n ways,
there are m + n ways in which exactly
one event can occur.
Combs and Permus -1 J. T. Butler
Example
Rule of Product:
Suppose
Permutations
Example
n factorial
r positions (cells)
6444447444448
Also,
P (n, r ) = n (n 1) (n 2) K (n r + 1)
n!
(n r )!
n ways to n 1 ways to
fill the
fill the
1st position 2nd position
Notation:
n r +1 ways
fill the
rth position
Remember
Alternative notation:
Prn = n Pr ( = P (n, r ))
Example
10
Example
How many ways are there to arrange the three
letters in ALL?
There are 12: ab, ba, ac, ca, ad, da, bc,
cb, bd, db, cd, and dc.
LAL L1AL 2
P(4,2) = 4 . 3 = 12.
Combs and Permus -1 J. T. Butler
L 2 AL1
LLA L1 L 2 A L 2 L 1A
11
12
We observe that :
3!
= 3.
2!
n!
.
n1 ! n2 !... nr !
13
14
Example
n!
is called a
n1 ! n2 !... nr !
multinomial.
D
C
F
C
B
A
D
D
D
C F
F
C
B
(a)
(b)
(c)
(d)
Here, (a) and (b) are identical whereas (a)=(b), (c), and
(d) are different.
Combs and Permus -1 J. T. Butler
15
16
17
18
19
Alternative words:
C(n,r) is the number of ways to choose r
objects from n distinct objects.
C(n,r) <=> n choose r
Alternative notation:
Crn = n Cr =
21
22
Note
FG nIJ = n! = FG n IJ .
H r K r!(n - r )! H n - rK
FG nIJ = C(n, r )
H rK
Notes:
1.
20
23
24
Answer:
{a,b}, {a,c}, {a,d}, {b,c}, {b,d}, and
{c,d} are all of the combinations of S of
size 2. There are 6. There are 12
permutations, two for each combination
above.
Combs and Permus -1 J. T. Butler
25
26
Pascals Triangle
Sum Diff.
1
2
1 2
1
4
1 3 3 1
8
1 4 6 4 1
16
1 5 10 10 5 1
32
1 6 15 20 15 6 1 64
6447448
6447448
{b,c}, {b,d}, {c,d} {a,b}, {a,c}, {a,d}
27
1
0
0
0
0
0
0
28
Write the 1s
1
2.
Brief history
1
1
1
2
1
3
29
30
0
1
2
1 2
1
1 3 3 1
5 1 4 6 4
1
6
1 5 10 10 5
1
7
1 6 15 20 15 6 1
4
Note:
Sum Diff.
1
2
4
8
16
32
64
1
0
0
0
0
0
0
31
r
n
0
1
2
3
4
5
6
0
1
1 +1
3
1 +2 +1
4
1 +3 +3 +1
5 1 +4 +6 +4 +1
6
1 +5 +10 +10 +5 +1
7
1 +6 +15 +20 +15 +6 +1
32
r
Sum
Diff.
1
2
4
8
16
32
64
1
0
0
0
0
0
0
n
0
1
2
3
4
5
6
33
0
1
Sum Diff.
1 -1
3
1 -2 +1
4
1 -3 +3 -1
5 1 -4 +6 -4 +1
6 1 -5 +10 -10 +5 -1
7
1 -6 +15 -20 +15 -6 +1
34
Note:
C(n, r) is the number of ways to choose
r objects from n distinct objects.
C(n, r) is called a binomial coefficient.
Binomial coefficients satisfy thousands
of identities.
Combs and Permus -1 J. T. Butler
1
2
4
8
16
32
64
35
36
1
0
0
0
0
0
0
ace of hearts
ace of diamonds
ace of spades
ace of clubs
2 3 4 5 6 7 8 9 10 J Q K A
where
J = Jack, Q = Queen
K = King, and A = Ace
and a suit
37
38
Definition:
To deal 52 cards to 4 people
means to randomly give 13 cards to 4
people. Usually, a person knows
only those cards given to him/her.
Clubs
Spades
Diamonds
Definition:
Hearts
39
40
Question:
Why should naming the ace change
the probability?
41
42
43
Boy
Boy
Girl
Girl
Boy
Girl
Boy
Girl (impossible)
44
46
Playing Keno
Question: Keno is a game in which you
choose 6 distinct numbers from 1 to 80.
The casino chooses 20 distinct numbers
from 1 to 80. You enter a choice of
numbers for $0.60 and the casino pays
you an amount of money depending on
how many of the 6 numbers you have
chosen matches the numbers chosen by
the casino.
Children Paradox
45
Older
47
48
Number of
ways k of 80
numbers can
match
Number of
ways casino
can choose
remaining
numbers
FG 80IJ FG 80 k IJ FG 60 IJ
H k K H 20 k K H 6 k K
P( k ) =
FG 80IJ FG 80IJ
H 20K H 6 K
Total number of
ways casino can
choose numbers
Combs and Permus -1 J. T. Butler
P(k)
0
1
2
3
4
5
6
0.167
0.363
0.308
0.130
0.029
0.003
0.0001
49
50
Playing Keno
Probability of matching k numbers
0.138
0.278
0.305
0.250
0.028
0.000
0.000
Probability
0.4
0.3
0.2
0.1
0
01
2
k 3 4
51
Probability
0.4
0.3
0.2
0.1
0
Experiment
5
Exact
52
54
(1)
Total number of
ways player can
choose numbers
Class exp.
Number of
ways player
can choose
remaining
numbers
53
H
TH
TTH
TTTH
$1.00
$2.00
$4.00
$8.00
1
1
1
$1.00 + $2.00 + $4.00+K
2
4
8
= $0.50 + $0.50 + $0.50+K ,
which, even with inflation, is a large
amount of money.
Combinations with
Repetition
Example:
If r = 2 and n = 3, then this number is
6. Let S = {a,b,c}. Then, one can
choose {a,b}, {a,c}, {b,c}, {a,a},
{b,b}, and {c,c}. If repetition is not
allowed, this number is 3 - {a,b},
{a,c}, and {b,c}.
Question:
How many ways can one choose r objects
from n distinct objects when repetition is
allowed? That is, one can choose any
object 0, 1, 2, ... etc. times.
Combs and Permus -2 J. T. Butler 5
0 0 <=> ab
0 0 <=> ac
0 0 <=> bc
0 0 <=> aa
0 0 <=> bb
0 0 <=> cc
Choose
Example:
C (n +r 1, n 1) = C (n +r 1, r)
ways. This is the number of ways to
choose r objects from n with
repetition.
Example:
When three distinct dice are rolled, the
number of outcomes is 6 . 6 . 6 =216.
Here, 1 2 1 2 1 1
Combs and Permus -2 J. T. Butler 11
Answer:
Go here
ways.
Question:
Answer:
Go here
East Move
Segments
North Move
Segments
You are
here
Combs and Permus -2 J. T. Butler 15
C ( 4 + 3 - 1, 3) = 6!/(3! . 3!)
= 20
ways to do this.
Combs and Permus -2 J. T. Butler 17
Example:
Example
Some
C ( 7 + 9 1, 7 - 1) = 5005.
and
the 36 players in
36!
2.145 1019
9! 9! 9! 9!
Answer:
Question:
P(n)
12
0.1670
15
0.2529
18
0.3469
21
0.4437
22
0.4757
23
0.5073
Thus, for a group of only 23 people, P(n) > 0.5!
P (365, n)
.
365n
Probability
of
Birthday
1
365
Jan. Mar.
/Feb. /Apr.
Number of People n
Birthday problem - J. T. Butler
May
/Jun.
6
Jul.
/Aug.
Sep. Nov.
/Oct. /Dec.
Question:
If the actual probability distribution
is used instead of the uniform distribution, how does this change P(n),
the probability that two people out
of n have the same birthday?
Birthday problem - J. T. Butler
The data for this comes from 239,762 births in New York State in 1977.
Birthday problem - J. T. Butler
8
Answer #1:
FG 365IJ
H 23 K
i1 <K< in
FG IJ
H K
FG IJ
H K
11
P (365, n)
n!
365n
P (365, n)
=
365n
365
n!
n
1
=
= n!
n
365
n selections 365
P '(n) =
10
FG IJ
H K
from 365
12
P (n) = n! p1 p2
Theorem:
+ ( p1 + p2 )
13
p1 p2 <
IJ
K
Thus,
15
(2)
in
14
Compare p1 p2 with
1
= p1 ( p1 + p2 )
2
1
+ = ( p1 + p2 ) p2
2
2 = p1 p2
p p2
= 1
2
in1
can be shown as
p Kp
p Kp
FG 1 ( p + p )IJ
H2
K
1
in 2
i1
2 < i1 <K<in 1
i1
2 <i1 <K<in
FG
H
p Kp
i1
2 <i1 <K<in 2
16
FG 1 ( p + p )IJ
H2
K
1
= p2
(4)
FG 1 ( p + p )IJ .
H2
K
2
Q.E.D.
Birthday problem - J. T. Butler
17
18
Answer #2:
Berresford overcomes the enormous
computer time needed when there are
365 different probabilities by
allowing a smaller number (10) and
rounding the actual probability to the
nearest. He obtains the following.
Birthday problem - J. T. Butler
Probability of
being born on
day d
19
Probability of
being born on
day d
That is,
FG m + n 1IJ
H n K
where
Day d
d p
i
= 365
i =1
i =1
for m = 10 yields
Birthday problem - J. T. Butler
Day d
Fd I
i
ni
is over the
(5)
FG m + n 1IJ
H n K
n1 + n2 +K+ nm = n
P(n)
Uniform case
P(n)
Non-uniform
case
12
15
18
21
22
23
0.1670
0.2529
0.3469
0.4437
0.4757
0.5073
0.1683
0.2537
0.3491
0.4463
0.4783
0.5101
GH n JK V
n1 + n2 +K+ nm = n i =1
21
20
P ( n) = n !
V3
V2
V3
by
24
25
3 Pigeonholes
Pigeonholes
4 Pigeons
7 Pigeons
Example:
No person has more than 300,000 hairs
on his/her head. There are 1,280,000
people on the Monterey Peninsula.
Thus, at least two people on the
Monterey Peninsula have the same
number of hairs on their head.
...
n Pigeonholes
q. n +1 Pigeons
people
<=> pigeons
1,280,000
= 4.26
300,000
3 divides 9
4 divides 64
4 divides 1
3 divides 7
Example:
10
30 numbers
Pigeonhole Principle - J. T. Butler
11
12
(2)
30 numbers
pj = pi + 11
*Pigeonhole principle.
Pigeonhole Principle - J. T. Butler
13
Example:
1 1 ... 1 19 1 1 ... 1
123
123
15
14
16
Example:
15
14
17
18
19
20
Generating
Generating Functions
Functions
Question: How many ways are there to make
Example:
5
5 10 10 10 10
for 50 yen.
50
50 50
50 50 50
14243
0 yen
14243
5 yen
50
14243
10 yen
(
(
(
(
14243
1 yen
10
14243
50 yen
14243
6 yen
Now substitute
= x0 = 1, 1 = x1,
1 1
= x5 ,
1 1 1
5 5 5
10
50 50
50 50
20
30
10
10 10
10 10 10
50
50 50
50 50 50
)
)
)
)
10
= x10,
5 5
50
= x50
c1 + x + x x + x x x +Kh b1 + x + x x
+ x x x + Kg c1 + x + x x + x x x +Kh
c1 + x + x x + x x x +Kh
= c1 + x + x + x +Khc1 + x + x + x +Kh
c1 + x + x + x +Khc1 + x + x
+ x +K g
10
10 10 10
Example:
50
10 10
10
10 10
= 1 + x + x 2 + x 3 + x 4 + 2 x5 + 2 x 6 + 2 x 7 + 2 x8 + 2 x 9
+ 4 x 10 + 4 x 11 + 4 x 12 + 4 x 13 + 4 x 14 + 6 x 15 +K
10 10 10
50
10
50
15
100
150
Observation:
1 + x 1 + x 2 + x 3 +K
= (1 x ) 1
1 + x 5 + x 10 + x 15 +K
= (1 x 5 ) 1
1 + x 10 + x 20 + x 30 +K
= (1 x 10 ) 1
1 + x 50 + x 100 + x 150 +K = (1 x 50 ) 1
whenever the power series (on the left)
converges.
10 1
P( x ) = (1 x )1 (1 x 5 ) 1 (1 x 10 )1 (1 x 50 )1
Generating Func. 1 - J. T. Butler 7
3)
5 1
= b0 + b1x + b2 x 2 +K bi = ai + bi5
5 1
10 1
= c0 + c1x + c2 x 2 +K ci = bi + ci10
5 1
10 1
50 1
(1 x ) (1 x ) (1 x )
1
4) (1 x ) (1 x ) (1 x ) (1 x ) = d0 + d1x + d2 x 2 +K di = ci + di50
Example:
(a0 + a1 x + a2 x 2 +K )(1 x 5 ) 1 = b0 + b1 x + b2 x 2 +K
ca + a x + a x +Kh = cb + b x + b x +Khc1 x h
2
b1 xg (1 x )
1
2)
(1 x )1 = a0 + a1x + a2 x 2 +K
1)
ai = bi bi 5
bi = ai + bi 5
i= 0
5 10 15 20 25 30 35 40 45 50
1) 1
1 1
1 1
2) 1
2 3
6 7
9 10 11
3) 1
2 4
9 12 16 20 25 30 36
4) 1
2 4
9 12 16 20 25 30 37
Answer:
c1 + yx
10
+ y 2 x 20 + y 3 x 30 +K = (1 yx 10 ) 1
So now
1
5 1
10 1
50 1
P ( x , y ) = (1 x ) (1 x ) (1 yx ) (1 x )
i= 0
5 10 15 20 25 30 35 40 45 50
1) 1
1 1
2) 1
2 3
3) 1
4) 1
y5
y0
2 4
9 12 16 20 25 30 36
2 4
9 12 16 20 25 30 37
y4
1 1
y3
6 7
y2
9 110 11
y
Example:
Consider
(1 +ax) (1 +bx) (1 +cx) =
1 +(a+b+c) x +(ab+bc+ca) x2 +abc x3
y0
Let a = b = c = 1. Then,
(1+x)3 = 1 +3x +3x2 +1x3
This shows that there are
1. 1 way to choose none,
2. 3 ways to choose one,
3. 3 ways to choose two, and
4. 1 way to choose three of a, b, and c.
In general
(1+x)n = C (n,0) +C (n,1) x +C (n,2) x2
+ ... + C (n,r) xr + ... + C (n,n) xn
(1)
FG nIJ .
H rK
Setting x = 1 in (1).
Example:
With n = 3
1 + 3 + 3 + 1 =8
FG 3IJ :
H 0K
0 0 0
Recall
+
FG 3IJ :
H 1K
0 0 1
0 1 0
1 0 0
Setting x = -1 yields
FG 3IJ :
H 2K
0 1 1
1 0 1
1 1 0
FG 3IJ :
H 3K
+
1
1 1 1
a1 a2 a3
222
Generating Func. 1 - J. T. Butler 27
Example:
8
Generating Func. 1 - J. T. Butler 28
Prove
Note:
Therefore,
FG nIJ = FG nIJ FG n IJ
H r K H r K H n rK
2
FG 2nIJ
H nK
FG 2nIJ .
H nK
Why?
Generating Func. 1 - J. T. Butler 31
Set
A 0
B
A
B
1
n 1
L
K
r
nr
L
K
n
0
UV
W
Example:
No. of
Choices
Prove
We obtain
r 1
+K+ n
FG nIJ x
H nK
n 1
= (1 + x ) n
= n(1 + x ) n 1
Now, set x = 1
n 1
n 1
r r r
(1 +rx
Choose
none
g g
+r2x2 +r3x3)
(1+gx
Choose
one ball
Choose
two balls
(1 +bx)
Choose
three balls
= (1 + x + x 2 + x 3 ) (1 + x + x 2 ) (1 + x )
However,
1 + x + x 2 +K+ x r +K =
1 + x + x2 + x3 =
1+ x + x2 =
Setting r = g = b = 1, yields
= 1 + 3x + 5x2 + 6x3 + 5x4 + 3x5 + x6 .
Generating Func. 2 - J. T. Butler
+g2x2)
1+ x =
1
1 x
1 x4
1 x
1 x3
1 x
1 x2
1 x
Thus,
FG 1 IJ
H 1 xK
= b1 x g
1 x4 1 x3 1 x 2 1 x2 x3 x4 + x5 + x6 + x7 x9
=
1 x 1 x 1 x
1 3x + 3x 2 x 3
(1 + x + x 2 +K+ x k +K ) n =
(1 + x ) n = 1 +
r =1
So
b1 xg
FG nIJ x
H rK
= 1+
r =1
FG nIJ b xg
HrK
( n)( n 1)K ( n r + 1)
r!
n + r 1
(n + r 1)K (n + 1)( n)
=
( 1) r =
( 1) r
r
r!
=
FG
H
Thus,
(1 x ) n = 1 +
r =1
FG n + r 1IJ x
H r K
=
r =0
FG n + r 1IJ x
H r K
Observation:
FG 1 IJ
H1 xK
= x n (1 x ) n
FG n + r 1IJ x
H r K
F n + r 1IJ x
= G
H r K
F r 1IJ x
= G
H r nK
= xn
r = 0
n + r
r = 0
( x + x 2 + x 3 +K+ x k +K ) n = x n
(1-x)-n is the
generating function for the number
of ways to choose r objects out of n
objects with repetition. If each
object is chosen at least once, then
we have,
IJ
K
FG r - 1IJ .
H r - nK
r =n
r = n + r
10
Question:
Answer:
S ( x ) = 1 + x + x 2 +K+ x t
11
12
FG 1 x IJ = FG 1 x IJ
H 1 x 1 xK H 1 x K
= c1 3x + 3x
x hb1 x g
t +1
t +1
t +1
2t +2
3t + 3
13
Alternative answer:
Without restriction, there are
FG 3 + 2t + 1 1IJ
H 2t + 1 K
This is done in
answer is
15
FG 3 + t 1IJ
H t K
16
Prove:
14
1 + 2 + 3+K+ m =
17
18
m( m + 1)
2
b1 x g
Answer:1 Consider
Note that if
2
= 1 + x + x + x +K
b g
Differentiate
both sides
2
1 x = 1 + 2 x + 3x 2 +K
Then,
(1 x ) 1 A( x ) = a 0 + ( a 0 + a1 ) x
+ ( a 0 + a1 + a 2 ) x 2 +K
Multiply by x
2
x 1 x = x + 2 x 2 + 3x 3 +K
b g
19
Therefore,
b1 x g
x (1 x )2 = 0 + (1) x + (1 + 2 ) x 2
+ (1 + 2 + 3) x 3 + (1 + 2 + 3 + 4 ) x 4K
20
21
m( m + 1)
.
2
22
Alternative
Answer
We seek
this sum.
m+1
1+2+3+4+ ... + m
Generating Func. 2 - J. T. Butler
23
24
Prove:
2 S = m(m + 1)
m(m + 1)
S=
2
12 + 2 2 +K+ m2 =
FG
H
IJ
K
1 (m + 1) m
( 2m + 1)
3
2
Answer:
25
26
Consider
27
28
Alternative Proof:
Note:
x (1 + x ) 2
= 1 x + (12 + 22 ) x 2 + (12 + 22 + 32 ) x 3 +K .
(1 x )4
12 22 32 42
22 = 1+3
(1 x )
12 = 1
32 = 1+3+5
42 = 1+3+5+7
29
30
1+ 2 + 3 + 4 =
12
22
32
42
24+1
31
32
Example:
(4 + 1)4
3(1 + 2 + 3 + 4 ) =
(2 4 + 1)
2
2
derive
the
Let A( x) = a0 + a1 x + a2 x 2 + a3 x 3 + K
B ( x ) = b0 + b1 x + b2 x 2 + b3 x 3 + K
C ( x ) = c0 + c1 x + c2 x 2 + c3 x 3 + K
33
34
C. Multiplication
A. Addition
C ( x ) = A( x )B ( x ) ci = a0 bi + a1bi 1
C( x ) = A( x) + B( x) ci = ai + bi
+ a 2 bi 2 + K + ai b0
If
B. Shifting
B ( x) =
C( x ) = x n A( x ) ci = ai n
1
= 1 + x + x 2 + x3 + K,
1 x
i
C ( x ) = A ( x ) B ( x ) ci = a j .
j =0
35
36
D. Change in x
A( x) + A( x)
= a0 + a2 x 2 + a4 x 4 + K
2
+ a2i x 2i + K
A( x) A( x)
C ( x) =
= a1 + a3 x3 + a5 x5 + K
2
+ a2i +1x 2i +1 + K
C ( x) =
C( x) = A(x) ci = i ai
37
38
1
(1 + x ) n
(1 + x ) n =
39
( 3)
b4 g
40
FG 1IJ 1 + FG 1 IJ 1 + FG 1 IJ 1
H 3K 1 FG x IJ H 2 K 1 FG x IJ H 4 K (1 FG x IJ )
H 3K
H 2K
H 2K
1 = A( x 2) 2 + B ( x 2)( x 3) + C ( x 3).
1 x n +1
= 1 + x + x 2 +...+ x n
1 x
1
= 1 + x + x 2 + + x 3 +...
(1 x )
41
42
1 1 1 1 1 2 1
+ + =
3 3 2 2 4 n 2
n
1 1 1 1 1 n + 1 1 1 1 1
1
+ +
= (n 1) 2 .
3 3 2 2 4 n 2 3 3 4
43
44
Example
An important topic in
computer science is graphs
and trees. These are useful,
for example, in data structures
r=1
r=2
r=3
r=4
G. Func. Examples - J. T. Butler
Note:
These count as
2 not 1.
leaves
T (x) = T2(x) + x
G. Func. Examples - J. T. Butler
(1)
0 = T 2 ( x) T ( x) + x
(1 + x ) n = 1 +
1 1 4x 1 1
= (1 4 x )1/ 2
T ( x) =
2
2 2
r =1
FG nIJ x
H rK
to get
(1 4 x ) 1/ 2 = 1 +
r =1
FG1 / 2IJ (4 x)
HrK
10
r
)(
1
/
2
r
)
K
r =1
= 1+
= 1
r =1
= 1+
= 1
r =1
1 1 1 3 K ( 2r 3) r r
4 x
r
r!
r =1 2
(1 4 x )1/ 2 = 1
= 1
r =1
2 4 K ( 2 r 2 ) 1 3 5 K ( 2r 3) r r
4 x
2 r 1 1 2 K ( r 1)
2r r !
1 2 3 4 5 K ( 2r 3)(2 r 2 ) r
2x
( r 1)!( r 1)! r
FG
H
IJ
K
2 2r 2 r
x
r r 1
11
12
1 1
(1 4 x )1/ 2
2 2
tr =
FG
H
IJ
K
1 2r 2
r r 1
=0
13
1 2
tr
1 1
14 42 132
14
15
16
Example:
Ways to place parantheses
Number of ways
( ab)
1
((ab)c) ( a (bc))
2
((ab)(cd )), (((ab) c)d ),(a (b(cd ))),(a ((bc)d )), ((a (bc))d ) 5
r=0
We have
r
r 1
17
18
19
6444444447444444448
64748
64444744448
21
23
20
22
Definition:
a0 +a1 x +a2 x2 + a3x3+
Generating functions
for permutations.
Definition:
Observation:
a 0 a1
a
a
+ x + 2 x 2 + 3 x 3 +K
0! 1!
2!
3!
Example:
Observation:
1+
1
1
1
x + x 2 + x 3 +K = e x
1!
2!
3!
1
1
x + x 2 +...).
1!
2!
G( x) = 1 +
FG 1 + 1 IJ x + FG 2 + 1 1 IJ x + FG 2 + 2 IJ x +K
H 1! 1!K H 2! 1!1!K H 3! 1!2!K
2
Example:
x
x2
x3
1 + (1 + 1) + ( 2 + 2)
+ (2 + 6) +K
1!
2!
3!
aa ab aaa aab
bb ba bbb aba
baa
00 01 02 03 04 10 11 12 13 14 20 21 22
23 24 30 31 32 33 34 40 41 42 43 44
bba
bab
abb
Exp. Gen. Func.- J. T. Butler 9
IJ FG
KH
IJ FG
KH
Example:
IJ
K
1
1
1
1
1
1
1 + x + x 2 +K 1 + x + x 2 +K 1 + x + x 2 +K
1!
2!
1!
2!
1!
2!
= ex ex ex ex ex = e5x
n=2
FG
H
UV
W
00 01 02 03 04 10 11 12 13 14 20 21 22
23 24 30 31 32 33 34 40 41 42 43 44
5n n
x .
The xn term is
5!
UV
W
n=2
FG1 + 1 x
H 2!
IJ FG
KH
IJ
K
IJ FG
KH
1 4
1
1
1
1
x +K 1 + x 2 + x 4 +K 1 + x + x 2 +K
4!
2!
4!
1!
2!
1
1
1
1
1
= (e x + e x ) (e x + e x )e 3 x = e5 x + e 3 x + e x
2
2
4
2
4
(1)
2
1 x
1
1
1
1
(e e x ) ( e x e x )e 3 x = e5 x e 3 x + e x
2
2
4
2
4
1 5x
e + ex
2
1
1
1
1
1
1
= 1 + 5x + 52 x 2 +K + 1 + x + x 2 +K
2
1!
2!
2
1!
2!
FG
H
(2)
The coefficient of
IJ FG
K H
IJ
K
xn
is
n!
1 n
(5 + 1)
2
Exp. Gen. Func.- J. T. Butler 15
FG nIJ (1) e
HiK
F nI
1
= G J ( 1) (n i ) x
r!
HiK
F nI
x
= ( 1) G J (n i )
r!
HiK
Distributing distinct
objects into nondistinct cells
( n i ) x
i =0
n
FG x + x + x +KIJ
H 2! 3! K
i =0
= ( e x 1) n
r =0
r =0
i =0
F nI
( 1) GH i JK (n i )
= n ! S ( r , n)
FG IJ
HK
n
1 n
( 1) i
(n i ) r
i
n! i =0
i =0
Note:
S(n,1) = S(r,r) = 1
S(r,n) = S(r -1, n -1) + nS(r - 1, n)
for 1 < r < n
B(n)
r
Bell numbers
1
1
2
3
4
5
6
2
3
4
5
6
7
1
1
1
1
3
6
1
1
10
25
15
1
15
65
90 31
1
1
7
1
2
5
15
52
203
0 1 2 3
B(n)
Interesting properties
Sum
r
0
1
2
3
1
1
2
5
n1
Bell triangle
0
1
2
3
4
5
n r 1
B (n) = B (n,0) = B (n 1, n 1)
B( 0,0) = 1
3
7
5
10
15
4
15
20
27
37 52
5
52 66
87 114 151 203
1
3
10
37
151
674
B(n)
Exp. Gen. Func.- J. T. Butler 29
Limerick
Example:
Definition:
Note:
n1 n2 n3 K n k 1
Now form
n k = ( n1 1) + ( n2 1) +K+ ( nk 1)
= m1 + m2 +K+ mk
m1 m2 K mk 0
Thus,
p k ( n ) = p k ( n k ) + p k 1 ( n k ) +K+ p 0 ( n k ) ,
n
k
0
1
2
3
4
5
6
Sum
Example:
p2 (4) = p2(2) + p1(2) + p0(2)
2 = 1 + 1 + 0
p4 (4) = p4(0) + p3(0) + p2(0) + p1(0) + p0(0)
1
0 +
In
(n)
k =1
1 + x 2 + x 4 + x 6 +K+ x 2 r +K =
4
0
1
2
1
1
0
0
5
5
0
1
2
2
1
1
0
7
6
0
1
3
3
2
1
1
11 p (n)
1 + x + x 2 + x 3 +K+ x r +K =
1
1 x
10
1
1 x2
pk(n)
2 3
0 0
1 1
1 1
0 1
0 0
0 0
0 0
2 3
1
0
1
0
0
0
0
0
1
p(n) =
0
1
0
0
0
0
0
0
1
11
12
S ( x) =
parts
1
1
1
K
3
1 x 1 x 1 x5
R ( x ) = (1 + x )(1 + x 2 )(1 + x 3 )K
Partitions of Integers - J. T. Butler
13
Note:
Example:
1 x 2 1 x 4 1 x 6 1 x 8 1 x 10
K
1 x 1 x 2 1 x 3 1 x 4 1 x5
1
1
1
=
K
3
1 x 1 x 1 x5
R( x ) =
Thus,
Theorem: The number of partitions with
every part odd is the same as the number
of partitions with no repeated parts.
Partitions of Integers - J. T. Butler
15
Let
1
1
1
1
K
= p k ( n ) x n
1 x 1 x 2 1 x 3 1 x k n =0
where, p k ( n) = pi ( n).
P( x, y ) = (1 + xy + x 2 y 2 + K)(1 + x 2 y + x 4 y 2 + K) K
1
1
1
=
K
(1)
2
1 xy 1 x y 1 x 3 y
i=0
16
14
17
18
Example
pk(n) xn yk,
y2 is
[ 1 x2 + 1 x3 + 2 x4 + 2 x5 + 3 x6 + ... ] y2
12
12 13
14 15
22
23 24
32
Pk ( x )
19
Pk ( x ) y k xy pk 1 ( k 1) x k 1 + pk 1 ( k ) x k +K y k 1 =
Note:
pk ( k ) x k + pk ( k + 1) x k +1 +K x k y k
Pk ( x ) y k x Pk 1 ( x ) y k = x k Pk ( x ) y k
(2)
(1 x k ) Pk ( x ) = x Pk 1 ( x )
x
Pk 1 ( x )
1 xk
x
Pk 1 ( x ) =
Pk 2 ( x )
1 x k 1
and
Pk ( x ) =
Pk ( x ) =
21
and
x2
Pk 2 ( x )
(1 x k )(1 x k 1 )
Pk ( x ) =
Similarly,
Pk ( x ) =
20
22
xk
P0 ( x)
(1 x k )(1 x k 1 ) K (1 x ) 123
1
Note:
x3
Pk 3 ( x )
(1 x k )(1 x k 1 )(1 x k 2 )
Pk ( x ) = x k Q ( x ),
where Q ( x ) is the generating function for
partitions with no part greater than k .
23
24
Example:
25
26
6+4+3+1
27
29
4+3+3+2+1+1
28
0
1
1
1
2
2
3
3
4
5
5 6 7
8 13 21
11701250
Born: Pisa, Italy
We have
an = an-1 +an-2 .
This is a recurrence relation. It can be solved in
a way similar to differential equations.
Assume a solution of the form
an = A n .
and we have
We have
a n = A1
0 = A n A n-1 A n-2
F1+ 5I
GH 2 JK
+ A2
F 1 5 I
GH 2 JK
or
Applying the boundary conditions gives
0 = 2 1.
This is called the characteristic equation.
Solving for yields
a0 = 1 = A1
a1 = 1 = A1
1 1+ 4 1 5
=
=
.
2
2
Recurrence Rel. - J. T. Butler
+ A2
F1+ 5I + A F1 5I .
GH 2 JK GH 2 JK
2
F
GH
1 1+ 5
2
5
Thus
I
JK
A2 =
F
GH
F
GH
I
JK
IF 1+ 5I
JK GH 2 JK
1 F 1 5IF 1 5I
G JG J
5 H 2 KH 2 K
1 1+ 5
an =
2
5
or
1 1 5
.
2
5
55
89
H
Belly button
B
10
8
21
13
Daisy - 13 petals
Aarons - 5 petals
Orange - 8
sections
Hibiscus- 5 petals
11
12
Aphelion Dis.
from Sun
x 106 km.
70
109
152
249
816
Saturn
Uranus
Neptune
Pluto
1504
3002
4537
7375
an ~
Note:
F
GH
I
JK
14
fn
=1
gn
1 1+ 5 1+ 5
2
5 2
Aphelion
Sun
13
Thus,
= 0.724 (1.62) n
a n +1 1 + 5
= 162
.
an
2
15
16
Area = 8 x8 = 64
17
18
Theorem*:
an an-2 a2n-1 = (1)n
64
65
66.02
67.05
Do this with
gold!
Recurrence Rel. - J. T. Butler
Proof:
19
n
an
0 1 2 3 4 5 6
1 1 2 3 5 8 13 ...
an = an-1 +an-2
an an-2 = a2n-1 +(1)n
13 5 = 82 +(1)6
Q.E.D.
21
20
Fibonacci Sequence
By induction
(1)
22
an =
k = 0 k
23
24
Solution:
25
27
n : 1
bn : 2
2n : 2
Choose
b10 = 1 .
Fibonacci sequence
Thus,
b1
n = an
b0n = b1n-1 = an-1
2
3
4
28
3
5
8
4
5
6
7
8
8 13 21 34 55
16 32 64 128 256
Note:
bn 0.724(1.62 ) n +1
= 0.
n 2 n
2n
and
bn = b1n +b0n = an +an-1 = an+1
Recurrence Rel. - J. T. Butler
26
lim
29
30
a x
n=2
n=2
= x a n 1 x n 1 + x 2 a n 2 x n 2 .
n=2
With
A(x) = a0 + a1x + a2x2 +a3x3 + ... ,
31
A ( x) =
Solving yields
1
1 x x2
= 1 + x + 2 x 2 + 3x 3 + 5x 4 + 8x 5 +K .
A ( x) =
which is
FG
H
5 5 +1
2
1
x
5 1
IJ FG
K H
+
5 5 1
2
1
x
5 1
I
JK
I F
JK GH
1
5
.
5 1
2
I
JK
34
IJ
K
F
GH
1 1+ 5
an =
2
5
IF1+ 5I
JK GH 2 JK
F
GH
1 1 5
2
5
IF1 5I
JK GH 2 JK
F I
1 F 1 5I
G J 15 GH 1 +2 5 JK
5H 2 K
A( x ) =
F 1 1 5 xI + F 1 1 + 5 xI .
GH 2 JK GH 2 JK
IF
JK GH
5 1
5 1
x
2
2
F
GH
A( x) =
Fx
GH
5
=
+
5 1
x
x
2
33
1
1
=
,
1 x x2 x2 + x 1
1
32
35
36
An interesting application of
recurrence relations is the
Fibonacci Number System
/att/math/sloane /doc/eistop.html .
*The Encyclopedia of Integer Sequences by N. J. A.
Sloane & S. Plouffe, Academic Press, ISBN 0-12558630-2.
Recurrence Rel. - J. T. Butler
37
Example:
1=
1
2 = 10
3 = 100
4 = 101
5 = 1000
39
b2 b1 = 1
678
011 = 3
110 = 5
123
b3 b2 = 1
40
38
generalized Fibonacci numbers, The Fibonacci Quarterly, 29.2, May 1991, pp. 124-131.
41
42
Proof:
By induction.
n = bi ai ,
i =1
where bi = 0 or 1, bi bi+1 = 0, bm =
1, ai is the ith Fibonacci number,
and am is the largest Fibonacci
number just less than or equal
to n.
Recurrence Rel. - J. T. Butler
43
Example:
Q.E.D.
Recurrence Rel. - J. T. Butler
44
45
46
Substituting yields
A n = 2A n-1
= 2 .
Thus,
a(h)n = A (2)n .
Assume a particular solution of the form
a(p)n = Bn +D .
Substituting this yields
[Bn +D] +2 [B (n1) +D] = n + 3 .
47
48
3Bn + 3D -2B = n + 3 .
Comparing coefficients yields
3B = 1 and 3D 2B = 3 .
That is,
B=
1
3
D=
an = an( h ) + an( p ) = A ( 2) n +
11
.
9
and so
a
Recurrence Rel. - J. T. Butler
( p)
n
n 11
+ .
3 9
an =
n 11
= + .
3 9
49
16
n 11
( 2 ) 2 + + .
9
3 9
50
51
52
53
54
55
n=0 1 2 3 4 5 6
an = 1 1 2 3 5 8 13 ...
56
Range Transformation
Consider
an = 3a2n-1
for n > 1 and a0 = 1. Let
bn = log2 an.
Thus,
bn = log2 an = 2log2 an-1 + log2 3 = 2bn-1 +log2 3
with
b0 = 0 .
Recurrence Rel. - J. T. Butler
or
an = 2 ( 2
57
1) log 2 3
= 2 log 2 3
( 2 n 1 )
= 32
58
Domain Transformation
The merge sort divides a set of n numbers in
half, sorts each half, then merges each half
together using at most n-1 comparisons. If n
is a power of 2, an upper bound tn on the
number of comparisons is
tn = 2tn/2 + n - 1
n>2
t1 = 0.
.
Recurrence Rel. - J. T. Butler
bn = ( 2 n 1) log 2 3
59
10
60
dn =
rd
n r +1
+ n +1
n 3,
(1)
r =2
n +1
2d n =
+ 1.
( 4)
n =1
n i
xn
n =1 i = 0
(5)
D( x ) =
n =1
O( x ) = 1 + 2 x + 3x 2 +... =
b g
1 x
D ( x ) 4 xD( x ) + 2 x 2 D ( x ) x + x 2 = 0 .
Recurrence Rel. - J. T. Butler
64
66
(9)
( 6)
x x2
= x + 3 x 2 + 10 x 3 + 34 x 4 +... .(7 )
1 4x + 2x2
n3
63
d n = 4 d n 1 2 d n 2 .
b1 xg
x .
Let
(3)
62
2 D( x ) = O( x ) D( x ) +
+1,
We have
d x = o d
n i
D ( x ) = d 0 + d 1 x + d 2 x 2 +... .
i =0
(i + 1)d
i =0
61
n i
( 2)
2d n =
o d
n 1.
2d n =
+1
n r +1
r =1
rd
65
11
(8)
Inclusion/Exclusion - J. T. Butler
Inclusion/Exclusion
Example:
Example:
Inclusion/Exclusion - J. T. Butler
6300
2100
1260
420
Divisible by 3
Divisible by 5
Divisible by 5 & 3
Inclusion/Exclusion - J. T. Butler
Inclusion/Exclusion - J. T. Butler
Let
General Formulation
Inclusion/Exclusion - J. T. Butler
Inclusion/Exclusion - J. T. Butler
In our example,
Theorem:
a1 --- divisible by 3
a2 --- divisible by 5
N (a1 , a 2 ,K , a r ) = N N (ai )
i
We saw that
3360
6300 2100 1260
420
N (a1, a2) = N N (a1) N (a2) +N (a1, a2)
N (a , a
, ak )
i , j ,k i j , j k ,k i
Inclusion/Exclusion - J. T. Butler
10
Example
In how many ways can the 26 letters
be permuted so that none of the ways
contains pattern car, dog, pun, or
byte?
Inclusion/Exclusion - J. T. Butler
Inclusion/Exclusion - J. T. Butler
Proof:
Inclusion/Exclusion - J. T. Butler
+K+ ( 1) r N (a1 , a 2 ,K , a r )
Number divisible by 3
Number divisible by 5
Number divisible by 3 and 5
Inclusion/Exclusion - J. T. Butler
N (a , a
i, j, i j
11
Inclusion/Exclusion - J. T. Butler
12
Inclusion/Exclusion - J. T. Butler
and N (ai , a 4 ) = 21!, for i 4. Also,
N (a1 , a 2 , a 3 ) = 20!, N (ai , a j , a 4 ) = 19 !, for
1 i < j 3, and N ( a1 , a 2 , a 3 , a 4 ) = 17 !.
Applying the principle of inclusion / exclu sion, we find that N (a '1 , a ' 2 , a ' 3 , a ' 4 ) =
26! [3 24 !+ 23!] + [3 22 !+ 3 21!] [20!+
3 19 !] + 17 !.
13
Inclusion/Exclusion - J. T. Butler
Example
14
Definition:
1 2 3
A derangement is a permutation of n
integers such that no integer is in its
own position. Let dn be the number
of derangements on n integers.
2 3 1
3 1 2
Inclusion/Exclusion - J. T. Butler
15
Inclusion/Exclusion - J. T. Butler
N(a1,a2,a3)=1 1 2 3
N(a1)=2
17
1
1
3
2
3
2
Inclusion/Exclusion - J. T. Butler
d3 = 2
16
Inclusion/Exclusion - J. T. Butler
U|
V|
W
2
3
2
1
1
3
3
2
1
3
2
1
18
N(a1,a2)=1
N(a1,a3)=1
N(a2,a3)=1
N(a2)=2
N(a3)=2
Inclusion/Exclusion - J. T. Butler
d n = N ( a1, a2 ,K, an ) = n !
FG nIJ ( n 1)!
H 1K
FG
H
IJ
K
x2 x3
xi
function is e x = 1 + x +
+ +... = .
2! 3!
i =0 i !
19
Inclusion/Exclusion - J. T. Butler
20
Example:
dn =
21
Inclusion/Exclusion - J. T. Butler
Inclusion/Exclusion - J. T. Butler
1 1 1
1
d ( n) = n! 1 + +L+ ( 1) n
1
!
2
!
3
!
n
!
1444442444443
Inclusion/Exclusion - J. T. Butler
Thus,
Inclusion/Exclusion - J. T. Butler
22
Example:
A man takes 8 spark plugs out of
his car to clean them. He
intended to put each back into the
same cylinder from which it
came, but got mixed up.
23
Inclusion/Exclusion - J. T. Butler
24
Inclusion/Exclusion - J. T. Butler
d8
8!
d8
is the probability that at least
8! one goes back in its original
position
Inclusion/Exclusion - J. T. Butler
25
8d7
d8
Inclusion/Exclusion - J. T. Butler
Inclusion/Exclusion - J. T. Butler
d8 +8d7
26
27
Inclusion/Exclusion - J. T. Butler
28
Inclusion/Exclusion - J. T. Butler
30
29
an ~ bn if lim
n
an is an asymptotic approximation
to bn. Typically, an is the exact
value, and bn is a simple
approximation.
Example: Fibonacci
Generating Function
A( x ) =
A( x ) = 1 + x + 2 x 2 + 3x 3 + 5 x 4 + ...
1
=
1 - x - x2
(1)
an =
F
GH
F
GH
1 1+ 5
2
5
I
JK
1+ 5
1
x
2
F
GH
1 1 5
2
5
1 -
I
JK
1- 5
x
2
a n = 0.724 1.618 n
I LM1 + 5 OP
JK N 2 Q
1 F 1 5 I L1 5 O
G JM P
5 H 2 KN 2 Q
1 1+ 5
2
5
an
=1
bn
value of
F
GH
I
JK
1 1+ 5
, etc.
2
5
F
GH
1 1+ 5
2
5
a n ~ bn =
I LM1 + 5 OP
JK N 2 Q
0.724 1.618 n
Asymptotic Approximations - J. T. Butler 7
Example:
LM 1 OP
N Q
A( x ) =
i greater than 1 complicates the calcula tion. However, we can proceed as follows.
x
x
x
1111
2
k
FG
H
1000
1000000
+
x
x
1
1
13
12
~ 4 5n .
IJ
K
x
15
FG
H
If
IJ
K
FG
H
IJ
K
Example:
A( x ) =
1 + x2
1 1+ x2
=
2
4 4x + x2
4
x
1
2
FG
H
IJ
K
LM FG
N H
IJ
K
IJ OP (5)
KQ
FG
H
1 1 n + 2 1
1 n 2 + 2 1
+ n2
n
n2
4 2n
2
5n 3
2n+2
g1 ( x )
FG1 x IJ
H K
FG1 x IJ
H K
Note that
then,
FG n i + s 1IJ =
H ni K
bn i + s 1gbn i + s 2g...(n i + 1) ,
bs 1g!
which is approximately n b s 1g!
FG 1 IJ FG n + s 1IJ + b FG 1 IJ FG n 1 + s 1IJ +
H K H n K H K H n 1 K
F 1 I FG n p + s 1IJ
...+b G J
(6)
H K H n p K
n
n 1
a n ~ b0
b0 + b1 x +...+b p x p
n p
s 1
when n is large.
Asymptotic Approximations - J. T. Butler 17
Thus,
an
n s 1
~
(b0 + b1 +...+b p p )
n
( s 1)!
an ~
n s 1
g( )
n ( s 1)!
n i=1 ( i ) in
( ) =
(7)
e t t 1dt .
t =0
b g
Properties
( ) = 1 ! when is
m m!
,
m ( + 1)( + 2)...( + m)
a positive integer.
( ) = lim
and
( ) = ( 1)
(0) = ,
t
( ) = lim (1 ) mt 1dt .
m
m
t =0
FG 1 IJ = 2
H 2K
FG 1IJ =
H 2K
.
Note:
Find an asymptotic
approximation to the number tn of
ordered binary trees with leaf nodes
given by
Theorem 1 applies to a
situation where there is more than one
singularity
on
the
circle
of
convergence (surrounding the region
|x|<r), where A(x) is analytic. In most
applications of this theorem, however, there is one or maybe two singularities.
T ( x) =
12
1 1
1
1 4x =
+
. (8)
2 2
2 1 4 x 1 2
Therefore,
tn
since
1
n 1 2
1
2
~
n
1 1
2 4
FG IJ FG IJ
H KH K
FG 1 IJ = 2
H 2K
References
1. Leuker, G.S., "Some techniques for solving
recurrences," Computing Surveys, Vol. 12,
No. 4, Dec. 1980.
2. Bender, E. A., "Asymptotic methods in enu meration," SIAM Review, Vol. 16,
No. 4, Oct. 1974.
Asymptotic Approximations - J. T. Butler 29
4 n 1
,
n3 2
N
F1
Structured
Flowchart
F1
F2
F1
F2
Fp
IF-THEN-ELSE
DO-WHILE
SEQUENCE
Let
represent a one-node IF-THEN-ELSE
flowchart and a one-node DO-WHILE
flowchart.
j
2
ITE
DW
SEQ
ITE ( x ) =
1
(a path)
ij
0
1
dj
0
1
dj
1
2
Structured Flowcharts - J. T. Butler 5
x
x
F ( x) F ( x) + F ( x 2 )
2
2
2
2
8
Structured Flowcharts - J. T. Butler 6
(1)
(2)
F ( x ) = 1 + ITE ( x ) + DW ( x ) + ITE ( x ) + DW ( x )
+ ITE ( x ) + DW ( x ) +K
(3)
xF 3 ( x )
xF ( x ) F ( x 2 )
+ xF 2 ( x ) +
+1
2
2
(5)
f 0 = 1,
f1 =
f 03
f2
+ f 02 + 0 = 2 ,
2
2
f2 =
3 f 0 f1
f f
+ 2 f 0 f1 + 0 1 = 8
2
2
and
xyF 2 ( x , y ) xyF ( x 2 , y 2 )
+
2
2
DW ( x , y ) = xF ( x , y )
1
F ( x, y) =
1 ITE ( x , y ) DW ( x , y )
ITE ( x , y ) =
(6)
(7)
F ( x, y ) =
(8)
xyF 3 ( x , y )
xyF ( x , y ) F ( x 2 , y 2 )
+ xF 2 ( x , y ) +
+1
2
2
(9)
3
a00
a2
+ 00 = 1
2
2
We have
F ( x, z) =
xF 3 ( x , z )
xF ( x , z ) F ( x 2 , z 2 )
+ xzF 2 ( x , z ) +
+1
2
2
b00 = 1
(10)
b003 b002
+
=1
2
2
b11 = b002 = 1
b10 =
3b00b10 b00b10
+
=2
2
2
3b b
b b
b21 = 00 11 + 2b00b11 + 00 11 = 4
2
2
b22 = 2b11
b20 =
F (x,t) is
F ( x , t ) = 1 + ITE ( x ) + DW ( x ) t + ITE ( x ) + DW ( x ) t 2 +K
or
F ( x, t ) =
1
1 t ITE ( x ) t DW ( x )
(11)
c00 = 1
xt F 2 ( x ) F ( x , t ) xt F ( x 2 ) F ( x , t )
F ( x, t ) =
+
2
2
+ xt F ( x ) F ( x , t ) + 1
f 02 c00 f 0c00
+
+ f 0c0 = 2
2
2
2c f f
c21 = 00 1 2 + f 1c00 = 4
2
f 02 c11 f 0c11
c22 =
+
+ f 0c11 = 4
2
2
c11 =
(12)
cc t + c
n1
n2
t 2 +K+ cnn t n x n ,
xt F 2 ( x ) F ( x , t ) xt F ( x 2 ) F ( x , t )
+
+ xt F ( x ) F ( x , t ) + 1
2
2
cc
n1
+ cn 2 t +K+ ncnn t n 1 x n .
Setting t = 1 yields
bc
n1
F ( x ,1) =
c11 =
F ( x , t )
xF ( x ) + F ( x ) F ( x ,1)
=
t t =1
2
xF ( x 2 ) F ( x ) + F ( x 2 ) F ( x ,1)
2
+ xF 2 ( x ) + xF ( x ) F ( x ,1)
+
2c11 =
f 03 + f 02 0 f 03 + f 02 0
+
+ f0 + f00 = 2
2
2
c
2
Avg.ht. = 11 = = 1.0
f1 2
3 f 02 f 1 + f 02 c11 + 0 f 0 f 1 + f 0c11
+
+ 2 f 0 f 1 + f 0c11 = 12
2
2
c21 + 2c22 12
Avg.ht. =
=
= 15
.
f2
8
DWW
UV
W
R
ITE
ST
1 2
Height
Introduction
Average
Asymptotic approximations
number of nodes
Variance
Asymptotic approximations
Conclusions
Introduction
decision diagram (BDD) graph representation of a switching
function, where
x2
1
0
x1
Binary
x3
1 x4
1
4
A threshold function, f ( x1 , x 2 ,... x n ) has the pro perty that f = 1 if and only if w1 x1 + w2 x 2 +...
For example, (1,1,1,1;4) is the weight threshold vector of the AND function,
whose BDD has been previously shown.
T ( x, y) =
x 3 y 5 2 x 3 y 7 + xy 3
b1 xyg c1 x y
2
2x2 y4
(1)
T ( x , y ) = ... + t n ,i x n y i + ... ,
where t n ,i is the number of Fibonacci
BDD' s with n variables and i nodes.
BDD Avg. No. of Nodes - J. T. Butler
10
We have
T ( x , y) =
... + x n [t n ,n + 2 y n + 2 + t n ,n + 4 y n + 4 +...]+... .
Setting y to 1 yields
d
T ( x , y ) =...+ x n [(n + 2) t n ,n + 2 + (n + 4) t n ,n + 4 +...]+... ,
dy
y =1
+ ( n + 4)t n ,n + 4 y n + 3 +...]+... .
11
12
y to 1 yields
T ( x) =
3 + 2x
c1 x x h
2 2
7 + 3x
1 x x2
1
b1 xg
3
.
1 x
1
5
(2)
13
1 + 5
n+2
(3)
14
Asymptotic Approximations
as follows.
F 11 + 5
GH 10
LM
N
61 + 31 5
OP LM1
Q N
2
10 5
2
(n + 1)
61 + 31 5
10 5
IJ
K
2
. (5)
5 1
15
16
5+ 2 5
2+6 5
n
18944
.
n 3.0832.
5
5
The only other known average number of
nodes is for symmetric functions, which is
n2
.
2
BDD Avg. No. of Nodes - J. T. Butler
I FG
JK H
17
18
No. of
Avg. No.
Variables of Nodes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Infinity
3.000
4.000
5.000
6.286
7.667
9.200
10.818
12.519
14.273
16.070
17.897
19.745
21.608
23.481
1.8944n
19
20
cuation of E ( X ).
BDD Avg. No. of Nodes - J. T. Butler
16 + 10 x
1 x x
+
h c
2 3
49 + 16 x
1 x x
21
49 + 25x
1 x x2
h c
2 2
b1 - xg b g b g b g
3
Asymptotic Approximations
1
23
2
+
1- x
1- x
1+ x
( 6)
FG
H
47 + 21 5
5 5
2
1
x
5 1
691 + 277 5
50
2
2
1
x
5 1
IJ FG
K H
3
22
23
IJ
K
2131 + 881 5
50 5
+
+ ... (7)
2
1
x
5 1
24
FG
H
IJ
K
b g
47 + 21 5 2
691 + 277 5
n + 3n + 2
n +1
50
10 5
+
2131 + 881 5
]
50 5
LM
N
2
5 1
OP
Q
100 44 5
228 28 5
n+
= 0.0645n + 6.6156. (9)
25
25
(8)
25
0.0645n + 6.6156
~ 0.2540 n
27
28
No. of
Standard
Variables Deviation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Infinity
26
0.000
0.000
0.000
0.700
0.943
1.327
1.585
1.853
2.049
2.224
2.354
2.462
2.543
2.609
1/2
0.2540n
29
30
Reference
Generating
functions provide an
effective way to compute
1.
J. T. Butler and T. Sasao,
Average number of nodes in binary
decision diagrams of Fibonacci
functions, The Fibonacci Quarterly,
Vol. 34.5, November 1996, pp. 413422.
Average values
Standard Deviation (Variance)
Generating
functions provide an
effective way to compute simple
asymptotic approximations
31
33
32