Post on 05-Apr-2018
7/31/2019 Math Diskrit
1/46
CHAPTER 1
GENERATING FUNCTION
7/31/2019 Math Diskrit
2/46
Infinite series in the form
The series is called Power.
Taylor series function f (x) around x = 0 is:
~
0n
n
nxa
~
0 !.0
n
nn
n
xfxf
....!30'''!2.0''.0'0
32
x
f
x
fxff
7/31/2019 Math Diskrit
3/46
Five Formula with Taylor series
1rmula........Fo....................n!
xe
~
0n
nx
2rmula........Fo....................xx1
1 ~
0n
n
3ormula.........F....................0Zk;xn
1nk
x1
1 n~
0n
k
4ormula.........F..............................x1
x1x...xxx1
1nn32
5.ala.....Formu..............................ee21......
6!x
4!x
2!x1 xx
642
5.bla.....Formu..............................ee2
1......
7!
x
5!
x
3!
xx xx
753
7/31/2019 Math Diskrit
4/46
Formula for Combination
If then :
with:
1, xRt
~
0
1n
nt xn
tx
1,
!
1...21
0,1
n
n
ntttt
n
n
t
~
0 0
~
0
~
0
.n
nn
k
knk
n
n
n
n
n
n xbaxbxaxBxA
7/31/2019 Math Diskrit
5/46
Definition of generating function
Let (an) = (a1, a2, a3, ...) is a sequence of realnumbers.
Ordinary Generating Function (FPB) from an is:
Exponent Function Generator (FPE) from an is:
~
0n
n
nxaxP
~
0 !.
n
n
nn
xaxP
7/31/2019 Math Diskrit
6/46
Generating functions for Combinations
Suppose there are three different objects, a, b,
and c. How many ways to pick n objects with a
drawn object condition at most 1, b are drawn
at most 3, and c are being picked up at most 2.
This form is called the ordinary generating
function of the problem.
232 111 xxxxxxxP
7/31/2019 Math Diskrit
7/46
Examples problem of application PROBLEM
Determine the number of ways n letters taken from theword MATEMATIKA on the condition of each vowel andconsonant must be picked up at most 10 M drawn, and theconsonants K drawn at least 5 and at most 15. specify thenumber of ways n letters decision.
COMPLETIONNote that the word MATEMATIKA there are 6 differentletters are M, T, K, A, E, I and the letters are vowels A, E, I.Since each vowel should be drawn, each vowel is
associated with a factor (x + x2 + x3 + ...) in the generatingfunction.Consonant M can be chosen at most 10, then theconsonant M associated with a factor (1 + x + x2 + ... + x10).Consonants K can be chosen at least 5 and at most 15
associated with a factor (x5 + x6 + x7 + ... + x15)
7/31/2019 Math Diskrit
8/46
Generating function of the problem are:
1,,1550terambil10terambil
.........1...1332157652102
IEAKTM
xxxxxxxxxxxxxP
3102511
...1...11
1
1
1
xxxxxxx
xx
xxP
6
2118
111
x
xx
kn
k
xk
kxxx
0
3019816
2
30
0
19
0
8
0
5525
k
n
k
k
n
k
k
n
k
xk
kxk
kxk
k
nn
n
n
n
n
xn
nx
n
nx
n
nxP
~
30
~
19
~
8 30
25
19
142
8
3
7/31/2019 Math Diskrit
9/46
Examples problem of application PROBLEM
Determine the number of k combinations of n distinct objects if:a). Repetition is not allowedb). Repetition is allowed
COMPLETIONSuppose the object is O1, O2, O3, ...
a) Repetition not allowedBecause repetition is not allowed then each object is associatedwith a factor (1 + x) the generating function.Generating function of the above problems are:
Thus the number of combinations of k out of n objects withoutrepetition
xxxxP 1....11
~
0k
kx
kn
nk
k
n
0;
7/31/2019 Math Diskrit
10/46
b). Repetition is allowed.
Since repetition is allowed, each object is associated with afactor (1 + x + x2 + x3 + ...) in the generating functionGenerating function of the problem is
Thus the number of combinations of k out of n objects withrepetition is the coefficient of xk in P (x), namely: thecoefficient of xk in P (x), namely:
nxxxxP ...1 32 n
x
1
1
kn
k
xk
kn
0
1
k
kn 1
7/31/2019 Math Diskrit
11/46
Examples problem of application
PROBLEMDetermine the number of ways to put n identical ballsinto k different boxes on the condition that thereshould be no empty boxes.COMPLETION:
Since there are k different boxes and each box can notbe empty, then the function generator from the aboveproblems are:
kxxxxP 32)(
tkt
xt
tk
~
0
1
n
kn
x
kn
nxP
~ 1)(
7/31/2019 Math Diskrit
12/46
Examples problem of application
PROBLEMGiven equation.
Determine the number of solutions of the equation!
COMPLETION:
Zzyxdanzyxzyx ,,;2,50,0.10
...1...1 43254322 xxxxxxxxxxxP
n
n
n
n
xn
nx
n
n
~
8
~
2 8
6
2
kk
xk
kxx
~
0
8213
8~
0
2~
0
22
k
k
k
k
xk
kxk
k
7/31/2019 Math Diskrit
13/46
Generating Function for Permutation
Given three different letters a, b , and c.How many passwords of length n which can beformed from a, b , and c such that in everypassword: Point a appears at most 1, letter bappears at most 3 and Point c appears at most 2
completion:
This is the generating function of the manyproblems of passwords of length n is thecoefficient of:
!2!11
!3!2!11
!11
232 xxxxxxxP
xP
n
xn
dalam
!
7/31/2019 Math Diskrit
14/46
Examples problem of application PROBLEM
Determine the number of passwords of length n formed from
the word combinatorics such that each vowel must appear in
every password.
COMPLETIONGenerating function of the problem are:
3
326
32
.. .!3!2!1
.. .!3!2!1
1
xxxxxxxP
36 1 xx ee
~
0
~
0
~
0
~
0 !
6
!
73
!
83
!
9
n
nn
n
nn
n
nn
n
nn
n
x
n
x
n
x
n
x
7/31/2019 Math Diskrit
15/46
Examples problem of application PROBLEM
Let S be the set of n rows of binary numbers. If a line iswritten at random what is the probability of thesequence contains "0" as many as odd and "1" as muchas the even!
COMPLETIONSuppose that:S = The set of n rows of binary numbers.A = set of all binary n rows contain the numbers "0" andodd numbers "1" as much as the even
Asked: P (A)Exponential generating function to find n (A):
...
!4!21...
!3!2!1
4253 xxxxxxP
xxxx eeee 2121
7/31/2019 Math Diskrit
16/46
Exponential generating function to find n (S):
So the chances of the sequence contains "0" as much
as even-odd and 1 is:
~
0
~
0 !.2
!.2
4
1
n
nn
n
nn
n
x
n
x
ganjiln
genapnAn
n ;2
;0
1
2
432
...!4!3!2!1
1
xxxxxP
~
0 !.2
n
nn
n
x 02 nSn n
snAn
AP
ganjiln
genapn
;2
1
;0
7/31/2019 Math Diskrit
17/46
Examples problem of application Determine the number of ways to put n balls into k boxes
such that no box is empty if:Different balls in different boxes
Different balls in a box identical
Since n different balls in k different boxes and no boxes are
empty then the generating function exponent is:
.. .
!3!2!1...... .
!3!2!1...
!3!2!1
321321321 xxxxxxxxxxP
k
xxxxP
.. .
!3!2
32
xtkxtktk
t
eet
k
inibagianekspansi;1
0
~
00 !.1
n
nnt
k
t n
xtk
t
k
k
t
nt
n tkt
ka
0
1
7/31/2019 Math Diskrit
18/46
If the box is identical to the number of way in
question is the answer to number a) above,
divided by K!.
So many ways to put an object with no empty
box is:
k
t
nttk
t
k
kknS
0
1!
1,
7/31/2019 Math Diskrit
19/46
Chapter 2
Recursive Relation
7/31/2019 Math Diskrit
20/46
Recursive Relation Linear Recursive Relations with Constant Coefficients
The general form of recursive part, of a linear recursive relation of
degree k is as follows:
an + h1 (n) an-1 + h2 (n) an-2 + h3 (n) an-3 + ... + Hk (n) an-k = f(n)
with hi (n) and f (n) is a function in and hk(n) 0
If f (n) = 0 then the relation rekursifnya called homogeneous, otherwisecalled nonhomogeneous.
Homogeneous Linear Recursive Relations with Constant Coefficients
The general form of linear homogeneous recursive relation with
constant coefficients are as follows:
c1an + an-1 + ... Ckan +-k = 0; ck 0 (1.2.1)
with k initial conditions, and for 1 i k, ci = constant
7/31/2019 Math Diskrit
21/46
Superposition Theorem
Theorem 1.2.1 (Principle of Superposition):
If g1 (n) the solution of an + c1an-1+ c2an-2+ c3an-3 + ... + ckan-k=f1(n)
and g2(n) solution of
an + c1an-1+ c2an-2+ c3an-3 + ... + ckan-k=f2(n)
then the linear combination
k1 g1(n) + k2 g2(n)
solution of an + c1an-1+ c2an-2+ c3an-3 + ... + ckan-k= k1f1(n) + k2 f2(n).
7/31/2019 Math Diskrit
22/46
Resolving Relationship With Recursive Linear
Homogeneous Constant Coefficient
The general form of linear homogeneous recursive relation with constantcoefficients are:an + c1an-1 + c2an-2 + ... + ckan-k= 0 ; n k... the recursivea0 = p0, a1 = p1 , ... ak-1 = pk-1 ... terms / conditions of the initial
Completion steps:
Let an = xn, x 0
2) Section rekursifnya be:xn + c1xn-1 + c2x
n-2 + ... + ckxn-k= 0
Smallest rank is n - k
3) For both sides of the equation by xn-k, is obtained:xk+ c1xk-1 + c2xk-2 + ... + ck= 0
The equation above is an equation called the "EquationCharacteristics "of the recursive relation above. In the general recursive
relationhas k roots. Suppose the roots of the characteristic equation isx1, x2, ... , Xk.
7/31/2019 Math Diskrit
23/46
CASE I: CHARACTERISTICS OF DIFFERENT ALL EQUAL ROOTS
In this case x1n, x2
n, ... , xkn is the solution of the above
recursive relation, so as a result of the superposition theorem
is obtained:k1x1
n + k2x2n + ... + k
kxkn solution of the recursive relation.
So, the solution of the recursive relation is:
an
= k1x1n+ k2x2
n+ ... + kkxkn
Case II: ROOTS THERE COPIES characteristic equation
If the characteristic equation xk+ c1xk-1+ c2x
k-2+ ... + ck
= 0 of
the recursive relation an + c1an-1 + ... + ckan-k = 0 ; ck 0 has
a root, say x1 (double root m, m k) then the generalsolution of recursive relationships involving x1 has the form:
c1x1n+ c2nx1
n+ c3n2x1
n+ c4n3x1
n+...+ cmnm-1x1
n
7/31/2019 Math Diskrit
24/46
Examples problem of application Find the formula of the n numbers in the Fibonacci sequence.
Recursive relation for Fn are:Fn = Fn-1 + Fn-2, n 2
F0 = F1 = 1
Step-by-step solution:
Let Fn = xn; x 0 then the recursive form of Fn - Fn-1 - Fn-2 = 0
becomes:
xn - xn-1 - xn-2 = 0
for both sides of this last characteristic equation xn-2with the
characteristic equation is obtained as follows:
x2 - x - 1 = 0
7/31/2019 Math Diskrit
25/46
Examples problem of application
Look for a formula to satisfy the following relationan-= 3an-1 + 6an-2 - 28an-3+24an-4with a0 = 1 a1 = 2 a2 = 3 and a3 = 4
completion:
Let an = xn
; x 0 then the form of recursivexn 3xn-1 6xn-2 + 28xn-3 24xn-4 = 0
For both sides of this last characteristic equation xn-4 obtainedthe characteristic equation as follows:x4 3x3 6x2 + 28x 24 = 0
Equivalent to (x - 2)3 (x + 3) = 0
an =c12n+ c2n2
n+ c3n22n+ c4(-3)
n
7/31/2019 Math Diskrit
26/46
Resolving Recursive Relation With
Generating Function
In previous chapters we have been talking
about generating functions and applications.
In this section we will see that the generating
function can also be used to find a recursivesolution easily.
Examples of:
Use the ordinary generating function to solvethe following recursive relation:
a0 = 1, a1 = 3; an = 2an-1 + 4n-1, n 2
7/31/2019 Math Diskrit
27/46
COMPLETION Suppose P (x) is the ordinary generating function of
the sequence (an), then by definition:
Since for n 2, an = an-1 + 2n-1+4n-1, if both sides of
this equation xn multiplied then summed for n = 2 ton = , obtained
So that equation (1.3.1) becomes
P(x) - 1 - 3x=2xP(x) - 2x +
7/31/2019 Math Diskrit
28/46
DERANGEMENT
Suppose there are n elements align in one row and labeled1,2,3, ... .., n. Then the n elements in the row
dipermutasikanThe same such that there is no one occupying elemenpun
its original position. A permutation is calledDerangement.Recursive Relation for Dn is:
The formula for Dn is
7/31/2019 Math Diskrit
29/46
Recursive Relation System
ISSUES.....
Suppose the stated amount of n-digit binary sequence thatincludes:"0" as much as an even number and "1" as much as an even
number;
bn stating the number of binary n-digit sequence thatcontains "0" as much as even and "1" as many as odd;
cn is the number of binary n-digit sequence that contains"0" as many as odd and "1" as much as fulfilled, and
dn is the number of binary n-digit sequence that contains"0" as many as odd and "1" as many as odd.
7/31/2019 Math Diskrit
30/46
Problems solutions
Since each n-digit binary sequence whichcontains "0" as much as even and "1" even asmuch as can be obtained from: a binarysequence (n-1)-numbers that contain "0" as
much as even and "1" as many as odd byadding / insert a digit "1", or a binarysequence (n-1)-numbers that contain "0" asmany as odd and "1" as much even with the
add / insert a digit "0",then obtained the following relationship:
7/31/2019 Math Diskrit
31/46
Similarly, any n-digit binary sequence which contains
"0" as much as even and "1" as many as odd can beobtained from:
a binary sequence (n-1)-numbers that contain "0" as
much as even and "1" as much even by inserting a
digit "1"; ora binary sequence (n-1)-numbers that contain "0" as
many as odd and "1" as many as odd by inserting a
digit "0". Thus obtained the following relationship:
7/31/2019 Math Diskrit
32/46
With a similar argument can be shown that for
and, successively apply the followingrelationship:
Furthermore, the
If a0 = 1, b0 = c0 = d0 = 0, then:
7/31/2019 Math Diskrit
33/46
Next, we use generating functions to solve the
recursive system. Suppose that A (x), B (x), C(x) and D (x), respectively, ordinary generating
function of an, bn, cn, and dn, is obtained:
7/31/2019 Math Diskrit
34/46
7/31/2019 Math Diskrit
35/46
7/31/2019 Math Diskrit
36/46
Chapter 3
Principle of inclusion-exclusion
7/31/2019 Math Diskrit
37/46
Principle of inclusion-exclusion
Theorem 3. 2. 1: (Principle of inclusion-exclusion)
If N is the number of objects in a set S and a1,. . . , ar
properties - properties that may be possessed by anobject in S, then the number of objects in S that do
not have the properties of a1, a2,. . . , Ar is
7/31/2019 Math Diskrit
38/46
Many Objects That Have Exactly m
Properties
Theorem 3.3.1
Let a1, a2, ..., ar are traits that may be
possessed by an object in the set S, then a lot
of objects S which has exactly m r propertiesare
7/31/2019 Math Diskrit
39/46
Many objects that have properties of
total Even or Odd
Theorem 3.4.1:
If in the set S there is r nature, then the number of
objects that S has an even number of properties are:
S and the number of objects that have properties of
an odd number is
7/31/2019 Math Diskrit
40/46
Examples problem of application
PROBLEM1. There is some integer from 1 to 1000 thatNot divisible by 3 or 5?Not divisible by 3, 5, or 7?
COMPLETIONLet S = {1,2,3, ..., 1000}.a1: the nature divisible by 3;a2: the nature divisible by 5;
a3: nature is divisible by 7.asked are:
(a). (b).
7/31/2019 Math Diskrit
41/46
Completion
It is clear that. Next we get,
N (a1) = number of members of S is divisible by 3 = 333
N (a2) = number of members of S is divisible by 5 = 200
N (a3) = number of members of S is divisible by 7 = 142N (a1a2) = number of members of S is divisible by 3 and
5 = 66
N (a2a3) = 28
N (a1a3) = 47
N (a1a2a3) = 9
7/31/2019 Math Diskrit
42/46
Thus, the inclusion-exclusion principle, beobtained
= 1000 - 333 - 200 - 66 = 533;
= 1000 - 333 - 200 - 142 + 66 + 47 + 28 9
= 457.
7/31/2019 Math Diskrit
43/46
Examples problem of application PROBLEM
A total of n different balls are placed into k differentboxes. What is the probability that there is an empty
box?
COMPLETION
Suppose S is the set of all events (distribution) is
possible. Ei be the event that the empty box to i and
ai is the nature of that event Ei appears. In this case i {1,2, ..., k}
7/31/2019 Math Diskrit
44/46
Examples problem of application
Use the principle of inclusion-exclusion to determinebanyaknsolusi round from the following equation:
x1 + x2 + x3 = 20, 0 xi 5, i {1,2,3}
completion:
Let S be the set of all round solution of the equation x1
+ x2
+
x3= 20, xi 0 i {1,2,3}. Then it can be shown that
According to the principle of inclusion-exclusion, is obtained:
7/31/2019 Math Diskrit
45/46
Examples problem of application
A total of n pairs of husband and wife attending adance party. Classes held simultaneously and aman dancing with a woman.
a) What is the probability there is exactly onehusband and wife pairs dancing togetherin the dance?
b) What opportunities there are exactly threehusband and wife pairs dancing togetherin the dance?
7/31/2019 Math Diskrit
46/46
Completion
Let S be the set of all possible dance partner, and indicate the
nature ai where i is paired with her husband to his wife.
1 i n. Since there are n pairs of husband and wife, then
N = S = n!.
Furthermore, we obtainOpportunities lie just one pair of husband-wife dance
together is:
opportunities there are exactly three pairs of husband-wife
dance together is: