diff options
Diffstat (limited to 'main.tex')
-rw-r--r-- | main.tex | 51 |
1 files changed, 35 insertions, 16 deletions
@@ -552,12 +552,12 @@ For the right hand side; we can start by picking $n_{0} = 1$ and $c = 1$ in the | |||
552 | 552 | ||
553 | In order to prove the right hand side of the inequality; we can pick $c_2 > 2$ which equals; | 553 | In order to prove the right hand side of the inequality; we can pick $c_2 > 2$ which equals; |
554 | 554 | ||
555 | \begin{eqnarray*}% | 555 | \begin{align*}% |
556 | \label{eq:c2gt2} | 556 | \label{eq:c2gt2} |
557 | f(n) + g(n) \le 2 \cdot f(n) \\ | 557 | f(n) + g(n) &\le 2 \cdot f(n) \\ |
558 | \cancel{f(n)} + g(n) \le \cancel{2 \cdot} f(n) \\ | 558 | \cancel{f(n)} + g(n) &\le \cancel{2 \cdot} f(n) \\ |
559 | g(n) \le f(n) | 559 | g(n) &\le f(n) |
560 | \end{eqnarray*} | 560 | \end{align*} |
561 | 561 | ||
562 | Which we proved above using Equation~\ref{eq:a_little_o}. This conjecture is \emph{true}. | 562 | Which we proved above using Equation~\ref{eq:a_little_o}. This conjecture is \emph{true}. |
563 | 563 | ||
@@ -589,8 +589,7 @@ Which we proved above using Equation~\ref{eq:a_little_o}. This conjecture is \em | |||
589 | 589 | ||
590 | Hence $f(n) = \mathcal{O}(n^{2})$ and $H=2$. | 590 | Hence $f(n) = \mathcal{O}(n^{2})$ and $H=2$. |
591 | 591 | ||
592 | % TODO: reread proof, strengthen? <06-11-20, yigit> % | 592 | (2) $L=2$. We can pick the constant $c = \frac{1}{2}$ and write the Big-$\Omega$ notation; |
593 | (2)$L=2$. We can pick the constant $c = \frac{1}{2}$ and write the Big-$\Omega$ notation; | ||
594 | 593 | ||
595 | \begin{gather*} | 594 | \begin{gather*} |
596 | c > 0 ~ \text{and} ~ n_{0} \ge 0 \\ | 595 | c > 0 ~ \text{and} ~ n_{0} \ge 0 \\ |
@@ -601,21 +600,41 @@ Hence $f(n) = \mathcal{O}(n^{2})$ and $H=2$. | |||
601 | 600 | ||
602 | Does a $L>2$ work? Pick any $\ell > 2$; | 601 | Does a $L>2$ work? Pick any $\ell > 2$; |
603 | 602 | ||
604 | \begin{gather*} | 603 | \begin{align*} |
605 | c > 0 ~ \text{and} ~ n_{0} \ge 0 \\ | 604 | c > 0 ~ \text{and} ~ n_{0} &\ge 0 \\ |
606 | \frac{n(n+1)}{2} \ge \frac{1}{2} n^{\ell} \\ | 605 | \frac{n(n+1)}{2} &\ge \frac{1}{2} n^{\ell} \\ |
607 | \frac{n(n+1)}{\cancel{2}} \ge \frac{1}{\cancel{2}} n^{\ell} \\ | 606 | \frac{n(n+1)}{\cancel{2}} &\ge \frac{1}{\cancel{2}} n^{\ell} \\ |
608 | n(n+1) \ge n^{\ell} \\ | 607 | n(n+1) &\ge n^{\ell} \\ |
609 | n+1 \ge n^{\ell - 1} \\ | 608 | n+1 &\ge n^{\ell - 1} \\ |
610 | 1 \ge n(n^{\ell - 2} - 1) | 609 | 1 &\ge n(n^{\ell - 2} - 1) |
611 | \end{gather*} | 610 | \end{align*} |
612 | 611 | ||
613 | The final equation does not hold $n>1$ so $L>2$ cannot be true. | 612 | The final equation does not hold for $n>1$ or the assumed $\ell > 2$ so $L>2$ cannot be true. |
614 | 613 | ||
615 | \begin{info}[] | 614 | \begin{info}[] |
616 | $f(n) = \sum^{\lceil{\log{n}}\rceil}_{k=0} \frac{n}{2^{k}}$ | 615 | $f(n) = \sum^{\lceil{\log{n}}\rceil}_{k=0} \frac{n}{2^{k}}$ |
617 | \end{info} | 616 | \end{info} |
618 | 617 | ||
618 | It's beneficial to unpack the infinite sum beforehand; | ||
619 | |||
620 | \begin{align*} | ||
621 | f(n) &= \sum^{\lceil{\log{n}}\rceil}_{k=0} \frac{n}{2^{k}}\\ | ||
622 | &= \frac{n}{2^{0}} + \frac{n}{2^{1}} + \frac{n}{2^{2}} + \dots + \frac{n}{2^{\lceil{\log{n}}\rceil}} \\ | ||
623 | &= n \Big(1 + \frac{1}{2^{1}} + \frac{1}{2^{2}} + \dots + \frac{1}{2^{\lceil{\log{n}}\rceil}} \Big) \\ | ||
624 | \end{align*} | ||
625 | |||
626 | The infinite sum approaches 1 as $\lceil{\log n\rceil} \rightarrow \infty$, giving us; | ||
627 | |||
628 | \begin{equation*} | ||
629 | f(n) = 2 \cdot n \\ | ||
630 | \end{equation*} | ||
631 | |||
632 | Finally, $H = L = 1$ since $f(n)$ is $\Theta(n)$. Borrowing the Big-$\Theta$ notation from Equation~\ref{eq:a_big_theta} for $c_1 = 1$ and $c_2 = 2$; | ||
633 | |||
634 | \begin{equation*} | ||
635 | n \le f(n) \le 2n | ||
636 | \end{equation*} | ||
637 | |||
619 | \begin{info}[] | 638 | \begin{info}[] |
620 | $f(n) = n(\log n)^{2}$ | 639 | $f(n) = n(\log n)^{2}$ |
621 | \end{info} | 640 | \end{info} |