- #1
evinda
Gold Member
MHB
- 3,836
- 0
Hello! (Wave)
The recurrence relation $T(n)=7T\left( \frac{n}{2} \right)+ n^2$ describes the running time of an algorithm $A$.
A competing algorithm $A'$ has a running time of $T'(n)=aT'\left( \frac{n}{4}\right)+n^2$.
What is the largest integer value for $a$ such that $A'$ is asymptotically faster than $A$ ?
$$
T(n) = 7\left[ 7T\left(\frac{n}{4}\right) + \frac{1}{4}n^2\right] + n^2 = 49 T\left(\frac{n}{4}\right) + \frac{11}{4}n^2,
$$
$a = 49$, $b = 4$, and $f(n) = \frac{11}{4}n^2$
$n^{\log_b a}=n^{\log_4{49}}>n^2$
$f(n)=\Omega(n^{\log_b a+ \epsilon})$ for $\epsilon=0.8>0$.
So from the case 1 of the master theorem we conclude that $T(n) \in \Theta\left(n^{\log_4 49}\right)$.
If we assume that the initial values of the two recurrence relations are the same then we see that $T(n) \geq T'(n)$ if $a \leq 49$.$$
T'(n) = a T'\left(\frac{n}{4}\right) + n^2.
$$
$a = a$, $b = 4$, and $f(n) = n^2$
If $a > 16$ then $\log_4 a>2$.
Then from the case case 1 of the master theorem we have that
$$
T'(n) \in \Theta\left(n^{\log_4 a}\right).
$$$n^{\log_4 49} \in o\left(n^{\log_4 a}\right)$ if $a > 49$,
so we conclude that $T(n) \in o\Bigl(T'(n)\Bigr)$ if $a > 49$.
So can we say that the greatest value for $a$ so that $A'$ is asymptotically faster than $A$ is $49$ or do we have to say that for $a=49$ the two algorithms have the same speed and the largest value for $a$ so that $A'$ is asymptotically faster than $A$ is $48$? (Thinking)
The recurrence relation $T(n)=7T\left( \frac{n}{2} \right)+ n^2$ describes the running time of an algorithm $A$.
A competing algorithm $A'$ has a running time of $T'(n)=aT'\left( \frac{n}{4}\right)+n^2$.
What is the largest integer value for $a$ such that $A'$ is asymptotically faster than $A$ ?
$$
T(n) = 7\left[ 7T\left(\frac{n}{4}\right) + \frac{1}{4}n^2\right] + n^2 = 49 T\left(\frac{n}{4}\right) + \frac{11}{4}n^2,
$$
$a = 49$, $b = 4$, and $f(n) = \frac{11}{4}n^2$
$n^{\log_b a}=n^{\log_4{49}}>n^2$
$f(n)=\Omega(n^{\log_b a+ \epsilon})$ for $\epsilon=0.8>0$.
So from the case 1 of the master theorem we conclude that $T(n) \in \Theta\left(n^{\log_4 49}\right)$.
If we assume that the initial values of the two recurrence relations are the same then we see that $T(n) \geq T'(n)$ if $a \leq 49$.$$
T'(n) = a T'\left(\frac{n}{4}\right) + n^2.
$$
$a = a$, $b = 4$, and $f(n) = n^2$
If $a > 16$ then $\log_4 a>2$.
Then from the case case 1 of the master theorem we have that
$$
T'(n) \in \Theta\left(n^{\log_4 a}\right).
$$$n^{\log_4 49} \in o\left(n^{\log_4 a}\right)$ if $a > 49$,
so we conclude that $T(n) \in o\Bigl(T'(n)\Bigr)$ if $a > 49$.
So can we say that the greatest value for $a$ so that $A'$ is asymptotically faster than $A$ is $49$ or do we have to say that for $a=49$ the two algorithms have the same speed and the largest value for $a$ so that $A'$ is asymptotically faster than $A$ is $48$? (Thinking)