{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

homework1

homework1 - Problem Set 1 Due date Monday at 4pm before...

This preview shows pages 1–2. Sign up to view the full content.

Problem Set 1 September 14, 2009 Due date: Monday, September 28 2009 at 4pm; before class. Exercise 1: (20 points) Some years ago, greek video-club chain Seven had the following offer to their customers: every time a customer rented a DVD, he was given a random coupon with the title of the Academy awards (Oscars) winner movie written on it. The first person to gather the coupons with all the unique winner-movie titles won a 10-day vacation on a Carribean island. If at that time, there were 75 unique such titles, and these titles were uniformly assigned to coupons, find the expected number of DVDs one had to rent in order to gather all of them. (No-credit question: when was the competition held?). Exercise 2: (20 points) Assume an array of n numbers X = { x 1 , ..., x n } . Write the pseudocode of an algorithm that computes the mean and the variance of the numbers by making a single pass over the data and using O (1) storage space. Recall that given X , the mean of X is given by x = 1 n n i =1 x i , and the variance of X is given by var ( X ) = 1 n n i =1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 2

homework1 - Problem Set 1 Due date Monday at 4pm before...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online