Texts: For this assignment, write out solutions for the following problems and submit your solutions on Canvas. You may submit a plain text file with typed solutions or an image of handwritten solutions.
1) (G & T): An evil king has n bottles of wine, and a spy has just poisoned one of them. Unfortunately, the king does not know which bottle was poisoned. The poison is very deadly but slow-acting; a single drop in a bottle of wine will kill anyone tasting it, but only after one month. By assigning n tasters, one to each bottle, the king can know which bottle is poisoned after one month. Design a scheme that allows him to determine the poisoned bottle within one month but with many fewer tasters, and characterize the number of tasters needed as a function of n. With your scheme, what are the smallest, largest, and average number of tasters who will be poisoned on the job?
2) Prove that the selection sort algorithm given in the notes (page 3-17) is correct, or prove that it is incorrect.
3) Use induction to prove that 2 = n(n+1)(2n+1)/6 for n ≥ 1.
4) Prove that if f(n) = O(g(n)) and h(n) = O(k(n)), then f(n) + h(n) = O(max(g(n), k(n))).
5) Rank the following functions by order of growth, indicating if O or Θ applies to each pair: 2^n, 4n, log2 n, n^3, √n, 6n log n, 4 log n, 1/n, log log n, √(n).