Sei sulla pagina 1di 46

CHAPTER 1

GENERATING FUNCTION
Infinite series in the form
The series is called Power.
Taylor series function f (x) around x = 0 is:

=
~
0 n
n
n
x a
( )
( )
( )

=
=
~
0
!
. 0
n
n
n
n
x
f x f
( ) ( ) ( ) ( ) ....
! 3
0 ' ' '
! 2
. 0 ' ' . 0 ' 0
3 2
+ + + + =
x
f
x
f x f f
Five Formula with Taylor series
1 rmula ........Fo .......... ..........
n!
x
e
~
0 n
n
x

=
=
2 rmula ........Fo .......... .......... x
x 1
1
~
0 n
n

=
=

{ } 3 ormula .........F .......... .......... 0 Z k ; x


n
1 n k
x 1
1
n
~
0 n
k
e
|
|
.
|

\
|
+
=
|
.
|

\
|

+
=

( ) 4 ormula .........F .......... .......... ..........


x 1
x 1
x ... x x x 1
1 n
n 3 2

= + + + + +
+
( ) 5.a la .....Formu .......... .......... .......... e e
2
1
......
6!
x
4!
x
2!
x
1
x x
6 4 2

+ = + + + +
( ) 5.b la .....Formu .......... .......... .......... e e
2
1
......
7!
x
5!
x
3!
x
x
x x
7 5 3

= + + + +
Formula for Combination
If then :

with:

1 , < e x R t
( )

=
|
|
.
|

\
|
= +
~
0
1
n
n
t
x
n
t
x
( )( ) ( )
1 ,
!
1 ... 2 1
0 , 1
>

+
=
=
|
|
.
|

\
|
n
n
n t t t t
n
n
t
( ) ( )

= =

= =
|
.
|

\
|
= |
.
|

\
|
|
.
|

\
|
=
~
0 0
~
0
~
0
.
n
n
n
k
k n k
n
n
n
n
n
n
x b a x b x a x B x A
Definition of generating function
Let (a
n
) = (a
1
, a
2
, a
3
, ...) is a sequence of real
numbers.

Ordinary Generating Function (FPB) from a
n
is:


Exponent Function Generator (FPE) from a
n
is:
( )

=
=
~
0 n
n
n
x a x P
( )

=
=
~
0
!
.
n
n
n
n
x
a x P
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.

( ) ( )( )( )
2 3 2
1 1 1 x x x x x x x P + + + + + + =
Examples problem of application
PROBLEM
Determine the number of ways n letters taken from the
word MATEMATIKA on the condition of each vowel and
consonant must be picked up at most 10 M drawn, and the
consonants K drawn at least 5 and at most 15. specify the
number of ways n letters decision.

COMPLETION
Note that the word MATEMATIKA there are 6 different
letters 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 generating
function.
Consonant M can be chosen at most 10, then the
consonant 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)

Generating function of the problem are:
( ) ( )( )( )( )
1 , , 15 5 0 terambil 10 terambil
... ... ... 1 ... 1
3
3 2 15 7 6 5 2 10 2
> s s > s
+ + + + + + + + + + + + + + =
I E A K T M
x x x x x x x x x x x x x P
( ) ( )( ) | | ( ) | |
3
10 2 5
11
... 1 ... 1
1
1
1
1
+ + + + + + +
|
.
|

\
|

|
|
.
|

\
|

= x x x x x x x
x x
x
x P
( )
6
2
11 8
1
1
1
|
.
|

\
|

=
x
x x
( )
k
n
k
x
k
k
x x x

=
|
|
.
|

\
|
+
+ =
0
30 19 8
1 6
2
30
0
19
0
8
0
5 5
2
5
+
=
+
=
+
=

|
|
.
|

\
|
+
+
|
|
.
|

\
|
+

|
|
.
|

\
|
+
=
k
n
k
k
n
k
k
n
k
x
k
k
x
k
k
x
k
k
( )
n
n
n
n
n
n
x
n
n
x
n
n
x
n
n
x P

= = =
|
|
.
|

\
|

+
|
|
.
|

\
|

|
|
.
|

\
|

=
~
30
~
19
~
8
30
25
19
14
2
8
3
Examples problem of application
PROBLEM
Determine the number of k combinations of n distinct objects if:
a). Repetition is not allowed
b). Repetition is allowed

COMPLETION
Suppose the object is O1, O2, O3, ...
a) Repetition not allowed
Because repetition is not allowed then each object is associated
with 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 without
repetition
( ) ( )( ) ( ) x x x x P + + + = 1 .... 1 1

=
|
|
.
|

\
|
=
~
0 k
k
x
k
n
n k
k
n
s s
|
|
.
|

\
|
0 ;
b). Repetition is allowed.
Since repetition is allowed, each object is associated with a
factor (1 + x + x2 + x3 + ...) in the generating function
Generating function of the problem is








Thus the number of combinations of k out of n objects with
repetition is the coefficient of xk in P (x), namely: the
coefficient of xk in P (x), namely:

( ) ( )
n
x x x x P ... 1
3 2
+ + + + =
n
x
|
.
|

\
|

=
1
1
k
n
k
x
k
k n

=
|
|
.
|

\
|
+
=
0
1
|
|
.
|

\
|
+
k
k n 1
Examples problem of application
PROBLEM
Determine the number of ways to put n identical balls
into k different boxes on the condition that there
should be no empty boxes.
COMPLETION:
Since there are k different boxes and each box can not
be empty, then the function generator from the above
problems are:

( )
k
x x x x P + + + =
3 2
) (
( )
t k
t
x
t
t k
+
=

|
|
.
|

\
|
+
=
~
0
1
n
k n
x
k n
n
x P

=
|
|
.
|

\
|

=
~
1
) (
Examples problem of application
PROBLEM
Given equation.
Determine the number of solutions of the equation!

COMPLETION:
Z z y x dan z y x z y x e > s s > = + + , , ; 2 , 5 0 , 0 . 10
( ) ( )( )( ) ... 1 ... 1
4 3 2 5 4 3 2 2
+ + + + + + + + + + + = x x x x x x x x x x x P
n
n
n
n
x
n
n
x
n
n

= =
|
|
.
|

\
|

|
|
.
|

\
|

=
~
8
~
2
8
6
2
( )
k
k
x
k
k
x x

=
|
|
.
|

\
|
+
=
~
0
8 2
1 3
8
~
0
2
~
0
2 2
+
=
+
=

|
|
.
|

\
|
+

|
|
.
|

\
|
+
=
k
k
k
k
x
k
k
x
k
k
Generating Function for Permutation
Given three different letters a, b, and c.
How many passwords of length n which can be
formed from a, b, and c such that in every
password: Point a appears at most 1, letter b
appears at most 3 and Point c appears at most 2
completion:



This is the generating function of the many
problems of passwords of length n is the
coefficient of:
( )
|
|
.
|

\
|
+ +
|
|
.
|

\
|
+ + +
|
.
|

\
|
+ =
! 2 ! 1
1
! 3 ! 2 ! 1
1
! 1
1
2 3 2
x x x x x x
x P
( ) x P
n
x
n
dalam
!
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.

COMPLETION
Generating function of the problem are:

( )
3
3 2
6
3 2
...
! 3 ! 2 ! 1
...
! 3 ! 2 ! 1
1
|
|
.
|

\
|
+ + +
|
|
.
|

\
|
+ + + + =
x x x x x x
x P
( ) ( )
3 6
1 =
x x
e e
( ) ( ) ( ) ( )

= = = =
+ =
~
0
~
0
~
0
~
0
!
6
!
7 3
!
8 3
!
9
n
n
n
n
n
n
n
n
n
n
n
n
n
x
n
x
n
x
n
x
Examples problem of application
PROBLEM
Let S be the set of n rows of binary numbers. If a line is
written at random what is the probability of the
sequence contains "0" as many as odd and "1" as much
as the even!

COMPLETION
Suppose that:
S = The set of n rows of binary numbers.
A = set of all binary n rows contain the numbers "0" and
odd numbers "1" as much as the even
Asked: P (A)
Exponential generating function to find n (A):

( )
|
|
.
|

\
|
+ + +
|
|
.
|

\
|
+ + + = ...
! 4 ! 2
1 ...
! 3 ! 2 ! 1
4 2 5 3
x x x x x
x P
( ) ( )
x x x x
e e e e

+ =
2
1
2
1
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
n
n
n
n
n
n
x
n
x
( )
( )

=

ganjil n
genap n
A n
n
; 2
; 0
1
( )
2
4 3 2
...
! 4 ! 3 ! 2 ! 1
1
|
|
.
|

\
|
+ + + + + =
x x x x
x P
|
|
.
|

\
|
=

=
~
0
!
. 2
n
n
n
n
x
( ) 0 2 > = n S n
n
( )
( )
( ) s n
A n
A P =

=
ganjil n
genap n
;
2
1
; 0
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
3 2 1 3 2 1 3 2 1
x x x x x x x x x
x P
( )
k
x x
x x P
|
|
.
|

\
|
+ + + = ...
! 3 ! 2
3 2
( )
( ) ( )x t k x t k
t
k
t
e e
t
k

=

|
|
.
|

\
|
=

ini bagian ekspansi ; 1


0
( ) ( )
|
|
.
|

\
|

|
|
.
|

\
|

|
|
.
|

\
|
=

= =
~
0 0
!
. 1
n
n
n t
k
t
n
x
t k
t
k
( ) ( )

=

|
|
.
|

\
|
=
k
t
n t
n
t k
t
k
a
0
1
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
n t
t k
t
k
k
k n S
0
1
!
1
,
Chapter 2
Recursive Relation
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:
a
n
+ h
1
(n) a
n-1
+ h
2
(n) a
n-2
+ h
3
(n) a
n-3
+ ... + H
k
(n) a
n-k
= f(n)
with h
i
(n) and f (n) is a function in and h
k
(n) 0
If f (n) = 0 then the relation rekursifnya called homogeneous, otherwise
called 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

Superposition Theorem
Theorem 1.2.1 (Principle of Superposition):

If g1 (n) the solution of a
n
+ c
1
a
n-1
+ c
2
a
n-2
+ c
3
a
n-3
+ ... + c
k
a
n-k
= f
1
(n)
and g
2
(n) solution of

a
n
+ c
1
a
n-1
+ c
2
a
n-2
+ c
3
a
n-3
+ ... + c
k
a
n-k
= f
2
(n)

then the linear combination
k
1
g
1
(n) + k
2
g
2
(n)

solution of a
n
+ c
1
a
n-1
+ c
2
a
n-2
+ c
3
a
n-3
+ ... + c
k
a
n-k
= k
1
f
1
(n) + k
2
f
2
(n).

Resolving Relationship With Recursive Linear
Homogeneous Constant Coefficient
The general form of linear homogeneous recursive relation with constant
coefficients are:
a
n
+ c
1
a
n-1
+ c
2
a
n-2
+ ... + c
k
a
n-k
= 0 ; n k... the recursive
a
0
= p
0
, a
1
= p
1
, ... a
k-1
= p
k-1
... terms / conditions of the initial

Completion steps:

Let a
n
= x
n
, x 0

2) Section rekursifnya be: x
n
+ c
1
x
n-1
+ c
2
x
n-2
+ ... + c
k
x
n-k
= 0
Smallest rank is n - k

3) For both sides of the equation by x
n-k
, is obtained:
x
k
+ c
1
x
k-1
+ c
2
x
k-2
+ ... + c
k
= 0
The equation above is an equation called the "Equation
Characteristics "of the recursive relation above. In the general recursive
relation
has k roots. Suppose the roots of the characteristic equation is
x
1
, x
2
, ... , X
k
.
CASE I: CHARACTERISTICS OF DIFFERENT ALL EQUAL ROOTS
In this case x
1
n
, x
2
n
, ... , x
k
n
is the solution of the above
recursive relation, so as a result of the superposition theorem
is obtained:
k
1
x
1
n
+ k
2
x
2
n
+ ... + k
k
x
k
n
solution of the recursive relation.
So, the solution of the recursive relation is:
a
n
= k
1
x
1
n
+ k
2
x
2
n
+ ... + k
k
x
k
n

Case II: ROOTS THERE COPIES characteristic equation
If the characteristic equation x
k
+ c
1
x
k-1
+ c
2
x
k-2
+ ... + c
k
= 0 of
the recursive relation a
n
+ c
1
a
n-1
+ ... + c
k
a
n-k
= 0 ; c
k
0 has
a root, say x
1
(double root m, m k) then the general
solution of recursive relationships involving x
1
has the form:
c
1
x
1
n
+ c
2
nx
1
n
+ c
3
n
2
x
1
n
+ c
4
n
3
x
1
n
+...+ c
m
n
m-1
x
1
n

Examples problem of application
Find the formula of the n numbers in the Fibonacci sequence.
Recursive relation for Fn are:
F
n
= F
n-1
+ F
n-2
, n 2
F
0
= F
1
= 1
Step-by-step solution:
Let F
n
= x
n
; x 0 then the recursive form of F
n
- F
n-1
- F
n-2
= 0
becomes:
x
n
- x
n-1
- x
n-2
= 0
for both sides of this last characteristic equation x
n-2

with the
characteristic equation is obtained as follows:
x
2
- x - 1 = 0
Examples problem of application
Look for a formula to satisfy the following relation
a
n-
= 3a
n-1
+ 6a
n-2
- 28a
n-3
+24a
n-4

with a
0
= 1 a
1
= 2 a
2
= 3 and a
3
= 4

completion:

Let a
n
= x
n
; x 0 then the form of recursive
x
n
- 3x
n-1
- 6x
n-2
+ 28x
n-3
- 24x
n-4
= 0


For both sides of this last characteristic equation x
n-4
obtained
the characteristic equation as follows:
x
4
- 3x
3
- 6x
2
+ 28x - 24 = 0

Equivalent to (x - 2)
3
(x + 3) = 0

a
n =
c
1
2
n
+ c
2
n2
n
+ c
3
n
2
2
n
+ c
4
(-3)
n



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 recursive
solution easily.
Examples of:
Use the ordinary generating function to solve
the following recursive relation:
a
0
= 1, a
1
= 3; a
n
= 2a
n-1
+ 4
n-1
, n 2

COMPLETION
Suppose P (x) is the ordinary generating function of
the sequence (a
n
), then by definition:


Since for n 2, a
n
= a
n-1
+ 2
n-1
+4
n-1
, if both sides of
this equation xn multiplied then summed for n = 2 to
n = , obtained


So that equation (1.3.1) becomes
P(x) - 1 - 3x =2x P(x) - 2x +
DERANGEMENT
Suppose there are n elements align in one row and labeled
1,2,3, ... .., n. Then the n elements in the row
dipermutasikan
The same such that there is no one occupying elemenpun
its original position. A permutation is called
Derangement.
Recursive Relation for D
n
is:



The formula for Dn is

Recursive Relation System
ISSUES.....

Suppose the stated amount of n-digit binary sequence that
includes:
"0" as much as an even number and "1" as much as an even
number;

b
n
stating the number of binary n-digit sequence that
contains "0" as much as even and "1" as many as odd;

c
n
is the number of binary n-digit sequence that contains
"0" as many as odd and "1" as much as fulfilled, and

d
n
is the number of binary n-digit sequence that contains
"0" as many as odd and "1" as many as odd.


Problems solutions

Since each n-digit binary sequence which
contains "0" as much as even and "1" even as
much as can be obtained from: a binary
sequence (n-1)-numbers that contain "0" as
much as even and "1" as many as odd by
adding / insert a digit "1", or a binary
sequence (n-1)-numbers that contain "0" as
many as odd and "1" as much even with the
add / insert a digit "0",
then obtained the following relationship:
Similarly, any n-digit binary sequence which contains
"0" as much as even and "1" as many as odd can be
obtained from:
a binary sequence (n-1)-numbers that contain "0" as
much as even and "1" as much even by inserting a
digit "1"; or
a 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:

With a similar argument can be shown that for
and, successively apply the following
relationship:


Furthermore, the
If a
0
= 1, b
0
= c
0
= d
0
= 0, then:

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:
Chapter 3
Principle of inclusion-exclusion
Principle of inclusion-exclusion
Theorem 3. 2. 1: (Principle of inclusion-exclusion)

If N is the number of objects in a set S and a
1
,. . . , a
r

properties - properties that may be possessed by a
n

object in S, then the number of objects in S that do
not have the properties of a
1
, a
2
,. . . , A
r
is
Many Objects That Have Exactly m
Properties
Theorem 3.3.1
Let a
1
, a
2
, ..., a
r
are traits that may be
possessed by an object in the set S, then a lot
of objects S which has exactly m r properties
are

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
Examples problem of application
PROBLEM
1. There is some integer from 1 to 1000 that
Not divisible by 3 or 5?
Not divisible by 3, 5, or 7?

COMPLETION
Let S = {1,2,3, ..., 1000}.
a
1
: the nature divisible by 3;
a
2
: the nature divisible by 5;
a
3
: nature is divisible by 7.
asked are:

(a). (b).
Completion
It is clear that. Next we get,
N (a
1
) = number of members of S is divisible by 3 = 333
N (a
2
) = number of members of S is divisible by 5 = 200
N (a
3
) = number of members of S is divisible by 7 = 142
N (a
1
a
2
) = number of members of S is divisible by 3 and
5 = 66
N (a
2
a
3
) = 28
N (a
1
a
3
) = 47
N (a
1
a
2
a
3
) = 9
Thus, the inclusion-exclusion principle, be
obtained


= 1000 - 333 - 200 - 66 = 533;




= 1000 - 333 - 200 - 142 + 66 + 47 + 28 9
= 457.

Examples problem of application
PROBLEM
A total of n different balls are placed into k different
boxes. What is the probability that there is an empty
box?

COMPLETION
Suppose S is the set of all events (distribution) is
possible. E
i
be the event that the empty box to i and
a
i
is the nature of that event Ei appears. In this case i
e {1,2, ..., k}

Examples problem of application
Use the principle of inclusion-exclusion to determine
banyaknsolusi round from the following equation:
x
1
+ x
2
+ x
3
= 20, 0 x
i
s 5, i e {1,2,3}
completion:
Let S be the set of all round solution of the equation x
1
+ x
2
+
x
3
= 20, xi 0 i e {1,2,3}. Then it can be shown that


According to the principle of inclusion-exclusion, is obtained:

Examples problem of application
A total of n pairs of husband and wife attending a
dance party. Classes held simultaneously and a
man dancing with a woman.

a) What is the probability there is exactly one
husband and wife pairs dancing together
in the dance?

b) What opportunities there are exactly three
husband and wife pairs dancing together
in the dance?

Completion
Let S be the set of all possible dance partner, and indicate the
nature a
i
where i is paired with her husband to his wife.
1 s i s n. Since there are n pairs of husband and wife, then
N = S = n!.
Furthermore, we obtain
Opportunities lie just one pair of husband-wife dance
together is:


opportunities there are exactly three pairs of husband-wife
dance together is:

Potrebbero piacerti anche