{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CS 310 Unit 2 Asymptotic Notation and Recurrences

# CS 310 Unit 2 Asymptotic Notation and Recurrences - CS 310...

This preview shows pages 1–9. Sign up to view the full content.

CS 310 Unit 2 Asymptotic Notation and Recurrences Furman Haddix Ph.D. Assistant Professor Minnesota State University, Mankato

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CS 310 Unit 2 Asymptotic Notation and Recurrences Objectives Asymptotic Notation O(n) – “Big Oh” (or “Oh”) of n (n) – Omega (or “Big Omega”) of n Θ (n) – Theta of n o(n) – Little oh of n ϖ (n) – Little omega of n Recurrence Relations Why Recurrence? Why Recursion? Solving Recurrence Relations Substitution method Recursion-tree method Text, Chapters 3 and 4
Asymptotic Notation Asymptotic Notation is used to describe the relationship between two functions which “approach” each other as n becomes very large. Although the absolute differences may increase (or decrease), the relative differences are diminishing for n sufficiently large. In asymptotic notation, low-order terms and constant coefficients are abstracted away In asymptotic notation, one cannot abstract away secondary variables, however.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Graph of 3n 3 + 90n 2 –5n+ 6046 vs. Θ ( n 3 ) Limits 0 5000000 10000000 15000000 20000000 25000000 30000000 35000000 10 20 30 40 50 60 70 80 90 100 110 120 3nnn T(n) 4nnn 18nnn
Graph of ( 3n 3 + 90n 2 –5n+ 6046 / 3 n 3 ) 0 1 2 3 4 5 6 7 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 1 0 1 0 1 2 0 1 3 0 1 4 0 1 5 0 1 6 0 1 7 0 1 8 0 1 9 0 2 0 1 T(n) Graph is of f(n)/cg(n), where f(n) = Θ (g(n)) and c = 3 Recall that g(n) = n 3 {T(n) = Θ (n 3 )}

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
O(n) – “Big Oh” (or “Oh”) of n O(n) provides an upper limit on the size of T(n) as n increases. O(n) is sometimes referred to as order of magnitude. f(n) = O(g(n)), if there exist constants c > 0, n 0 > 0, such that 0 f(n) cg(n) for all n n 0 . Example: T(n) = n 2 + 2n 2 + 100 n There are several valid assertions that we could make. T(n) = O(n 3 ) T(n) = O(n 2 ) Which is the most useful? This illustrates the difference between a “tight” limit and a “loose” limit.
Graph of 3n 2 + 100n +1000 vs. O () Limits 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 4nn T(n) nnn n 3 works for c = 1 and n 0 = 7 n 2 works for c = 4 and n 0 = 17

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
(n) – Omega (or “Big Omega”) of n “Big Oh” provides an upper bounds notation. To say that a function is at least O(f(n)), doesn’t make any sense.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 23

CS 310 Unit 2 Asymptotic Notation and Recurrences - CS 310...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online