Discrete Structures Lecture 11
Discrete Structures Lecture 11
(Discrete Mathematics)
Fall 2016
Lecture - 11
Sequences
and
Summations
Sequences
n an
Sequences
𝑎, 𝑎𝑟, 𝑎𝑟 2 , … . , 𝑎𝑟 𝑛 , …
𝑎, 𝑎 + 𝑑, 𝑎 + 2𝑑, … . , 𝑎 + 𝑛𝑑, …
3, 9, 15, 21, …
4, 1, −2, … , 𝑖𝑠 − 77
Determining the Sequence Formula
• Given values in a sequence, how do you determine the
formula?
• Steps to consider:
• Is it an arithmetic progression (each term a constant
amount from the last)?
• Is it a geometric progression (each term a factor of the
previous term)?
• Does the sequence repeat itself (or cycle)?
• Does the sequence combine previous terms?
• Are there runs of the same value?
Sequences (Example)
1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, …
Solution:
Solution:
*1/2𝑛;1 +
It is a geometric progression.
a=1 and r=1/2
Sequences (Example)
• Find formula for the following sequence.
1, 3, 5, 7, 9, …
Solution:
*2𝑛 − 1+
It is a arithmetic progression.
a=1 and d=2
Sequences (Example)
• Find formula for the following sequence.
1, −1, 1, −1, 1, …
Solution:
* −1 𝑛;1 +
It is a geometric progression.
a=1 and r=-1
Sequences (Example)
Solution:
Solution:
Compare it to *3𝑛 +.
*3𝑛 −2+
Summations
• The sum of the terms 𝑎𝑚 , 𝑎𝑚:1 , … , 𝑎𝑛 from the sequence
{𝑎𝑛 } is:
• 𝑎𝑚 , 𝑎𝑚:1 , … , 𝑎𝑛
𝑛
• 𝑗<𝑚 𝑎𝑗
• 𝑚≤𝑗≤𝑛 𝑎𝑗 , where donates summation and j is the
index of summation.
𝑎𝑗
𝑗<𝑚
is like a for loop:
int sum = 0;
for ( int j = m; j <= n; j++ )
sum += a(j);
Summations (Example)
Solution:
100
1
𝑛
𝑛<1
Summations (Example)
3 2?
What is the value of 𝑖<1
𝑖
Solution:
𝑖 2 = 1 + 4 + 9 = 14
𝑖<1
More Summations (Example)
5
• 𝑘<1(𝑘 + 1) = 2 + 3 + 4 + 5 + 6 = 20
4 𝑘
• 𝑘<0(−2) = −2 0 + −2 1 + −2 2 + −2 3 +
(−2)4 = 11
10
• 𝑘<1 3 = 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3
= 30
More Summations (Example)
10
Evaluate 𝑘<1
2𝑘 − 2𝑘;1 ) = ?
Solution:
10
5 2
• 𝑗<1 𝑗 shift the index of summation from 0 to 4 rather
than from 1 to 5.
Properties of Summations
Example
𝑛 𝑛
Is equivalent to:
int sum = 0;
for ( int i = 1; i <= 4; i++ )
for ( int j = 1; j <= 3; j++ )
sum += i*j;
Double Summations
4
3
• 𝑗<1 𝑖𝑗
𝑖<1
Example
3
2
𝑆𝑜𝑙𝑣𝑒 𝑗<1
(𝑖 − 𝑗).
𝑖<1
Some Useful Summations
Example
100 2
Find 𝑘<50 𝑘 .
Example
200
Find 𝑘<100 𝑘 .
200 3
Find 𝑘<99 𝑘 .
Exercise Questions
Chapter # 2
Topic # 2.4
Questions 1, 2, 4, 25, 26, 29,30,31, 32, 33, 34, 39, 40