Homework 0 - Problem 1: warmup
This problem has two purposes: (i) makes sure you have the prerequisite background and (ii) makes sure the homework submission system works. This homework will not count towards your grade.
* Required
SUNetID
*
For example, "psl" (this is not your student id number)
Name
Collaborators
(a) [1 point]
If I toss 3 fair coins, what is the probability of getting at least one heads?
(b) [1 point]
If I want to compute the second largest element of a list of n elements, what is the running time of the best algorithm (use big-Oh notation)?
(c) [1 point]
Define $g(n) = \begin{cases} 1 & \text{if } n = 0 \\ n + g(n-1) & \text{otherwise} \end{cases}$. Compute $g(3)$.
(d) [1 point]
What is the dot product of the two vectors $(1, 3, 4)$ and $(1, -3, 2)$?