Homework II

Due Monday, October 15

Problem 1:

Consider the trick coin example in Sec. 3.9, generalized a bit, so that one coin has probability p of heads and the other has probability q. (Do NOT assume p+q = 1.) We choose a coin at random from the box, and toss it n times, resulting in Y heads. Find Var(Y), using the Law of Total Variance (required). You MUST state what your X is.

Problem 2:

Consider the committee/gender example in this supplement to the book. Find Var(D) in two ways:

Even though indicator random variables often make for a nice shortcut, in this case that approach may be a bit harder. However, it will give you excellent practice with the properties of covariance.

In your writeup of the analysis using indicator random variables, use stacked equations with reasons in parentheses, as in (5.68)-(5.70).

Problem 3:

Assume the same setting as in the disk seek time example on p.116, except for the following: In 20% of the disk access requests, the requested sector is in the same track as the last access; in the remaining 80%, the new track is uniformly distributed on [0,1]. Find Var(seek). Verify using R simulation.

Problem 4:

Using transforms (required), show that the generating function, evaluated at s, of the negative binomial distribution with parameters r and p is {ps/[1-s(1-p)]}r.

Problem 5:

We'll be starting to use matrices more, so this problem will help you review your matrix algebra.

Suppose A is an invertible matrix, and u and v are column vectors. Show that

(A+uv')-1 = A-1 - c A-1 uv' A-1

where c = 1/(1+v'A-1u).

Also, write an R function matupdate(), with arguments amat (the matrix A), u and v (the vectors u and v), that computes the new inverse as above and returns it. Generate a large test case, then run timings of this fast method versus the from-scratch method, using R's system.time() function.

This an "update formula." Say we have a matrix A and have already computed its inverse, but then A is altered by adding uv' to it. This formula then shows us how to compute the new inverse by updating the old one--avoiding computing the new inverse from scratch. This is very useful in statistical regression, for instance.

The derivation consists of multiplying the right-hand side of the claimed equation by A+uv'. The rest is just some careful matrix-algebraic manipulations, thereby giving you review of same. Feel free to use the Web here, as this is a famous equation; just be sure to give proper attribution.

Hint: First show that A-1 uv' A-1 uv' = v'A-1u A-1 uv'. To do this, note that v'A-1u is a scalar, and thus can be factored out from a matrix product.