0

I'm having a hard time finding the constants/witnesses $C_0$ and $k_0$ that show $(\log_b n)^c$ is $O(n^d)$. That is $|(\log_b n)^c| \leq C_0|n^d|$ for $n > k_0$ (b > 1, and c,d are positive).

I understand you can show just the Big-O relation through L-Hopital, but my specific issue is with finding the witnesses

For example, in Rosen's discrete Math textbook, they mention in the solutions for one problem that $(\log_2 x)^4 \leq x^3$ for $x > 1$, that is $C_0 = 1$ and $k_0 = 1$. However, I'm not sure how to exactly derive that myself, nor does the textbook give an explanation as to how it got that answer. I can only see that it makes sense via desmos (at least for the finite amount of points it shows lol)

Moreover, when I try to see the relation between say $(\log_2 x)^4$ and $x^2$, I see $x^2$ only seems to start exceeding $(\log_2 x)^4$ past x = 16 (via desmos again), i.e one pair of witnesses would be $C_0 = 1$ and $k_0 = 16$.

Hence I'm really lost in finding witness pairs for $(log_b n)^c \in O(n^d)$. Kindly please help suggest some strategies that would make it easier to solve.


I have a similar confusion for witnesses when showing:

  1. $n^d \in O(b^n)$ ($b > 1$ and $d$ is positive)
  2. $c^n \in O(n!)$ ($c > 1$)

But I can leave these 2 for a separate question. We can just focus on $(log_b n)^c \in O(n^d)$ in this thread.


  • It's enough to show $\lim\limits_{n \to \infty}\frac{\ln(n)}{n^\alpha}=0$, for $\alpha>0$. Have you tried this? – zkutch Jun 27 '24 at 20:59

1 Answers1

1

For any pair of witness $(C_0, k_0)$, the pair of witness $(C_0, |k_0|)$ would work as well. So W.L.O.G we can only consider only the positive $k_0 > 0$, which gives us $$\begin{align*} (\log_b n)^c &\le C_0n^d & \forall n \ge k_0 \\ c \ln (\log_b n) &\le \ln C_0 + d \ln n & \forall n \ge k_0 \\ c \ln (\ln n) - c \ln (\ln b) - d \ln n &\le \ln C_0 & \forall n \ge k_0 \\ \end{align*}$$

Now take $h(x) = c \ln (\ln x) - c \ln (\ln b) - d \ln x$. We get $h'(x) = \frac{c}{x \ln x} - \frac{d}{x}$. This derivative $h'(x)$ will always be non-positive ($\le 0$) when $x > 1$ and $\frac{x\ln x}{x} \ge \frac{c}{d}$, or $x \ge e^{c/d}$. So for any $k_0 \ge e^{c/d}$, the value $h(x) : \forall x \ge k_0$ will be non-increasing. We can take the equality here $k_0 = e^{c/d}$, and let $C_0$ take care of the rest

Thus we only need to find the $C_0$ where $h(k_0) \le \ln C_0$, and as $h$ is non-increasing after that, it will never go above this value $\forall x \ge k_0$ $$\begin{align*} c \ln (\ln (e^{c/d})) - c \ln (\ln b) - d \ln (e^{c/d}) &\le \ln C_0 \\ \ln \left( \frac{\left( \frac{c}{d} \right)^c}{(\ln b)^c e^c} \right) &\le \ln C_0 \\ \left( \frac{c}{e d (\ln b)} \right)^c &\le C_0 \\ \left( \frac{c}{e d (\ln b)} \right)^c &= C_0 \\ \end{align*}$$

EnEm
  • 1,293
  • 4
  • 14
  • Very very cool solution! I just have one qualm with this part: "This derivative $h'(x)$ will always be non-positive ($\le 0$) when $\frac{x\ln x}{x} \ge \frac{c}{d}$ or $x \ge e^{c/d}$." – Bob Marley Jun 27 '24 at 23:21
  • I understand that this derivative $\frac{c}{x\ln x} - \frac{d}{x} \leq 0 \iff \frac{c}{x\ln x} \leq \frac{d}{x} \iff \frac{x}{x\ln x} \leq \frac{d}{c}$ (where I divided by c and multiplied by x since c is positive and $k_0 > 0$, hence x > 0 or positive, making these operations not change direction of inequality. But when you'd take the inverse the inequality would flip and hence come to your result only when $\frac{x}{x\ln x} > 0$, hence we need $\ln x > 0$, which means $x > 1$. – Bob Marley Jun 27 '24 at 23:27
  • I feel we could make the proof work if we instead assume $k_0 > 1$ which is fine considering this lemma: Lemma. Let $f(x)$ be $O(g(x))$ and let $C_0$ and $k_0$ be any constants. Then there exist constants $C$ and $k$ such that $C > C_0$, $k > k_0$, and such that $|f(x)| \leq C|g(x)|$ whenever $x > k$.

    Informally speaking, this lemma says that when applying the definition of big-O, you can assume the constants $C$ and $k$ are as great as you need them to be.

    – Bob Marley Jun 27 '24 at 23:29
  • Let me know on your thoughts. – Bob Marley Jun 27 '24 at 23:29
  • @BobMarley Oh yeah you are absolutely correct. Will edit this miss in my answer. Fortunately this doesn't impact the rest of the solution as $e^{c/d} > 1$ for all $c,d$ – EnEm Jun 27 '24 at 23:46
  • Wait hang on this is weird cuz if I start with $x \geq e^{\frac{c}{d}} > 0$, then I see the following chain of $\iff$'s... $x \geq e^{\frac{c}{d}} > 0 \iff \ln x \geq \frac{c}{d}$, and since $\frac{c}{d} > 0$, we can take multiplicative inverse to get $\iff \frac{1}{\ln x} \leq \frac{d}{c} \iff \frac{x}{x\ln x} \leq \frac{d}{c} \iff \frac{c}{x\ln x} \leq \frac{d}{x} \iff \frac{c}{x\ln x} - \frac{d}{x} \leq 0$. – Bob Marley Jun 27 '24 at 23:47
  • Am I missing something lol? – Bob Marley Jun 27 '24 at 23:50
  • @BobMarley Nah you haven't missed anything as $x \ge e^{c/d} \implies \frac{c}{x \ln x} - \frac{d}{x} \le 0$ is without any problem as $e^{c/d} > 1$ . Its only when we go the opposite direction that we have to take care that $x>1$ – EnEm Jun 27 '24 at 23:53
  • But I though when we do inequality manipulations or algebra manipulations they're reversible and hence the reverse implication is also true, no (hence the chain of iff's)? – Bob Marley Jun 27 '24 at 23:54
  • 1
    @BobMarley I guess the problem is that $\ln x \ge \frac{c}{d} \implies \frac{1}{\ln x} \le \frac{d}{c}$ is always true, but $ \frac{1}{\ln x} \le \frac{d}{c} \implies \ln x \ge \frac{c}{d}$ is not necessarily true. – EnEm Jun 28 '24 at 00:00
  • Yes! I was just thinking about that too! Cool makes sense. – Bob Marley Jun 28 '24 at 00:02
  • Also how would I justify $(log_2 x)^4 < x^3$ for all $x > 1$? – Bob Marley Jun 28 '24 at 14:03