1 / 8

Discrete Structures – CNS2300

Discrete Structures – CNS2300. Text Discrete Mathematics and Its Applications Kenneth H. Rosen Chapter 2 The Fundamentals: Algorithms, the Integers, and Matrices. Section 2.2. The Growth of Functions. Big- O notation.

makara
Download Presentation

Discrete Structures – CNS2300

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. Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen Chapter 2 The Fundamentals: Algorithms, the Integers, and Matrices

  2. Section 2.2 The Growth of Functions

  3. Big-O notation Let f and g be functions from the set of integers or the set of real numbers to the set of real numbers. We say that f(x) is O(g(x)) if there are constants C and k such that |f(x)| <= C|g(x)| whenever x > k. Read f(x) is “big-oh” of g(x).

  4. x f(x) g(x)1/4 5/16 3/16 2/4 25/16 12/16 3/4 33/16 27/16 4/4 48/16 48/16 5/4 65/16 75/16 Consider f(x) = x2 + 2x g(x) = 3x2 Let C=3 Let k=1

  5. Suppose that f1(x) is O(g1(x)) and f2(x) are both O(g(x)) . Then (f1+f2)(x) isO(g(x)). The Growth of Combinations of Functions Suppose that f1(x) is O(g1(x)) and f2(x) is O(g2(x)) . Then (f1+f2)(x) isO(max(g1(x), g2(x))).

  6. The Growth of Combinations of Functions Suppose that f1(x) is O(g1(x)) and f2(x) is O(g2(x)) . Then (f1f2)(x) isO( g1(x)g2(x)).

  7. Computer Times Used by Algorithms n log nnnlog nn2 2nn! 10 3E-9 E-8 3E-8 E-7 E-6 3E-3 102 7E-9 E-7 7E-7 E-5 4E13yr * 103 1E-8 E-6 E-5 E-3 * * 104 1.3E-8 E-5 E-4 E-1 * * 105 1.7E-8 E-4 2E-3 10 * * 106 2E-8 E-3 2E-2 17min * * All times are in seconds unless otherwise stated. An * indicates a time of more than 10100 years.

  8. finished

More Related