CSC120 - Discrete Structures
(Discrete Mathematics)
Fall 2024
Week - 09
Sequences
and
Summations
1 2
2 4
3 8 Function
4 16 Z S
5 32
6 64
n an
Explicit Formula
Explicit Formula
• Consider the sequence {an}, where an = 1/n.
• The list of the terms of this sequence beginning with a1:
a1, a2, a3, a4, …
{1, 1/2, 1/3, 1/4 , … }
• Consider the sequence {an}, where an = 3n.
• The list of the terms of this sequence beginning with a1:
{3, 6, 9, 12 , …}
Explicit Formula
the numerator oscillates back
and forth between 11 and 21; it
is 11 when k is odd
and 21 when k is even. To
achieve this oscillation, insert a
factor of (21)k11 (or (21)k-1)
into the formula for ak. [For when
k is odd, k11 is even and thus
(21)k11 5 11; and when
k is even, k11 is odd and thus
(21)k11 5 21.]
Explicit formula-Exercise
Geometric Progression
Geometric Progression
Geometric Progression (Example)
• Is {2. (5) 𝑛-1 } geometric progression? If yes then what
will be sequence, initial term and common ratio?
2,10,50,250,…
Yes, a=2 and r=5
• Is {6. ( 1 / 3 ) 𝑛-1 } geometric progression?
6,2,2/3,2/9,…
Yes, a=6 and r=1/3
Geometric Progression (Example)
• Find the 8th term of the following geometric sequence
4, 12, 36, 108, …
Arithmetic Progression
• An arithmetic progression is a sequence of the form
𝑎, 𝑎 + 𝑑, 𝑎 + 2𝑑, … . , 𝑎 + 𝑛𝑑, …
• Where the initial term a and the common difference d
are real numbers.
Arithmetic Progression
Arithmetic Progression
Arithmetic Progression (Example)
• Is {4𝑛 - 5}Arithmetic progression?
-1,3,7,11,…
Yes, a=-1 and d=4
• Is {10 - 3𝑛}Arithmetic progression?
7,4,1,-2, . . .
Yes, a=7 and d=-3
Arithmetic Progression (Example)
• Find the 20th term of the arithmetic sequence
3, 9, 15, 21, …
• Which term of the arithmetic sequence
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)
• Find a formula for the following sequence.
1, 1/2, 1/4, 1/8, 1/16, …
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 an 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)
• How can you produce the terms of the following
sequence?
1, 2, 2, 3, 3, 3, 4, 4, 4, 4, …
Solution:
A rule for generating this sequence is that integer n
appears exactly n times.
Sequences (Example)
• How can you produce the terms of the following
sequence?
5, 11, 17, 23, 29, 35, 41, …
Solution:
A rule for generating this sequence is 6𝑛 − 1.
It is an arithmetic progression.
a=5 and d=6
Sequences (Example)
• Find a formula for the following sequence.
15, 8, 1, −6, −13, −20, −27, …
Solution:
Each term is 7 less than the previous term.
𝑎𝑛 = 22 − 7𝑛
Useful Sequences
Sequences (Example)
• Find a formula for the following sequence?
2, 16, 54, 128, 250, 432, 686, …
Solution:
Each term is twice the cube of 𝑛.
𝑎𝑛 = 2 ∗ 𝑛3
Sequences (Example)
• Find formula for the following sequence.
1, 7, 25, 79, 241, 727, 2185, …
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.
• m is lower limit and n is upper limit.
Summations
• A summation:
𝑛
𝑎𝑗
𝑗=𝑚
is like a for loop:
int sum = 0;
for ( int j = m; j <= n; j++ )
sum += a(j);
Summations (Example)
Express the sum of the first 100 terms of the sequence
{1/n} for n=1,2,3,… .
Solution:
100
1/𝑛
𝑛=1
Summations (Example)
3
What is the value of 𝑖2
𝑖=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 3= 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3
𝑘=1
= 30
More Summations (Example)
10
Evaluate σ 𝑘=1
(2 𝑘 - 2𝑘-1) = ?
Solution:
10
σ ( 2 𝑘 − 2 𝑘 ; 1 ) = (21 − 20) + (22 − 21) + (23 − 22) + (24 − 23) +
𝑘=1
25 − 24) + (26 − 25) + (27 − 26) + (28 − 27) + (29 − 28) + (210 − 29
= −1 + 210 = −1 + 1024 = 1023
Shifting the Index of Summation
• Useful in case of sum.
• σ5𝑗=1 𝑗2 shift the index of summation from 0 to 4 rather
than from 1 to 5.
Properties of Summations
Assignment: Please see other summations properties and I will
ask in next lecture
Example
𝑛 𝑛
𝑆𝑜𝑙𝑣𝑒 3 σ ( 2 𝑘 − 3) + σ ( 4 − 5𝑘)
𝑘=1 𝑘=1
Double Summations
• Like a nested for loop
4 3
𝑖𝑗
𝑖=1 𝑗=1
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 𝑗=0
Some Useful Summations
Example
Find 100 𝑘 2 .
σ𝑘=50
Example
Find 200
σ𝑘=100 𝑘.
200
Find σ𝑘=99 𝑘3.
Exercise Questions
Chapter # 2
Topic # 2.4
Questions 1, 2, 4, 25, 26, 29,30,31, 32, 33, 34, 39, 40