Skip to main content
added 1 character in body
Source Link
Yuval Filmus
  • 279.1k
  • 27
  • 316
  • 512

Question is to find the runtime $T(n)$ of following problem by solving the recurrence.

$T(n)=16\cdot T(\frac{n}{4}) + n!$.

I went through the following theory.

If the recurrence relation is of the form $T(n)=aT(\frac{n}{b}) + \Theta(n^k(\log n)^p)$,where $a \geq 1$ , $b \gt 1$, $k \ge 0$ and $p$ is a real number, then: , $k \ge 0$ and p is a real number,then:

  1. If $a \gt b^k$, then $T(n)=\Theta(n^(\log_b a))$$T(n)=\Theta(n^{\log_b a})$.

  2. If $a=b^k$

    1. If $p \gt -1 $, then $T(n)=\Theta((n^(\log_b a)(\log n)^(p+1))$$T(n)=\Theta(n^{\log_b a}(\log n)^{p+1})$.
    2. If $p=-1 $ then $T(n)=\Theta((n^(\log_b a)(\log log n))$$T(n)=\Theta((n^{\log_b a}\log \log n)$.
    3. If $p \lt -1 $, then $T(n)=\Theta(n^(log_b a))$$T(n)=\Theta(n^{\log_b a})$.
  3. If $a \lt b^k$

    1. If $p \ge 0 $, then $T(n)=\Theta(n^k(\log n)^p)$.
    2. If $p \lt 0 $, then $T(n)=O(n^k)$.

Now I want to know how do I compare the second terms of the the equations ($n!$ and $\Theta(n^k(\log n)^p) $) to obtain $k$ so that I can check which of the above case holds true ?

Question is to find the runtime $T(n)$ of following problem by solving the recurrence.

$T(n)=16\cdot T(\frac{n}{4}) + n!$.

I went through the following theory.

If the recurrence relation is of the form $T(n)=aT(\frac{n}{b}) + \Theta(n^k(\log n)^p)$,where $a \geq 1$ , $b \gt 1$ , $k \ge 0$ and p is a real number,then:

  1. If $a \gt b^k$, then $T(n)=\Theta(n^(\log_b a))$.

  2. If $a=b^k$

    1. If $p \gt -1 $, then $T(n)=\Theta((n^(\log_b a)(\log n)^(p+1))$.
    2. If $p=-1 $ then $T(n)=\Theta((n^(\log_b a)(\log log n))$.
    3. If $p \lt -1 $, then $T(n)=\Theta(n^(log_b a))$.
  3. If $a \lt b^k$

    1. If $p \ge 0 $, then $T(n)=\Theta(n^k(\log n)^p)$.
    2. If $p \lt 0 $, then $T(n)=O(n^k)$.

Now I want to know how do I compare the second terms of the the equations ($n!$ and $\Theta(n^k(\log n)^p) $) to obtain $k$ so that I can check which of the above case holds true ?

Question is to find the runtime $T(n)$ of following problem by solving the recurrence.

$T(n)=16\cdot T(\frac{n}{4}) + n!$.

I went through the following theory.

If the recurrence relation is of the form $T(n)=aT(\frac{n}{b}) + \Theta(n^k(\log n)^p)$,where $a \geq 1$ , $b \gt 1$, $k \ge 0$ and $p$ is a real number, then:

  1. If $a \gt b^k$, then $T(n)=\Theta(n^{\log_b a})$.

  2. If $a=b^k$

    1. If $p \gt -1 $, then $T(n)=\Theta(n^{\log_b a}(\log n)^{p+1})$.
    2. If $p=-1 $ then $T(n)=\Theta((n^{\log_b a}\log \log n)$.
    3. If $p \lt -1 $, then $T(n)=\Theta(n^{\log_b a})$.
  3. If $a \lt b^k$

    1. If $p \ge 0 $, then $T(n)=\Theta(n^k(\log n)^p)$.
    2. If $p \lt 0 $, then $T(n)=O(n^k)$.

Now I want to know how do I compare the second terms of the the equations ($n!$ and $\Theta(n^k(\log n)^p) $) to obtain $k$ so that I can check which of the above case holds true ?

Source Link

How do I find running time for the following divide and conquer problem?

Question is to find the runtime $T(n)$ of following problem by solving the recurrence.

$T(n)=16\cdot T(\frac{n}{4}) + n!$.

I went through the following theory.

If the recurrence relation is of the form $T(n)=aT(\frac{n}{b}) + \Theta(n^k(\log n)^p)$,where $a \geq 1$ , $b \gt 1$ , $k \ge 0$ and p is a real number,then:

  1. If $a \gt b^k$, then $T(n)=\Theta(n^(\log_b a))$.

  2. If $a=b^k$

    1. If $p \gt -1 $, then $T(n)=\Theta((n^(\log_b a)(\log n)^(p+1))$.
    2. If $p=-1 $ then $T(n)=\Theta((n^(\log_b a)(\log log n))$.
    3. If $p \lt -1 $, then $T(n)=\Theta(n^(log_b a))$.
  3. If $a \lt b^k$

    1. If $p \ge 0 $, then $T(n)=\Theta(n^k(\log n)^p)$.
    2. If $p \lt 0 $, then $T(n)=O(n^k)$.

Now I want to know how do I compare the second terms of the the equations ($n!$ and $\Theta(n^k(\log n)^p) $) to obtain $k$ so that I can check which of the above case holds true ?