A' should be asymptotically faster than A

  • Context: MHB 
  • Thread starter Thread starter evinda
  • Start date Start date
Click For Summary
SUMMARY

The discussion centers on comparing the asymptotic performance of two algorithms, A and A', defined by their recurrence relations. Algorithm A has a time complexity of $T(n)=7T\left( \frac{n}{2}\right)+n^2$, while algorithm A' is defined as $T'(n)=aT'\left( \frac{n}{4}\right)+n^2$. For A' to be asymptotically faster than A, the condition $a < 16$ must be satisfied. The analysis concludes that if $a$ exceeds 16, A' cannot be faster than A, confirming the critical threshold for performance comparison.

PREREQUISITES
  • Understanding of recurrence relations in algorithm analysis
  • Familiarity with the Master Theorem for asymptotic analysis
  • Knowledge of Big O, Big Theta, and Big Omega notations
  • Basic logarithmic properties and their applications in algorithm complexity
NEXT STEPS
  • Study the Master Theorem in detail to apply it to various recurrence relations
  • Explore the implications of different values of 'a' in the context of algorithm performance
  • Learn about logarithmic comparisons and their role in algorithm analysis
  • Investigate other algorithms with similar recurrence structures for further insights
USEFUL FOR

Computer scientists, algorithm designers, and students studying algorithm analysis who seek to understand performance comparisons between recursive algorithms.

evinda
Gold Member
MHB
Messages
3,741
Reaction score
0
Hello! (Wave)

The recurrence relation $T(n)=7T\left( \frac{n}{2}\right)+n^2$ describes the execution time of an algorithm $A$.

A "competitor" algorithm, let $A'$, has execution time $T'(n)=aT'\left( \frac{n}{4} \right)+n^2$.

Which is the greatest integer value of $a$, for which $A'$ is asymptotically faster than $A$?

$$T(n)=7T\left( \frac{n}{2}\right)+n^2$$
$$a=7 \geq 1, b=2>1, f(n)=n^2$$

$$n^{\log_b a}=n^{\log_27}<n^{\log_2 4}=n^2$$

We see that $f(n)=O(n^{\log_b a-\epsilon})$, for example for $\epsilon=0.8$.

So, $T(n)=\Theta(n^{\log_b a})=\Theta(n^2)$

$$T'(n)=aT'\left( \frac{n}{4} \right)+n^2$$
$$b=4, f(n)=n^2$$
$$n^{\log_b a}=n^{\log_4 a}$$

  • $f(n)=O(n^{\log_b a+ \epsilon})$, then $T'(n)=\Theta(n^{\log_4 a})$

    We want to that $A'$ is asymptotically faster that $A$, so it must be $n^{\log_4 a}<n^2 \Rightarrow n^{\log_4 a}< n^{\log_4 4^2} \Rightarrow a<16$
    $$$$
  • $f(n)=\Theta(n^{\log_b a})$, then $T'(n)=\Theta(n^{\log_4 a} \log_2 n)$

    We want to that $A'$ is asymptotically faster that $A$, so it must be $n^{\log_4 a} \log_2 n<n^2$

    How can we find the $a$s, for which this inequality stands? :confused:
    $$$$
  • $f(n)=\Omega(n^{\log_b a+ \epsilon})$, then $T'(n)=\Theta(f(n))=\Theta(n^2)$

    So, in this case, we cannot find $a$s so that $A'$ is asymptotically faster than $A$.

Is that what I have tried right? (Thinking)
 
Technology news on Phys.org
Or have I done something wrong? (Thinking)
 

Similar threads

  • · Replies 15 ·
Replies
15
Views
8K
  • · Replies 17 ·
Replies
17
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 7 ·
Replies
7
Views
5K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 2 ·
Replies
2
Views
949
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K