BY LECTURER/ AISHA DAWOOD DW Lab # 4 Overview of Extraction, Transformation, and Loading.
BY Lecturer: Aisha Dawood. stands alone on the right-hand side of an equation (or inequality),...
-
Upload
justin-lester -
Category
Documents
-
view
213 -
download
0
Transcript of BY Lecturer: Aisha Dawood. stands alone on the right-hand side of an equation (or inequality),...
![Page 1: BY Lecturer: Aisha Dawood. stands alone on the right-hand side of an equation (or inequality), example : n = O(n 2 ). means set membership :n ∈ O(n.](https://reader035.fdocuments.in/reader035/viewer/2022080223/56649ea45503460f94ba8d3b/html5/thumbnails/1.jpg)
Algorithms analysis and design
BYLecturer: Aisha Dawood
![Page 2: BY Lecturer: Aisha Dawood. stands alone on the right-hand side of an equation (or inequality), example : n = O(n 2 ). means set membership :n ∈ O(n.](https://reader035.fdocuments.in/reader035/viewer/2022080223/56649ea45503460f94ba8d3b/html5/thumbnails/2.jpg)
2
stands alone on the right-hand side of an equation (or inequality), example : n = O(n2). means set membership :n O(n∈ 2).
when it appears in a formula, we interpret it as standing for some function that we do not care to name. For example, 2n2 + 3n + 1 = 2n2 + (n).
Left hand side and right hand side example : 2n2 + (n) = O(n2).
Order of growth notations in equations and inequalities
![Page 3: BY Lecturer: Aisha Dawood. stands alone on the right-hand side of an equation (or inequality), example : n = O(n 2 ). means set membership :n ∈ O(n.](https://reader035.fdocuments.in/reader035/viewer/2022080223/56649ea45503460f94ba8d3b/html5/thumbnails/3.jpg)
3
the relational properties of real numbers apply to asymptotic comparisons as well.
Comparing functions
![Page 4: BY Lecturer: Aisha Dawood. stands alone on the right-hand side of an equation (or inequality), example : n = O(n 2 ). means set membership :n ∈ O(n.](https://reader035.fdocuments.in/reader035/viewer/2022080223/56649ea45503460f94ba8d3b/html5/thumbnails/4.jpg)
4
![Page 5: BY Lecturer: Aisha Dawood. stands alone on the right-hand side of an equation (or inequality), example : n = O(n 2 ). means set membership :n ∈ O(n.](https://reader035.fdocuments.in/reader035/viewer/2022080223/56649ea45503460f94ba8d3b/html5/thumbnails/5.jpg)
5
For any two functions f(n) and g(n), we have f(n) = (g(n)), if and only if f(n) = O(g(n)) and f(n) = Ω(g(n)).
Proof: left as a home work….
Theorem
![Page 6: BY Lecturer: Aisha Dawood. stands alone on the right-hand side of an equation (or inequality), example : n = O(n 2 ). means set membership :n ∈ O(n.](https://reader035.fdocuments.in/reader035/viewer/2022080223/56649ea45503460f94ba8d3b/html5/thumbnails/6.jpg)
6
Common expressions used to describe algorithm’s running time:
Name Expression
Constant 1 ,2,…,c
Logarithmic log(n)
Log squared log2(n)
Linear n
n log n n.log(n)
Quadratic n2
Cubic n3
Exponential 2n
![Page 7: BY Lecturer: Aisha Dawood. stands alone on the right-hand side of an equation (or inequality), example : n = O(n 2 ). means set membership :n ∈ O(n.](https://reader035.fdocuments.in/reader035/viewer/2022080223/56649ea45503460f94ba8d3b/html5/thumbnails/7.jpg)
7
Conclusions (f(n)) describes f(n) f(n) = O(g(n)) and f(n) = Ω(g(n)). o(f(n) describes f(n) f(n) = O(g(n)) but not f(n) = Ω(g(n)). ω(f(n)) describes f(n) f(n) = Ω(g(n)) but not f(n) = O(g(n)).
![Page 8: BY Lecturer: Aisha Dawood. stands alone on the right-hand side of an equation (or inequality), example : n = O(n 2 ). means set membership :n ∈ O(n.](https://reader035.fdocuments.in/reader035/viewer/2022080223/56649ea45503460f94ba8d3b/html5/thumbnails/8.jpg)
8
Rule #1: Sequential composition: Worst case running time of a sequence :
Rules For Big Oh Analysis of Running Time
![Page 9: BY Lecturer: Aisha Dawood. stands alone on the right-hand side of an equation (or inequality), example : n = O(n 2 ). means set membership :n ∈ O(n.](https://reader035.fdocuments.in/reader035/viewer/2022080223/56649ea45503460f94ba8d3b/html5/thumbnails/9.jpg)
9
Rule #2: Iteration: Worst case running time of an iteration:
Rules For Big Oh Analysis of Running Time
For (S1)S2S3...SmO(T(n)) = MAX (O(T1(n)),O(T2(n)),...,O(Tm(n)))
![Page 10: BY Lecturer: Aisha Dawood. stands alone on the right-hand side of an equation (or inequality), example : n = O(n 2 ). means set membership :n ∈ O(n.](https://reader035.fdocuments.in/reader035/viewer/2022080223/56649ea45503460f94ba8d3b/html5/thumbnails/10.jpg)
10
Rule #3: Conditional execution: Worst case running time of a conditional
statement :
Rules For Big Oh Analysis of Running Time
![Page 11: BY Lecturer: Aisha Dawood. stands alone on the right-hand side of an equation (or inequality), example : n = O(n 2 ). means set membership :n ∈ O(n.](https://reader035.fdocuments.in/reader035/viewer/2022080223/56649ea45503460f94ba8d3b/html5/thumbnails/11.jpg)
11
Determine a tight big-oh bound on the running time of a program to compute the series of sums S0 , S1, S2..., Sn-1 where
T(n) = O(n2)
Example-Prefix Sums
![Page 12: BY Lecturer: Aisha Dawood. stands alone on the right-hand side of an equation (or inequality), example : n = O(n 2 ). means set membership :n ∈ O(n.](https://reader035.fdocuments.in/reader035/viewer/2022080223/56649ea45503460f94ba8d3b/html5/thumbnails/12.jpg)
12
The Fibonacci numbers are the series of numbers F0,F1 ,F2 ... given by
Consider the sequence of Fibonacci numbers
T(n) = O(n)
Example-Fibonacci Numbers
![Page 13: BY Lecturer: Aisha Dawood. stands alone on the right-hand side of an equation (or inequality), example : n = O(n 2 ). means set membership :n ∈ O(n.](https://reader035.fdocuments.in/reader035/viewer/2022080223/56649ea45503460f94ba8d3b/html5/thumbnails/13.jpg)
13
we use the definition of Fibonacci numbers to implement directly a recursive algorithm
Example-Fibonacci Numbers
![Page 14: BY Lecturer: Aisha Dawood. stands alone on the right-hand side of an equation (or inequality), example : n = O(n 2 ). means set membership :n ∈ O(n.](https://reader035.fdocuments.in/reader035/viewer/2022080223/56649ea45503460f94ba8d3b/html5/thumbnails/14.jpg)
14
T(n) = Ω(Fn+1) By induction from the nature of the problem we get T(n) = Ω(2n)
Example-Fibonacci Numbers