diff --git a/404.html b/404.html index 271ab11..d1eace5 100644 --- a/404.html +++ b/404.html @@ -1425,7 +1425,7 @@
$$ \begin{aligned} & \frac{3}{3^p}+\frac{8}{4^p}=1\cr - & \frac{3}{3^1}+\frac{8}{4^1}=3\cr + & \frac{3}{3^{1.5}}+\frac{8}{4^{1.5}}=3^{-(1/2)}+1\cr & \frac{3}{3^2}+\frac{8}{4^2}=\frac{5}{6}\cr - \implies & 1<p<2\cr + \implies & 1.5<p<2\cr T(n) & =\Theta(n^p(1+\int_{1}^{n}\frac{f(x)}{x^{p+1}}dx))\cr & =\Theta(n^p(1+\int_{1}^{n}\frac{x^2/\lg x}{x^{p+1}}dx))\cr - & =\Theta(n^p(1+\int_{1}^{n}\frac{1}{x^{p-1}\ln x}dx))\cr - & = \Omega(n^p(1+\int_{1}^{n}\frac{1}{x\ln x}dx))\cr - & = \Omega(n^p(1+\left[\ln\ln x\right]_1^{n}))\cr - & = \Omega(n^p(1+\ln\ln n-\ln\ln 1))\cr - & = \infty\cr + & =\Theta(n^p(1+\int_{1}^{n}\frac{1}{x^{p-1}\lg x}dx))\cr + & =\Omega(n^p(1+\lg n\int_{1}^{n}\frac{1}{x^{p-1}}dx))\cr + & =\Omega(n^p(1+n^{2-p}\lg n ))\cr + & =\Omega(n^2/\lg n)\cr + T(n) & =O(n^p(1+\lg 1(\text{regarded as constant})\int_{1}^{\sqrt{n}}\frac{1}{x^{p-1}}dx+\lg \sqrt{n}\int_{\sqrt{n}}^{n}\frac{1}{x^{p-1}}dx))\cr + & = O(n^p(1+\Theta(n^{(p-1)/2})+\Theta(n^{p-1}/\lg n)))\cr + & =O(n^2/\lg n)\cr \end{aligned} $$
c.
@@ -1816,7 +1818,7 @@$$ +\begin{aligned} + n^{\log_{b}{a}} = n^{\log_{3}{5}}\cr + f(n) = n\lg{n} = O(n^{\log_{b}{a}-\log_{3}{(5/4)}})\cr + T(n)=\Theta({n^{\log_{b}{a}}})=\Theta(n^{\log_{3}{5}})\cr +\end{aligned} +$$
+$$ +\begin{aligned} + & 3(\frac{1}{3})^p=1\cr + \implies & p = 1\cr + T(n) & =\Theta(n^p(1+\int_{1}^{n}\frac{f(x)}{x^{p+1}}dx))\cr + & = \Theta(n^1(1+\int_{1}^{n}\frac{x/\lg x}{x^{2}}dx))\cr + & = \Theta(n^1(1+\int_{1}^{n}\frac{1}{x^{}\lg x}dx))\cr + & = \Theta(n^1(1+\left[\lg\lg x\right]_{1}^{n}))\cr + & = \Theta (n\lg\lg n)\cr +\end{aligned} +$$
+$$ +\begin{aligned} + n^{\log_{b}{a}} = n^{\log_{2}{8}}=n^{3}\cr + f(n) = n^{7/2} = \Omega(n^{\log_{b}{a}+1/2})\cr + af(n/b)=2^{-1/2}(n^{7/2})\leq 2^{-1/2}f(n)\cr + T(n)=\Theta(f(n))=\Theta(n^{7/2})\cr +\end{aligned} +$$
+$$ +\begin{aligned} + f(n)=n/2 \text{ satisfies polynomial-growth condition}\cr + T(n)=2T(n/2)+n/2\cr + n^{\log_{b}{a}} = n^{\log_{2}{2}}=n^{}\cr + f(n) = n^{}/2 = \Theta(n^{\log_{b}{a}}\lg^{0}n)\cr + T(n)=\Theta(n^{\log_{b}{a}}\lg n)=\Theta(n\lg n)\cr +\end{aligned} +$$
+$$ +\begin{aligned} + & 2(\frac{1}{2})^p=1\cr + \implies & p = 1\cr + T(n) & =\Theta(n^p(1+\int_{1}^{n}\frac{f(x)}{x^{p+1}}dx))\cr + & = \Theta(n^1(1+\int_{1}^{n}\frac{x/\lg x}{x^{2}}dx))\cr + & = \Theta(n^1(1+\int_{1}^{n}\frac{1}{x^{}\lg x}dx))\cr + & = \Theta(n^1(1+\left[\lg\lg x\right]_{1}^{n}))\cr + & = \Theta(n\lg\lg n)\cr +\end{aligned} +$$
+$$ +\begin{aligned} + & (\frac{1}{2})^{p}+(\frac{1}{4})^{p}+(\frac{1}{8})^{p}=1\cr + & 0.5<p<1\cr + T(n) & =\Theta(n^p(1+\int_{1}^{n}\frac{f(x)}{x^{p+1}}dx))\cr + & = \Theta(n^p(1+\int_{1}^{n}\frac{x}{x^{p+1}}dx))\cr + & = \Theta(n^p(1+\int_{1}^{n}\frac{1}{x^{p}}dx))\cr + & = \Theta(n^p(1+\left[x^{1-p}\right]_{1}^{n}))\cr + & = \Theta(n)\cr +\end{aligned} +$$
+$$ +\begin{aligned} + T(n) & = \frac{1}{2}\sum_{i=1}^{n}(\frac{1}{i})\cr + & \leq \frac{1}{2}+1/2\int_{1}^{n-1}\frac{1}{x}\cr + & = \Theta(\frac{1}{2}+\frac{1}{2}\lg (n-1))\cr + & = \Theta(\lg n)\cr +\end{aligned} +$$
+$T(n)=T(n-1)+\lg n$ +$$ +\begin{aligned} + T(n) & = \sum_{i=1}^{n}\lg i\cr + & = \lg(n!)\cr + & = \Theta(n\lg n)\cr +\end{aligned} +$$
+$$ +\begin{aligned} + T(n) & =1+\sum_{i=2}^{n}\frac{1}{\lg i}\cr + & = \Omega(\frac{n^2}{\sum_{i=2}^{n}\lg n})\cr + & = \Omega(\frac{n}{\lg n})\cr + T(n) & =O(\sum_{i=2}^{\sqrt{n}-1}\frac{1}{\lg 2}+\sum_{i=\sqrt{n}}^{n}\frac{1}{\lg \sqrt{n}})\cr + & = O(\sqrt{n}+\frac{n}{\lg n})\cr + T(n) & = \Theta(n)\cr +\end{aligned} +$$
+depth: $\lg\lg n+1$, leaves: $n$
+total cost of over all nodes at depth $i$, for $i=0,1,...,\lg \lg n-1$, is n
+$$ +\begin{aligned} + T(n)=\Theta(n\lg\lg n)\cr +\end{aligned} +$$
@@ -1525,7 +1846,7 @@$$ +\begin{aligned} + z+z\mathcal{F}(z)+z^2\mathcal{F}(z) & =z+z\sum_{i=0}^{\infty}F_iz^i + z^{2}\sum_{i=0}^{\infty}F_iz^i\cr + & = z+\sum_{i=1}^{\infty}F_{i-1}z^i + \sum_{i=2}^{\infty}F_{i-2}z^i\cr + & = z+F_{0}z^1 + \sum_{i=2}^{\infty}(F_{i-2}+F_{i-1})z^i\cr + & = z+0 + \sum_{i=2}^{\infty}F_{i}z^i\cr + & =\sum_{i=0}^{\infty}F_{i}z^i\cr + & =\mathcal{F}(z)\cr +\end{aligned} +$$
+$$ +\begin{aligned} + &\mathcal{F}(z)=z+z\mathcal{F}(z)+z^2\mathcal{F}(z)\cr + \implies & \mathcal{F}(z) = \frac{z}{1-z-z^2}\cr + & \phi\hat{\phi}=-1;\phi + \hat{\phi}=1;\phi - \hat{\phi}=\sqrt{5}\cr + \implies & \mathcal{F}(z) = \frac{z}{1-(\phi + \hat{\phi})z-(-\phi\hat{\phi})z^2}\cr + \implies & \mathcal{F}(z) = \frac{z}{(1-\phi z)(1-\hat\phi z)}\cr + \implies & \mathcal{F}(z) = \frac{1}{\sqrt{5}}\frac{(\phi - \hat{\phi}) z}{(1-\phi z)(1-\hat\phi z)}\cr + \implies & \mathcal{F}(z) = \frac{1}{\sqrt{5}}(\frac{1}{1-\phi z}-\frac{1}{1-\hat\phi z})\cr +\end{aligned} +$$
+$$ +\begin{aligned} + \sum_{i=0}^{\infty}\frac{1}{\sqrt{5}}(\phi^{i}-\hat{\phi}^i)z^i & = \sum_{i=0}^{\infty}\frac{1}{\sqrt{5}}(\phi z)^i - \sum_{i=0}^{\infty}\frac{1}{\sqrt{5}}(\hat{\phi}z)^i\cr + & = \frac{1}{\sqrt{5}}(\frac{1}{1-\phi z}-\frac{1}{1-\hat{\phi} z})\cr + & = \mathcal{F}(z)\cr +\end{aligned} +$$
+$$ +\begin{aligned} + F_{i} & =\frac{1}{\sqrt{5}}(\phi^{i}-\hat{\phi}^i)\cr + & = \frac{\phi^{i}}{\sqrt{5}}-\frac{\hat{\phi}^i}{\sqrt{5}}\cr + & \because |\hat{\phi}^i|<1 \therefore |\hat{\phi}^i/\sqrt{5}|<0.5\cr + \implies & F_{i}=round(\frac{\phi^{i}}{\sqrt{5}})\cr +\end{aligned} +$$
+$$ +\begin{aligned} + F_{2} & =1\geq\phi^{0}=1\cr + F_{3} & =2\geq\phi^{1}=\frac{1+\sqrt{5}}{2}\cr + F_{i+2} & = F_{i+1}+F_{i}\cr + & \geq \phi^{i-1}+\phi^{i-2}\cr + & =\phi^{i-2}(\phi+1)\cr + & =\phi^{i-2}(\phi^2)\cr + & = \phi^{i}\cr +\end{aligned} +$$
@@ -1540,7 +1720,7 @@-Professor Diogenes has n supposedly identical integrated-circuit chips that in principle are capable of testing each other. The professor’s test jig accommodates two chips at a time. When the jig is loaded, each chip tests the other and reports whether it is good or bad. A good chip always reports accurately whether the other chip is good or bad, but the professor cannot trust the answer of a bad chip. Thus, the four possible outcomes of a test are as follows:
+Professor Diogenes has $n$ supposedly identical integrated-circuit chips that in principle are capable of testing each other. The professor’s test jig accommodates two chips at a time. When the jig is loaded, each chip tests the other and reports whether it is good or bad. A good chip always reports accurately whether the other chip is good or bad, but the professor cannot trust the answer of a bad chip. Thus, the four possible outcomes of a test are as follows: