Homework 0, due 9/15 This homework is for us to gauge your background. It will not count for grading, but please do your best. If you claim to find all these problems to be trivial, we'll take your word for it. 1. Nowadays, when Alice receives an email message, the probability is 0.6 that it is spam. Given a spam message, the conditional probability is 0.1 that it contains the word "mortgage". Given a non-spam message, the conditional probability is 0.005 that it contains the word "mortgage". Alice just received yet another message with the word "mortgage". How likely is it spam? 2. Let n be a positive integer. (a) I pick n real numbers, randomly and independently, from the uniform distribution between 0 and 1. What is the probability that the resulting sequence is in non-descending order? (b) If the sequence is not non-descending, I uniformly randomly permute it until it becomes non-descending. How many times do I expect to permute the sequence? (c) Do your answers to (a) and (b) change if I pick the n real numbers from not the *uniform* distribution between 0 and 1 but the *normal* distribution with mean 0 and standard deviation 1? What if I pick n *integers* from the *uniform* distribution between 0 and 1? You may enjoy how the Jargon File defines "bogo-sort": (var.: stupid-sort) The archetypical perversely awful algorithm (as opposed to {bubble sort}, which is merely the generic bad algorithm). Bogo-sort is equivalent to repeatedly throwing a deck of cards in the air, picking them up at random, and then testing whether they are in order. It serves as a sort of canonical example of awfulness. Looking at a program and seeing a dumb algorithm, one might say "Oh, I see, this program uses bogo-sort." Esp. appropriate for algorithms with factorial or super-exponential running time in the average case and probabilistically infinite worst-case running time. Compare {bogus}, {brute force}. A spectacular variant of bogo-sort has been proposed which has the interesting property that, if the Many Worlds interpretation of quantum mechanics is true, it can sort an arbitrarily large array in linear time. (In the Many-Worlds model, the result of any quantum action is to split the universe-before into a sheaf of universes-after, one for each possible way the state vector can collapse; in any one of the universes-after the result appears random.) The steps are: 1. Permute the array randomly using a quantum process, 2. If the array is not sorted, destroy the universe (checking that the list is sorted requires O(n) time). Implementation of step 2 is left as an exercise for the reader. 3. The probability density function for the normal distribution with mean 0 and standard deviation 1 is p(x) = exp(-x^2/2)/sqrt(2pi). Suppose we have n real numbers x[1],...,x[n] that are independently sampled from some normal distribution. What mean and standard deviation for the normal distribution would maximize the probability density of the samples x[1],...,x[n]? Justify your answer.