Suppose X is a random variable and Y = aX + b is a linear function of X. Show that the correlation of X and Y is -1 if a < 0.

cor(X,Y) = cov(X,V)/ sqrt(var(X)*var(Y))

To show that the correlation of X and Y is -1 when a < 0, we need to calculate the covariance between X and Y and the variances of X and Y.

First, let's calculate the covariance between X and Y:
cov(X, Y) = cov(X, aX + b)
Since covariance is linear, we can expand this expression:
cov(X, Y) = cov(X, aX) + cov(X, b)
Since b is a constant, cov(X, b) = 0 because the covariance between a constant and a random variable is zero.
cov(X, Y) = cov(X, aX)
Using the property that cov(aX, bY) = ab * cov(X, Y), we have:
cov(X, Y) = a * cov(X, X)
Since the covariance of a variable with itself is its variance, we can rewrite this expression as:
cov(X, Y) = a * var(X)

Next, let's calculate the variances of X and Y:
var(X) = cov(X, X)
var(Y) = cov(Y, Y)

Since Y = aX + b, we can express Y in terms of X:
Y = aX + b
=> Y - b = aX
=> X = (1/a)(Y - b)
Note that a < 0, which means 1/a > 0.

Now, let's substitute this expression into the variance of X:
var(X) = cov(X, X)
= cov((1/a)(Y - b), (1/a)(Y - b))
= (1/a)^2 * cov(Y - b, Y - b)
= (1/a)^2 * var(Y - b)

By substituting the values we derived for the covariance and variances back into the correlation formula, we have:
cor(X, Y) = cov(X, Y) / sqrt(var(X) * var(Y))
= (a * var(X)) / sqrt(var(X) * var(Y))
= a / sqrt(var(Y - b) * var(Y))

Since a < 0, we can see that a is negative. Therefore, the correlation coefficient will be negative because the numerator is negative. Hence, when a < 0, the correlation of X and Y is -1.