To help you better understand why the definition of Big-O is concerned only with the behavior of functions for large values of n, choose two functions with different growth rates in which the faster growing function is lower at small values of n, but eventually becomes larger. Write a short program that periodically compares the values of the two functions and illustrates the point at which the faster growing function overtakes the slower growing one. s an example, consider the following two functions: f(n) = 500n2 + 15n + 1000 g(n) = 2n3 Shown below is a table of the values of both functions for small values of n. n f(n) g(n) 10 51150 2000 20 201300 16000 30 451450 54000 40 801600 128000 50 1251750 250000 60 1801900 432000 70 2452050 686000 80 3202200 1024000 90 4052350 1458000 100 5002500 2000000 110 6052650 2662000 120 7202800 3456000 130 8452950 4394000 140 9803100 5488000 150 11253250 6750000 160 12803400 8192000 170 14453550 9826000 180 16203700 11664000 190 18053850 13718000 200 20004000 16000000 210 22054150 18522000 220 24204300 21296000 230 26454450 24334000 240 28804600 27648000 250 31254750 31250000 260 33804900 35152000 Once n reaches 260 g overtakes f.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

To help you better understand why the definition of Big-O is concerned only with the behavior of functions for large values of n, choose two functions with different growth rates in which the faster growing function is lower at small values of n, but eventually becomes larger. Write a short program that periodically compares the values of the two functions and illustrates the point at which the faster growing function overtakes the slower growing one.

s an example, consider the following two functions:

  • f(n) = 500n2 + 15n + 1000
  • g(n) = 2n3

Shown below is a table of the values of both functions for small values of n.

n f(n) g(n)

10 51150 2000

20 201300 16000

30 451450 54000

40 801600 128000

50 1251750 250000

60 1801900 432000

70 2452050 686000

80 3202200 1024000

90 4052350 1458000

100 5002500 2000000

110 6052650 2662000

120 7202800 3456000

130 8452950 4394000

140 9803100 5488000

150 11253250 6750000

160 12803400 8192000

170 14453550 9826000

180 16203700 11664000

190 18053850 13718000

200 20004000 16000000

210 22054150 18522000

220 24204300 21296000

230 26454450 24334000

240 28804600 27648000

250 31254750 31250000

260 33804900 35152000

Once n reaches 260 g overtakes f.

Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Bare Bones Programming Language
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education