You are on page 1of 51

SUMS

CSE 301 July 2021


Md. Tareq Mahmood
Department of CSE, BUET
NOTATION
Effciency of understanding
Effciency of understanding
Sigma
Iverson

Based on APL
Example
Say, is a prime identifier function

=
=

Same
Off Topic
◦ Interesting read on APL: https://xpqz.github.io/learnapl/intro.html

◦ Why should you learn a different PL (e.g. LISP or APL)


Lisp is worth learning for a different reason — the profound enlightenment
experience you will have when you finally get it. That experience will make you
a better programmer for the rest of your days, even if you never actually use
Lisp itself a lot.
Off Topic (or is it?)
◦ “Notation as a Tool of Thought” - Kenneth E. Iverson
◦ https://dl.acm.org/doi/pdf/10.1145/358896.358899
Laws
EVALUATING SUMS
Perturbation Method
MULTIPLE SUM
Example – Vanilla

law applies whenever the ranges


of j and k are independent of each other.

C
Example – Rocky Road

It applies when the range of an inner sum depends on


the index variable of the outer sum.
Plan to Handle Rocky Road

∑ ∑ 𝑎 𝑗 𝑏𝑘= ∑ ∑ 𝑎 𝑗 𝑏𝑘
1≤ 𝑗 ≤3 𝑗≤ 𝑘≤3 1≤ 𝑘≤3 1≤ 𝑗≤ 𝑘
Strategy 1

◦ If ,
◦ then
DOUBLE SUM

for(int j = 1; j <= n; j++) {


for(int k = j; k <= n; k++) {
sum += a[j] * a[k]
}
}
DOUBLE SUM

for(int k = 1; k <= n; k++) {


for(int j = 1; j <= k; j++) {
sum += a[k] * a[j]
}
}
DOUBLE SUM

𝑆𝑢+𝑆𝑙=¿
Another Double Sum
Double Sum – Strategy 2
Double Sum 2

𝑛
1
𝐻 𝑛 =∑
𝑘=1 𝑘

https://math.stackexchange.com/questions/52572/do-harmonic-numbers-have-a-closed-form-expression
Double Sum 2
Double Sum 2
Double Sum 2

◦ Range of ◦ Range of

◦ (and )

https://math.stackexchange.com/questions/1751893/concrete-mathematics-2-4-sum-of-1-k-j
FINITE CALCULUS
Difference
◦ Infinite

◦ Finite
Factorial Powers
◦ Falling Factorial Power
x to the m falling
Same as

◦ Rising Factorial Power


x to the m rising
Similar to Differentiation
Sum (Anti-Difference)
If,
Then,

We define
is the class of functions whose difference is
Definite Sum (Anti-Difference)
We define

to be analogous to definite integrals.


Examples:
Definite Sum (Anti-Difference)
Definite Sum (Anti-Difference)
◦ So we can say

◦ Examples
How Does That Helps Us?
◦ Represent a sum as a definite finite sum

◦ If we know then answer is


Properties
Falling Powers Again

We can find out

Using these
Ordinary Power to Falling Power
How Does That Helps Us Again?
Say, we need find sum of
Convert between ordinary powers and factorial powers
Ordinary Power to Falling Power
The following formulas relate integral powers of a variable x through sums using the 
Stirling numbers of the second kind (notated by curly brackets)
Falling Negative Power
◦ We define
Falling Negative Power - Difference
◦ Example:

◦ General formula for difference then,


Falling Negative Power - Sum
◦ We can say, but

◦ In integration:
Falling Negative Power - Sum

¿ 𝐻 ( 𝑥 +1 ) − 𝐻 ( 𝑥 )=△ 𝐻 (𝑥)

Hx is the discrete analog of


General Formula the continuous ln x.
What’s in Finite Calculus
Other Exponents in Finite Calculus

◦ And they helps in sum of exponents


Product Rule, Summation by Parts
And It Helps…
◦ Suppose we need find

◦ Then,

◦ Finally
Try Yourselves

You might also like