Show that if the correlation coefficient pXY 1 then Y aX
Solution
I will need to assume that X has nonzero variance, since otherwise the correlation coefficient would be 0/0, which is indeterminate.
 
 We use the following properties of variance and covariance.
 Let r, s, t, and u be constants; let V, W, and Z be random variables (which may or may not also be constants).
 
 1) Var(rV + s) = r^2 Var(V).
 2) Cov(V, V) = Var(V).
 3) Cov(V, r) = Cov(r, V) = 0.
 4) Cov(V, W + Z) = Cov(V, W) + Cov(V, Z).
 5) Cov(V, rW) = Cov(rV, W) = rCov(V, W).
 
 Let p(X, Y) = correlation(X, Y) = Cov(X , Y) / [sqrt(Var(X)) * sqrt(Var(Y))].
 Keeping in mind that a and Var(X) are nonzero, we have
 
 p(X, Y) = p(X, aX + b)
 = Cov(X , aX + b) / [sqrt(Var(X)) * sqrt(Var(aX + b))] from the definition of p(X, Y)
 = [Cov(X, aX) + cov(X, b)] / [sqrt(Var(X)) * sqrt(a^2 Var(X))] from properties 1), 4)
 = [aCov(X, X) + 0] / [sqrt(Var(X)) * sqrt(Var(X)) * sqrt(a^2)] from properties 3), 5)
 = aVar(X) / [Var(X) * |a|] from property 2)
 = a/|a|, since I\'m assuming Var(X) is nonzero
 = +-1, since a is nonzero, a/|a| = a/a = 1 for a > 0, and a/|a| = a/(-a) = -1 for a < 0.
 
 Note that this means that, assuming a and Var(X) are nonzero, p(X, Y) = 1 if and only if a is positive.

