If (x,y) is the value of the random vector (X,Y) and is uniformly distributed over the triangle with vertices (0,0), (0,1), (1,0) how do I calculate the correlation between X and Y??????

This is such a cute little problem that I would love to just solve it for you. But you are supposed to be learning this stuff, not me. So let's use the socratic method.

Can you write down an expression for COV(X,Y)? It doesn't matter if you don't know how to evaluate the expression yet. Just start with the definition.

I was getting -1/12 for the covariance and -1 for the correlation. Although I was having issues with my bounds for integration- I was going 0 to 1 for X and 1-x to 1 for Y. That does not make sense to me. Any help on the bounds? I was using xy dx dy as the integrand

I was going 0 to 1 for X and 1-x to 1 for Y. That does not make sense to me. Any help on the bounds? I was using xy dx dy as the integrand

If you're using a variable in your limits of integration for Y then you need to do the integration for Y first. Also: Clearly 1-x is one of the limits for Y. But consider a fixed point x and then figure out the region you're integrating for Y. Does that seem right? The appropriate change should hopefully be clear.

My initial bounds were 0 (lower bound) and 1-x (upper bound).
Then EXY=1/12 and my correlation is -2, which is clearly wrong. I must be missing something.
thanks again!

oh and my integrand is (2 xy dx dy). Maybe I have this wrong.

Your end product of the correlation is fine. But what you're getting for the variance doesn't add up to me. I think it should actually be 3/54.

I'm not recommending simulation as a way to get past theory. But I will recommend it as a way to check answers. For example in R you could simulate data from this distribution through a relatively simple rejection sampling algorithm. Then you could calculate the sample means, variances, covariance, and correlation and see if they are close to what you get theoretically. For example:

Code:

> # Simulate a single value
> gen <- function(){
+ repeat{
+ x <- runif(1)
+ y <- runif(1)
+ if(y <= 1-x){
+ return(c(x,y))
+ }
+ }
+ }
>
> # Get a large sample from the distribution
> tmp <- replicate(100000, gen())
>
> # I like the data to be stacked nice
> tmp <- t(tmp)
>
> #Get the sample means
> mean(tmp[,1])
[1] 0.3337302
> mean(tmp[,2])
[1] 0.3338301
>
> # Get the variances and covariances
> var(tmp)
[,1] [,2]
[1,] 0.05555359 -0.02784043
[2,] -0.02784043 0.05543795
>
> # Get the correlation
> cor(tmp)
[,1] [,2]
[1,] 1.0000000 -0.5016679
[2,] -0.5016679 1.0000000