The efficiency of an algorithm depends on the amount of time, storage and other resources required to execute the algorithm. The efficiency is measured with the help of asymptotic notations.

An algorithm may not have the same performance for different types of inputs. With the increase in the input size, the performance will change.

The study of change in performance of the algorithm with the change in the order of the input size is defined as asymptotic analysis.

There are five types of asymptotic notation: \(O\) (Big O), \(\Omega\) (Big omega), \(\Theta\) (Big theta), \(o\) (Little o) and \(\omega\) (Little Omega).

Big-O Notation

Big O notation represents the upper bound or worst-case scenario of the growth rate of a function. It describes an algorithm’s maximum time or space complexity.

Let \(f(n)\) and \(g(n)\) be functions that map positive integers to positive real numbers. We say that \(f(n)\) is \(O(g(n))\) (or \(f(n) \in O(g(n))\)) if there exists a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that \(f(n) \leq c \cdot g(n)\) for every integer \(n \geq n_0\).

Example

Let \(f(n) = 7n + 8\) and \(g(n) = n\). Is \(f(n) \in O(g(n))\)?

Solution

To determine whether \(f(n) = 7n + 8\) belongs to \(O(g(n))\) where \(g(n) = n\), we need to check if \(f(n)\) grows at most as fast as \(g(n)\) asymptotically. A function \(f(n)\) is in \(O(g(n))\) if there exists a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \leq c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to determine if there exist constants \(c\) and \(n_0\) such that:

\[ 7n + 8 \leq c \cdot n \]

Subtract both sides by \(c \cdot n\):

\[ (7 - c)n + 8 \leq 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((7 - c)n\) must be negative. Therefore:

\[ 7 - c \lt 0 \implies c \gt 7 \]

This means that for the inequality to hold for large enough \(n\), \(c\) must be greater than \(7\).

Choose \(c = 8\):

\[ 7n + 8 \leq 8n \implies n \geq 8 \]

Therefore, we can pick \(c = 8\) and \(n_0 = 8\):

\[ 8 \geq 8 \]

Hence, we have shown that there exist constants \(c = 8\) and \(n_0 = 8\) such that \(f(n) \leq c \cdot g(n)\) for all \(n \geq n_0\). Thus, \(f(n) \in O(g(n))\).

Example

Let \(f(n) = 7n^{2} + 8\) and \(g(n) = n\). Is \(f(n) \in O(g(n))\)?

Solution

To determine whether \(f(n) = 7n^{2} + 8\) belongs to \(O(g(n))\) where \(g(n) = n\), we need to check if \(f(n)\) grows at most as fast as \(g(n)\) asymptotically. A function \(f(n)\) is in \(O(g(n))\) if there exists a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \leq c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to determine if there exist constants \(c\) and \(n_0\) such that:

\[ 7n^{2} + 8 \leq c \cdot n \]

Subtract both sides by \(c \cdot n\):

\[ 7n^{2} - c \cdot n + 8 \leq 0 \]

For large \(n\), the term \(7n^{2}\) will grow faster than \(c \cdot n\). Hence, the inequality \(7n^{2} + 8 \leq c \cdot n\) will not hold for any large \(n\).

Hence, we have shown that there do not exist constants \(c \gt 0\) and \(n_0\) such that \(7n^{2} + 8 \leq c \cdot n\) for all \(n \geq n_0\). Thus, \(f(n) \notin O(g(n))\).

Example

Prove that running time \(f(n) = n^{3} + 20n + 1\) is O(n^{3})$

Solution

To determine whether \(f(n) = n^{3} + 20n + 1\) belongs to \(O(g(n))\) where \(g(n) = n^{3}\), we need to check if \(f(n)\) grows at most as fast as \(g(n)\) asymptotically. A function \(f(n)\) is in \(O(g(n))\) if there exists a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \leq c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to determine if there exist constants \(c\) and \(n_0\) such that:

\[ n^{3} + 20n + 1 \leq c \cdot n^{3} \]

Move all terms to right side of the inequality and combine like terms:

\[ (c - 1)n^{3} - 20n - 1 \geq 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((c - 1)n^{3}\) must be positive. Therefore:

\[ c - 1 \gt 0 \implies c \gt 1 \]

This means that for the inequality to hold for large enough \(n\), \(c\) must be greater than \(1\).

Choose \(c = 2\):

\[ n^{3} - 20n - 1 \geq 0 \]

We want to find \(n_0\) such that:

\[ n^{3} - 20n - 1 \geq 0 \]

To estimate \(n\) for which \(n^{3} - 20n - 1 \geq 0\) holds, we need to find the point where the positive terms (\(n^{3}\)) become dominant over the negative terms (\(20n\) and \(1\)). We can compare terms based on their degree and the magnitude of their coefficients.

\(n^{3}\) is the highest-degree positive term and \(20n\) is the highest-degree negative term. We compare \(n^{3}\) with \(20n\) to estimate \(n\).

\[ n^{3} \gt 20n \implies n \gt \sqrt{20} \approx 4.4721 \]

So, \(n^{3}\) starts to dominate \(20n\) when \(n\) is \(5\) or larger.

Let's approach it by testing positive values for \(n\) such that \(n^{3} - 20n - 1 \geq 0\) holds.

For \(n = 5\):

\[ 5^{3} - 20(5) - 1 = 125 - 20 - 1 = 24 \quad (\text{which} \quad \gt 0) \]

Hence, we have shown that there exist constants \(c = 2\) and \(n_0 = 5\) such that \(f(n) \leq c \cdot g(n)\) for all \(n \geq n_0\). Thus, \(f(n) \in O(g(n))\).

Example

Prove that running time \(f(n) = n^{3} + 20n + 1\) is not \(O(n^{2})\)

Solution

To determine whether \(f(n) = n^{3} + 20n + 1\) belongs to \(O(g(n))\) where \(g(n) = n^{2}\), we need to check if \(f(n)\) grows at most as fast as \(g(n)\) asymptotically. A function \(f(n)\) is in \(O(g(n))\) if there exists a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \leq c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

Assume, for contradiction, that \(f(n) = n^{3} + 20n + 1\) is \(O(n^{2})\). Then there exist constants \(c \gt 0\) and \(n_0 \geq 1\) such that for all \(n \geq n_0\):

\[ n^{3} + 20n + 1 \leq c \cdot n^{2} \]

Subtract by \(c \cdot n^{2}\) from both sides:

\[ n^{3} - c \cdot n^{2} + 20n + 1 \leq 0 \]

For large \(n\), the term \(n^{3}\) will grow faster than \(c \cdot n^{2}\). Hence, the inequality \(n^{3} + 20n + 1 \leq c \cdot n^{2}\) will not hold for any large \(n\).

Hence, we have shown that there do not exist constants \(c \gt 0\) and \(n_0\) such that \(n^{3} + 20n + 1 \leq c \cdot n^{2}\) for all \(n \geq n_0\). Thus, \(f(n) \notin O(g(n))\).

Example

Prove that running time \(f(n) = 100n^{3} + 20n + 1\) is \(O(n^{4})\)

Solution

To determine whether \(f(n) = 100n^{3} + 20n + 1\) belongs to \(O(g(n))\) where \(g(n) = n^{4}\), we need to check if \(f(n)\) grows at most as fast as \(g(n)\) asymptotically. A function \(f(n)\) is in \(O(g(n))\) if there exists a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \leq c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to determine if there exist constants \(c\) and \(n_0\) such that:

\[ 100n^{3} + 20n + 1 \leq c \cdot n^{4} \]

Move all terms to right side of the inequality and combine like terms:

\[ c \cdot n^{4} - 100n^{3} - 20n - 1 \geq 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \(c \cdot n^{4}\) must be positive. Therefore:

\[ c \gt 0 \]

This means that for the inequality to hold for large enough \(n\), \(c\) must be greater than \(0\).

Choose \(c = 1\):

\[ n^{4} - 100n^{3} - 20n - 1 \geq 0 \]

We want to find \(n_0\) such that:

\[ n^{4} - 100n^{3} - 20n - 1 \geq 0 \]

To estimate \(n\) for which \(n^{4} - 100n^{3} - 20n - 1 \geq 0\) holds, we need to find the point where the positive terms (\(n^{4}\)) become dominant over the negative terms (\(100n^{3}\), \(20n\) and \(1\)). We can compare terms based on their degree and the magnitude of their coefficients.

\(n^{4}\) is the highest-degree positive term and \(100n^{3}\) is the highest-degree negative term. We compare \(n^{4}\) with \(100n^{3}\) to estimate \(n\).

\[ n^{4} \gt 100n^{3} \implies n \gt 100 \]

So, \(n^{4}\) starts to dominate \(100n^{3}\) when \(n\) is larger than \(100\).

Let's approach it by testing positive values for \(n\) such that \(n^{4} - 100n^{3} - 20n - 1 \geq 0\) holds.

For \(n = 101\):

\[ 101^{4} - 100(101^{3}) - 20(101) - 1 = 104060401 -103030100 - 2020 - 1 = 1028280 \quad (\text{which} \quad \gt 0) \]

For \(n = 100\):

\[ 100^{4} - 100(100^{3}) - 20(100) - 1 = 100000000 -100000000 - 2000 - 1 = -2001 \quad (\text{which} \quad \lt 0) \]

Hence, we have shown that there exist constants \(c = 1\) and \(n_0 = 101\) such that \(f(n) \leq c \cdot g(n)\) for all \(n \geq n_0\). Thus, \(f(n) \in O(g(n))\).

Example

Prove that running time \(f(n) = 2^{n+1}\) is \(O(2^{n})\)

Solution

To determine whether \(f(n) = 2^{n+1}\) belongs to \(O(g(n))\) where \(g(n) = 2^{n}\), we need to check if f(n) grows at most as fast as g(n) asymptotically. A function f(n) is in \(O(g(n))\) if there exists a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \leq c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to determine if there exist constants \(c\) and \(n_0\) such that:

\[ 2^{n+1} \leq c \cdot 2^{n} \]

Divide by \(2^{n}\) from both sides:

\[ c \geq 2 \]

This means that for large enough \(n\), the inequality will hold as long as \(c \geq 2\).

Choose \(c = 2\):

\[ 2^{n+1} \leq 2 \cdot 2^{n} \implies 2^{n+1} \leq 2^{n+1} \]

Therefore, we can pick \(c = 2\) and \(n_0 = 1\):

\[ 2^{2} \leq 2^{2} \]

Hence, we have shown that there exist constants \(c = 2\) and \(n_0 = 1\) such that \(f(n) \leq c \cdot g(n)\) for all \(n \geq n_0\). Thus, \(f(n) \in O(g(n))\).

Example

Prove that running time \(f(n) = 10^{80}\) is \(O(1)\)

Solution

To determine whether \(f(n) = 10^{80}\) belongs to \(O(g(n))\) where \(g(n) = 1\), we need to check if \(f(n)\) grows at most as fast as \(g(n)\) asymptotically. A function \(f(n)\) is in \(O(g(n))\) if there exists a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \leq c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

The function \(f(n) = 10^{80}\) is a constant value, meaning that it does not depend on \(n\). It remains \(10^{80}\) regardless of the input \(n\).

\[ 10^{80} \leq c \cdot 1 \]

We need to find a constant \(c\) such that:

\[ 10^{80} \leq c \]

This inequality is true for any constant \(c \geq 10^{80}\). Therefore, we can choose \(c = 10^{80}\).

Thus, we can conclude that \(f(n) \in O(g(n))\) with \(c = 10^{80}\) and \(n_0 = 1\).

Example

Prove that running time \(f(n) = \log_{\ln(5)}(\log^{\log(100)}(n))\) is \(O(\log(\log(n)))\)

Solution

The function \(f(n) = \log_{\ln(5)}(\log^{\log(100)}(n))\) can be rewritten using the change of base formula:

\[ f(n) = \log_{\ln(5)}(\log^{\log(100)}(n)) = \frac{\log (\log^{\log(100)}(n))}{\log(\ln(5))} \]

Next, simplify the expression:

\[ f(n) = \log_{\ln(5)}(\log^{\log(100)}(n)) = \frac{\log(100)}{\log (\ln(5))} \cdot \log(\log(n)) \]

To determine whether \(f(n) = \log_{\ln(5)}(\log^{\log(100)}(n))\) belongs to \(O(g(n))\) where \(g(n) = \log(\log(n))\), we need to check if \(f(n)\) grows at most as fast as \(g(n)\) asymptotically. A function \(f(n)\) is in \(O(g(n))\) if there exists a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \leq c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to determine if there exist constants \(c\) and \(n_0\) such that:

\[ \log_{\ln(5)}(\log^{\log(100)}(n)) \leq c \cdot \log(\log(n)) \]

Simplify the function \(f(n)\):

\[ \frac{\log(100)}{\log (\ln(5))} \cdot \log(\log(n)) \leq c \cdot \log(\log(n)) \]

Divide by \(\log(\log(n))\) from both sides:

\[ \frac{\log(100)}{\log (\ln(5))} \leq c \]

This means that for large enough \(n\), the inequality will hold as long as \(c \geq \frac{\log(100)}{\log (\ln(5))}\).

Thus, we can conclude that \(f(n) \in O(g(n))\) with \(c = \frac{\log(100)}{\log(\ln(5))}\) and \(n_0 = 1\).

Example

Prove that running time \(f(n) = 5^{log(3)} n^{3} + 10^{80} n^{2} + log(3) n^{3.1} + 6006\) is \(O(n^{3.1})\).

Solution

To determine whether \(f(n) = 5^{log(3)} n^{3} + 10^{80} n^{2} + log(3) n^{3.1} + 6006\) belongs to \(O(g(n))\) where \(g(n) = n^{3.1}\), we need to check if f(n) grows at most as fast as g(n) asymptotically. A function f(n) is in \(O(g(n))\) if there exists a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \leq c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to determine if there exist constants \(c\) and \(n_0\) such that:

\[ 5^{log(3)} n^{3} + 10^{80} n^{2} + log(3) n^{3.1} + 6006 \leq c \cdot n^{3.1} \]

Move all terms to right side of the inequality and combine like terms:

\[ (c - log(3))n^{3.1} - 5^{log(3)}n^{3} - 10^{80}n^{2} - 6006 \geq 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((c - log(3))n^{3.1}\) must be positive. Therefore:

\[ c - log(3) \gt 0 \implies c \gt log(3) \approx 0.4771 \]

This means that for the inequality to hold for large enough \(n\), \(c\) must be greater than \(0.4771\).

Choose \(c = 1\):

\[ (1 - log(3))n^{3.1} - 5^{log(3)}n^{3} - 10^{80}n^{2} - 6006 \geq 0 \]

To estimate \(n\) for which \((1 - log(3))n^{3.1} - 5^{log(3)}n^{3} - 10^{80}n^{2} - 6006 \geq 0\) holds, we need to find the point where the positive terms (\((1 - log(3))n^{3.1}\)) become dominant over the negative terms (\(5^{log(3)}n^{3}\), \(10^{80}n^{2}\) and \(6006\)). We can compare terms based on their degree and the magnitude of their coefficients.

We compare \((1 - log(3))n^{3.1}\) which is the highest-degree positive term with \(5^{log(3)}n^{3}\) which is the highest-degree negative term to estimate \(n\).

\[ (1 - log(3))n^{3.1} \gt 5^{log(3)}n^{3} \]

Divide both sides by \((1 - log(3))n^{3}\):

\[ n^{0.1} \gt \frac{5^{log(3)}}{1 - log(3)} \approx 8.85 \]

Raise both sides to the power of \(10\):

\[ n \gt 4.94 \cdot 10^{9} \]

Next, we compare \((1 - log(3))n^{3.1}\) which is the highest-degree positive term with \(10^{80}n^{2}\) which is the term with the largest constant magnitude to estimate \(n\).

\[ (1 - log(3))n^{3.1} \gt 10^{80}n^{2} \]

Divide both sides of the inequality by n^{2}

\[ (1 - log(3))n^{1.1} \gt 10^{80} \]

Divide both sides by \(1−log⁡(3)\):

\[ n^{1.1} \gt \frac{10^{80}}{1 - log(3)} \approx 10^{80} \]

Now, take the 1.11-th root of both sides to isolate \(n\):

\[ n \gt 10^{72.73} \]

This is a much larger threshold than \(4.94 \cdot 10^{9}\).

Let's approach it by testing positive values for \(n\) such that \((1 - log(3))n^{3.1} - 5^{log(3)}n^{3} - 10^{80}n^{2} - 6006 \geq 0\) holds.

For \(n = 10^{73}\):

\[ (1 - log(3)) (10^{73})^{3.1} - 5^{log(3)} (10^{73})^{3} - 10^{80} (10^{73})^{2} - 6006 \approx -10^{226} \quad (\text{which} \quad \lt 0) \]

For \(n = 10^{74}\):

\[ (1 - log(3)) (10^{74})^{3.1} - 5^{log(3)} (10^{74})^{3} - 10^{80} (10^{74})^{2} - 6006 \approx 5.23 \cdot 10^{228.4} \quad (\text{which} \quad \gt 0) \]

Hence, we have shown that there exist constants \(c = 1\) and \(n_0 = 10^{74}\) such that \(f(n) \leq c \cdot g(n)\) for all \(n \geq n_0\). Thus, \(f(n) \in O(g(n))\).

Example

Prove that running time \(f(n) = \binom{n}{\frac{n}{2}}\) is \(O(\frac{2^{n}}{\sqrt{n}})\).

Solution

The binomial coefficient \(\binom{n}{\frac{n}{2}}\) can be approximated using Stirling's approximation for factorials. Stirling's approximation states:

\[ n! \approx \sqrt{2\pi n} (\frac{n}{e})^{n} \]

The binomial coefficient can be expressed as:

\[ \binom{n}{\frac{n}{2}} = \frac{n!}{(\frac{n}{2})!(\frac{n}{2})!} \]

Applying Stirling's approximation:

\[ n! \approx \sqrt{2\pi n} (\frac{n}{e})^{n} \]
\[ \frac{n}{2}! \approx \sqrt{\pi n} (\frac{\frac{n}{2}}{e})^{\frac{n}{2}} \]

Thus:

\[ \binom{n}{\frac{n}{2}} = \frac{\sqrt{2\pi n} (\frac{n}{e})^{n}}{(\sqrt{\pi n} (\frac{\frac{n}{2}}{e})^{\frac{n}{2}})^{2}} \]

Simplify the expression:

\[ \binom{n}{\frac{n}{2}} \approx \frac{\sqrt{2\pi n} (\frac{n}{e})^{n}}{\pi n (\frac{\frac{n}{2}}{e})^{n}} \]

Simplify further:

\[ \binom{n}{\frac{n}{2}} \approx \frac{\sqrt{2}}{\sqrt{\pi}} \cdot \frac{2^{n}}{\sqrt{n}} \]

To determine whether \(f(n) = \binom{n}{\frac{n}{2}}\) belongs to \(O(g(n))\) where \(g(n) = \frac{2^{n}}{\sqrt{n}}\), we need to check if \(f(n)\) grows at most as fast as \(g(n)\) asymptotically. A function \(f(n)\) is in \(O(g(n))\) if there exists a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \leq c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to determine if there exist constants \(c\) and \(n_0\) such that:

\[ \binom{n}{\frac{n}{2}} \leq c \cdot \frac{2^{n}}{\sqrt{n}} \]

From the above approximation:

\[ \frac{\sqrt{2}}{\sqrt{\pi}} \cdot \frac{2^{n}}{\sqrt{n}} \leq c \cdot \frac{2^{n}}{\sqrt{n}} \]

Divide by \(\frac{2^{n}}{\sqrt{n}}\) from both sides:

\[ \frac{\sqrt{2}}{\sqrt{\pi}} \leq c \]

This means that for large enough \(n\), the inequality will hold as long as \(c \geq \frac{\sqrt{2}}{\sqrt{\pi}}\).

Thus, we can conclude that \(f(n) \in O(g(n))\) with \(c = \frac{\sqrt{2}}{\sqrt{\pi}}\) and \(n_0 = 1\).

Example

Prove that running time \(f(n) = \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{3} − 11n^{2} + 12}\) is \(O(n)\)

Solution

To determine whether \(f(n) = \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12}\) belongs to \(O(g(n))\) where \(g(n) = n\), we need to check if \(f(n)\) grows at most as fast as \(g(n)\) asymptotically. A function \(f(n)\) is in \(O(g(n))\) if there exists a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \leq c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to determine if there exist constants \(c\) and \(n_0\) such that:

\[ \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12} \leq c \cdot n \]

Simplify the inequality:

\[ 4n^{3} − 28n^{2} + 56n − 35 \leq c \cdot n \cdot (2n^{2} − 11n + 12) \]

Expand the expression:

\[ 4n^{3} − 28n^{2} + 56n − 35 \leq 2c \cdot n^{3} − 11c \cdot n^{2} + 12c \cdot n \]

Move all terms to right side of the inequality and combine like terms:

\[ (2c - 4)n^{3} + (28 - 11c)n^{2} + (12c - 56)n + 35 \geq 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((2c - 4)n^{3}\) must be positive or zero. If the dominant term \((2c - 4)n^{3}\) becomes zero, the term \((28 - 11c)n^{2}\) can still satisfy the inequality for large \(n\). Therefore:

\[ 2c - 4 \geq 0 \implies c \geq 2 \]

This means that for the inequality to hold for large enough \(n\), \(c\) must be greater than or equal to \(2\).

Choose \(c = 2\):

\[ 6n^{2} - 32n + 35 \geq 0 \]

To estimate \(n\) for which \(6n^{2} - 32n + 35 \geq 0\) holds, we need to find the point where the positive terms (\(6n^{2}\) and \(35\)) become dominant over the negative terms (\(32n\)). We can compare terms based on their degree and the magnitude of their coefficients.

We compare \(6n^{2}\) which is the highest-degree positive term with \(32n\) which is the highest-degree negative term to estimate \(n\).

\[ 6n^{2} \geq 32n \]

Divide both sides by \(6n\):

\[ n \geq 5.4 \]

So, \(6n^{2}\) starts to dominate \(32n\) when \(n\) is \(6\) or larger.

Let's approach it by testing positive values for \(n\) such that \(6n^{2} - 32n + 35 \geq 0\) holds.

For \(n = 6\):

\[ 6(6^{2}) - 32(6) + 35 = 216 - 192 + 35 = 59 \quad (\text{which} \quad \gt 0) \]

For \(n = 5\):

\[ 6(5^{2}) - 32(5) + 35 = 150 - 160 + 35 = 25 \quad (\text{which} \quad \gt 0) \]

For \(n = 4\):

\[ 6(4^{2}) - 32(4) + 35 = 96 - 128 + 35 = 3 \quad (\text{which} \quad \gt 0) \]

For \(n = 3\):

\[ 6(3^{2}) - 32(3) + 35 = 54 - 96 + 35 = -7 \quad (\text{which} \quad \lt 0) \]

Hence, we have shown that there exist constants \(c = 2\) and \(n_0 = 4\) such that \(f(n) \leq c \cdot g(n)\) for all \(n \geq n_0\). Thus, \(f(n) \in O(g(n))\).

Example

Prove that running time \(f(n) = \frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45}\) is \(O(\frac{1}{n^{2}})\)

Solution

To determine whether \(f(n) = \frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45}\) belongs to \(O(g(n))\) where \(g(n) = \frac{1}{n^{2}}\), we need to check if \(f(n)\) grows at most as fast as \(g(n)\) asymptotically. A function \(f(n)\) is in \(O(g(n))\) if there exists a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \leq c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to determine if there exist constants \(c\) and \(n_0\) such that:

\[ \frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45} \leq c \cdot \frac{1}{n^{2}} \]

Simplify the inequality:

\[ n^{2} \cdot (5n^{2} − 2n − 35) \leq c \cdot (2n^{4} − 11n^{3} + 12n^{2} + 4n + 45) \]

Expand the expression:

\[ 5n^{4} − 2n^{3} − 35n^{2} \leq 2c \cdot n^{4} − 11c \cdot n^{3} + 12c \cdot n^{2} + 4c \cdot n + 45c \]

Move all terms to right side of the inequality and combine like terms:

\[ (2c - 5)n^{4} + (2 - 11c)n^{3} + (12c + 35)n^{2} + (4c)n + 45c \geq 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((2c - 5)n^{4}\) must be positive. Therefore:

\[ 2c - 5 \gt 0 \implies c \gt 2.5 \]

This means that for the inequality to hold for large enough \(n\), \(c\) must be greater than or equal to \(2.5\).

Choose \(c = 2.6\):

\[ 0.2n^{4} - 26.6n^{3} + 66.2n^{2} + 10.4n + 117 \geq 0 \]

Multiply both sides by \(5\):

\[ n^{4} - 133n^{3} + 331n^{2} + 52n + 585 \geq 0 \]

To estimate \(n\) for which \(n^{4} - 133n^{3} + 331n^{2} + 52n + 585 \geq 0\) holds, we need to find the point where the positive terms (\(n^{4}\), \(331n^{2}\), \(52n\) and \(585\)) become dominant over the negative terms (\(133n^{3}\)). We can compare terms based on their degree and the magnitude of their coefficients.

We compare \(n^{4}\) which is the highest-degree positive term with \(133n^{2}\) which is the highest-degree negative term to estimate \(n\).

\[ n^{4} \geq 133n^{3} \]

Solving for \(n\):

\[ n \geq 133 \]

Let's approach it by testing positive values for \(n\) such that \(n^{4} - 133n^{3} + 331n^{2} + 52n + 585 \geq 0\) holds.

For \(n = 133\):

\[ (133)^{4} - 133(133^{3}) + 331(133^{2}) + 52(133) + 585 = 312900721 - 312900721 + 5855059 + 6916 + 585 = 5862560 \quad (\text{which} \quad \gt 0) \]

For \(n = 132\):

\[ (132)^{4} - 133(132^{3}) + 331(132^{2}) + 52(132) + 585 = 303180864 - 306789024 + 5763054 + 6864 + 585 = 2168343 \quad (\text{which} \quad \gt 0) \]

For \(n = 131\):

\[ (131)^{4} - 133(131^{3}) + 331(131^{2}) + 52(131) + 585 = 294616321 - 299674083 + 5688511 + 6792 + 585 = 642126 \quad (\text{which} \quad \gt 0) \]

For \(n = 130\):

\[ (130)^{4} - 133(130^{3}) + 331(130^{2}) + 52(130) + 585 = 285610000 - 292321000 + 5596900 + 6760 + 585 = -1106755 \quad (\text{which} \quad \lt 0) \]

Hence, we have shown that there exist constants \(c = 2.6\) and \(n_0 = 131\) such that \(f(n) \leq c \cdot g(n)\) for all \(n \geq n_0\). Thus, \(f(n) \in O(g(n))\).

Example

Prove that running time \(f(n) = \log(n!)\) is \(O(n \log(n))\).

Solution

The factorial function can be approximated using Stirling's approximation. Stirling's approximation states:

\[ n! \approx \sqrt{2\pi n} (\frac{n}{e})^{n} \]

Taking the logarithm of both sides:

\[ \log(n!) \approx \log (\sqrt{2\pi n} (\frac{n}{e})^{n}) \]

Using the properties of logarithms, we can expand the expression:

\[ \log(n!) \approx \log (\sqrt{2\pi n}) + n \log (\frac{n}{e}) \]

Simplify each term:

\[ \log(n!) \approx \frac{1}{2} \log(2\pi) + \frac{1}{2} \log(n) + n \log(n) - n \log(e) \]

To determine whether \(f(n) = \log(n!)\) belongs to \(O(g(n))\) where \(g(n) = n \log(n)\), we need to check if f(n) grows at most as fast as g(n) asymptotically. A function f(n) is in \(O(g(n))\) if there exists a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \leq c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to determine if there exist constants \(c\) and \(n_0\) such that:

\[ \log(n!) \leq c \cdot n \log(n) \]

From the approximation above:

\[ \frac{1}{2} \log(2\pi) + \frac{1}{2} \log(n) + n \log(n) - n \log(e) \leq c \cdot n \log(n) \]

Move all terms to right side of the inequality and combine like terms:

\[ (c - 1)n \log(n) + n \log(e) - \frac{1}{2} \log(n) - \frac{1}{2} \log(2\pi) \geq 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((c - 1)n \log(n)\) must be positive or zero. If the dominant term \((c - 1)n \log(n)\) becomes zero, the term \(n \log(e)\) can still satisfy the inequality for large \(n\). Therefore:

\[ c - 1 \geq 0 \implies c \geq 1 \]

This means that for the inequality to hold for large enough \(n\), \(c\) must be greater than or equal to \(1\).

Choose \(c = 1\):

\[ n \log(e) - \frac{1}{2} \log(n) - \frac{1}{2} \log(2\pi) \geq 0 \]

To estimate \(n\) for which \(n \log(e) - \frac{1}{2} \log(n) - \frac{1}{2} \log(2\pi) \geq 0\) holds, we need to find the point where the positive terms (\(n \log(e)\)) become dominant over the negative terms (\(\frac{1}{2} \log(n)\) and \(\frac{1}{2} \log(2\pi)\)). We can compare terms based on their degree and the magnitude of their coefficients.

We compare \(n \log(e)\) which is the highest-degree positive term with \(\frac{1}{2} \log(n)\) which is the highest-degree negative term to estimate \(n\).

\[ n \log(e) \gt \frac{1}{2} \log(n) \]

The inequality \(n \log(e) \gt \frac{1}{2} \log(n)\) holds for all positive \(n\)

\[ n \gt 0 \]

Let's approach it by testing positive values for \(n\) such that \(n \log(e) - \frac{1}{2} \log(n) - \frac{1}{2} \log(2\pi) \geq 0\) holds.

For \(n = 1\):

\[ 1 \cdot log(e) - \frac{1}{2} \log(1) - \frac{1}{2} \log(2\pi) \geq 0 \approx 0.434 - 0 - 0.399 \approx 0.035 \quad (\text{which} \quad \gt 0) \]

Hence, we have shown that there exist constants \(c = 1\) and \(n_0 = 1\) such that \(f(n) \leq c \cdot g(n)\) for all \(n \geq n_0\). Thus, \(f(n) \in O(g(n))\).

Little-o Notation

Let \(f(n)\) and \(g(n)\) be functions that map positive integers to positive real numbers. We say that \(f(n)\) is \(o(g(n))\) (or \(f(n) \in o(g(n))\)) if for any real constant \(c \gt 0\), there exists an integer constant \(n_0 \geq 1\) such that \(f(n) \lt c \cdot g(n)\) for every integer \(n \geq n_0\).

Example

Let \(f(n) = 7n + 8\) and \(g(n) = n\). Is \(f(n) \in o(g(n))\)?

Solution 1

To determine whether \(f(n) = 7n + 8\) belongs to \(o(g(n))\) where \(g(n) = n\), we need to check if \(f(n)\) grows strictly slower than \(g(n)\) asymptotically. A function \(f(n)\) is in \(o(g(n))\) if for any given positive real constant \(c\), there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \lt c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

Substituting the given functions:

\[ 7n + 8 \lt c \cdot n \]

Subtract both sides by \(c \cdot n\):

\[ (7 - c)n + 8 \lt 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((7 - c)n\) must be negative. Therefore:

\[ 7 - c \lt 0 \implies c \gt 7 \]

This means that for the inequality to hold for large enough \(n\), \(c\) must be greater than \(7\). However, \(o(g(n))\) requires the inequality to hold for any positive \(c\), no matter how small.

Since \(c \gt 7\) requires \(c\) to be at least \(7\), \(f(n)\) cannot be less than \(c \cdot n\) for arbitrary small values of \(c\). Therefore, \(f(n)\) does not satisfy the condition for \(o(g(n))\) because there exists a lower bound on \(c\) (namely \(7\)).

Hence, \(f(n) = 7n + 8 \notin o(g(n))\).

Solution 2

To determine whether \(f(n) = 7n + 8\) is in \(o(g(n))\) where \(g(n) = n\) using limits, we need to evaluate the following limit:

\[ \lim_{n \to \infty} \frac{f(n)}{g(n)} \]

If the limit is \(0\), then \(f(n) \in o(g(n))\). Otherwise, \(f(n) \notin o(g(n))\).

Given \(f(n) = 7n + 8\) and \(g(n) = n\), we need to evaluate:

\[ \lim_{n \to \infty} \frac{7n + 8}{n} \]

Simplify the expression:

\[ \lim_{n \to \infty} \frac{7n + 8}{n} = \lim_{n \to \infty} (7 + \frac{8}{n}) \]

As \(n\) approaches infinity, the term \(\frac{8}{n}\) approaches \(0\). Thus, the limit becomes:

\[ \lim_{n \to \infty} (7 + \frac{8}{n}) = 7 \]

Since the limit is \(7\) (and not \(0\)), the function \(f(n) = 7n + 8\) does not grow faster than \(g(n) = n\). Therefore, \(f(n) \notin o(g(n))\).

Example

Let \(f(n) = 7n + 8\) and \(g(n) = n^{2}\). Is \(f(n) \in o(g(n))\)?

Solution 1

To determine whether \(f(n) = 7n + 8\) belongs to \(o(g(n))\) where \(g(n) = n^{2}\), we need to check if \(f(n)\) grows strictly slower than \(g(n)\) asymptotically. A function \(f(n)\) is in \(o(g(n))\) if for any given positive real constant \(c\), there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \lt c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

Substituting the given functions:

\[ 7n + 8 \lt c \cdot n^{2} \]

Subtract both sides by \(c \cdot n^{2}\):

\[ (-c)n^{2} + 7n + 8 \lt 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((-c)n^{2}\) must be negative. Therefore:

\[ -c \lt 0 \implies c \gt 0 \]

This means that for the inequality to hold for large enough \(n\), \(c\) must be greater than \(0\).

Since the inequality holds for any positive \(c\), \(f(n)\) satisfy the condition for \(o(g(n))\). Therefore, \(f(n) = 7n + 8 \in o(g(n) = n^{2})\).

Solution 2

To determine whether \(f(n) = 7n + 8\) is in \(o(g(n))\) where \(g(n) = n^{2}\) using limits, we need to evaluate the following limit:

\[ \lim_{n \to \infty} \frac{f(n)}{g(n)} \]

If the limit is \(0\), then \(f(n) \in o(g(n))\). Otherwise, \(f(n) \notin o(g(n))\).

Given \(f(n) = 7n + 8\) and \(g(n) = n^{2}\), we need to evaluate:

\[ \lim_{n \to \infty} \frac{7n + 8}{n^{2}} \]

Simplify the expression:

\[ \lim_{n \to \infty} \frac{7n + 8}{n^{2}} = \lim_{n \to \infty} (\frac{7}{n} + \frac{8}{n^{2}}) \]

As \(n\) approaches infinity, the terms \(\frac{7}{n}\) and \(\frac{8}{n^{2}}\) approach \(0\). Thus, the limit becomes:

\[ \lim_{n \to \infty} (\frac{7}{n} + \frac{8}{n^{2}}) = 0 \]

Since the limit is \(0\), then \(f(n) = 7n + 8 \in o(g(n) = n^{2})\).

Example

Let \(f(n) = 2^{n+1}\) and \(g(n) = 2^{n}\). Is \(f(n) \in o(g(n))\)?

Solution 1

To determine whether \(f(n) = 2^{n+1}\) belongs to \(o(g(n))\) where \(g(n) = 2^{n}\), we need to see if for any given positive value of \(c\), we can find a point \(n_0\) beyond which the function \(f(n) = 2^{n+1}\) grows strictly slower than \(c\) times \(g(n) = 2^{n}\):

\[ f(n) \lt c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

Substituting the given functions:

\[ 2^{n+1} \lt c \cdot 2^{n} \]

Divide both sides by \(2^{n}\):

\[ 2 \lt c \]

This means that for the inequality to hold for large enough \(n\), \(c\) must be greater than \(2\). However, \(o(g(n))\) requires the inequality to hold for any positive \(c\), no matter how small.

Since \(c \gt 2\) requires \(c\) to be at least \(2\), \(f(n)\) cannot be less than \(c \cdot n\) for arbitrary small values of \(c\). Therefore, \(f(n)\) does not satisfy the condition for \(o(g(n))\) because there exists a lower bound on \(c\) (namely \(2\)).

Hence, \(f(n) = 2^{n+1} \notin o(g(n) = 2^{n})\).

Solution 2

To determine whether \(f(n) = 2^{n+1}\) belongs to \(o(g(n))\) where \(g(n) = 2^{n}\) using limits, we need to evaluate the following limit:

\[ \lim_{n \to \infty} \frac{f(n)}{g(n)} \]

If the limit is \(0\), then \(f(n) \in o(g(n))\). Otherwise, \(f(n) \notin o(g(n))\).

Given \(f(n) = 2^{n+1}\) and \(g(n) = 2^{n}\), we need to evaluate:

\[ \lim_{n \to \infty} \frac{2^{n+1}}{2^{n}} \]

Simplify the expression and evaluate the limit:

\[ \lim_{n \to \infty} \frac{2^{n+1}}{2^{n}} = \lim_{n \to \infty} 2 = 2 \]

Since the limit is \(2\) (and not \(0\)), the function \(f(n) = 2^{n+1}\) does not grow faster than \(g(n) = 2^{n}\). Therefore, \(f(n) \notin o(g(n))\).

Example

Let \(f(n) = \log_{\ln(5)}(\log^{\log(100)}(n))\) and \(g(n) = \log(\log(n))\). Is \(f(n) \in o(g(n))\)

Solution 1

Let's simplify the expression \(\log_{\ln(5)}(\log^{\log(100)}(n))\).

The change of base formula states:

\[ \log_{a}(x) = \frac{\log_{b}(x)}{\log_{b}(a)} \]

Applying this to the expression:

\[ \log_{\ln(5)}(\log^{\log(100)}(n)) = \frac{\log (\log^{\log(100)}(n))}{\ln(5)} \]

The expression inside the logarithm can be simplified using the logarithm power rule, \(\log⁡ (x^{y}) = y \cdot \log⁡ (x)\):

\[ \log (\log^{\log(100)}(n)) = \log(100) \cdot \log (\log(n)) \]

So, the original expression becomes:

\[ \frac{\log (\log^{\log(100)}(n))}{\ln(5)} = \frac{\log(100)}{\ln(5)} \cdot \log (\log(n)) \]

To determine whether \(f(n) = \log_{\ln(5)}(\log^{\log(100)}(n))\) belongs to \(o(g(n))\) where \(g(n) = \log(\log(n))\), we need to check if \(f(n)\) grows strictly slower than \(g(n)\) asymptotically. A function \(f(n)\) is in \(o(g(n))\) if for any given positive real constant \(c\), there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \lt c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

Substituting the given functions:

\[ \log_{\ln(5)}(\log^{\log(100)}(n)) \lt c \cdot \log(\log(n)) \]

Simplify the expression \(\log_{\ln(5)}(\log^{\log(100)}(n))\):

\[ \frac{\log(100)}{\ln(5)} \cdot \log (\log(n)) \lt c \cdot \log(\log(n)) \]

Divide both sides by \(\log(\log(n))\) \quad (\text{which} \quad is positive for all \(n\)):

\[ \frac{\log(100)}{\ln(5)} \lt c \]

This means that for the inequality to hold for large enough \(n\), \(c\) must be greater than \(\frac{\log(100)}{\ln(5)}\). However, \(o(g(n))\) requires the inequality to hold for any positive \(c\), no matter how small.

Since \(c \gt \frac{\log(100)}{\ln(5)}\) requires \(c\) to be at least \(\frac{\log(100)}{\ln(5)}\), \(f(n)\) cannot be less than \(c \cdot n\) for arbitrary small values of \(c\). Therefore, \(f(n)\) does not satisfy the condition for \(o(g(n))\) because there exists a lower bound on \(c\) (namely \(\frac{\log(100)}{\ln(5)}\)).

Hence, \(f(n) = \log_{\ln(5)}(\log^{\log(100)}(n)) \notin o(g(n) = \log(\log(n)))\).

Solution 2

Let's simplify the expression \(\log_{\ln(5)}(\log^{\log(100)}(n))\).

The change of base formula states:

\[ \log_{a}(x) = \frac{\log_{b}(x)}{\log_{b}(a)} \]

Applying this to the expression:

\[ \log_{\ln(5)}(\log^{\log(100)}(n)) = \frac{\log (\log^{\log(100)}(n))}{\ln(5)} \]

The expression inside the logarithm can be simplified using the logarithm power rule, \(\log⁡ (x^{y}) = y \cdot \log⁡ (x)\):

\[ \log (\log^{\log(100)}(n)) = \log(100) \cdot \log (\log(n)) \]

So, the original expression becomes:

\[ \frac{\log (\log^{\log(100)}(n))}{\ln(5)} = \frac{\log(100)}{\ln(5)} \cdot \log (\log(n)) \]

To determine whether \(f(n) = \log_{\ln(5)}(\log^{\log(100)}(n))\) belongs to \(o(g(n))\) where \(g(n) = \log(\log(n))\) using limits, we need to evaluate the following limit:

\[ \lim_{n \to \infty} \frac{f(n)}{g(n)} \]

If the limit is \(0\), then \(f(n) \in o(g(n))\). Otherwise, \(f(n) \notin o(g(n))\).

Given \(f(n) = \log_{\ln(5)}(\log^{\log(100)}(n))\) and \(g(n) = \log(\log(n))\), we need to evaluate:

\[ \lim_{n \to \infty} \frac{\log_{\ln(5)}(\log^{\log(100)}(n))}{\log(\log(n))} \]

Simplify the expression and evaluate the limit:

\[ \lim_{n \to \infty} \frac{\log_{\ln(5)}(\log^{\log(100)}(n))}{\log(\log(n))} = \lim_{n \to \infty} \frac{\frac{\log(100)}{\ln(5)} \cdot \log (\log(n))}{\log(\log(n))} = \frac{\log(100)}{\ln(5)} \]

Since the limit is \(\frac{\log(100)}{\ln(5)}\) (and not \(0\)), the function \(f(n) = \log_{\ln(5)}(\log^{\log(100)}(n))\) does not grow faster than \(g(n) = \log(\log(n))\). Therefore, \(f(n) \notin o(g(n))\).

Example

Let \(f(n) = \binom{n}{\frac{n}{2}}\) and \(g(n) = \frac{2^{n}}{\sqrt{n}}\). Is \(f(n)\) in \(o(g(n))\).

Solution 1

The binomial coefficient \(\binom{n}{\frac{n}{2}}\) can be approximated using Stirling's approximation for factorials. Stirling's approximation states:

\[ n! \approx \sqrt{2\pi n} (\frac{n}{e})^{n} \]

The binomial coefficient can be expressed as:

\[ \binom{n}{\frac{n}{2}} = \frac{n!}{(\frac{n}{2})!(\frac{n}{2})!} \]

Applying Stirling's approximation:

\[ n! \approx \sqrt{2\pi n} (\frac{n}{e})^{n} \]
\[ \frac{n}{2}! \approx \sqrt{\pi n} (\frac{\frac{n}{2}}{e})^{\frac{n}{2}} \]

Thus:

\[ \binom{n}{\frac{n}{2}} \frac{\sqrt{2\pi n} (\frac{n}{e})^{n}}{(\sqrt{\pi n} (\frac{\frac{n}{2}}{e})^{\frac{n}{2}})^{2}} \]

Simplifying this expression:

\[ \binom{n}{\frac{n}{2}} \approx \frac{\sqrt{2\pi n} (\frac{n}{e})^{n}}{\pi n (\frac{\frac{n}{2}}{e})^{n}} \]

Simplify further:

\[ \binom{n}{\frac{n}{2}} \approx \frac{\sqrt{2}}{\sqrt{\pi}} \cdot \frac{2^{n}}{\sqrt{n}} \]

To determine whether \(f(n) = \binom{n}{\frac{n}{2}}\) belongs to \(o(g(n))\) where \(g(n) = \frac{2^{n}}{\sqrt{n}}\), we need to check if \(f(n)\) grows strictly slower than \(g(n)\) asymptotically. A function \(f(n)\) is in \(o(g(n))\) if for any given positive real constant \(c\), there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \lt c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

Substituting the given functions:

\[ \binom{n}{\frac{n}{2}} \lt c \cdot \frac{2^{n}}{\sqrt{n}} \]

The binomial coefficient \(\binom{n}{\frac{n}{2}}\) can be approximated using Stirling's approximation:

\[ \sqrt{\frac{2}{\pi}} \cdot \frac{2^{n}}{\sqrt{n}} \lt c \cdot \frac{2^{n}}{\sqrt{n}} \]

Divide both sides by \(\frac{2^{n}}{\sqrt{n}}\) \quad (\text{which} \quad is positive for all \(n\)):

\[ \sqrt{\frac{2}{\pi}} \lt c \]

This means that for the inequality to hold for large enough \(n\), \(c\) must be greater than \(\sqrt{\frac{2}{\pi}}\). However, \(o(g(n))\) requires the inequality to hold for any positive \(c\), no matter how small.

Since \(c \gt \sqrt{\frac{2}{\pi}}\) requires \(c\) to be at least \(\sqrt{\frac{2}{\pi}}\), \(f(n)\) cannot be less than \(c \cdot n\) for arbitrary small values of \(c\). Therefore, \(f(n)\) does not satisfy the condition for \(o(g(n))\) because there exists a lower bound on \(c\) (namely \(\sqrt{\frac{2}{\pi}}\)).

Hence, \(f(n) = \binom{n}{\frac{n}{2}} \notin o(g(n) = \frac{2^{n}}{\sqrt{n}})\).

Solution 2

The binomial coefficient \(\binom{n}{\frac{n}{2}}\) can be approximated using Stirling's approximation for factorials. Stirling's approximation states:

\[ n! \approx \sqrt{2\pi n} (\frac{n}{e})^{n} \]

The binomial coefficient can be expressed as:

\[ \binom{n}{\frac{n}{2}} = \frac{n!}{(\frac{n}{2})!(\frac{n}{2})!} \]

Applying Stirling's approximation:

\[ n! \approx \sqrt{2\pi n} (\frac{n}{e})^{n} \]
\[ \frac{n}{2}! \approx \sqrt{\pi n} (\frac{\frac{n}{2}}{e})^{\frac{n}{2}} \]

Thus:

\[ \binom{n}{\frac{n}{2}} \frac{\sqrt{2\pi n} (\frac{n}{e})^{n}}{(\sqrt{\pi n} (\frac{\frac{n}{2}}{e})^{\frac{n}{2}})^{2}} \]

Simplifying this expression:

\[ \binom{n}{\frac{n}{2}} \approx \frac{\sqrt{2\pi n} (\frac{n}{e})^{n}}{\pi n (\frac{\frac{n}{2}}{e})^{n}} \]

Simplify further:

\[ \binom{n}{\frac{n}{2}} \approx \frac{\sqrt{2}}{\sqrt{\pi}} \cdot \frac{2^{n}}{\sqrt{n}} \]

To determine whether \(f(n) = \binom{n}{\frac{n}{2}}\) belongs to \(o(g(n))\) where \(g(n) = \frac{2^{n}}{\sqrt{n}}\) using limits, we need to evaluate the following limit:

\[ \lim_{n \to \infty} \frac{f(n)}{g(n)} \]

If the limit is \(0\), then \(f(n) \in o(g(n))\). Otherwise, \(f(n) \notin o(g(n))\).

Given \(f(n) = \binom{n}{\frac{n}{2}}\) and \(g(n) = \frac{2^{n}}{\sqrt{n}}\), we need to evaluate:

\[ \lim_{n \to \infty} \frac{\binom{n}{\frac{n}{2}}}{\frac{2^{n}}{\sqrt{n}}} \]

The binomial coefficient \(\binom{n}{\frac{n}{2}}\) can be approximated using Stirling's approximation and be simplified to:

\[ \lim_{n \to \infty} \frac{\binom{n}{\frac{n}{2}}}{\frac{2^{n}}{\sqrt{n}}} = \lim_{n \to \infty} \frac{\sqrt{\frac{2}{\pi}} \cdot \frac{2^{n}}{\sqrt{n}}}{\frac{2^{n}}{\sqrt{n}}} = \lim_{n \to \infty} \sqrt{\frac{2}{\pi}} = \sqrt{\frac{2}{\pi}} \]

Since the limit is \(\sqrt{\frac{2}{\pi}}\) (and not \(0\)), the function \(f(n) = \binom{n}{\frac{n}{2}}\) does not grow faster than \(g(n) = \frac{2^{n}}{\sqrt{n}}\). Therefore, \(f(n) \notin o(g(n))\).

Example

Let \(f(n) = \log(n!)\) and \(g(n) = n \log(n)\). Is \(f(n)\) in \(o(g(n))\).

Solution 1

The factorial function can be approximated using Stirling's approximation. Stirling's approximation states:

\[ n! \approx \sqrt{2\pi n} (\frac{n}{e})^{n} \]

Taking the logarithm of both sides:

\[ \log(n!) \approx \log (\sqrt{2\pi n} (\frac{n}{e})^{n}) \]

Using the properties of logarithms, we can expand the expression:

\[ \log(n!) \approx \log (\sqrt{2\pi n}) + n \log (\frac{n}{e}) \]

Simplify each term:

\[ \log(n!) \approx \frac{1}{2} \log(2\pi) + \frac{1}{2} \log(n) + n \log(n) - n \log(e) \]

To determine whether \(f(n) = \log(n!)\) belongs to \(o(g(n))\) where \(g(n) = n \log(n)\), we need to check if \(f(n)\) grows strictly slower than \(g(n)\) asymptotically. A function \(f(n)\) is in \(o(g(n))\) if for any given positive real constant \(c\), there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \lt c \cdot g(n) \quad \text{for all} \quad \quad n \geq n_0 \]

Substituting the given functions:

\[ \log(n!) \lt c \cdot n \log(n) \]

The factorial \(n!\) can be approximated using Stirling's approximation and be simplified to:

\[ \frac{1}{2} \log(2\pi) + \frac{1}{2} \log(n) + n \log(n) - n \log(e) \lt c \cdot n \log(n) \]

Move all terms to right side of the inequality and combine like terms:

\[ (c - 1)n \log(n) + n \log(e) - \frac{1}{2} \log(n) - \frac{1}{2} \log(2\pi) \gt 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((c - 1)n \log(n)\) must be positive or zero. If the dominant term \((c - 1)n \log(n)\) becomes zero, the term \(n \log(e)\) can still satisfy the inequality for large \(n\). Therefore:

\[ c - 1 \geq 0 \implies c \geq 1 \]

This means that for the inequality to hold for large enough \(n\), \(c\) must be greater than or equal to \(1\). However, \(o(g(n))\) requires the inequality to hold for any positive \(c\), no matter how small.

Since \(c \geq 1\) requires \(c\) to be at least \(1\), \(f(n)\) cannot be less than \(c \cdot n\) for arbitrary small values of \(c\). Therefore, \(f(n)\) does not satisfy the condition for \(o(g(n))\) because there exists a lower bound on \(c\) (namely \(1\)).

Hence, \(f(n) = \log(n!) \notin o(g(n) = n \log(n))\).

Solution 2

The factorial function can be approximated using Stirling's approximation. Stirling's approximation states:

\[ n! \approx \sqrt{2\pi n} (\frac{n}{e})^{n} \]

Taking the logarithm of both sides:

\[ \log(n!) \approx \log (\sqrt{2\pi n} (\frac{n}{e})^{n}) \]

Using the properties of logarithms, we can expand the expression:

\[ \log(n!) \approx \log (\sqrt{2\pi n}) + n \log (\frac{n}{e}) \]

Simplify each term:

\[ \log(n!) \approx \frac{1}{2} \log(2\pi) + \frac{1}{2} \log(n) + n \log(n) - n \log(e) \]

To determine whether \(f(n) = \log(n!)\) is in \(o(g(n))\) where \(g(n) = n \log(n)\) using limits, we need to evaluate the following limit:

\[ \lim_{n \to \infty} \frac{f(n)}{g(n)} \]

If the limit is \(0\), then \(f(n) \in o(g(n))\). Otherwise, \(f(n) \notin o(g(n))\).

Given \(f(n) = \log(n!)\) and \(g(n) = n \log(n)\), we need to evaluate:

\[ \lim_{n \to \infty} \frac{\log(n!)}{n \log(n)} \]

The factorial \(n!\) can be approximated using Stirling's approximation and be simplified to:

\[ \lim_{n \to \infty} \frac{\frac{1}{2} \log(2\pi) + \frac{1}{2} \log(n) + n \log(n) - n \log(e)}{n \log(n)} = \lim_{n \to \infty} (\frac{\log(2\pi)}{2n \log(n)} + \frac{1}{2n} + 1 - \frac{\log(e)}{\log(n)}) \]

As n approaches infinity, the term \(\frac{\log(2\pi)}{2n \log(n)}\), \(\frac{1}{2n}\) and \(\frac{\log(e)}{\log(n)}\) approach \(0\). Thus, the limit becomes:

\[ \lim_{n \to \infty} (\frac{\log(2\pi)}{2n \log(n)} + \frac{1}{2n} + 1 - \frac{\log(e)}{\log(n)}) = 0 + 0 + 1 - 0 = 1 \]

Since the limit is \(1\) (and not \(0\)), the function \(f(n) = \log(n!)\) does not grow faster than \(g(n) = n \log(n)\). Therefore, \(f(n) \notin o(g(n))\).

Example

Let \(f(n) = \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12}\) and \(g(n) = n\). Is \(f(n)\) in \(o(g(n))\).

Solution 1

To determine whether \(f(n) = \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12}\) belongs to \(o(g(n))\) where \(g(n) = n\), we need to check if \(f(n)\) grows strictly slower than \(g(n)\) asymptotically. A function \(f(n)\) is in \(o(g(n))\) if for any given positive real constant \(c\), there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \lt c \cdot g(n) \quad \text{for all} \quad \quad n \geq n_0 \]

Substituting the given functions:

\[ \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12} \lt c \cdot n \]

Multiply both sides by the denominator \(2n^{2} − 11n + 12\):

\[ 4n^{3} − 28n^{2} + 56n − 35 \lt c \cdot n \cdot (2n^{2} − 11n + 12) \]

Expand the right-hand side, the inequality becomes:

\[ 4n^{3} − 28n^{2} + 56n − 35 \lt 2c \cdot n^{3} - 11c \cdot n^{2} + 12c \cdot n \]

Move all terms to right side of the inequality and combine like terms:

\[ (2c - 4)n^{3} + (28 - 11c)n^{2} + (12c - 56)n + 35 \gt 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((2c - 4)n^{3}\) must be positive or zero. If the dominant term \((2c - 4)n^{3}\) becomes zero, the term \((28 - 11c)n^{2}\) can still satisfy the inequality for large \(n\). Therefore:

\[ 2c - 4 \geq 0 \implies c \geq 2 \]

This means that for the inequality to hold for large enough \(n\), \(c\) must be greater than or equal to \(2\). However, \(o(g(n))\) requires the inequality to hold for any positive \(c\), no matter how small.

Since \(c \geq 2\) requires \(c\) to be at least \(2\), \(f(n)\) cannot be less than \(c \cdot n\) for arbitrary small values of \(c\). Therefore, \(f(n)\) does not satisfy the condition for \(o(g(n))\) because there exists a lower bound on \(c\) (namely \(2\)).

Hence, \(f(n) = \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12} \notin o(g(n) = n)\).

Solution 2

To determine whether \(f(n) = \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12}\) belongs to \(o(g(n))\) where \(g(n) = n\) using limits, we need to evaluate the following limit:

\[ \lim_{n \to \infty} \frac{f(n)}{g(n)} \]

If the limit is \(0\), then \(f(n) \in o(g(n))\). Otherwise, \(f(n) \notin o(g(n))\).

Given \(f(n) = \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12}\) and \(g(n) = n\), we need to evaluate:

\[ \lim_{n \to \infty} \frac{\frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12}}{n} \]

Simplify the fraction:

\[ \lim_{n \to \infty} \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{3} − 11n^{2} + 12n} \]

Applying L'Hôpital's rule:

\[ \lim_{n \to \infty} \frac{\frac{d}{dn} \, (4n^{3} − 28n^{2} + 56n − 35)}{\frac{d}{dn} \, (2n^{3} − 11n^{2} + 12n)} = \lim_{n \to \infty} \frac{12n^{2} − 56n + 56}{6n^{2} − 22n + 12} \]

Applying L'Hôpital's rule again:

\[ \lim_{n \to \infty} \frac{\frac{d}{dn} \, (12n^{2} − 56n + 56)}{\frac{d}{dn} \, (6n^{2} − 22n + 12)} = \lim_{n \to \infty} \frac{24n − 56}{12n − 22} \]

Applying L'Hôpital's rule again:

\[ \lim_{n \to \infty} \frac{\frac{d}{dn} \, (24n − 56)}{\frac{d}{dn} \, (12n − 22)} = \lim_{n \to \infty} \frac{24}{12} = 2 \]

Since the limit is \(2\) (and not \(0\)), the function \(f(n) = \frac{5n^{4} − 2n^{3} − 35n^{2}}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45}\) does not grow faster than \(g(n) = n\). Therefore, \(f(n) \notin o(g(n))\).

Example

Let \(f(n) = \frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45}\) and \(g(n) = \frac{1}{n^{2}}\). Is \(f(n)\) in \(o(g(n))\).

Solution 1

To determine whether \(f(n) = \frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45}\) belongs to \(o(g(n))\) where \(g(n) = \frac{1}{n^{2}}\), we need to check if \(f(n)\) grows strictly slower than \(g(n)\) asymptotically. A function \(f(n)\) is in \(o(g(n))\) if for any given positive real constant \(c\), there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \lt c \cdot g(n) \quad \text{for all} \quad \quad n \geq n_0 \]

Substituting the given functions:

\[ \frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45} \lt c \cdot \frac{1}{n^{2}} \]

Multiply both sides by the denominators \(2n^{4} − 11n^{3} + 12n^{2} + 4n + 45\) and \(n^{2}\):

\[ n^{2} (5n^{2} − 2n − 35) \lt c \cdot (2n^{4} − 11n^{3} + 12n^{2} + 4n + 45) \]

Expand the expression, the inequality becomes:

\[ 5n^{4} − 2n^{3} − 35n^{2} \lt 2c \cdot n^{4} - 11c \cdot n^{3} + 12c \cdot n^{2} + 4c \cdot n + 45c \]

Move all terms to right side of the inequality and combine like terms:

\[ (2c - 5)n^{4} + (2 - 11c)n^{3} + (35 + 12c)n^{2} + (4c)n + 45c \gt 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((2c - 5)n^{4}\) must be positive. Therefore:

\[ 2c - 5 \gt 0 \implies c \gt 2.5 \]

This means that for the inequality to hold for large enough \(n\), \(c\) must be greater than \(2.5\). However, \(o(g(n))\) requires the inequality to hold for any positive \(c\), no matter how small.

Since \(c \gt 2.5\) requires \(c\) to be at least \(2.5\), \(f(n)\) cannot be less than \(c \cdot n\) for arbitrary small values of \(c\). Therefore, \(f(n)\) does not satisfy the condition for \(o(g(n))\) because there exists a lower bound on \(c\) (namely \(2.5\)).

Solution 2

To determine whether \(f(n) = \frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45}\) belongs to \(o(g(n))\) where \(g(n) = \frac{1}{n^{2}}\) using limits, we need to evaluate the following limit:

\[ \lim_{n \to \infty} \frac{f(n)}{g(n)} \]

If the limit is \(0\), then \(f(n) \in o(g(n))\). Otherwise, \(f(n) \notin o(g(n))\).

Given \(f(n) = \frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45}\) and \(g(n) = \frac{1}{n^{2}}\), we need to evaluate:

\[ \lim_{n \to \infty} \frac{\frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45}}{\frac{1}{n^{2}}} \]

Simplify the fraction:

\[ \lim_{n \to \infty} \frac{5n^{4} − 2n^{3} − 35n^{2}}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45} \]

Applying L'Hôpital's rule:

\[ \lim_{n \to \infty} \frac{\frac{d}{dn} \, (5n^{4} − 2n^{3} − 35n^{2})}{\frac{d}{dn} \, (2n^{4} − 11n^{3} + 12n^{2} + 4n + 45)} = \lim_{n \to \infty} \frac{20n^{3} − 6n^{2} − 70n}{8n^{3} − 33n^{2} + 24n + 4} \]

Applying L'Hôpital's rule again:

\[ \lim_{n \to \infty} \frac{\frac{d}{dn} \, (20n^{3} − 6n^{2} − 70n)}{\frac{d}{dn} \, (8n^{3} − 33n^{2} + 24n + 4)} = \lim_{n \to \infty} \frac{60n^{2} − 12n − 70}{24n^{2} − 66n + 24} \]

Applying L'Hôpital's rule again:

\[ \lim_{n \to \infty} \frac{\frac{d}{dn} \, (60n^{2} − 12n − 70)}{\frac{d}{dn} \, (24n^{2} − 66n + 24)} = \lim_{n \to \infty} \frac{120n − 12}{48n − 66} \]

Applying L'Hôpital's rule again:

\[ \lim_{n \to \infty} \frac{\frac{d}{dn} \, (120n − 12)}{\frac{d}{dn} \, (48n − 66)} = \lim_{n \to \infty} \frac{120}{48} = \frac{5}{2} \]

Since the limit is \(2.5\) (and not \(0\)), the function \(f(n) = \frac{5n^{4} − 2n^{3} − 35n^{2}}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45}\) does not grow faster than \(g(n) = \frac{1}{n^{2}}\). Therefore, \(f(n) \notin o(g(n))\).

Big–Omega Notation

Big Omega notation represents the lower bound or best-case scenario of the growth rate of a function. It describes an algorithm’s minimum time or space complexity.

Let \(f(n)\) and \(g(n)\) be functions that map positive integers to positive real numbers. We say that \(f(n)\) is \(\Omega(g(n))\) (or \(f(n) \in \Omega(g(n))\)) if there exists a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that \(f(n) \geq c \cdot g(n)\) for every integer \(n \geq n_0\).

Example

Let \(f(n) = 7n + 8\) and \(g(n) = n\). Is \(f(n) \in \Omega(g(n))\)?

Solution

To determine whether \(f(n) = 7n + 8\) belongs to \(\Omega(g(n))\) where \(g(n) = n\), we need to check if \(f(n)\) grows at least as fast as \(g(n)\) asymptotically. A function \(f(n)\) is in \(\Omega(g(n))\) if there exist a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \geq c \cdot g(n) \quad \text{for all} \quad \quad n \geq n_0 \]

We need to find \(c\) and \(n_0\) such that:

\[ 7n + 8 \geq c \cdot n \]

Subtract \(c \cdot n\) from both sides:

\[ (7 - c)n + 8 \geq 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((7 - c)n\) must be positive or zero. If the dominant term \((7 - c)n\) becomes zero, the term \(8\) can still satisfy the inequality for large \(n\). Therefore:

\[ 7 - c \geq 0 \implies c \leq 7 \]

We can choose \(c = 7\). Then, the inequality becomes:

\[ 7n + 8 \geq 7n \]

Subtract both sides by \(7n\):

\[ 8 \geq 0 \]

This is true for all \(n \geq 1\) (or any positive \(n_0\)).

We have shown that for \(c = 7\) and \(n_0 = 1\), the inequality holds. Hence, \(f(n) = 7n + 8 \in \Omega(g(n) = n)\).

Example

Let \(f(n) = n^{3} + 20n + 1\) and \(g(n) = n^{3}\). Is \(f(n) \in \Omega(g(n))\)?

Solution

To determine whether \(f(n) = n^{3} + 20n + 1\) belongs to \(\Omega(g(n))\) where \(g(n) = n^{3}\), we need to check if \(f(n)\) grows at least as fast as \(g(n)\) asymptotically. A function \(f(n)\) is in \(\Omega(g(n))\) if there exist a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \geq c \cdot g(n) \quad \text{for all} \quad \quad n \geq n_0 \]

We need to find \(c\) and \(n_0\) such that:

\[ n^{3} + 20n + 1 \geq c \cdot n^{3} \]

Subtract \(c \cdot n^{3}\) from both sides:

\[ (1 - c)n^{3} + 20n + 1 \geq 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((1 - c)n^{3}\) must be positive or zero. If the dominant term \((1 - c)n^{3}\) becomes zero, the term \(20n\) can still satisfy the inequality for large \(n\). Therefore:

\[ 1 - c \geq 0 \implies c \leq 1 \]

We can choose \(c = 1\). Then, the inequality becomes:

\[ 20n + 1 \geq 0 \]

This is true for all \(n \geq 1\), so we can set \(n_0 = 1\).

We have shown that for \(c = 1\) and \(n_0 = 1\), the inequality holds. Hence, \(f(n) = n^{3} + 20n + 1 \in \Omega(g(n) = n^{3})\).

Example

Prove that running time \(f(n) = 2^{n+1} is \Omega(2^{n})\)

Solution

To determine whether \(f(n) = 2^{n+1}\) belongs to \(\Omega(g(n))\) where \(g(n) = 2^{n}\), we need to check if \(f(n)\) grows at least as fast as \(g(n)\) asymptotically. A function \(f(n)\) is in \(\Omega(g(n))\) if there exist a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \geq c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to find \(c\) and \(n_0\) such that:

\[ 2^{n+1} \geq c \cdot 2^{n} \]

Cancel \(2^{n}\) from both sides of the inequality:

\[ 2 \geq c \]

We can choose \(c = 2\). Then, the inequality becomes:

\[ 2^{n+1} \geq 2 \cdot 2^{n} \]

Divide both sides by \(2^{n+1}\):

\[ 1 \geq 1 \]

This is true for all \(n \geq 1\), so we can set \(n_0 = 1\).

We have shown that for \(c = 1\) and \(n_0 = 1\), the inequality holds. Hence, \(f(n) = 2^{n+1} \in \Omega(g(n) = 2^{n})\).

Example

Prove that running time \(f(n) = 10^{80}\) is \(\Omega(1)\)

Solution

To determine whether \(f(n) = 10^{80}\) belongs to \(\Omega(g(n))\) where \(g(n) = 1\), we need to check if \(f(n)\) grows at least as fast as \(g(n)\) asymptotically. A function \(f(n)\) is in \(\Omega(g(n))\) if there exist a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \geq c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to find \(c\) and \(n_0\) such that:

\[ 10^{80} \geq c \cdot 1 \]

We can choose \(c = 10^{80}\). Then, the inequality becomes:

\[ 10^{80} \geq 10^{80} \]

This is true for all \(n \geq 1\), so we can set \(n_0 = 1\).

We have shown that for \(c = 1\) and \(n_0 = 1\), the inequality holds. Hence, \(f(n) = 10^{80} \in \Omega(g(n) = 1)\).

Example

Prove that running time \(f(n) = \log_{\ln(5)}(\log^{\log(100)}(n))\) is \(\Omega(\log(\log(n)))\)

Solution

The function \(f(n) = \log_{\ln(5)}(\log^{\log(100)}(n))\) can be rewritten using the change of base formula:

\[ f(n) = \log_{\ln(5)}(\log^{\log(100)}(n)) = \frac{\log (\log^{\log(100)}(n))}{\log (\ln(5))} \]

Next, simplify the expression \(\log (\log^{\log(100)}(n))\):

\[ \log (\log^{\log(100)}(n)) = \log(100) \cdot \log(\log(n)) \]

Substituting this back into \(f(n)\), we get:

\[ f(n) = \frac{\log(100)}{\log (\ln(5))} \cdot \log(\log(n)) \]

To determine whether \(f(n) = \log_{\ln(5)}(\log^{\log(100)}(n))\) belongs to \(\Omega(g(n))\) where \(g(n) = \log(\log(n))\), we need to check if \(f(n)\) grows at least as fast as \(g(n)\) asymptotically. A function \(f(n)\) is in \(\Omega(g(n))\) if there exist a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \geq c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to find \(c\) and \(n_0\) such that:

\[ \log_{\ln(5)}(\log^{\log(100)}(n)) \geq c \cdot \log(\log(n)) \]

From the simplified form of \(f(n)\):

\[ \frac{\log(100)}{\log (\ln(5))} \cdot \log(\log(n)) \geq c \cdot \log(\log(n)) \]

Cancel \(\log(\log(n))\) from both sides of the inequality:

\[ \frac{\log(100)}{\log (\ln(5))} \geq c \]

We can choose \(c = \frac{\log(100)}{\log (\ln(5))}\). Then, the inequality becomes:

\[ \frac{\log(100)}{\log (\ln(5))} \cdot \log(\log(n)) \geq \frac{\log(100)}{\log (\ln(5))} \cdot \log(\log(n)) \]

Divide both sides by \(\frac{\log(100)}{\log (\ln(5))} \cdot \log(\log(n))\):

\[ 1 \geq 1 \]

This is true for all \(n \geq 1\), so we can set \(n_0 = 1\).

We have shown that for \(c = \frac{\log(100)}{\log (\ln(5))}\) and \(n_0 = 1\), the inequality holds. Hence, \(f(n) = \log_{\ln(5)}(\log^{\log(100)}(n)) \in \Omega(g(n) = \log(\log(n)))\).

Example

Prove that running time \(f(n) = \binom{n}{\frac{n}{2}} is \Omega(\frac{2^{n}}{\sqrt{n}})\).

Solution

The binomial coefficient \(\binom{n}{\frac{n}{2}}\) can be approximated using Stirling's approximation for factorials. Stirling's approximation states:

\[ n! \approx \sqrt{2\pi n} (\frac{n}{e})^{n} \]

The binomial coefficient can be expressed as:

\[ \binom{n}{\frac{n}{2}} = \frac{n!}{(\frac{n}{2})!(\frac{n}{2})!} \]

Applying Stirling's approximation:

\[ n! \approx \sqrt{2\pi n} (\frac{n}{e})^{n} \]
\[ \frac{n}{2}! \approx \sqrt{\pi n} (\frac{\frac{n}{2}}{e})^{\frac{n}{2}} \]

Thus:

\[ \binom{n}{\frac{n}{2}} \frac{\sqrt{2\pi n} (\frac{n}{e})^{n}}{(\sqrt{\pi n} (\frac{\frac{n}{2}}{e})^{\frac{n}{2}})^{2}} \]

Simplifying this expression:

\[ \binom{n}{\frac{n}{2}} \approx \frac{\sqrt{2\pi n} (\frac{n}{e})^{n}}{\pi n (\frac{\frac{n}{2}}{e})^{n}} \]

Simplify further:

\[ \binom{n}{\frac{n}{2}} \approx \frac{\sqrt{2}}{\sqrt{\pi}} \cdot \frac{2^{n}}{\sqrt{n}} \]

To determine whether \(f(n) = \binom{n}{\frac{n}{2}}\) belongs to \(\Omega(g(n))\) where \(g(n) = \frac{2^{n}}{\sqrt{n}}\), we need to check if \(f(n)\) grows at least as fast as \(g(n)\) asymptotically. A function \(f(n)\) is in \(\Omega(g(n))\) if there exist a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \geq c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to find \(c\) and \(n_0\) such that:

\[ \binom{n}{\frac{n}{2}} \geq c \cdot \frac{2^{n}}{\sqrt{n}} \]

From the simplified form of \(f(n)\):

\[ \frac{\sqrt{2}}{\sqrt{\pi}} \cdot \frac{2^{n}}{\sqrt{n}} \geq c \cdot \frac{2^{n}}{\sqrt{n}} \]

Cancel \(\frac{2^{n}}{\sqrt{n}}\) from both sides of the inequality:

\[ \frac{\sqrt{2}}{\sqrt{\pi}} \geq c \]

We can choose \(c = \frac{\sqrt{2}}{\sqrt{\pi}}\). Then, the inequality becomes:

\[ \frac{\sqrt{2}}{\sqrt{\pi}} \cdot \frac{2^{n}}{\sqrt{n}} \geq \frac{\sqrt{2}}{\sqrt{\pi}} \cdot \frac{2^{n}}{\sqrt{n}} \]

This is true for all \(n \geq 1\), so we can set \(n_0 = 1\).

We have shown that for \(c = \frac{\sqrt{2}}{\sqrt{\pi}}\) and \(n_0 = 1\), the inequality holds. Hence, \(f(n) = \binom{n}{\frac{n}{2}} \in \Omega(g(n) = \frac{2^{n}}{\sqrt{n}})\).

Example

Prove that running time \(f(n) = \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12}\) is \(\Omega(n)\)

Solution

To determine whether \(f(n) = \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12}\) belongs to \(\Omega(g(n))\) where \(g(n) = n\), we need to check if \(f(n)\) grows at least as fast as \(g(n)\) asymptotically. A function \(f(n)\) is in \(\Omega(g(n))\) if there exist a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \geq c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to find \(c\) and \(n_0\) such that:

\[ \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12} \geq c \cdot n \]

Multiply both sides by the denominator \(2n^{2} − 11n + 12\):

\[ 4n^{3} − 28n^{2} + 56n − 35 \geq c \cdot n \cdot (2n^{2} − 11n + 12) \]

Expand the right-hand side, the inequality becomes:

\[ 4n^{3} − 28n^{2} + 56n − 35 \geq 2c \cdot n^{3} − 11c \cdot n^{2} + 12c \cdot n \]

Move all terms to left side of the inequality and combine like terms:

\[ (4 - 2c)n^{3} + (11c - 28)n^{2} + (56 - 12c)n - 35 \geq 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((4 - 2c)n^{3}\) must be positive. Therefore:

\[ 4 - 2c \gt 0 \implies c \lt 2 \]

Choose \(c = 1.9\):

\[ 0.2n^{3} - 7.1n^{2} + 33.2n - 35 \geq 0 \]

Multiply both sides by \(10\):

\[ 2n^{3} - 71n^{2} + 332n - 350 \geq 0 \]

To estimate \(n\) for which \(2n^{3} - 71n^{2} + 332n - 350 \geq 0\) holds, we need to find the point where the positive terms (\(2n^{3}\) and \(332n\)) become dominant over the negative terms (\(71n^{2}\) and \(350\)). We can compare terms based on their degree and the magnitude of their coefficients.

We compare \(2n^{3}\) which is the highest-degree positive term with \(71n^{2}\) which is the highest-degree negative term to estimate \(n\).

\[ 2n^{3} \gt 71n^{2} \]

Divide both sides by \(2n^{2}\):

\[ n \gt 30.5 \]

Let's approach it by testing positive values for \(n\) such that \(2n^{3} - 71n^{2} + 332n - 350 \geq 0\) holds.

For \(n = 31\):

\[ 2(31^{3}) - 71(31^{2}) + 332(31) - 350 = 59582 - 68131 + 10292 - 350 = 1393 \quad (\text{which} \quad \gt 0) \]

For \(n = 30\):

\[ 2(30^{3}) - 71(30^{2}) + 332(30) - 350 = 54000 - 63900 + 9960 - 350 = -290 \quad (\text{which} \quad \lt 0) \]

Hence, we have shown that there exist constants \(c = 1.9\) and \(n_0 = 31\) such that \(f(n) \geq c \cdot g(n)\) for all \(n \geq n_0\). Thus, \(f(n) \in \Omega(g(n))\).

Example

Prove that running time \(f(n) = \frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45}\) is \(\Omega(\frac{1}{n^{2}})\)

Solution

To determine whether \(f(n) = \frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45}\) belongs to \(\Omega(g(n))\) where \(g(n) = \frac{1}{n^{2}}\), we need to check if \(f(n)\) grows at least as fast as \(g(n)\) asymptotically. A function \(f(n)\) is in \(\Omega(g(n))\) if there exist a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \geq c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to find \(c\) and \(n_0\) such that:

\[ \frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45} \geq c \cdot \frac{1}{n^{2}} \]

Multiply both sides by the denominator \(2n^{2} − 11n + 12\) and \(n^{2}\):

\[ n^{2}(5n^{2} − 2n − 35) \geq c \cdot (2n^{4} − 11n^{3} + 12n^{2} + 4n + 45) \]

Expand the expression, the inequality becomes:

\[ 5n^{4} − 2n^{3} − 35n^{2} \geq 2c \cdot n^{4} − 11c \cdot n^{3} + 12c \cdot n^{2} + 4c \cdot n + 45c \]

Move all terms to left side of the inequality and combine like terms:

\[ (5 - 2c)n^{4} + (11c - 2)n^{3} - (35 + 12c)n^{2} - (4c)n - 45c \geq 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((5 - 2c)n^{4}\) must be positive or zero. If the dominant term \((5 - 2c)n^{4}\) becomes zero, the term \((11c - 2)n^{3}\) can still satisfy the inequality for large \(n\). Therefore:

\[ 5 - 2c \geq 0 \implies c \leq 2.5 \]

Choose \(c = 2.5\):

\[ (5 - 2(2.5))n^{4} + (11(2.5) - 2)n^{3} - (35 + 12(2.5))n^{2} - (4(2.5))n - 45(2.5) \geq 0 \]

Calculate each coefficient:

\[ 51n^{3} - 130n^{2} - 20n - 225 \geq 0 \]

To estimate \(n\) for which \(51n^{3} - 130n^{2} - 20n - 225 \geq 0\) holds, we need to find the point where the positive terms (\(51n^{3}\)) become dominant over the negative terms (\(130n^{2}\), \(20n\) and \(225\)). We can compare terms based on their degree and the magnitude of their coefficients.

We compare \(51n^{3}\) which is the highest-degree positive term with \(130n^{2}\) which is the highest-degree negative term to estimate \(n\).

\[ 51n^{3} \geq 130n^{2} \]

Divide both sides by \(51n^{2}\):

\[ n \geq 2.549 \]

Let's approach it by testing positive values for \(n\) such that \(51n^{3} - 130n^{2} - 20n - 225 \geq 0\) holds.

For \(n = 3\):

\[ 51(3)^{3} - 130(3)^{2} - 20(3) - 225 = 1377 - 1170 - 60 - 225 = -78 \quad (\text{which} \quad \lt 0) \]

For \(n = 4\):

\[ 51(4)^{3} - 130(4)^{2} - 20(4) - 225 = 3264 - 2080 - 80- 225 = 879 \quad (\text{which} \quad \gt 0) \]

Hence, we have shown that there exist constants \(c = 2.5\) and \(n_0 = 4\) such that \(f(n) \geq c \cdot g(n)\) for all \(n \geq n_0\). Thus, \(f(n) \in \Omega(g(n))\).

Example

Let \(f(n) = \log(n!)\) and \(g(n) = n \log(n)\). Is \(f(n)\) in \(\Omega(g(n))\).

Solution

Stirling's approximation for \(n!\) is given by:

\[ n! \approx \sqrt{2\pi n} (\frac{n}{e})^{n} \]

Taking the logarithm of both sides:

\[ \log(n!) \approx \log (\sqrt{2\pi n} (\frac{n}{e})^{n}) \]

Using the properties of logarithms, we can expand the expression:

\[ \log(n!) \approx \log (\sqrt{2\pi n}) + \log (\frac{n^{n}}{e^{n}}) \]

Simplify each term:

\[ \log(n!) \approx \frac{1}{2} \log (2\pi) + \frac{1}{2} \log (n) + n \log (n) - n log (e) \]

To determine whether \(f(n) = \log(n!)\) belongs to \(\Omega(g(n))\) where \(g(n) = n \log(n)\), we need to check if \(f(n)\) grows at least as fast as \(g(n)\) asymptotically. A function \(f(n)\) is in \(\Omega(g(n))\) if there exist a real constant \(c \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \geq c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to find \(c\) and \(n_0\) such that:

\[ \log(n!) \geq c \cdot n \log(n) \]

From the simplified form of \(f(n)\):

\[ \frac{1}{2} \log (2\pi) + \frac{1}{2} \log (n) + n \log (n) - n log (e) \geq c \cdot n \log(n) \]

Move all terms to left side of the inequality and combine like terms:

\[ (1 - c) n \log(n) - n \log (e) + \frac{1}{2} \log (n) + \frac{1}{2} \log (2\pi) \geq 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((1 - c)n \log(n)\) must be positive. Therefore:

\[ 1 - c \gt 0 \implies c \lt 1 \]

Choose \(c = 0.9\):

\[ \frac{1}{10} n \log(n) - n \log (e) + \frac{1}{2} \log (n) + \frac{1}{2} \log (2\pi) \geq 0 \]

Multiply both sides by \(10\):

\[ n \log(n) - 10n \log (e) + 5 \log (n) + 5 \log (2\pi) \geq 0 \]

To estimate \(n\) for which \(n \log(n) - 10n \log (e) + 5 \log (n) + 5 \log (2\pi) \geq 0\) holds, we need to find the point where the positive terms (\(n \log(n)\), \(5 \log (n)\), and \(5 \log (2\pi)\)) become dominant over the negative terms (\(10n \log (e)\)). We can compare terms based on their degree and the magnitude of their coefficients.

We compare \(n \log(n)\) which is the highest-degree positive term with \(10n \log (e)\) which is the highest-degree negative term to estimate \(n\).

\[ n \log(n) \geq 10n \log (e) \]

Divide both sides by \(n\):

\[ \log(n) \geq 10 \log (e) \approx 4.34 \]

Rewrite it in its exponential form:

\[ n \geq 10^{4.34} \]

Let's approach it by testing positive values for \(n\) such that \(n \log(n) - 10n \log (e) + 5 \log (n) + 5 \log (2\pi) \geq 0\) holds.

For \(n = 10^{5}\):

\[ 10^{5} \cdot \log(10^{5}) - 10 \cdot 10^{5} \cdot \log (e) + 5 \log (10^{5}) + 5 \log (2\pi) = 5 \cdot 10^{5} - 4.34 \cdot 10^{5} + 25 + 3.99 \approx 66029 \quad (\text{which} \quad \gt 0) \]

Hence, we have shown that there exist constants \(c = 0.9\) and \(n_0 = 66029\) such that \(f(n) \geq c \cdot g(n)\) for all \(n \geq n_0\). Thus, \(f(n) \in \Omega(g(n))\).

Little–Omega Notation

Let f(n) and g(n) be functions that map positive integers to positive real numbers. We say that f(n) is \omega(g(n)) (or f(n) \in \omega(g(n))) if for any real constant c \gt 0, there exists an integer constant n_0 \geq 1 such that f(n) \gt c \cdot g(n) for every integer n \geq n_0.

Example

Let \(f(n) = 7n + 8\) and \(g(n) = n\). Is \(f(n) \in \omega(g(n))\)?

Solution 1

To determine whether \(f(n) = 7n + 8\) belongs to \(\omega(g(n))\) where \(g(n) = n\), we need to check if \(f(n)\) grows strictly faster than \(g(n)\) asymptotically. A function \(f(n)\) is in \(\omega(g(n))\) if for any given positive constant \(c\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \gt c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

Substituting the given functions:

\[ 7n + 8 \gt c \cdot n \]

Subtract both sides by \(c \cdot n\):

\[ (7 - c)n + 8 \gt 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((7 - c)n\) must be positive or zero. If the dominant term \((7 - c)n\) becomes zero, the term 8 can still satisfy the inequality for large \(n\). Therefore:

\[ 7 - c \geq 0 \implies c \leq 7 \]

This means that for the inequality to hold for large enough \(n\), c must be less than or equal to \(1\). However, \(\omega(g(n))\) requires the inequality to hold for any positive \(c\), no matter how small.

Since \(c \leq 7\) requires \(c\) to be at most \(7\), \(f(n)\) cannot grow faster than \(c \cdot n\) for arbitrary large values of \(c\). Therefore, \(f(n)\) does not satisfy the condition for \(\omega(g(n))\) because there exists a upper bound on \(c\) (namely \(7\)).

Hence, \(f(n) = 7n + 8 \notin \omega(g(n) = n)\).

Solution 2

To determine whether \(f(n) = 7n + 8\) is in \(\omega(g(n))\) where \(g(n) = n\) using limits, we need to evaluate the following limit:

\[ \lim_{n \to \infty} \frac{f(n)}{g(n)} \]

If the limit is \(\infty\), then \(f(n) \in \omega(g(n))\). Otherwise, \(f(n) \notin \omega(g(n))\).

Given \(f(n) = 7n + 8\) and \(g(n) = n\), we need to evaluate:

\[ \lim_{n \to \infty} \frac{7n + 8}{n} \]

Simplify the expression:

\[ \lim_{n \to \infty} \frac{7n + 8}{n} = \lim_{n \to \infty} (7 + \frac{8}{n}) \]

As \(n\) approaches infinity, the term \(\frac{8}{n}\) approaches \(0\). Thus, the limit becomes:

\[ \lim_{n \to \infty} (7 + \frac{8}{n}) = 7 \]

Since the limit is \(7\) (and not \(\infty\)), the function \(f(n) = 7n + 8\) does not grow faster than \(g(n) = n\). Therefore, \(f(n) \notin \omega(g(n))\).

Example

Let \(f(n) = 7n^{2} + 8\) and \(g(n) = n\). Is \(f(n) \in \omega(g(n))\)?

Solution 1

To determine whether \(f(n) = 7n^{2} + 8\) belongs to \(\omega(g(n))\) where \(g(n) = n\), we need to check if \(f(n)\) grows strictly faster than \(g(n)\) asymptotically. A function \(f(n)\) is in \(\omega(g(n))\) if for any given positive constant \(c\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \gt c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

Substituting the given functions:

\[ 7n^{2} + 8 \gt c \cdot n \]

Subtract both sides by \(c \cdot n\):

\[ 7n^{2} + (-c)n + 8 \gt 0 \]

For the inequality to hold for sufficiently large \(n\), the coefficient of the dominant term \(n^{2}\), must be positive and it does not depend on \(c\). Therefore:

\[ c \gt 0 \]

This means that for the inequality to hold for large enough \(n\), \(c\) must be greater than \(0\).

Since the inequality holds for any positive \(c\), \(f(n)\) satisfy the condition for \(\omega(g(n))\). Therefore, \(f(n) = 7n + 8 \in \omega(g(n) = n^{2})\).

Solution 2

To determine whether \(f(n) = 7n^{2} + 8\) is in \(\omega(g(n))\) where \(g(n) = n\) using limits, we need to evaluate the following limit:

\[ \lim_{n \to \infty} \frac{f(n)}{g(n)} \]

If the limit is \(\infty\), then \(f(n) \in \omega(g(n))\). Otherwise, \(f(n) \notin \omega(g(n))\).

Given \(f(n) = 7n^{2} + 8\) and \(g(n) = n\), we need to evaluate:

\[ \lim_{n \to \infty} \frac{7n^{2} + 8}{n} \]

Simplify the expression:

\[ \lim_{n \to \infty} \frac{7n^{2} + 8}{n} = \lim_{n \to \infty} (7n + \frac{8}{n^{2}}) \]

As \(n\) approaches infinity, the terms \(\frac{8}{n^{2}}\) approach \(0\). Thus, the limit becomes:

\[ \lim_{n \to \infty} 7n = \infty \]

Since the limit is \(\infty\), the function \(f(n) = 7n^{2} + 8\) always grows faster than \(g(n) = n\). Therefore, \(f(n) \in \omega(g(n))\).

Example

Let \(f(n) = 2^{n+1}\) and \(g(n) = 2^{n}\). Is \(f(n) \in \omega(g(n))\)?

Solution 1

To determine whether \(f(n) = 2^{n+1}\) belongs to \(\omega(g(n))\) where \(g(n) = 2^{n}\), we need to check if \(f(n)\) grows strictly faster than \(g(n)\) asymptotically. A function \(f(n)\) is in \(\omega(g(n))\) if for any given positive constant \(c\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \lt c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

Substituting the given functions:

\[ 2^{n+1} \lt c \cdot 2^{n} \]

Divide both sides by \(2^{n}\):

\[ 2 \lt c \]

This means that for the inequality to hold for large enough \(n\), \(c\) must be greater than \(2\). However, \(\omega(g(n))\) requires the inequality to hold for any positive \(c\), no matter how small.

Since \(c \gt 2\) requires \(c\) to be at least \(2\), \(f(n)\) cannot grow faster than \(c \cdot n\) for arbitrary small values of \(c\). Therefore, \(f(n)\) does not satisfy the condition for \(o(g(n))\) because there exists a lower bound on \(c\) (namely \(2\)).

Hence, \(f(n) = 2^{n+1} \notin \omega(g(n) = 2^{n})\).

Solution 2

To determine whether \(f(n) = 2^{n+1}\) belongs to \(\omega(g(n))\) where \(g(n) = 2^{n}\) using limits, we need to evaluate the following limit:

\[ \lim_{n \to \infty} \frac{f(n)}{g(n)} \]

If the limit is \(\infty\), then \(f(n) \in \omega(g(n))\). Otherwise, \(f(n) \notin \omega(g(n))\).

Given \(f(n) = 2^{n+1}\) and \(g(n) = 2^{n}\), we need to evaluate:

\[ \lim_{n \to \infty} \frac{2^{n+1}}{2^{n}} \]

Simplify the expression and evaluate the limit:

\[ \lim_{n \to \infty} \frac{2^{n+1}}{2^{n}} = \lim_{n \to \infty} 2 = 2 \]

Since the limit is \(2\) (and not \(\infty\)), the function \(f(n) = 2^{n+1}\) does not grow faster than \(g(n) = 2^{n}\). Therefore, \(f(n) \notin \omega(g(n))\).

Example

Let \(f(n) = \log_{\ln(5)}(\log^{\log(100)}(n))\) and \(g(n) = \log(\log(n))\). Is \(\)f(n) \in \omega(g(n))$

Solution 1

Simplify the expression using the change of base formula, \(\log_{a}(x) = \frac{\log_{b}(x)}{\log_{b}(a)}\):

\[ \log_{\ln(5)}(\log^{\log(100)}(n)) = \frac{\log(\log^{\log(100)}(n))}{\ln(5)} \]

The expression inside the logarithm can be simplified using the logarithm power rule, \(\log⁡ (x^{y}) = y \cdot \log⁡(x)\):

\[ \log(\log^{\log(100)}(n)) = \log(100) \cdot \log(\log(n)) \]

So, the original expression becomes:

\[ \frac{\log(\log^{\log(100)}(n))}{\ln(5)} = \frac{\log(100)}{\ln(5)} \cdot \log(\log(n)) \]

To determine whether \(f(n) = \log_{\ln(5)}(\log^{\log(100)}(n))\) belongs to \(\omega(g(n))\) where \(g(n) = \log(\log(n))\), we need to check if \(f(n)\) grows strictly faster than \(g(n)\) asymptotically. A function \(f(n)\) is in \(\omega(g(n))\) if for any given positive constant \(c\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \gt c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

Substituting the given functions:

\[ \log_{\ln(5)}(\log^{\log(100)}(n)) \gt c \cdot \log(\log(n)) \]

Simplify the expression \log_{\ln(5)}(\log^{\log(100)}(n)):

\[ \frac{\log(100)}{\ln(5)} \cdot \log (\log(n)) \gt c \cdot \log(\log(n)) \]

Divide both sides by \(\log(\log(n))\):

\[ \frac{\log(100)}{\ln(5)} \gt c \]

This means that for the inequality to hold for large enough \(n\), \(c\) must be less than \(\frac{\log(100)}{\ln(5)}\). However, \(o(g(n))\) requires the inequality to hold for any positive \(c\), no matter how large.

Since \(c \lt \frac{\log(100)}{\ln(5)}\) requires \(c\) to be at most \(\frac{\log(100)}{\ln(5)}\), \(f(n)\) cannot grow faster than \(c \cdot n\) for arbitrary big values of \(c\). Therefore, \(f(n)\) does not satisfy the condition for \(o(g(n))\) because there exists a upper bound on \(c\) (namely \(\frac{\log(100)}{\ln(5)}\)).

Hence, \(f(n) = \log_{\ln(5)}(\log^{\log(100)}(n)) \notin \omega(g(n) = \log(\log(n)))\).

Solution 2

Let's simplify the expression \(\log_{\ln(5)}(\log^{\log(100)}(n))\).

The change of base formula states:

\[ \log_{a}(x) = \frac{\log_{b}(x)}{\log_{b}(a)} \]

Applying this to the expression:

\[ \log_{\ln(5)}(\log^{\log(100)}(n)) = \frac{\log (\log^{\log(100)}(n))}{\ln(5)} \]

The expression inside the logarithm can be simplified using the logarithm power rule, \(\log⁡ (x^{y}) = y \cdot \log⁡ (x)\):

\[ \log (\log^{\log(100)}(n)) = \log(100) \cdot \log (\log(n)) \]

So, the original expression becomes:

\[ \frac{\log (\log^{\log(100)}(n))}{\ln(5)} = \frac{\log(100)}{\ln(5)} \cdot \log (\log(n)) \]

To determine whether \(f(n) = \log_{\ln(5)}(\log^{\log(100)}(n))\) belongs to \(\omega(g(n))\) where \(g(n) = \log(\log(n))\) using limits, we need to evaluate the following limit:

\[ \lim_{n \to \infty} \frac{f(n)}{g(n)} \]

If the limit is \(\infty\), then \(f(n) \in \omega(g(n))\). Otherwise, \(f(n) \notin \omega(g(n))\).

Given \(f(n) = \log_{\ln(5)}(\log^{\log(100)}(n))\) and \(g(n) = \log(\log(n))\), we need to evaluate:

\[ \lim_{n \to \infty} \frac{\log_{\ln(5)}(\log^{\log(100)}(n))}{\log(\log(n))} \]

Simplify the expression and evaluate the limit:

\[ \lim_{n \to \infty} \frac{\log_{\ln(5)}(\log^{\log(100)}(n))}{\log(\log(n))} = \lim_{n \to \infty} \frac{\frac{\log(100)}{\ln(5)} \cdot \log (\log(n))}{\log(\log(n))} = \frac{\log(100)}{\ln(5)} \]

Since the limit is \(\frac{\log(100)}{\ln(5)}\) (and not \(\infty\)), the function \(f(n) = \log_{\ln(5)}(\log^{\log(100)}(n))\) does not grow faster than \(g(n) = \log(\log(n))\). Therefore, \(f(n) \notin \omega(g(n))\).

Example

Let \(f(n) = \binom{n}{\frac{n}{2}} and g(n) = \frac{2^{n}}{\sqrt{n}}. Is \)f(n)\( in \)\omega(g(n))$.

Solution 1

The binomial coefficient \(\binom{n}{\frac{n}{2}}\) can be approximated using Stirling's approximation for factorials. Stirling's approximation states:

\[ n! \approx \sqrt{2\pi n} (\frac{n}{e})^{n} \]

The binomial coefficient can be expressed as:

\[ \binom{n}{\frac{n}{2}} = \frac{n!}{(\frac{n}{2})!(\frac{n}{2})!} \]

Applying Stirling's approximation:

\[ n! \approx \sqrt{2\pi n} (\frac{n}{e})^{n} \]
\[ \frac{n}{2}! \approx \sqrt{\pi n} (\frac{\frac{n}{2}}{e})^{\frac{n}{2}} \]

Thus:

\[ \binom{n}{\frac{n}{2}} \frac{\sqrt{2\pi n} (\frac{n}{e})^{n}}{(\sqrt{\pi n} (\frac{\frac{n}{2}}{e})^{\frac{n}{2}})^{2}} \]

Simplifying this expression:

\[ \binom{n}{\frac{n}{2}} \approx \frac{\sqrt{2\pi n} (\frac{n}{e})^{n}}{\pi n (\frac{\frac{n}{2}}{e})^{n}} \]

Simplify further:

\[ \binom{n}{\frac{n}{2}} \approx \frac{\sqrt{2}}{\sqrt{\pi}} \cdot \frac{2^{n}}{\sqrt{n}} \]

To determine whether \(f(n) = \binom{n}{\frac{n}{2}}\) belongs to \(\omega(g(n))\) where \(g(n) = \frac{2^{n}}{\sqrt{n}}\), we need to check if \(f(n)\) grows strictly faster than \(g(n)\) asymptotically. A function \(f(n)\) is in \(\omega(g(n))\) if for any given positive constant \(c\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \gt c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

Substituting the given functions:

\[ \binom{n}{\frac{n}{2}} \gt c \cdot \frac{2^{n}}{\sqrt{n}} \]

The binomial coefficient \(\binom{n}{\frac{n}{2}}\) can be approximated using Stirling's approximation:

\[ \sqrt{\frac{2}{\pi}} \cdot \frac{2^{n}}{\sqrt{n}} \gt c \cdot \frac{2^{n}}{\sqrt{n}} \]

Divide both sides by \(\frac{2^{n}}{\sqrt{n}}\):

\[ \sqrt{\frac{2}{\pi}} \lt c \]

This means that for the inequality to hold for large enough \(n\), \(c\) must be larger than \(\sqrt{\frac{2}{\pi}}\). However, \(\omega(g(n))\) requires the inequality to hold for any positive \(c\), no matter how small.

Since \(c \gt \sqrt{\frac{2}{\pi}}\) requires \(c\) to be at least \(\sqrt{\frac{2}{\pi}}\), \(f(n)\) cannot grow faster than \(c \cdot n\) for arbitrary small values of \(c\). Therefore, \(f(n)\) does not satisfy the condition for \(\omega(g(n))\) because there exists a lower bound on \(c\) (namely \(\sqrt{\frac{2}{\pi}}\)).

Hence, \(f(n) = \binom{n}{\frac{n}{2}} \notin \omega(g(n) = \frac{2^{n}}{\sqrt{n}})\).

Solution 2

The binomial coefficient \(\binom{n}{\frac{n}{2}}\) can be approximated using Stirling's approximation for factorials. Stirling's approximation states:

\[ n! \approx \sqrt{2\pi n} (\frac{n}{e})^{n} \]

The binomial coefficient can be expressed as:

\[ \binom{n}{\frac{n}{2}} = \frac{n!}{(\frac{n}{2})!(\frac{n}{2})!} \]

Applying Stirling's approximation:

\[ n! \approx \sqrt{2\pi n} (\frac{n}{e})^{n} \]
\[ \frac{n}{2}! \approx \sqrt{\pi n} (\frac{\frac{n}{2}}{e})^{\frac{n}{2}} \]

Thus:

\[ \binom{n}{\frac{n}{2}} \frac{\sqrt{2\pi n} (\frac{n}{e})^{n}}{(\sqrt{\pi n} (\frac{\frac{n}{2}}{e})^{\frac{n}{2}})^{2}} \]

Simplifying this expression:

\[ \binom{n}{\frac{n}{2}} \approx \frac{\sqrt{2\pi n} (\frac{n}{e})^{n}}{\pi n (\frac{\frac{n}{2}}{e})^{n}} \]

Simplify further:

\[ \binom{n}{\frac{n}{2}} \approx \frac{\sqrt{2}}{\sqrt{\pi}} \cdot \frac{2^{n}}{\sqrt{n}} \]

To determine whether \(f(n) = \binom{n}{\frac{n}{2}}\) belongs to \(\omega(g(n))\) where \(g(n) = \frac{2^{n}}{\sqrt{n}}\) using limits, we need to evaluate the following limit:

\[ \lim_{n \to \infty} \frac{f(n)}{g(n)} \]

If the limit is \(\infty\), then \(f(n) \in \omega(g(n))\). Otherwise, \(f(n) \notin \omega(g(n))\).

Given \(f(n) = \binom{n}{\frac{n}{2}}\) and \(g(n) = \frac{2^{n}}{\sqrt{n}}\), we need to evaluate:

\[ \lim_{n \to \infty} \frac{\binom{n}{\frac{n}{2}}}{\frac{2^{n}}{\sqrt{n}}} \]

The binomial coefficient \(\binom{n}{\frac{n}{2}}\) can be approximated using Stirling's approximation and be simplified to:

\[ \lim_{n \to \infty} \frac{\binom{n}{\frac{n}{2}}}{\frac{2^{n}}{\sqrt{n}}} = \lim_{n \to \infty} \frac{\sqrt{\frac{2}{\pi}} \cdot \frac{2^{n}}{\sqrt{n}}}{\frac{2^{n}}{\sqrt{n}}} = \lim_{n \to \infty} \sqrt{\frac{2}{\pi}} = \sqrt{\frac{2}{\pi}} \]

Since the limit is \(\sqrt{\frac{2}{\pi}}\) (and not \(\infty\)), the function \(f(n) = \binom{n}{\frac{n}{2}}\) does not grow faster than \(g(n) = \frac{2^{n}}{\sqrt{n}} \log(n)\). Therefore, \(f(n) \notin \omega(g(n))\).

Example

Let \(f(n) = \log(n!)\) and \(g(n) = n \log(n)\). Is \(f(n)\) in \(\omega(g(n))\).

Solution 1

Stirling's approximation for \(n!\) is given by:

\[ n! \approx \sqrt{2\pi n} (\frac{n}{e})^{n} \]

Taking the logarithm of both sides:

\[ \log(n!) \approx \log (\sqrt{2\pi n} (\frac{n}{e})^{n}) \]

Using the properties of logarithms, we can expand the expression:

\[ \log(n!) \approx \log (\sqrt{2\pi n}) + \log (\frac{n^{n}}{e^{n}}) \]

Simplify each term:

\[ \log(n!) \approx \frac{1}{2} \log (2\pi) + \frac{1}{2} \log (n) + n \log (n) - n log (e) \]

To determine whether \(f(n) = \log(n!)\) belongs to \(\omega(g(n))\) where \(g(n) = n \log(n)\), we need to check if \(f(n)\) grows strictly faster than \(g(n)\) asymptotically. A function \(f(n)\) is in \(\omega(g(n))\) if for any given positive constant \(c\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \gt c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

Substituting the given functions:

\[ \log(n!) \gt c \cdot n \log(n) \]

The factorial \(n!\) can be approximated using Stirling's approximation and be simplified to:

\[ \frac{1}{2} \log(2\pi) + \frac{1}{2} \log(n) + n \log(n) - n log (e) \gt c \cdot n \log(n) \]

Move all terms to left side of the inequality and combine like terms:

\[ (1 - c)n \log(n) - n \log(e) + \frac{1}{2} \log(n) + \frac{1}{2} \log(2\pi) \gt 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((1 - c)n \log(n)\) must be positive. Therefore:

\[ 1 - c \gt 0 \implies c \lt 1 \]

This means that for the inequality to hold for large enough \(n\), \(c\) must be smaller than \(1\). However, \(\omega(g(n))\) requires the inequality to hold for any positive \(c\), no matter how big.

Since \(c \lt 1\) requires \(c\) to be at most \(1\), \(f(n)\) cannot grow faster than \(c \cdot n\) for arbitrary large values of \(c\). Therefore, \(f(n)\) does not satisfy the condition for \(\omega(g(n))\) because there exists a upper bound on \(c\) (namely \(1\)).

Hence, \(f(n) = \log(n!) \notin \omega(g(n) = n \log(n))\).

Solution 2

Stirling's approximation for \(n!\) is given by:

\[ n! \approx \sqrt{2\pi n} (\frac{n}{e})^{n} \]

Taking the logarithm of both sides:

\[ \log(n!) \approx \log(\sqrt{2\pi n} (\frac{n}{e})^{n}) \]

Using the properties of logarithms, we can expand the expression:

\[ \log(n!) \approx \log(\sqrt{2\pi n}) + \log (\frac{n^{n}}{e^{n}}) \]

Simplify each term:

\[ \log(n!) \approx \frac{1}{2} \log(2\pi) + \frac{1}{2} \log(n) + n \log(n) - n \log(e) \]

To determine whether \(f(n) = \log(n!)\) is in \(\omega(g(n))\) where \(g(n) = n \log(n)\) using limits, we need to evaluate the following limit:

\[ \lim_{n \to \infty} \frac{f(n)}{g(n)} \]

If the limit is \(\infty\), then \(f(n) \in \omega(g(n))\). Otherwise, \(f(n) \notin o(g(n))\).

Given \(f(n) = \log(n!)\) and \(g(n) = n \log(n)\), we need to evaluate:

\[ \lim_{n \to \infty} \frac{\log(n!)}{n \log(n)} \]

The factorial \(n!\) can be approximated using Stirling's approximation and be simplified to:

\[ \lim_{n \to \infty} \frac{\frac{1}{2} \log(2\pi) + \frac{1}{2} \log(n) + n \log(n) - n \log(e)}{n \log(n)} = \lim_{n \to \infty} (\frac{\log (2\pi)}{2n \log(n)} + \frac{1}{2n} + 1 - \frac{log(e)}{log(n)}) \]

As \(n\) approaches infinity, the term \(\frac{\log (2\pi)}{2n \log(n)}\), \(\frac{1}{2n}\) and \(\frac{log(e)}{log(n)}\) approach \(0\). Thus, the limit becomes:

\[ \lim_{n \to \infty} (\frac{\log(2\pi)}{2n \log(n)} + \frac{1}{2n} + 1 - \frac{log(e)}{log(n)}) = 1 \]

Since the limit is \(1\) (and not \(\infty\)), the function \(f(n) = \log(n!)\) does not grow faster than \(g(n) = n \log(n)\). Therefore, \(f(n) \notin \omega(g(n))\).

Example

Let \(f(n) = \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12}\) and \(g(n) = n\). Is \(f(n)\) in \(\omega(g(n))\).

Solution 1

To determine whether \(f(n) = \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12}\) belongs to \(\omega(g(n))\) where \(g(n) = n\), we need to check if \(f(n)\) grows strictly faster than \(g(n)\) asymptotically. A function \(f(n)\) is in \(\omega(g(n))\) if for any given positive constant \(c\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \gt c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

Substituting the given functions:

\[ \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12} \gt c \cdot n \]

Multiply both sides by the denominator \(2n^{2} − 11n + 12\):

\[ 4n^{3} − 28n^{2} + 56n − 35 \gt c \cdot n \cdot (2n^{2} − 11n + 12) \]

Expand the right-hand side, the inequality becomes:

\[ 4n^{3} − 28n^{2} + 56n − 35 \gt 2c \cdot n^{3} - 11c \cdot n^{2} + 12c \cdot n \]

Move all terms to left side of the inequality and combine like terms:

\[ (4 - 2c)n^{3} + (11c − 28)n^{2} + (56 - 12c)n − 35 \gt 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((4 - 2c)n^{3}\) must be positive. Therefore:

\[ 4 - 2c \gt 0 \implies c \lt 2 \]

This means that for the inequality to hold for large enough \(n\), \(c\) must be smaller than \(2\). However, \(\omega(g(n))\) requires the inequality to hold for any positive \(c\), no matter how big.

Since \(c \lt 2\) requires \(c\) to be at most \(2\), \(f(n)\) cannot grow faster than \(c \cdot n\) for arbitrary large values of \(c\). Therefore, \(f(n)\) does not satisfy the condition for \(\omega(g(n))\) because there exists a upper bound on \(c\) (namely \(2\)).

Hence, \(f(n) = \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12} \notin \omega(g(n) = n)\).

Solution 2

To determine whether \(f(n) = \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12}\) belongs to \(\omega(g(n))\) where \(g(n) = n\) using limits, we need to evaluate the following limit:

\[ \lim_{n \to \infty} \frac{f(n)}{g(n)} \]

If the limit is \(\infty\), then \(f(n) \in o(g(n))\). Otherwise, \(f(n) \notin \omega(g(n))\).

Given \(f(n) = \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12}\) and \(g(n) = n\), we need to evaluate:

\[ \lim_{n \to \infty} \frac{\frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12}}{n} \]

Simplify the fraction:

\[ \lim_{n \to \infty} \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{3} − 11n^{2} + 12n} \]

Applying L'Hôpital's rule:

\[ \lim_{n \to \infty} \frac{\frac{d}{dn} \, (4n^{3} − 28n^{2} + 56n − 35)}{\frac{d}{dn} \, (2n^{3} − 11n^{2} + 12n)} = \lim_{n \to \infty} \frac{12n^{2} − 56n + 56}{6n^{2} − 22n + 12} \]

Applying L'Hôpital's rule again:

\[ \lim_{n \to \infty} \frac{\frac{d}{dn} \, (12n^{2} − 56n + 56)}{\frac{d}{dn} \, (6n^{2} − 22n + 12)} = \lim_{n \to \infty} \frac{24n − 56}{12n − 22} \]

Applying L'Hôpital's rule again:

\[ \lim_{n \to \infty} \frac{\frac{d}{dn} \, (24n − 56)}{\frac{d}{dn} \, (12n − 22)} = \lim_{n \to \infty} \frac{24}{12} = 2 \]

Since the limit is \(2\) (and not \(\infty\)), the function \(f(n) = \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12}\) does not grow faster than \(g(n) = n\). Therefore, \(f(n) \notin \omega(g(n))\).

Example

Let \(f(n) = \frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45}\) and \(g(n) = \frac{1}{n^{2}}\). Is \(f(n)\) in \(\omega(g(n))\).

Solution 1

To determine whether \(f(n) = \frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45}\) belongs to \(\omega(g(n))\) where \(g(n) = \frac{1}{n^{2}}\), we need to check if \(f(n)\) grows strictly faster than \(g(n)\) asymptotically. A function \(f(n)\) is in \(\omega(g(n))\) if for any given positive constant \(c\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ f(n) \gt c \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

Substituting the given functions:

\[ \frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45} \gt c \cdot \frac{1}{n^{2}} \]

Multiply both sides by the denominators \(2n^{4} − 11n^{3} + 12n^{2} + 4n + 45\) and \(n^{2}\):

\[ n^{2} (5n^{2} − 2n − 35) \gt c \cdot (2n^{4} − 11n^{3} + 12n^{2} + 4n + 45) \]

Expand the expression, the inequality becomes:

\[ 5n^{4} − 2n^{3} − 35n^{2} \gt 2c \cdot n^{4} - 11c \cdot n^{3} + 12c \cdot n^{2} + 4c \cdot n + 45c \]

Move all terms to left side of the inequality and combine like terms:

\[ (5 - 2c)n^{4} + (11c − 2)n^{3} - (12c + 35)n^{2} - 4c \cdot n - 45c \gt 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((5 - 2c)n^{4}\) must be positive or zero. If the dominant term \((5 - 2c)n^{4}\) becomes zero, the term \((11c − 2)n^{3}\) can still satisfy the inequality for large \(n\). Therefore:

\[ 5 - 2c \geq 0 \implies c \geq 2.5 \]

This means that for the inequality to hold for large enough \(n\), \(c\) must be greater than or equal to \(2.5\). However, \(\omega(g(n))\) requires the inequality to hold for any positive \(c\), no matter how small.

Since \(c \geq 2.5\) requires \(c\) to be at least \(2.5\), \(f(n)\) cannot grow faster than \(c \cdot n\) for arbitrary large values of \(c\). Therefore, \(f(n)\) does not satisfy the condition for \(\omega(g(n))\) because there exists a lower bound on \(c\) (namely \(2.5\)).

Solution 2

To determine whether \(f(n) = \frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45}\) belongs to \(\omega(g(n))\) where \(g(n) = \frac{1}{n^{2}}\) using limits, we need to evaluate the following limit:

\[ \lim_{n \to \infty} \frac{f(n)}{g(n)} \]

If the limit is \(\infty\), then \(f(n) \in \omega(g(n))\). Otherwise, \(f(n) \notin \omega(g(n))\).

Given \(f(n) = \frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45}\) and \(g(n) = \frac{1}{n^{2}}\), we need to evaluate:

\[ \lim_{n \to \infty} \frac{\frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45}}{\frac{1}{n^{2}}} \]

Simplify the fraction:

\[ \lim_{n \to \infty} \frac{5n^{4} − 2n^{3} − 35n^{2}}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45} \]

Applying L'Hôpital's rule:

\[ \lim_{n \to \infty} \frac{\frac{d}{dn} \, (5n^{4} − 2n^{3} − 35n^{2})}{\frac{d}{dn} \, (2n^{4} − 11n^{3} + 12n^{2} + 4n + 45)} = \lim_{n \to \infty} \frac{20n^{3} − 6n^{2} − 70n}{8n^{3} − 33n^{2} + 24n + 4} \]

Applying L'Hôpital's rule again:

\[ \lim_{n \to \infty} \frac{\frac{d}{dn} \, (20n^{3} − 6n^{2} − 70n)}{\frac{d}{dn} \, (8n^{3} − 33n^{2} + 24n + 4)} = \lim_{n \to \infty} \frac{60n^{2} − 12n − 70}{24n^{2} − 66n + 24} \]

Applying L'Hôpital's rule again:

\[ \lim_{n \to \infty} \frac{\frac{d}{dn} \, (60n^{2} − 12n − 70)}{\frac{d}{dn} \, (24n^{2} − 66n + 24)} = \lim_{n \to \infty} \frac{120n − 12}{48n − 66} \]

Applying L'Hôpital's rule again:

\[ \lim_{n \to \infty} \frac{\frac{d}{dn} \, (120n − 12)}{\frac{d}{dn} \, (48n − 66)} = \lim_{n \to \infty} \frac{120}{48} = \frac{5}{2} \]

Since the limit is \(\frac{5}{2}\) (and not \(\infty\)), the function \(f(n) = \frac{5n^{4} − 2n^{3} − 35n^{2}}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45}\) does not grow faster than \(g(n) = \frac{1}{n^{2}}\). Therefore, \(f(n) \notin \omega(g(n))\).

Big–Theta Notation

Big Theta notation represents both the upper and lower bounds of the growth rate of a function. It provides a tight bound on the time or space complexity of an algorithm.

Let \(f(n)\) and \(g(n)\) be functions that map positive integers to positive real numbers. We say that \(f(n)\) is \(\Theta(g(n))\) (or \(f(n) \in \Theta(g(n))\)) if and only if \(f(n) \in O(g(n))\) and \(f(n) \in \Omega(g(n))\).

Example

Let \(f(n) = 7n + 8\) and \(g(n) = n\). Is \(f(n) \in \Theta(g(n))\)?

Solution

To determine whether \(f(n) = 7n + 8\) is in \(\Theta(g(n))\) where \(g(n) = n\), we need to check if \(f(n)\) grows at the same rate as \(g(n)\) asymptotically. A function \(f(n)\) is in \(\Theta(g(n))\) if there exist positive real constants \(c_1 \gt 0\), \(c_2 \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ c_1 \cdot g(n) \leq f(n) \leq c_2 \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to find \(c_1\), \(c_2\) such that:

\[ c_1 \cdot n \leq 7n + 8 \leq c_2 \cdot n \]

To show \(f(n)\) is in \(O(g(n))\), we need to find \(c_2\) such that:

\[ 7n + 8 \leq c_2 \cdot n \]

Move all terms to right side of the inequality and combine like terms:

\[ (c_2 - 7)n - 8 \geq 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((c_2 - 7)n\) must be positive. Therefore:

\[ c_2 - 7 \gt 0 \implies c_2 \gt 7 \]

We can choose \(c_2 = 8\). Then, the inequality becomes:

\[ (8 - 7)n - 8 \geq 0 \]

Solve for \(n\):

\[ n \geq 8 \]

Thus, we can choose \(c_2 = 8\) and it holds for \(n \geq 8\).

To show \(f(n)\) is in \(\Omega(g(n))\), we need to find \(c_1\) such that:

\[ 7n + 8 \geq c_1 \cdot n \]

Move all terms to left side of the inequality and combine like terms:

\[ (7 - c_1)n + 8 \geq 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((7 - c_1)n\) must be positive or zero. If the dominant term \((7 - c_1)n\) becomes zero, the term \(8\) can still satisfy the inequality for large \(n\). Therefore:

\[ 7 - c_1 \geq 0 \implies c_1 \lt 7 \]

We can choose \(c_1 = 7\). Then, the inequality becomes:

\[ (7 - 7)n + 8 \geq 0 \]

Simplify the inequality:

\[ 8 \geq 0 \]

Thus, we can choose \(c_1 = 7\) and it holds for all \(n \geq 1\).

To satisfy both conditions for \(n \geq n_0\), we can choose \(c_1 = 7\), \(c_2 = 8\), \(n_0 = 8\).

Hence, \(f(n) = 7n + 8 \in \Theta(g(n) = n)\).

Example

Let \(f(n) = n^{3} + 20n + 1\) and \(g(n) = n^{3}\). Is \(f(n) \in \Theta(g(n))\)?

Solution

To determine whether \(f(n) = n^{3} + 20n + 1\) is in \(\Theta(g(n))\) where \(g(n) = n^{3}\), we need to check if \(f(n)\) grows at the same rate as \(g(n)\) asymptotically. A function \(f(n)\) is in \(\Theta(g(n))\) if there exist positive real constants \(c_1 \gt 0\), \(c_2 \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ c_1 \cdot g(n) \leq f(n) \leq c_2 \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to find \(c_1\), \(c_2\) such that:

\[ c_1 \cdot n^{3} \leq n^{3} + 20n + 1 \leq c_2 \cdot n^{3} \]

To show \(f(n)\) is in \(O(g(n))\), we need to find \(c_2\) such that:

\[ n^{3} + 20n + 1 \leq c_2 \cdot n^{3} \]

Move all terms to right side of the inequality and combine like terms:

\[ (c_2 - 1)n^{3} - 20n - 1 \geq 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((c_2 - 1)n^{3}\) must be positive. Therefore:

\[ c_2 - 1 \gt 0 \implies c_2 \gt 1 \]

We can choose \(c_2 = 2\). Then, the inequality becomes:

\[ (2 - 1)n^{3} - 20n - 1 \geq 0 \]

Simplify the inequality:

\[ n^{3} - 20n - 1 \geq 0 \]

To estimate \(n\) for which \(n^{3} - 20n - 1 \geq 0\) holds, we need to find the point where the positive terms (\(n^{3}\)) become dominant over the negative terms (\(20n\) and \(1\)). We can compare terms based on their degree and the magnitude of their coefficients.

\(n^{3}\) is the highest-degree positive term and \(20n\) is the highest-degree negatiive term. We compare \(n^{3}\) with \(20n\) to estimate \(n\).

\[ n^{3} \gt 20n \implies n \gt \sqrt{20} \approx 4.4721 \]

So, \(n^{3}\) starts to dominate \(20n\) when \(n\) is \(5\) or larger.

Let's approach it by testing positive values for \(n\) such that \(n^{3} - 20n 1 \geq 0\) holds.

For \(n = 5\):

\[ 5^{3} - 20(5) - 1 = 125 - 20 - 1 = 24 \quad (\text{which} \quad \gt 0) \]

Thus, we can choose \(c_2 = 2\) and it holds for \(n \geq 5\).

To show \(f(n)\) is in \(\Omega(g(n))\), we need to find \(c_1\) such that:

\[ n^{3} + 20n + 1 \geq c_1 \cdot n^{3} \]

Move all terms to left side of the inequality and combine like terms:

\[ (1 - c_1)n^{3} + 20n + 1 \geq 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((1 - c_1)n^{3}\) must be positive or zero. If the dominant term \((1 - c_1)n^{3}\) becomes zero, the term \(20n\) can still satisfy the inequality for large \(n\). Therefore:

\[ 1 - c_1 \geq 0 \implies c_1 \leq 1 \]

We can choose \(c_1 = 1\). Then, the inequality becomes:

\[ (1 - 1)n^{3} + 20n + 1 \geq 0 \]

Simplify the inequality:

\[ 20n + 1 \geq 0 \]

The inequality holds for all \(n \geq 1\).

Thus, we can choose \(c_1 = 1\) and it holds for all \(n \geq 1\).

To satisfy both conditions, we can choose \(c_1 = 1\), \(c_2 = 2\), \(n_0 = 5\)

Hence, \(f(n) = n^{3} + 20n + 1 \in \Theta(g(n) = n^{3})\).

Example

Prove that running time \(f(n) = 2^{n+1}\) is \(\Theta(2^{n})\)

Solution

To determine whether \(f(n) = 2^{n+1}\) is in \(\Theta(g(n))\) where \(g(n) = 2^{n}\), we need to check if \(f(n)\) grows at the same rate as \(g(n)\) asymptotically. A function \(f(n)\) is in \(\Theta(g(n))\) if there exist positive real constants \(c_1 \gt 0\), \(c_2 \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ c_1 \cdot g(n) \leq f(n) \leq c_2 \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to find \(c_1\), \(c_2\) such that:

\[ c_1 \cdot 2^{n} \leq 2^{n+1} \leq c_2 \cdot 2^{n} \]

To show \(f(n)\) is in \(O(g(n))\), we need to find \(c_2\) such that:

\[ 2^{n+1} \leq c_2 \cdot 2^{n} \]

Divide both sides by \(2^{n}\):

\[ 2 \leq c_2 \]

The inequality holds for all \(n \geq 1\).

We can choose \(c_2 = 2\) and it holds for all \(n \geq 1\).

To show \(f(n)\) is in \(\Omega(g(n))\), we need to find \(c_1\) such that:

\[ 2^{n+1} \geq c_1 \cdot 2^{n} \]

Divide both sides by \(2^{n}\):

\[ 2 \geq c_1 \]

The inequality holds for all \(n \geq 1\).

We can choose \(c_1 = 2\) and it holds for all \(n \geq 1\).

To satisfy both conditions, we can choose \(c_1 = 2\), \(c_2 = 2\), \(n_0 = 1\).

Hence, \(f(n) = 2^{n+1} \in \Theta(g(n) = 2^{n})\).

Example

Prove that running time \(f(n) = 10^{80}\) is \(\Theta(1)\)

Solution

To determine whether \(f(n) = 10^{80}\) is in \(\Theta(g(n))\) where \(g(n) = 1\), we need to check if \(f(n)\) grows at the same rate as \(g(n)\) asymptotically. A function \(f(n)\) is in \(\Theta(g(n))\) if there exist positive real constants \(c_1 \gt 0\), \(c_2 \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ c_1 \cdot g(n) \leq f(n) \leq c_2 \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to find \(c_1\), \(c_2\) such that:

\[ c_1 \cdot 1 \leq 10^{80} \leq c_2 \cdot 1 \]

To show \(f(n)\) is in \(O(g(n))\), we need to find \(c_2\) such that:

\[ 10^{80} \leq c_2 \cdot 1 \]

Simplify the inequality:

\[ 10^{80} \leq c_2 \]

The inequality holds for all \(n \geq 1\).

We can choose \(c_2 = 10^{80}\) and it holds for all \(n \geq 1\).

To show \(f(n)\) is in \(\Omega(g(n))\), we need to find \(c_1\) such that:

\[ 10^{80} \geq c_1 \cdot 1 \]

Simplify the inequality:

\[ 10^{80} \geq c_1 \]

The inequality holds for all \(n \geq 1\).

We can choose \(c_1 = 10^{80}\) and it holds for all \(n \geq 1\).

To satisfy both conditions, we can choose \(c_1 = 10^{80}\), \(c_2 = 10^{80}\), and for all \(n \geq 1\).

Hence, \(f(n) = 10^{80} \in \Theta(g(n) = 1)\).

Example

Prove that running time \(f(n) = \log_{\ln(5)}(\log^{\log(100)}(n))\) is \(\Theta(\log(\log(n)))\)

Solution

Simplify the expression using the change of base formula, \(\log_{a}(x) = \frac{\log_{b}(x)}{\log_{b}(a)}\):

\[ \log_{\ln(5)}(\log^{\log(100)}(n)) = \frac{\log(\log^{\log(100)}(n))}{\ln(5)} \]

The expression inside the logarithm can be simplified using the logarithm power rule, \(\log⁡ (x^{y}) = y \cdot \log⁡(x)\):

\[ \log(\log^{\log(100)}(n)) = \log(100) \cdot \log(\log(n)) \]

So, the original expression becomes:

\[ \frac{\log(\log^{\log(100)}(n))}{\ln(5)} = \frac{\log(100)}{\ln(5)} \cdot \log(\log(n)) \]

To determine whether \(f(n) = \log_{\ln(5)}(\log^{\log(100)}(n))\) is in \(\Theta(g(n))\) where \(g(n) = \log(\log(n))\), we need to check if \(f(n)\) grows at the same rate as \(g(n)\) asymptotically. A function \(f(n)\) is in \(\Theta(g(n))\) if there exist positive real constants \(c_1 \gt 0\), \(c_2 \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ c_1 \cdot g(n) \leq f(n) \leq c_2 \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to find \(c_1\), \(c_2\) such that:

\[ c_1 \cdot \log(\log(n)) \leq \log_{\ln(5)}(\log^{\log(100)}(n)) \leq c_2 \cdot \log(\log(n)) \]

To show \(f(n)\) is in \(O(g(n))\), we need to find \(c_2\) such that:

\[ \log_{\ln(5)}(\log^{\log(100)}(n)) \leq c_2 \cdot \log(\log(n)) \]

Simplify the expression \(\log_{\ln(5)}(\log^{\log(100)}(n))\):

\[ \frac{\log(100)}{\ln(5)} \cdot \log(\log(n)) \leq c_2 \cdot \log(\log(n)) \]

Divide both sides by \(\log(\log(n))\):

\[ \frac{\log(100)}{\ln(5)} \leq c_2 \]

The inequality holds for all \(n \geq 1\).

We can choose \(c_2 = \frac{\log(100)}{\ln(5)}\) and it holds for all \(n \geq 1\).

To show \(f(n)\) is in \(\Theta(g(n))\), we need to find \(c_1\) such that:

\[ \log_{\ln(5)}(\log^{\log(100)}(n)) \geq c_1 \cdot \log(\log(n)) \]

Simplify the expression \(\log_{\ln(5)}(\log^{\log(100)}(n))\):

\[ \frac{\log(100)}{\ln(5)} \cdot \log(\log(n)) \geq c_1 \cdot \log(\log(n)) \]

Divide both sides by \(\log(\log(n))\):

\[ \frac{\log(100)}{\ln(5)} \geq c_1 \]

The inequality holds for all \(n \geq 1\).

We can choose \(c_1 = \frac{\log(100)}{\ln(5)}\) and it holds for all \(n \geq 1\).

To satisfy both conditions, we can choose \(c_1 = \frac{\log(100)}{\ln(5)}\), \(c_2 = \frac{\log(100)}{\ln(5)}\), and for all \(n \geq 1\).

Hence, \(f(n) = \log_{\ln(5)}(\log^{\log(100)}(n)) \in \Theta(g(n) = \log(\log(n)))\).

Example

Prove that running time \(f(n) = \binom{n}{\frac{n}{2}}\) is \(\Theta(\frac{2^{n}}{\sqrt{n}})\).

Solution

Stirling's approximation states:

\[ n! \approx \sqrt{2\pi n} (\frac{n}{e})^{n} \]

The binomial coefficient can be expressed as:

\[ \binom{n}{\frac{n}{2}} = \frac{n!}{(\frac{n}{2})!(\frac{n}{2})!} \]

Applying Stirling's approximation:

\[ n! \approx \sqrt{2\pi n} (\frac{n}{e})^{n} \]
\[ \frac{n}{2}! \approx \sqrt{\pi n} (\frac{\frac{n}{2}}{e})^{\frac{n}{2}} \]

Thus:

\[ \binom{n}{\frac{n}{2}} \frac{\sqrt{2\pi n} (\frac{n}{e})^{n}}{(\sqrt{\pi n} (\frac{\frac{n}{2}}{e})^{\frac{n}{2}})^{2}} \]

Simplifying this expression:

\[ \binom{n}{\frac{n}{2}} \approx \frac{\sqrt{2\pi n} (\frac{n}{e})^{n}}{\pi n (\frac{\frac{n}{2}}{e})^{n}} \]

Simplify further:

\[ \binom{n}{\frac{n}{2}} \approx \frac{\sqrt{2}}{\sqrt{\pi}} \cdot \frac{2^{n}}{\sqrt{n}} \]

To determine whether \(f(n) = \binom{n}{\frac{n}{2}}\) is in \(\Theta(g(n))\) where \(g(n) = \frac{2^{n}}{\sqrt{n}}\), we need to check if \(f(n)\) grows at the same rate as \(g(n)\) asymptotically. A function \(f(n)\) is in \(\Theta(g(n))\) if there exist positive real constants \(c_1 \gt 0\), \(c_2 \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ c_1 \cdot g(n) \leq f(n) \leq c_2 \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to find \(c_1\), \(c_2\) such that:

\[ c_1 \cdot \frac{2^{n}}{\sqrt{n}} \leq \binom{n}{\frac{n}{2}} \leq c_2 \cdot \frac{2^{n}}{\sqrt{n}} \]

To show \(f(n)\) is in \(O(g(n))\), we need to find \(c_2\) such that:

\[ \binom{n}{\frac{n}{2}} \leq c_2 \cdot \frac{2^{n}}{\sqrt{n}} \]

Simplify the expression \(\binom{n}{\frac{n}{2}}\) using Stirling's approximation:

\[ \frac{\sqrt{2}}{\sqrt{\pi}} \cdot \frac{2^{n}}{\sqrt{n}} \leq c_2 \cdot \frac{2^{n}}{\sqrt{n}} \]

Divide both sides by \(\frac{2^{n}}{\sqrt{n}}\):

\[ \frac{\sqrt{2}}{\sqrt{\pi}} \leq c_2 \]

The inequality holds for all \(n \geq 1\).

We can choose \(c_2 = \frac{\sqrt{2}}{\sqrt{\pi}}\) and it holds for all \(n \geq 1\).

To show \(f(n)\) is in \(\Omega(g(n))\), we need to find \(c_1\) such that:

\[ \binom{n}{\frac{n}{2}} \geq c_1 \cdot \frac{2^{n}}{\sqrt{n}} \]

Simplify the expression \(\binom{n}{\frac{n}{2}}\) using Stirling's approximation:

\[ \frac{\sqrt{2}}{\sqrt{\pi}} \cdot \frac{2^{n}}{\sqrt{n}} \geq c_1 \cdot \frac{2^{n}}{\sqrt{n}} \]

Divide both sides by \(\frac{2^{n}}{\sqrt{n}}\):

\[ \frac{\sqrt{2}}{\sqrt{\pi}} \geq c_1 \]

The inequality holds for all \(n \geq 1\).

We can choose \(c_1 = \frac{\sqrt{2}}{\sqrt{\pi}}\) and it holds for all \(n \geq 1\).

To satisfy both conditions, we can choose \(c_1 = \frac{\sqrt{2}}{\sqrt{\pi}}\), \(c_2 = \frac{\sqrt{2}}{\sqrt{\pi}}\), and for all \(n \geq 1\).

Hence, \(f(n) = \binom{n}{\frac{n}{2}} \in \Theta(g(n) = \frac{2^{n}}{\sqrt{n}})\).

Example

Prove that running time \(f(n) = \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12}\) is \(\Theta(n)\)

Solution

To determine whether \(f(n) = \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12}\) is in \(\Theta(g(n))\) where \(g(n) = n\), we need to check if \(f(n)\) grows at the same rate as \(g(n)\) asymptotically. A function \(f(n)\) is in \(\Theta(g(n))\) if there exist positive real constants \(c_1 \gt 0\), \(c_2 \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ c_1 \cdot g(n) \leq f(n) \leq c_2 \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to find \(c_1\), \(c_2\) such that:

\[ c_1 \cdot n \leq \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12} \leq c_2 \cdot n \]

To show \(f(n)\) is in \(O(g(n))\), we need to find \(c_2\) such that:

\[ \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12} \leq c_2 \cdot n \]

Multiply both sides by the denominator \(2n^{2} − 11n + 12\):

\[ 4n^{3} − 28n^{2} + 56n − 35 \leq c_2 \cdot n \cdot (2n^{2} − 11n + 12) \]

Expand the right-hand side, the inequality becomes:

\[ 4n^{3} − 28n^{2} + 56n − 35 \leq 2c_2 \cdot n^{3} - 11c_2 \cdot n^{2} + 12c_2 \cdot n \]

Move all terms to left side of the inequality and combine like terms:

\[ (2c_2 - 4)n^{3} + (28 - 11c_2)n^{2} + (12c_2 - 56)n + 35 \geq 0 \]

For the inequality to hold for sufficiently large n, the dominant term \((2c_2 - 4)n^{3}\) must be positive or zero. If the dominant term \((2c_2 - 4)n^{3}\) becomes zero, the term \((28 - 11c_2)n^{2}\) can still satisfy the inequality for large \(n\). Therefore:

\[ 2c_2 - 4 \geq 0 \implies c_2 \geq 2 \]

We can choose \(c_2 = 2\). Then, the inequality becomes:

\[ (2(2) - 4)n^{3} + (28 - 11(2))n^{2} + (12(2) - 56)n + 35 \geq 0 \]

Simplify the inequality:

\[ 6n^{2} - 32n + 35 \geq 0 \]

To estimate \(n\) for which \(6n^{2} - 32n + 35 \geq 0\) holds, we need to find the point where the positive terms (\(6n^{2}\) and \(35\)) become dominant over the negative terms (\(32n\)). We can compare terms based on their degree and the magnitude of their coefficients.

\(6n^{2}\) is the highest-degree positive term and \(32n\) is the highest-degree negatiive term. We compare \(6n^{2}\) with \(32n\) to estimate \(n\).

\[ 6n^{2} \geq 32n \implies n \geq 5.4 \]

So, \(6n^{2}\) starts to dominate \(32n\) when \(n\) is \(6\) or larger.

Let's approach it by testing positive values for \(n\) such that \(6n^{2} - 32n + 35 \geq 0\) holds.

For \(n = 6\):

\[ 6(6^{2}) - 32(6) + 35 = 216 - 192 + 35 = 59 \quad (\text{which} \quad \gt 0) \]

For \(n = 5\):

\[ 6(5^{2}) - 32(5) + 35 = 150 - 160 + 35 = 25 \quad (\text{which} \quad \gt 0) \]

For \(n = 4\):

\[ 6(4^{2}) - 32(4) + 35 = 96 - 128 + 35 = 3 \quad (\text{which} \quad \gt 0) \]

For \(n = 3\):

\[ 6(3^{2}) - 32(3) + 35 = 54 - 96 + 35 = -7 \quad (\text{which} \quad \lt 0) \]

Thus, we can choose \(c_2 = 2\) and \(n \geq 4\).

To show \(f(n)\) is in \(\Omega(g(n))\), we need to find \(c_1\) such that:

\[ \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12} \geq c_1 \cdot n \]

Multiply both sides by the denominator \(2n^{2} − 11n + 12\):

\[ 4n^{3} − 28n^{2} + 56n − 35 \geq c_1 \cdot n \cdot (2n^{2} − 11n + 12) \]

Expand the left-hand side, the inequality becomes:

\[ 4n^{3} − 28n^{2} + 56n − 35 \geq 2c_1 \cdot n^{3} - 11c_1 \cdot n^{2} + 12c_1 \cdot n \]

Move all terms to left side of the inequality and combine like terms:

\[ (4 - 2c_1)n^{3} + (11c_1 - 28)n^{2} + (56 - 12c_1)n - 35 \geq 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((4 - 2c_1)n^{3}\) must be positive. Therefore:

\[ 4 - 2c_1 \gt 0 \implies c_1 \lt 2 \]

We can choose \(c_1 = 1\). Then, the inequality becomes:

\[ (4 - 2(1))n^{3} + (11(1) - 28)n^{2} + (56 - 12(1))n - 35 \geq 0 \]

Simplify the inequality:

\[ 2n^{3} - 17n^{2} + 44n - 35 \geq 0 \]

To estimate \(n\) for which \(2n^{3} - 17n^{2} + 44n - 35 \geq 0\) holds, we need to find the point where the positive terms (\(2n^{3}\) and \(44n\)) become dominant over the negative terms (\(17n^{2}\) and \(35\)). We can compare terms based on their degree and the magnitude of their coefficients.

\(2n^{3}\) is the highest-degree positive term and \(17n^{2}\) is the highest-degree negative term. We compare \(2n^{3}\) with \(17n^{2}\) to estimate \(n\).

\[ 2n^{3} \geq 17n^{2} \implies n \geq 8.5 \]

So, \(2n^{3}\) starts to dominate \(17n^{2}\) when \(n\) is \(9\) or larger.

Let's approach it by testing positive values for \(n\) such that \(2n^{3} - 17n^{2} + 44n - 35 \geq 0\) holds.

For \(n = 9\):

\[ 2(9^{3}) - 17(9^{2}) + 44(9) - 35 = 1458 - 1377 + 396 - 35 = 442 \quad (\text{which} \quad \gt 0) \]

For \(n = 8\):

\[ 2(8^{3}) - 17(8^{2}) + 44(8) - 35 = 1024 - 1088 + 352 - 35 = 253 \quad (\text{which} \quad \gt 0) \]

For \(n = 6\):

\[ 2(6^{3}) - 17(6^{2}) + 44(6) - 35 = 432 - 612 + 264 - 35 = 49 \quad (\text{which} \quad \gt 0) \]

For \(n = 4\):

\[ 2(4^{3}) - 17(4^{2}) + 44(4) - 35 = 128 - 272 + 176 - 35 = -3 \quad (\text{which} \quad \lt 0) \]

For \(n = 5\):

\[ 2(5^{3}) - 17(5^{2}) + 44(5) - 35 = 250 - 425 + 220 - 35 = 10 \quad (\text{which} \quad \gt 0) \]

Thus, we can choose \(c_1 = 1\) and \(n \geq 5\).

To satisfy both conditions, we can choose \(c_1 = 1\), \(c_2 = 2\), and \(n_0 = 5\).

Hence, \(f(n) = \frac{4n^{3} − 28n^{2} + 56n − 35}{2n^{2} − 11n + 12} \in \Theta(g(n) = n)\).

Example

Prove that running time \(f(n) = \frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45}\) is \(\Theta(\frac{1}{n^{2}})\)

Solution

To determine whether \(f(n) = \frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45}\) is in \(\Theta(g(n))\) where \(g(n) = \frac{1}{n^{2}}\), we need to check if \(f(n)\) grows at the same rate as \(g(n)\) asymptotically. A function \(f(n)\) is in \(\Theta(g(n))\) if there exist positive real constants \(c_1 \gt 0\), \(c_2 \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ c_1 \cdot g(n) \leq f(n) \leq c_2 \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to find \(c_1\), \(c_2\) such that:

\[ c_1 \cdot \frac{1}{n^{2}} \leq \frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45} \leq c_2 \cdot \frac{1}{n^{2}} \]

To show \(f(n)\) is in \(O(g(n))\), we need to find \(c_2\) such that:

\[ \frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45} \leq c_2 \cdot \frac{1}{n^{2}} \]

Multiply both sides by the denominator \(2n^{4} − 11n^{3} + 12n^{2} + 4n + 45\) and \(n^{2}\):

\[ (5n^{2} − 2n − 35) \cdot n^{2} \leq c_2 \cdot (2n^{4} − 11n^{3} + 12n^{2} + 4n + 45) \]

Expand the expression, the inequality becomes:

\[ 5n^{4} − 2n^{3} − 35n^{2} \leq 2c_2 \cdot n^{4} − 11c_2 \cdot n^{3} + 12c_2 \cdot n^{2} + 4c_2 \cdot n + 45c_2 \]

Move all terms to right side of the inequality and combine like terms:

\[ (2c_2 - 5)n^{4} − (11c_2 - 2)n^{3} + (12c_2 + 35)n^{2} + (4c_2)n + 45c_2 \geq 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((2c_2 - 5)n^{4}\) must be positive. Therefore:

\[ 2c_2 - 5 \gt 0 \implies c_2 \gt 2.5 \]

We can choose \(c_2 = 3\). Then, the inequality becomes:

\[ (2(3) - 5)n^{4} − (11(3) - 2)n^{3} + (12(3) + 35)n^{2} + (4(3))n + 45(3) \geq 0 \]

Simplify the inequality:

\[ n^{4} − 31n^{3} + 71n^{2} + 12n + 135 \geq 0 \]

To estimate \(n\) for which \(n^{4} − 31n^{3} + 71n^{2} + 12n + 135 \geq 0\) holds, we need to find the point where the positive terms (\(n^{4}\), \(71n^{2}\), \(12n\) and \(135\)) become dominant over the negative terms (\(31n^{3}\)). We can compare terms based on their degree and the magnitude of their coefficients.

\(n^{4}\) is the highest-degree positive term and \(31n^{3}\) is the highest-degree negative term. We compare \(n^{4}\) with \(31n^{3}\) to estimate \(n\).

\[ n^{4} \geq 31n^{3} \implies n \geq 31 \]

So, \(n^{4}\) starts to dominate \(31n^{3}\) when \(n\) is \(31\) or larger.

Let's approach it by testing positive values for \(n\) such that \(n^{4} − 31n^{3} + 71n^{2} + 12n + 135 \geq 0\) holds.

For \(n = 31\):

\[ 31^{4} − 31(31^{3}) + 71(31^{2}) + 12(31) + 135 = 923521 - 923521 + 68131 + 372 + 135 = 68638 \quad (\text{which} \quad \gt 0) \]

For \(n = 29\):

\[ 29^{4} − 31(29^{3}) + 71(29^{2}) + 12(29) + 135 = 707281 - 756059 + 59711 + 348 + 135 = 11416 \quad (\text{which} \quad \gt 0) \]

For \(n = 27\):

\[ 27^{4} − 31(27^{3}) + 71(27^{2}) + 12(27) + 135 = 531441 - 610173 + 51759 + 324 + 135 = -26514 \quad (\text{which} \quad \lt 0) \]

For \(n = 28\):

\[ 28^{4} − 31(28^{3}) + 71(28^{2}) + 12(28) + 135 = 614656 - 680512 + 55664 + 336 + 135 = -9721 \quad (\text{which} \quad \lt 0) \]

Thus, we can choose \(c_2 = 3\) and \(n \geq 29\).

To show \(f(n)\) is in \(\Omega(g(n))\), we need to find \(c_1\) such that:

\[ \frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45} \geq c_1 \cdot \frac{1}{n^{2}} \]

Multiply both sides by the denominator \(2n^{4} − 11n^{3} + 12n^{2} + 4n + 45\) and \(n^{2}\):

\[ (5n^{2} − 2n − 35) \cdot n^{2} \geq c_1 \cdot (2n^{4} − 11n^{3} + 12n^{2} + 4n + 45) \]

Expand the expression, the inequality becomes:

\[ 5n^{4} − 2n^{3} − 35n^{2} \geq 2c_1 \cdot n^{4} − 11c_1 \cdot n^{3} + 12c_1 \cdot n^{2} + 4c_1 \cdot n + 45c_1 \]

Move all terms to left side of the inequality and combine like terms:

\[ (5 - 2c_1)n^{4} + (11c_1 - 2)n^{3} - (35 + 12c_1)n^{2} - (4c_1)n - 45c_1 \geq 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((5 - 2c_1)n^{4}\) must be positive or zero. If the dominant term \((5 - 2c_1)n^{4}\) becomes zero, the term \((11c_1 - 2)n^{3}\) can still satisfy the inequality for large \(n\). Therefore:

\[ 5 - 2c_1 \geq 0 \implies c_1 \leq 2.5 \]

We can choose \(c_1 = 2\). Then, the inequality becomes:

\[ (5 - 2(2))n^{4} + (11(2) - 2)n^{3} - (35 + 12(2))n^{2} - (4(2))n - 45(2) \geq 0 \]

Simplify the inequality:

\[ n^{4} + 20n^{3} - 59n^{2} - 8n - 90 \geq 0 \]

To estimate \(n\) for which \(n^{4} + 20n^{3} - 59n^{2} - 8n - 90 \geq 0\) holds, we need to find the point where the positive terms (\(n^{4}\) and \(20n^{3}\)) become dominant over the negative terms (\(59n^{2}\), \(8n\) and \(90\)). We can compare terms based on their degree and the magnitude of their coefficients.

\(n^{4}\) is the highest-degree positive term and \(59n^{2}\) is the highest-degree negative term. We compare \(n^{4}\) with \(59n^{2}\) to estimate \(n\).

\[ n^{4} \geq 59n^{2} \implies n \geq 7.68 \]

So, \(n^{4}\) starts to dominate \(59n^{2}\) when \(n\) is \(8\) or larger.

Let's approach it by testing positive values for \(n\) such that \(n^{4} + 20n^{3} - 59n^{2} - 8n - 90 \geq 0\) holds.

For \(n = 8\):

\[ 8^{4} + 20(8^{3}) - 59(8^{2}) - 8(8) - 90 = 4096 + 10240 - 3776 - 64 - 90 = 10506 \quad (\text{which} \quad \gt 0) \]

For \(n = 6\):

\[ 6^{4} + 20(6^{3}) - 59(6^{2}) - 8(6) - 90 = 1296 + 4320 - 2124 - 48 - 90 = 3354 \quad (\text{which} \quad \gt 0) \]

For \(n = 4\):

\[ 4^{4} + 20(4^{3}) - 59(4^{2}) - 8(4) - 90 = 256 + 1280 - 944 - 32 - 90 = 470 \quad (\text{which} \quad \gt 0) \]

For \(n = 3\):

\[ 3^{4} + 20(3^{3}) - 59(3^{2}) - 8(3) - 90 = 81 + 540 - 531 - 24 - 90 = -24 \quad (\text{which} \quad \lt 0) \]

Thus, we can choose \(c_1 = 2\) and \(n \geq 3\).

To satisfy both conditions, we can choose \(c_1 = 2\), \(c_2 = 3\), and \(n_0 = 29\).

Hence, \(f(n) = \frac{5n^{2} − 2n − 35}{2n^{4} − 11n^{3} + 12n^{2} + 4n + 45} \in \Theta(g(n) = \frac{1}{n^{2}})\).

Example

Let \(f(n) = \log(n!)\) and \(g(n) = n \log(n)\). Is \(f(n)\) in \(\Theta(g(n))\).

Solution

Stirling's approximation for \(n!\) is given by:

\[ n! \approx \sqrt{2\pi n} (\frac{n}{e})^{n} \]

Taking the logarithm of both sides:

\[ \log(n!) \approx \log(\sqrt{2\pi n} (\frac{n}{e})^{n}) \]

Using the properties of logarithms, we can expand the expression:

\[ \log(n!) \approx \log(\sqrt{2\pi n}) + \log(\frac{n^{n}}{e^{n}}) \]

Simplify each term:

\[ \log(n!) \approx \frac{1}{2} \log(2\pi) + \frac{1}{2} \log(n) + n \log(n) - n \log(e) \]

To determine whether \(f(n) = \log(n!)\) is in \(\Theta(g(n))\) where \(g(n) = n \log(n)\), we need to check if \(f(n)\) grows at the same rate as \(g(n)\) asymptotically. A function \(f(n)\) is in \(\Theta(g(n))\) if there exist positive real constants \(c_1 \gt 0\), \(c_2 \gt 0\) and there exists an integer constant \(n_0 \geq 1\) such that:

\[ c_1 \cdot g(n) \leq f(n) \leq c_2 \cdot g(n) \quad \text{for all} \quad n \geq n_0 \]

We need to find \(c_1\), \(c_2\) such that:

\[ c_1 \cdot n \log(n) \leq \log(n!) \leq c_2 \cdot n \log(n) \]

To show \(f(n)\) is in \(O(g(n))\), we need to find \(c_2\) such that:

\[ \log(n!) \leq c_2 \cdot n \log(n) \]

Simplify the expression \(\log(n!)\) using Stirling's approximation:

\[ \frac{1}{2} \log(2\pi) + \frac{1}{2} \log(n) + n \log(n) - n \log(e) \leq c_2 \cdot n \log(n) \]

Move all terms to right side of the inequality and combine like terms:

\[ (c_2 - 1)n \log(n) + n \log(e) - \frac{1}{2} \log(n) - \frac{1}{2} \log(2\pi) \geq 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((c_2 - 1)n \log(n)\) must be positive or zero. If the dominant term \((c_2 - 1)n \log(n)\) becomes zero, the term \(n \log(e)\) can still satisfy the inequality for large \(n\). Therefore:

\[ c_2 - 1 \geq 0 \implies c_2 \geq 1 \]

We can choose \(c_2 = 1\). Then, the inequality becomes:

\[ n \log(e) - \frac{1}{2} \log(n) - \frac{1}{2} \log(2\pi) \geq 0 \]

Simplify the inequality:

\[ 0.4343n - 0.5 \log(n) - 0.39905 \geq 0 \]

To estimate \(n\) for which \(0.4343n - 0.5 \log(n) - 0.39905 \geq 0\) holds, we need to find the point where the positive terms (\(0.4343n\)) become dominant over the negative terms (\(0.5 \log(n)\) and \(0.39905\)). We can compare terms based on their degree and the magnitude of their coefficients.

\(0.4343n\) is the highest-degree positive term and \(0.5 \log(n)\) is the highest-degree negative term. We compare \(0.4343n\) with \(0.5 \log(n)\) to estimate \(n\).

\[ 0.4343n \gt 0.5 \log(n) \]

Divide both sides by \(0.5\)

\[ 0.8686n \gt \log(n) \]

The inequality holds for all \(n \geq 1\).

To show \(f(n)\) is in \(\Omega(g(n))\), we need to find \(c_1\) such that:

\[ \log(n!) \geq c_1 \cdot n \log(n) \]

Simplify the expression \(\log(n!)\) using Stirling's approximation:

\[ \frac{1}{2} \log(2\pi) + \frac{1}{2} \log(n) + n \log(n) - n \log(e) \geq c_1 \cdot n \log(n) \]

Move all terms to left side of the inequality and combine like terms:

\[ (1 - c_1)n \log(n) - n \log(e) + \frac{1}{2} \log(n) + \frac{1}{2} \log(2\pi) \geq 0 \]

For the inequality to hold for sufficiently large \(n\), the dominant term \((1 - c_1)n \log(n)\) must be positive. Therefore:

\[ 1 - c_1 \gt 0 \implies c_1 \lt 1 \]

We can choose \(c_1 = 0.5\). Then, the inequality becomes:

\[ (1 - 0.5)n \log(n) - n \log(e) + \frac{1}{2} \log(n) + \frac{1}{2} \log(2\pi) \geq 0 \]

Simplify the inequality:

\[ 0.5n \log(n) - 0.4343n + 0.5 \log(n) + 0.39905 \geq 0 \]

To estimate \(n\) for which \(0.5n \log(n) - 0.4343n + 0.5 \log(n) + 0.39905 \geq 0\) holds, we need to find the point where the positive terms (\(0.5n \log(n)\), \(0.5 \log(n)\), and \(0.39905\)) become dominant over the negative terms (\(0.4343n\)). We can compare terms based on their degree and the magnitude of their coefficients.

\(0.5n \log(n)\) is the highest-degree positive term and \(0.4343n\) is the highest-degree negative term. We compare \(0.5n \log(n)\) with \(0.4343n\) to estimate \(n\).

\[ 0.5n \log(n) \geq 0.4343n \]

Divide both sides by \(0.5n\)

\[ \log(n) \geq 0.8686 \]

Exponentiate both sides to remove the logarithm:

\[ n \geq 10^{0.8686} \approx 7.35 \]

So, \(0.5n \log(n)\) starts to dominate \(0.4343n\) when \(n\) is \(8\) or larger.

Let's approach it by testing positive values for \(n\) such that \(n^{4} + 20n^{3} - 59n^{2} - 8n - 90 \geq 0\) holds.

For \(n = 8\):

\[ 0.5(8) \log(8) - 0.4343(8) + 0.5 \log(8) + 0.39905 = 3.6124 - 3.4744 + 0.45155 + 0.39905 = 0.9886 \quad (\text{which} \quad \gt 0) \]

For \(n = 7\):

\[ 0.5(7) \log(7) - 0.4343(7) + 0.5 \log(7) + 0.39905 = 2.95835 - 3.0431 + 0.42255 + 0.39905 = 0.73685 \quad (\text{which} \quad \gt 0) \]

For \(n = 5\):

\[ 0.5(5) \log(5) - 0.4343(5) + 0.5 \log(5) + 0.39905 = 1.744925 - 2.1715 + 0.349485 + 0.39905 = 0.32196 \quad (\text{which} \quad \gt 0) \]

For \(n = 3\):

\[ 0.5(3) \log(3) - 0.4343(3) + 0.5 \log(3) + 0.39905 = 0.71165 - 1.3029 + 0.23855 + 0.39905 = 0.04635 \quad (\text{which} \quad \gt 0) \]

For \(n = 2\):

\[ 0.5(2) \log(2) - 0.4343(2) + 0.5 \log(2) + 0.39905 = 0.3010 - 0.8686 + 0.1505 + 0.39905 = -0.01805 \quad (\text{which} \quad \lt 0) \]

To satisfy both conditions, we can choose \(c_1 = 0.5\), \(c_2 = 1\), and for all \(n \geq 2\).

Hence, \(f(n) = \log(n!) \in \Theta(g(n) = n \log(n))\).