# Combination of 2 random variables that is perfectly correlated with another random variable

I'd appreciate some pointers for the following question: Given 3 random variables $X_i$, $i = 1, 2, 3$ such that none of them have a pairwise correlation of $+1$ or $−1$. Can we find a combination of $X_1$ and $X_2$ that has a correlation of $+1$ with $X_3$?

-

This is going to depend on the nature of the underlying relationships amongst these variables. BTW, is this homework? If so, please edit to add the homework tag. – gung Oct 21 '12 at 21:23

## 1 Answer

Yes, it's possible, but not likely to occur in real life. An artificial example

````x1 <- rnorm(100)
x2 <- rnorm(100)
x3 <- x1+x2
cor(x1, x2)
cor(x1, x3)
cor(x2, x3)
````

and, of course, since `x3 = x1 + x2`, the correlation between `(x1 + x2)` and `x3` is 1.0.

If you had specified that the three variables are independent, I don't think it's possible, but I am not 100% sure.

-

4
If $X_1$ and $X_2$ are uncorrelated with $X_3$, the linear combination $aX_1+bX_2$ is uncorrelated with $X_3$ since covariance is bilinear. – Douglas Zare Oct 21 '12 at 11:02
The question didn't say $X_1$ and $X_2$ were uncorrelated with $X_3$, just that the correlations weren't 1.0 or -1.0. – Peter Flom Oct 21 '12 at 11:13
Yes, I was referring to your last line, which talks about what might happen if the variables are pairwise independent, hence uncorrelated. – Douglas Zare Oct 21 '12 at 11:26
Oh, sorry. Cool, thanks for that. That was my intuition, but it's nice to know I was right. :-). – Peter Flom Oct 21 '12 at 11:30
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 16, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9611327052116394, "perplexity_flag": "middle"}