a1q1.tex 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. \documentclass[11pt]{article}
  2. \usepackage{amsthm,amsmath,amsfonts,amssymb}
  3. \usepackage[ruled,noline,noend]{algorithm2e}
  4. \usepackage[margin=1in]{geometry}
  5. \usepackage{enumerate}
  6. %%% Update the following commands with your name, ID, and acknowledgments.
  7. \newcommand{\YourName}{Tareef Dedhar}
  8. \newcommand{\YourStudentID}{20621325}
  9. \newcommand{\YourAck}{This question was completed only with the teachings from CS courses here at uWaterloo.}
  10. \newenvironment{solution}{\paragraph{Solution.}}{}
  11. \title{
  12. \vspace{-0.8in} \normalsize
  13. \begin{flushright} \YourName \\ \YourStudentID \end{flushright}
  14. \rule{\textwidth}{.5pt}\\[0.4cm] \huge Assignment 1: Question 1 \\
  15. \rule{\textwidth}{2pt}
  16. \vspace{-1in}
  17. }
  18. \date{}
  19. \begin{document}
  20. \maketitle
  21. \paragraph{Acknowledgments.} \YourAck
  22. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  23. \section*{Asymptotics}
  24. Prove or disprove each of the following statements.
  25. \begin{enumerate}[(a)]
  26. \item For any constant $b > 0$, the function $f : n \mapsto 1 + b + b^2 + b^3 + \cdots + b^n$ satisfies
  27. \[
  28. f(n) = \begin{cases}
  29. \Theta(b^n) & \mbox{if } b > 1 \\
  30. \Theta(1) & \mbox{if } b \le 1.
  31. \end{cases}
  32. \]
  33. \begin{solution}
  34. Since f(n) is a geometric series, we can express it as $\sum_{i=1}^{n} {b^i}$ = $\frac{1 - {b^N}}{1 - b}$ = $\frac{{b^n} - 1}{b - 1}$
  35. Using this:\\
  36. When b=1: $\lim{n\to\infty}{\dfrac{\tfrac{{b^n} - 1}{b - 1}}{b^n}}$=$\frac{{b^n} - 1}{{b^{n+1}} - b}$, which, by :'Hopital's rule = $1 \div b$. Since $0 \lt 1 \div b \lt \infty$ , we have a \theta bound.
  37. \end{solution}
  38. \item For every pair of functions $f, g : \mathbb{Z}^+ \to \mathbb{R}^{\ge 1}$ that satisfy $f = \Theta(g)$, the functions $F : n \mapsto 2^{f(n)}$ and $G : n \mapsto 2^{g(n)}$ also satisfy $F = \Theta(G)$.
  39. \begin{solution}
  40. (ENTER YOUR SOLUTION HERE.)
  41. \end{solution}
  42. \item For every pair of functions $f, g : \mathbb{Z}^+ \to \mathbb{R}^{\ge 1}$ that satisfy $f = o(g)$, the functions $F : n \mapsto 2^{f(n)}$ and $G : n \mapsto 2^{g(n)}$ also satisfy $F = o(G)$.
  43. \begin{solution}
  44. (ENTER YOUR SOLUTION HERE.)
  45. \end{solution}
  46. \end{enumerate}
  47. \end{document}