Introduction to Algorithms
Introduction to Algorithms
3rd Edition
ISBN: 9780262033848
Author: Thomas H. Cormen, Ronald L. Rivest, Charles E. Leiserson, Clifford Stein
Publisher: MIT Press
Question
100%
Book Icon
Chapter 1, Problem 1P
Program Plan Intro

To complete the table for given function f(n) and time t .

Expert Solution & Answer
Check Mark

Explanation of Solution

Given Information:The time taken by algorithm to solve the problems in f(n) microseconds.

Explanation:

Since 1 microsecond is equal to 106 seconds. Therefore, 1 second is equal to 106 microseconds.

Consider the function f(n)=lg(n) . Now, determine the value of n such that lgn<106

as follows:

lgn<1062lgn<2 106n<2 106

Therefore, the value of n is 2106 for 1 second.

Since 1 hour is equal to 3600 seconds. Therefore, 1 hour is equal to 3.6×109 microseconds.

Again, consider the function f(n)=lg(n) . Now, determine the value of n such that lgn<3.6×109

as follows:

lgn<3.6×1092lgn<23.6× 109n<23.6× 109

Therefore, the value of n is 23.6×109 for 1 hour.

Consider a month is equal to 30 days and a year is equal to 365 days.

Similarly, calculate the other values of t in the different functions f(n) to obtain the correspondinglargest values of n .

Complete the table for different values of n

as follows:

    f(n)1 second1 minute1 hour1 day1 month1 year1 century
    lgn210626×10723.6×10928.64×101022.592×101223.15×101323.16×1015
    n1×10123.6×10151.29×10197.46×10216.72×10249.95×10269.95×1026
    n1×1066×1073.6×1098.64×10102.59×10123.15×10133.16×1015
    nlgn6274628014171333780582755147513718708564047976338933496.86×1013
    n210007745600002939381609968561569256176151
    n3100391153244201373631593146679
    2n19253136414451
    n!9111213151617

Table 1

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
For function f(n)=log n and time t=1 second, determine the largest size n of a problem that can be solved in time t, assume that the algorithm to solve the problem takes f(n) microseconds.
Consider the following function that prints a triangle of height n. def triangle(n): s = "" for i in range(n): for j in range(i): s += "#" print(s) Explain, in terms of big-Θ, what is the time complexity of triangle as a function of n. You can assume that the operation s+="#" is constant time.
Let f (f(n) and g(n)) be asymptotically nonnegative functions. Using the basic definition of Θ notation, prove that max(f(n), g(n)) = Θ(f(n) + g(n)),
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education