3.2 Standard notations and common functions
3.2-1
Show that if \(f(n)\) and \(g(n)\) are monotonically increasing functions, then so are the functions \(f(n) + g(n)\) and \(f(g(n))\), and if \(f(n)\) and \(g(n)\) are in addition nonnegative, then \(f(n) \cdot g(n)\) is monotonically increasing.
which proves the first function.
Then
This is true, since \(g(m) \le g(n)\) and \(f(n)\) is monotonically increasing.
If both functions are nonnegative, then we can multiply the two equalities and we get
3.2-2
Prove equation \(\text{(3.16)}\).
3.2-3
Prove equation \(\text{(3.19)}\). Also prove that \(n! \ne \omega(2^n)\) and \(n! \ne o(n^n)\).
\[\lg(n!) = \Theta(n\lg n) \tag{3.19}\]
We can use Stirling's approximation to prove these three equations.
For equation \(\text{(3.19)}\),
For \(n! \ne \omega(2^n)\),
where the last step holds for \(n > 4e\).
For \(n! \ne o(n^n)\),
3.2-4 \(\star\)
Is the function \(\lceil \lg n \rceil!\) polynomially bounded? Is the function \(\lceil \lg\lg n \rceil!\) polynomially bounded?
Proving that a function \(f(n)\) is polynomially bounded is equivalent to proving that \(\lg(f(n)) = O(\lg n)\) for the following reasons.
- If \(f\) is polynomially bounded, then there exist constants \(c\), \(k\), \(n_0\) such that for all \(n \ge n_0\), \(f(n) \le cn^k\). Hence, \(\lg(f(n)) \le kc\lg n\), which means that \(\lg(f(n)) = O(\lg n)\).
- If \(\lg(f(n)) = O(\lg n)\), then \(f\) is polynomially bounded.
In the following proofs, we will make use of the following two facts:
- \(\lg(n!) = \Theta(n\lg n)\)
- \(\lceil \lg n \rceil = \Theta(\lg n)\)
\(\lceil \lg n \rceil!\) is not polynomially bounded because
\(\lceil \lg\lg n \rceil!\) is polynomially bounded because
The last step above follows from the property that any polylogarithmic function grows more slowly than any positive polynomial function, i.e., that for constants \(a, b > 0\), we have \(\lg^b n = o(n^a)\). Substitute \(\lg n\) for \(n\), \(2\) for \(b\), and \(1\) for \(a\), giving \(\lg^2(\lg n) = o(\lg n)\).
Therefore, \(\lg(\lceil \lg\lg n \rceil!) = O(\lg n)\), and so \(\lceil \lg\lg n \rceil!\) is polynomially bounded.
3.2-5 \(\star\)
Which is asymptotically larger: \(\lg(\lg^\*n)\) or \(\lg^\*(\lg n)\)?
We have \(\lg^\* 2^n = 1 + \lg^\* n\),
Therefore, we have that \(\lg^*(\lg n)\) is asymptotically larger.
3.2-6
Show that the golden ratio \(\phi\) and its conjugate \(\hat \phi\) both satisfy the equation \(x^2 = x + 1\).
3.2-7
Prove by induction that the \(i\)th Fibonacci number satisfies the equality
\[F_i = \frac{\phi^i - \hat\phi^i}{\sqrt 5},\]where \(\phi\) is the golden ratio and \(\hat\phi\) is its conjugate.
-
Base case
For \(i = 0\),
\[ \begin{aligned} \frac{\phi^0 - \hat\phi^0}{\sqrt 5} & = \frac{1 - 1}{\sqrt 5} \\\\ & = 0 \\\\ & = F_0. \end{aligned} \]For \(i = 1\),
\[ \begin{aligned} \frac{\phi^1 - \hat\phi^1}{\sqrt 5} & = \frac{(1 + \sqrt 5) - (1 - \sqrt 5)}{2 \sqrt 5} \\\\ & = 1 \\\\ & = F_1. \end{aligned} \] -
Assume
- \(F_{i - 1} = (\phi^{i - 1} - \hat\phi^{i - 1}) / \sqrt 5\) and
- \(F_{i - 2} = (\phi^{i - 2} - \hat\phi^{i - 2}) / \sqrt 5\),
\[ \begin{aligned} F_i & = F_{i - 1} + F_{i - 2} \\\\ & = \frac{\phi^{i - 1} - \hat\phi^{i - 1}}{\sqrt 5} + \frac{\phi^{i - 2} - \hat\phi^{i - 2}}{\sqrt 5} \\\\ & = \frac{\phi^{i - 2}(\phi + 1) - \hat\phi^{i - 2}(\hat\phi + 1)}{\sqrt 5} \\\\ & = \frac{\phi^{i - 2}\phi^2 - \hat\phi^{i - 2}\hat\phi^2}{\sqrt 5} \\\\ & = \frac{\phi^i - \hat\phi^i}{\sqrt 5}. \end{aligned} \]
3.2-8
Show that \(k\ln k = \Theta(n)\) implies \(k = \Theta(n / \lg n)\).
From the symmetry of \(\Theta\),
Let's find \(\ln n\),
Let's divide the two,
本页面的全部内容在 小熊老师 - 莆田青少年编程俱乐部 0594codes.cn 协议之条款下提供,附加条款亦可能应用