CPSC 413: Assignment 2 Solutions
1. A biologist is looking at n samples of DNA. Finding the exact DNA
code for each sample is quite a slow process. However, all the biologist wants to know is whether at least half the samples come from the
same animal. He
Solution to Quiz 2
8 October 2010
Let denote the n items with i1 , . . . , in . Each item ik , has three parameters assigned to it, (cik , pik , wik )
where cik denotes the time required for constructing the item, pik for painting and wik for wrap
CPSC 413 Fall 2010: Midterm
November 2nd, 2010
No outside aids of any kind are allowed.
You have 1 hour and 15 minutes.
Do not turn this page until you are told to do so.
There are four questions on this exam, and each questio
Quiz 3 Solution
The greedy algorithm would be sorting n items regarding their shipping time (ti) in
Utilizing algorithms such as Merge Sort will cause the algorithm to
CPSC 413: Assignment 1 Solutions
1. (a) Show that if f = O(g), then g = (f ).
If f = O(g), then there is some n0 and c > 0 such that for
all n n0 , f (n) cg(n). Dividing both sides by c then gives
g(n) 1 f (n) for all n0 n, so g = (f ).
(b) Recall that
Algorithm B is an efficient certifier for problem X if:
1) B is a polytime algo that takes 2 input string I (instance of X) and C (a certificate
2) B outputs yes or no
3) There is a polynomial p(n) such that for everything I: I X I