1 / 21

CS 23022 Discrete Mathematical Structures

CS 23022 Discrete Mathematical Structures. Mehdi Ghayoumi MSB rm 132 mghayoum@kent.edu Ofc hr: Thur, 9:30-11:30a. Announcements. Homework 5 available. Due 06/26, 8a. Midterm 1: 06/30/14, Chapter 3 in Rosen and some other articles. Growth of functions - another theorem. If

cyrus-ray
Download Presentation

CS 23022 Discrete Mathematical Structures

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 23022Discrete Mathematical Structures Mehdi Ghayoumi MSB rm 132 mghayoum@kent.edu Ofc hr: Thur, 9:30-11:30a

  2. Announcements • Homework 5 available. Due 06/26, 8a. • Midterm 1: 06/30/14, • Chapter 3 in Rosen and some other articles.

  3. Growth of functions - another theorem If f1(x) = O(g1(x)) and f2(x)=O(g2(x)), then f1(x)·f2(x) = O(g1(x)·g2(x))

  4. Growth of functions Algorithm “Good Morning” For I = 1 to n For J = I+1 to n Shake Hands(student(I), student(J)) Running time of “Good Morning” Time = (# of HS) x (time/HS) + some overhead We want an expression for T(n), running time of “Good Morning” on input of size n.

  5. 2 Growth of functions Algorithm “Good Morning” For I = 1 to n For J = I+1 to n ShakeHands(student(I), student(J)) How many handshakes? J n2 - n I

  6. = O(n2) if ShakeHands() runs in constant time. Growth of functions Algorithm “Good Morning” For I = 1 to n For J = I+1 to n ShakeHands(student(I), student(J)) T(n) = s(n2- n)/2 + t Where s is time for one HS, and t is time for getting organized.

  7. Growth of functions • Use the definition of O-notationto express|17x6 – 3x3 + 2x + 8| ≤ 30|x6| for all x > 1 • M = 30 • x0 = 1 • 17x6 – 3x3 + 2x + 8 is O(x6)

  8. Growth of functions 30x6 17x6 – 3x3 + 2x + 8 x6

  9. Growth of functions • Use the definition of O-notationto expressfor all x > 6 • M = 45 • x0 = 6

  10. Growth of functions

  11. O -notation For function g(n), we define O(g(n)), big-O of n, as the set: O(g(n)) = {f(n) :  positive constants c and n0, such that n  n0, we have f(n)  cg(n)}

  12.  -notation For function g(n), we define (g(n)), big-Omega of n, as the set: (g(n)) = {f(n) : positive constants c and n0, such that n  n0, we have 0  cg(n) f(n)}

  13. -notation For function g(n),define (g(n)), big-Theta of n, as the set: (g(n)) = {f(n) : positive constants c1, c2, and n0, such that n  n0, we have 0 c1g(n)  f(n) c2g(n)}

  14. “f is little-o of g” Growth of functions - other estimates f = o(g) o(g(n)) = {f(n) : positive constants c>0 and n0, such that n  n0, we have 0 f(n)cg(n) }

  15. This inequality holds when n > 21/c. So, k = 21/c. Growth of functions - other estimates Example: Show that n2 = o(n2log n) Choose c arbitrarily. How large does n have to be so that n2  c n2log n? 1  c log n 1/c  log n 21/c  n

  16. This inequality holds when n > 10/c. So, k = 10/c. Growth of functions - other estimates Example: Show that 10n2 = o(n3) Proof : find a k (possibly in terms of c) that makes the inequality hold. Choose c arbitrarily. How large does n have to be so that 10n2 c n3? 10/c  n

  17. Relations Between Q, O, W

  18. Comparison of Functions f g  a  b f (n) = O(g(n)) a b f (n) = (g(n)) a b f (n) = (g(n)) a = b f (n) = o(g(n)) a <b

  19. Comparison of Functions If f(x) = O(g(x)), and f(x) = (g(x)), then f(x) = (x)

  20. “f is big-theta of g” When we write f=O(g), it is like f  g When we write f= (g), it is like f  g When we write f= (g), it is like f = g. Comparison of Functions

More Related