Application of Residue Theorem to evaluate real integrations.pptx
Summation Series
1. Sums
Notation: We will be working with sums of the general form
1 2 3 1n na a a a a
This form of representing sums is called three-dot notation. Other alternative notations
are also available to represent sums.
1
k
k n
a
is called Sigma-notation because it uses the Greek letter (sigma).
1
n
k
k
a
is called delimited form to represent sums.
For example, we can express the sum of the squares of all odd positive integers below
100 as follows:
. The delimited equivalent of this sum is
49
2
0
(2 1)
k
k
.
The biggest advantage of Sigma-notation is that we can manipulate it more easily than
the delimited form. For example, suppose we want to change the index k to k+1.
1 1 1
k k
k n k n
a a
it is easy to see what is going one. But for delimited form, we have
1
1
1 0
n n
k k
k k
a a
it is harder to see what is happed and more likely to make mistake. But
delimited form is nice and tidy, we can write it quickly.
People are often tempted to write
1
2
( 1)( )
n
k
k k n k
instead of
0
( 1)( )
n
k
k k n k
because
the terms for k = 0, 1 and n in this sum are zero. But it is more helpful to keep upper and
lower bounds on an index of summation as simple as possible, because sum can be
manipulated much more easily when the bounds are simple. Indeed the form
1
2
n
k
can
even be ambiguous, because it’s meaning is not clear when n = 0 or n = 1.
Sums and Recurrences: There is an intimate relation between sums and recurrences.
The sum
0
n
n k
k
S a
is equivalent to the recurrence
0 0S a
1n n nS S a , for 0n (1)
Therefore, we can evaluate sums by using methods we learned earlier to solve recurrence
in closed form. For example, if na is equal to a constant plus a multiple of n, the
recurrence takes the following form:
0R
1n nR R n , for 0n (2)
If we look after small cases to solve the above recurrence then we get
2
1 100
odd
k
k
k
2. 1 0R R
2 1 2 2 2 3R R ,
3 2 3 2 3 3 3 6R R
and so on, in general the solution can be written in the form ( ) ( ) ( )nR A n B n C n
where A(n), B(n) and C(n) are coefficients of dependence on the general parameters
, and . Setting 1nR in equation (2), we get
1
1 1 0 0 and 0n n
hence ( ) 1A n .
Setting nR n in equation (2), we get
0
1 1 1 and 0n n n n
hence ( )B n n .
Again, setting 2
nR n in equation (2), we get
2 2 2 2
0
( 1) 2 1 2 1 1 and 2n n n n n n n n n
hence 2 2
2 ( ) ( ) 2 ( ) ( ) ( 1)
2
n
C n B n n C n n n C n n
Putting the values of A(n), B(n) and C(n) we get the solution of equation (2)
( 1)
2
n
n
R n n
Therefore if we want to evaluate
0
( )
n
k
a bk
, then we can write the sum as follows
0S a
1n nS S a bn , for 0n
Comparing with general equation (2) with the above sum, we get , anda a b .
Thus
0
( ) ( 1) ( 1) ( 1) ( 1)( )
2 2 2
n
k
n n nb
a bk a na n b a n n b n a
Conversely, many recurrences can be reduced to sums. For example, we are going to
transfer the Tower of Hanoi recurrence solution into sums.
0 0T
12 1n nT T , for 0n
Dividing both side by 2n
, we get
0
0 0
0
2 2
T
1 1
1
2 1 2
2 2 2 2
nn n n
n n n n
T T T
, for 0n
3. Setting
2
n
nn
T
S , we get
0 0S
1 2 n
n nS S
, for 0n
= ( 1)
2 2 2n n
nS
= ( 2) ( 1)
3 2 2 2n n n
nS
= ( 1) ( 2) ( 3) ( 2) ( 1)
2 2 2 2 2 2n n n n n n n n n
n nS
= 1 2 3 ( 2) ( 1)
0 2 2 2 2 2 2n n n
S
=
1
2
n
k
k
We have derived sum from the Tower of Hanoi recurrence solution. Adding 0
2 with both
side of the sum, we get
0 0
1
2 2 2
n
k
n
k
S
0 1 2 2 1
1 1 1 1 1 11
2 2 2 2 2 2n n nnS
1
11
2 1
11
2
n
nS
1
12(1 ) 1
2nnS
11
2 2
n
n n
T
2 1n
nT
The trick of dividing both-side by 2n
in Tower of Hanoi recurrence to get fromn nS T is a
special case of a general technique that can reduce virtually any recurrence of the form
1n n n n na T b T c (3)
to a sum. The idea is to multiple both sides by a summation faction, ns :
1n n n n n n n ns a T s b T s c
This factor ns is clearly chosen to make 1 1n n n ns b s a
Then if we write n n n nS s a T , we have a sum-recurrence
1 1 1 1 1n n n n n n n n n n n n n nS s b T s c s a T s c S s c
Hence, 1 2 1 1n n n n n n n n nS S s c S s c s c
0 1 1 2 2 1 1
0 0 0 0 1 1 0
1 1 1
n n n n
n n n
k k k k k k
k k k
S s c s c s c s c
S s c s a T s c s bT s c
4. The solution of the general recurrence is 1 1 0
1
1
( )
n
n
n k k
kn n n n
S
T s bT s c
s a s a
(4)
For example, when n = 1, then 1 1 0 1 1 1 0 1
1
1 1 1
( ) ( )s bT s c bT c
T
s a a
. The value of 1s
cancels out, so it can be anything but zero. To find out the right summation factor, ns we
can unfold the relation 1 1 2 2 1 1 1 2 1
1 2 1
n n n n n n n
n
n n n n n
s a s a a s a a a
s
b b b b b b
Thus, 1 2 1
2 1
n n
n
n n
a a a
s
b b b
or any convenient constant multiple of this value, will be a
suitable summation factor.
To understand the whole process, we are going to apply these ideas to solve the average
number of comparison steps required by quick-sort when it is applied to n items
0 0C
1
0
2
( 1)
n
n k
k
C n C
n
, for 0n (5)
We can find out some small cases from the above sum to guess the solution.
1 0(1 1) 2 2C C
2 0 1
2
(2 1) ( ) 3 2 5
2
C C C
With the intent to simplify the equation (5), we can multiply both sides by n
1 1
2
0 0
( 1) 2 2
n n
n k k
k k
nC n n C n n C
, for 0n (6)
hence, if we replace n by (n-1), we get
2
2
1
0
( 1) ( 1) ( 1) 2
n
n k
k
n C n n C
, for 1 0n (7)
Now, we can subtract equation (7) from equation (6) to get rid of sign
1 2
2 2
1
0 0
( 1) 2 ( 2 1) ( 1) 2
n n
n n k k
k k
nC n C n n C n n n C
, for 1n
2 2
2 2
1
0 0
2 2 2 1 1 2
n n
k n k
k k
n n C C n n n C
Now, we are going to find out a suitable summation faction for the above recurrence.
Here, na n , 1nb n and 2nc n .
Thus the summation faction, 1 2 2 1
1 3 2
( 1) ( 2) 2 1 2
( 1) 4 3 ( 1)
n n
n
n n
a a a a n n
s
b b b b n n n n
.
The solution to our recurrence according to equation (4), is therefore
0
1 1
( 1) 2 2 1
[ (1 1) 2 ] 2( 1)
2 (1 1) 1 ( 1) 1
n n
n
k k
n n
C C k n
n k k k
(8)
, for n 1
2n 2Cn1 , for n 11
5. We can represent nC using Harmonic number,
1
1 1 1 1 1
1
2 3 1
n
n
k
H
n n k
To find out the closed form of quick-sort recurrence, we have to find out the summation
portion of the equation.
1 1
1 1 1 1 1 1 1 1 1 1 1 1
(1 ) 1
1 2 3 1 2 3 1 1 1
n n
n
k k
n n
H
k n n n n k n n
Putting the value of summation in equation (8), we get
2( 1)[ ] 2( 1) 2
1
n n n
n
C n H n H n
n
.
We can check small cases to verify our solution
1 12(1 1) 2 1 4(1) 2 4 2 2C H
2 2
1 3
2(2 1) 2 2 6(1 ) 4 6 4 5
2 2
C H
3 3
1 1 11 44 26
2(3 1) 2 3 8(1 ) 6 8 6 6
2 3 6 3 3
C H
☺Good Luck☺
6. Sums
Manipulation of Sums: Let P be any finite set of integers. Sums over the elements
of P can be transformed by using three simple rules:
Distributive Law: k k
k P k P
ca c a
(1)
Associative Law: ( )k k k k
k P k P k P
a b a b
(2)
Commutative Law: k m
k P m P
a a
(3)
For example, if { 1,0,1}K and m k these three laws tell us respectively that
1 0 1 1 0 1( )ca ca ca c a a a [Distributive Law]
1 1 0 0 1 1 1 0 1 1 0 1( ) ( ) ( ) ( ) ( )a b a b a b a a a b b b [Associative Law]
1 0 1 1 0 1a a a a a a [Commutative Law]
Suppose, we want to compute the general sum,
0
( )
k n
S a bk
By using commutative law, we can replace k by n k , obtaining
0 ( ) 0
( ( )) ( )
n k n k n
S a b n k a bn bk
These two equations can be added by using associative law:
0 0 0 0
2 ( ) ( ) ( ) (2 )
k n k n k n k n
S a bk a bn bk a bk a bn bk a bn
Now, we can apply distributive law to evaluate the sum.
0 0
2 (2 ) (2 ) 1 (2 )( 1)
(2 )( 1)
( )( 1)
2 2
k n k n
S a bn a bn a bn n
a bn n bn
S a n
Perturbation Method: This method is used to evaluate a sum in closed form. The
operation of splitting off a term is the basis of this method. The idea is to start with an
unknown sum and call it nS .
0
n k
k n
S a
Then, we rewrite 1nS in two ways, by splitting off both its last term and its first term:
1 0 0 1 0 1
0 1 1 1 1 1 1 0
n n k k k k
k n k n k n k n
S a a a a a a a a
Now, we try to represent the last in terms of nS and if we succeed then we obtain an
equation whose solution is the sum we seek.
For example, let’s use this technique to find out the sum,
0
k
n
k n
S ax
.
1 0 1
1 1 1 1 1 0
n k k k
n n
k n k n k n
S ax ax ax a ax a x ax a xS
7. 1n
n nS xS a ax
1
(1 )
1
n
n
a x
S
x
, for 1x
Let’s try perturbation technique for another example. Evaluate
0
2k
k n
k
.
Let,
0
2k
n
k n
S k
1 0 1 1 1
0 0 0 0 0
( 1) 2 0 2 ( 1) 2 2 2 2 2 2 2n k k k k k
n
k n k n k n k n k n
S n k k k
Let,
0
2k
n
k n
R
. Now, first we find out the sum of nR , using the result we get nS finally.
1 0 1
0 0
2 2 2 1 2 2 1 2n k k
n n
k n k n
R R
1
1
2 1 2
2 1
n
n n
n
n
R R
R
Now, 1 1 2
0 0
( 1) 2 2 2 2 2 2 2(2 1) 2 2 2n k k n n
n n n
k n k n
S n k S S
1 1 2 1 1 1 1 1
2 2 2 2 2 2 (1 2) 2 2 2 2 2 ( 1)2n n n n n n n n
nS n n n n
Try to prove that
1 2
2
0
( 1)
(1 )
n nn
k
k
x n x nx
kx
x
using perturbation technique.
☺Good Luck☺