Question

Question 4: For each of the following, find the dominant term(s) having the sharpest increase in n and give the time complexi

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Find the dominant term and Time complexity:

Expression 2n2log4n +30m2log100m 7(n+5y*+nlogn20 30n logn+3n log1On (2n3(10m))+)100 Dominant Term 2n log4n 7(n+5) 30nPlogn (n

Description:

(1) 2n2log4n + 30m2log100m (consider n > m)

Simplifying above expression to find time complexity:

2n2log4n + 30m2log100m

= 2n2(log104 + log10n) + 30m2 (log10100+ log10m)

= 2n2log104 + 2n2log10n +30m2log10100+30m2log10m

Since n>m Dominant term for expression 2n2log4n + 30m2log100m is 2n2​​​​​​​log4n

Time complexity: O(n2logn)

(2) 7(n+5)4 + nlogn20

Simplifying above expression to find time complexity:

7(n+5)4 + nlogn20

= 7(n4 +20n3 + 150n2 + 500n +625) + 20nlogn

= (7n4 +140n3 + 1050n2 + 3500n +4375) + 20nlogn

Dominant term for expression 7(n+5)4 + nlogn20  is 7(n+5)4

Time complexity: O(n4)

(3) 30n5logn + 3n log10n

Simplifying above expression to find time complexity:

30n5logn + 3n log10n

= 30n5logn + 3n log10n10

= 30n5logn + 30nlogn

Dominant term for expression 30n5logn + 3n log10n is 30n5logn

Time complexity: O(n5logn)

(4) (2n3(10m3)) + (n/2(n2))2 /100 (consider n > m)

Simplifying above expression to find time complexity:

(2n3(10m3)) + (n/2(n2))2 /100

= (2n3(10m3)) + ( (n/2)2 (n2)2 )/ 100

= 20n3 m3+ ((n2 * n4 ) / 200

= 20n3 m3 + n6 / 200

Since n>m Dominant term for expression (2n3(10m3)) + (n/2(n2))2 /100 is (n/2(n2))2 /100

Time complexity: O(n6)

Add a comment
Know the answer?
Add Answer to:
Question 4: For each of the following, find the dominant term(s) having the sharpest increase in...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Find the dominant term(s) having the sharpest increase in n and give the time complexity using Big-O notation.

    The expression is:3nlog8n +30mlog20m I solved it and got 3nlog8n as the dominant term and O term is O(n log n)Is this correct?

  • Question 3: Given the following two code fragments [2 Marks] (i)Find T(n), the time complexity (as...

    Question 3: Given the following two code fragments [2 Marks] (i)Find T(n), the time complexity (as operations count) in the worst case? (ii)Express the growth rate of the function in asymptotic notation in the closest bound possible. (iii)Prove that T(n) is Big O (g(n)) by the definition of Big O (iv)Prove that T(n) is (g(n)) by using limits

  • Hi, I am having trouble with the following question: Given an unsorted array with integers, find...

    Hi, I am having trouble with the following question: Given an unsorted array with integers, find the median of it using the Quick Select method we’ve discussed in the class (Hint: We use the quick select to find the kth smallest element in an unsorted array in O(n) time complexity). Note: A median is the middle number of the array after it is sorted. And in this problem, we return the N/2-th number after sorted if there are even numbers...

  • 1. [5 marks Show the following hold using the definition of Big Oh: a) 2 mark...

    1. [5 marks Show the following hold using the definition of Big Oh: a) 2 mark 1729 is O(1) b) 3 marks 2n2-4n -3 is O(n2) 2. [3 marks] Using the definition of Big-Oh, prove that 2n2(n 1) is not O(n2) 3. 6 marks Let f(n),g(n), h(n) be complexity functions. Using the definition of Big-Oh, prove the following two claims a) 3 marks Let k be a positive real constant and f(n) is O(g(n)), then k f(n) is O(g(n)) b)...

  • 1 question) Arrange the following in the order of their growth rates, from least to greatest:...

    1 question) Arrange the following in the order of their growth rates, from least to greatest: (5 pts) n3                     n2         nn        lg n     n!       n lg n              2n                     n 2 question)Show that 3n3 + n2 is big-Oh of n3. You can use either the definition of big-Oh (formal) or the limit approach. Show your work! (5 pts.) 3 question)Show that 6n2 + 20n is big-Oh of n3, but not big-Omega of n3. You can use either the definition of big-Omega...

  • Analysis of Algorithms Fall 2013 Do any (4) out of the following (5) problems 1. Assume n-3t is a...

    Analysis of Algorithms Fall 2013 Do any (4) out of the following (5) problems 1. Assume n-3t is a power of 3 fork20. Solve accurately the following recursion. If you cannot find the exact solution, use the big-O notation. Tu) T(n)Tin/3)+2 2. Suppose that you have 2 differeut algorithms to solve a giveu probleen Algorithm A has worst-case time complexity e(n2) and Algorithm B has worst-case time complexity e(nlog n). Which of the following statements are true and which are...

  • Question 1 (25 pts) Find the running time complexity for the following code fragments. Express yo...

    Question 1 (25 pts) Find the running time complexity for the following code fragments. Express your answers using either the Big-O or Big-Θ notations, and the tightest bound possible. Justify your answers. for(int count O , i -0; i < n* n; i++) for(int i0 ; j <i; j++) count++ for(int count O , i -0; i

  • Exercise 1 Use Top-Down Design to “design” a set of instructions to write an algorithm for...

    Exercise 1 Use Top-Down Design to “design” a set of instructions to write an algorithm for “travel arrangement”. For example, at a high level of abstraction, the algorithm for “travel arrangement” is: book a hotel buy a plane ticket rent a car Using the principle of stepwise refinement, write more detailed pseudocode for each of these three steps at a lower level of abstraction. Exercise 2 Asymptotic Complexity (3 pts) Determine the Big-O notation for the following growth functions: 1....

  • Q2-Σ Notation Review notation by investigating In this problem we will remind ourselves of 2k k O a) Consider the similar finite sum 2* k-0 Using n - 3, rewrite this expression in expanded form,...

    Q2-Σ Notation Review notation by investigating In this problem we will remind ourselves of 2k k O a) Consider the similar finite sum 2* k-0 Using n - 3, rewrite this expression in expanded form, and then evaluate it. b) Rewrite Expression (2) in expanded form for n-6, and then evaluate it c) Expression (2) becomes a better approximation to Expression (1) as n grows larger. To get an idea of what (1) is, evaluate (2) using n 100. Don't...

  • 1. Find the Big Oh notation for the expressions below A. 10,000,000 B. 1+2+3+4+...+n C. 50,000+log(n^2000)+500n...

    1. Find the Big Oh notation for the expressions below A. 10,000,000 B. 1+2+3+4+...+n C. 50,000+log(n^2000)+500n D. 5,000(n^2)+7,000,000 E. 700n^3+n^2+50,000,000n+1 F. 2^(n+3)+300(n^3) 2. Identify time complexity in Big O notation for the program segments A. sum=0; for(i=1;i<=n;i=i*3)      sum++; B. sum=0; for(int i=1;i<3^n;i=i*3)     sum=sum++; for (int j=n;j<0;j--)     sum--; C. sum=0; for(i=n;i>=1;i--)     for(j=i;j<=n;j++)         sum++; D. sum=0; for(i=1;i<=10;i++)     for(int j=1; j<=n*n; j++)          sum++;

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT