Q1) (a) Consider the following six functions. Choose only one of the following…
- User
Q1) (a) Consider the following six functions. Choose only one of the following asymptotic running times for each function and write a, b, c, or d in your answer sheet. � �1(𝑛) = 4000𝑛2 � �2(𝑛) = 100 √(𝑛 −10) 𝑓3(𝑛) = 2𝑛log(𝑛) � �4(𝑛) = 10 𝑙𝑜𝑔(𝑛3) � �5(𝑛) = 12𝑛3 +100𝑛2log(𝑛) � �6(𝑛) = 3𝑛 +1000𝑛 � �) 𝜃(𝑛) log(𝑛) � �) 𝜃(1) � �)𝜃(𝑛2) 𝑐) 𝜃(𝑛3) � �)𝜃(1) � �)𝜃(𝑛0.5) 𝑐) 𝜃(𝑛0.5 log(𝑛)) 𝑑)𝜃(log(𝑛)) � �) 𝜃(2𝑛) 𝑏)𝜃(𝑛) 𝑐) 𝜃(2𝑛log(𝑛)) 𝑑)𝜃(log(𝑛)) � �) 𝜃(𝑛3) � �) 𝜃(𝑛2) � �) 𝜃(𝑛) � �)𝜃(𝑛) � �)𝜃(𝑛) � �) 𝜃(log(𝑛)) � �) 𝜃(𝑛2log(𝑛)) � �)𝜃(𝑛3) 𝑐) 𝜃(𝑛(3𝑛)) � �)𝜃(2𝑛) � �)𝜃(𝑛3) � �)𝜃(3𝑛) [5 marks] (b) Arrange the functions (𝑓𝑖) in ascending order of running time and write your answer on the answer sheet.
- Assistant
To solve part (a), we need to determine the asymptotic running time for each function using Big Theta notation. Here's how we analyze each function:
-
( f_1(n) = 4000n^2 )
- The dominant term is ( n^2 ). Thus, ( f_1(n) = \Theta(n^2) ).
- Answer: c
-
( f_2(n) = 100\sqrt{n-10} )
- The dominant term is ( \sqrt{n} ). Thus, ( f_2(n) = \Theta(n^{0.5}) ).
- Answer: a
-
( f_3(n) = 2n\log(n) )
- The dominant term is ( n\log(n) ). Thus, ( f_3(n) = \Theta(n\log(n)) ).
- Answer: b
-
( f_4(n) = 10\log(n^3) )
- This expands to ( 10 \times 3\log(n) = 30\log(n) ), hence, ( f_4(n) = \Theta(\log(n)) ).
- Answer: d
-
( f_5(n) = 12n^3 + 100n^2\log(n) )
- The dominant term is ( n^3 ). Thus, ( f_5(n) = \Theta(n^3) ).
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.