Recall the example from tutorial where we had X = # of heads after two coins are flipped. The probability that there is exactly one head facing up when the two coins land is P(X = 1) = 1/2. The sample space is { HH, HT, TH, TT } and each has probability 1/4 of occurring. Hence E[X] is 1/4 x 2 + 1/4 x 1 + 1/4 x 1 + 1/4 x 0 = 1. In tutorial we went over why in an array A = A[1], A[2], ..., A[n], which is equally likely to contain any permutation of {1,..., n}, the probability that A[i] is the largest amongst the elements A[1], A[2], ..., A[i] is just 1/i. After class however, some of you mentioned that although you understood this, you were unclear why the expected value E[Xi] of the random variable Xi is 1/i, where Xi = 1 if A[i] is the largest element in A[1], ... , A[i], and 0 otherwise. To see this we can simply invoke the definition of the expectation of a random variable: E[Xi] = sum of x * P(Xi = x) where x takes on all values in the range of Xi, which is just {0 , 1}. So E[Xi] = 0*P(Xi = 0) + 1*P(Xi = 1) = P(Xi = 1) = 1/i. Then, as shown in tutorial: E[total_number_of_assignments] = E[X1 + ... + Xn] = E[X1] + ... + E[Xn] (by linearity of expectation) = 1 + 1/2 + ... + 1/n. Recall from tutorial that Xi is a random variable and hence is a function from the sample space (the set of permutations of {1,...,n}) to {0,1}. Let's look at the special case where n=3 and i=2. We have that X2(1,2,3) = 1 X2(1,3,2) = 1 X2(2,1,3) = 0 X2(2,3,1) = 1 X2(3,1,2) = 0 X2(3,2,1) = 0 Note that X2 = 1 in exactly 1/2 of the cases so P(X2 = 1) = 1/2 = 1/i.