• retagged by
1,049 views
3 3 votes

If $T$$\left ( 0 \right )$ $=$ $T$$\left ( 1 \right )$ $=$ $1$, each of the following recurrences for $n$ $\left ( \geq \right )$$2$ defines a function $T$ on the nonnegative integers. Which of the following CANNOT be bounded by a polynomial function?

where Floor$\left ( x \right )$ means $\rightarrow$ the greatest integer that is less than or equal to $x$.

  1. T$\left ( n \right )$ = $3T Floor$$\left ( n/2 \right )$ $+$$n$^$2$
  2. T$\left ( n \right )$ = $T$$\left ( n-1 \right )$$+$ $n$^$2$
  3. T$\left ( n \right )$= $T Floor$ $\left ( 7n/8 \right )$$+ 8n$ $+ 1$
  4. T$\left ( n \right )$ = $2T$$\left ( n-2 \right )$ $+ 1$

2 Answers

2 2 votes

ANS is D)

1.⊝(n^2),3.⊝(n)  by case III of master theorem.

2.⊝(n^3)  by solving recurrence.

4..⊝(2^n)  by solving recurrence.

0 0 votes

A) T(n) = 3T(⌊n/2⌋) + n² (Master Method)

a = 3, b = 2, f(n) = n²

n^(log_b a) = n^(log₂ 3) ≈ n^1.585

Since f(n) = n² = Ω(n^(log₂ 3 + ε))
and regularity condition holds,

T(n) = Θ(n²)

Polynomially bounded.

B) T(n) = T(n − 1) + n² (Expansion)

T(n) = T(n−1) + n²
     = T(n−2) + (n−1)² + n²
     ...
     = T(0) + Σ i²  (i = 1 to n)

Σ i² = Θ(n³)

T(n) = Θ(n³)

Polynomially bounded.

C) T(n) = T(⌊7n/8⌋) + 8n + 1 (Recursion Tree)

Level 0 cost: 8n
Level 1 cost: 8(7/8)n
Level 2 cost: 8(7/8)²n
...
Level k cost: 8(7/8)^k n

Height: (7/8)^k n = 1 ⇒ k = Θ(log n)

Total cost:
8n [1 + (7/8) + (7/8)² + ...] = Θ(n)

Polynomially bounded.

D) T(n) = 2T(n − 2) + 1 (Expansion)

T(n) = 2T(n−2) + 1
     = 2²T(n−4) + (2 + 1)
     ...
     = 2^k T(n−2k) + (2^k − 1)

n − 2k = 0 ⇒ k = n/2

T(n) = Θ(2^(n/2))

Exponential growth.
Not polynomially bounded.

Final Answer

Correct Option: D
Answer:
Position:
Show:

Related questions

1 1 vote
1 answers 1 answer
2.0k
2.0k views
Bikram asked Jan 24, 2017
2,024 views
Given a graph $G$ with vertex set $V$ and edge set $E$, which of the following statements is/are correct about graph $G$?If $G$ is directed and acyclic, the asymptotic al...
1 1 vote
1 answers 1 answer
687
687 views
Bikram asked Jan 24, 2017
687 views
Which of the following sorting algorithms has the lowest best-case asymptotic algorithmic complexity?Selection sortMerge sortInsertion sortHeap sort
6 6 votes
2 answers 2 answers
2.1k
2.1k views
Bikram asked Jan 24, 2017
2,087 views
A Multinational software vendor needs to choose two sorting algorithm implementations $S1$ and $S2$ to built a software for it's offshore clients.$S1$ will be used in sit...
1 1 vote
2 answers 2 answers
1.4k
1.4k views
Bikram asked Jan 24, 2017
1,409 views
Why might quick sort be preferred over insertion sort and merge sort?The worst-case asymptotic algorithmic complexity of quick sort is superior to that of insertion sort ...