1. 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 ) ), read as "f ( x ) is big-oh of g ( x )", if there are constants C and k such that | f ( x ) | ≤ C | g ( x ) | whenever x > k. (a) Show that f(x) = x2 + 2x + 1 is O(x2) Solution: When x>1; ? 2 (1 + 2 ? + 1 ? 2 ) < ? 2 (1 + 2 1 + 1 1 2 ) = 4? 2 So, ??? ? > 1, ? 2 + 2? + 1 < 4? 2 From the definition 0 ≤ f(x) ≤ cg(x) for x≥1 Hence, for N0 = 1; c=4; and g(x)=x2 for N0 = 2; c=3; and g(x)=x2 for N0 = 3; c=2; and g(x)=x2 … Therefore, ? ? + ?? + ? = ?(? ? ) O(g(x)) = {f(x)|there exist positive constant c and N0 such that 0 ≤ f(x) ≤ cg(x) for all x≥N0} 2. Show that 7x2 is O(x3)
1. 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 ) ), read as "f ( x ) is big-oh of g ( x )", if there are constants C and k such that | f ( x ) | ≤ C | g ( x ) | whenever x > k. (a) Show that f(x) = x2 + 2x + 1 is O(x2) Solution: When x>1; ? 2 (1 + 2 ? + 1 ? 2 ) < ? 2 (1 + 2 1 + 1 1 2 ) = 4? 2 So, ??? ? > 1, ? 2 + 2? + 1 < 4? 2 From the definition 0 ≤ f(x) ≤ cg(x) for x≥1 Hence, for N0 = 1; c=4; and g(x)=x2 for N0 = 2; c=3; and g(x)=x2 for N0 = 3; c=2; and g(x)=x2 … Therefore, ? ? + ?? + ? = ?(? ? ) O(g(x)) = {f(x)|there exist positive constant c and N0 such that 0 ≤ f(x) ≤ cg(x) for all x≥N0} 2. Show that 7x2 is O(x3)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
1. 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 ) ), read as "f ( x ) is big-oh of g ( x )", if there are constants C and k
such that | f ( x ) | ≤ C | g ( x ) | whenever x > k.
(a) Show that f(x) = x2 + 2x + 1 is O(x2)
Solution:
When x>1;
?
2 (1 +
2
?
+
1
?
2
) < ?
2 (1 +
2
1
+
1
1
2
) = 4?
2
So, ??? ? > 1, ?
2 + 2? + 1 < 4?
2
From the definition 0 ≤ f(x) ≤ cg(x) for x≥1
Hence, for N0 = 1; c=4; and g(x)=x2
for N0 = 2; c=3; and g(x)=x2
for N0 = 3; c=2; and g(x)=x2
…
Therefore, ?
? + ?? + ? = ?(?
?
)
O(g(x)) = {f(x)|there exist positive constant c and N0 such that 0 ≤ f(x) ≤ cg(x) for all x≥N0}
2. Show that 7x2 is O(x3).
3. Suppose there are x number of boxes to be delivered to x number of household that is 2km
apart, what is the distance travelled by the transport delivery service?
4. In number 3, suppose that each boxes must be coming from the Warehouse and the transport
delivery service must need to back-and-port to pick-up each box. What is the distance
travelled by the transport delivery service?
5. Evaluate the methods used in number 3 and number 4 method of delivery. If the function x2 is
considered as the dominant term for each method used.
6. What will happen to the term 2x + 5 of the original function x2 + 2x + 5 when compared to the
dominant term which is x2. Show a simple analysis for this function
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY