Linear Dependence between Two Bernoulli Random Variables

The Pearson correlation coefficient, denoted , is a measure of the linear dependence between two random variables, that is, the extent to which a random variable can be written as , for some and some . This Demonstration explores the following question: what correlation coefficients are possible for a random vector , where is a Bernoulli random variable with parameter and is a Bernoulli random variable with parameter ? Interestingly, a two-dimensional Bernoulli random vector has a correlation coefficient that is constrained by the choices of and .


  • [Snapshot]
  • [Snapshot]
  • [Snapshot]


For the sake of simplicity, you are constrained to choose and that are slightly bounded away from 0 and 1.
In the upper left-hand corner, there is a possible joint distribution of that accommodates your choices of , , and . Additionally, at the bottom is shown (with a red line) the linear correlation coefficients that are attainable for fixed choices of and . The basic lesson is clear: it is not possible to couple together two arbitrary Bernoulli random variables in such a way that any conceivable linear correlation coefficient is attained. Notice that choosing maximizes the range of possible values of .
For a two-dimensional random vector , where both and are discrete random variables, finding a joint probability distribution that triggers a particular linear correlation coefficient is equivalent to solving a system of linear equations. It is not surprising, then, that sometimes this system of linear equations has no solution, a unique solution, or infinitely many solutions.
If in the -dimensional random vector the are Gaussian, then finding a joint probability distribution with a particular variance-covariance matrix (and, therefore, particular pairwise linear correlation coefficients between the coordinates of the -dimensional random vector) also happens to be equivalent to solving a system of linear equations. This fact is true for any elliptical distribution as well, that is, a distribution with a density function whose constant curves are ellipsoids. In general, however, the dependence between two or more random variables cannot be captured by a single number.
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.

Mathematica »
The #1 tool for creating Demonstrations
and anything technical.
Wolfram|Alpha »
Explore anything with the first
computational knowledge engine.
MathWorld »
The web's most extensive
mathematics resource.
Course Assistant Apps »
An app for every course—
right in the palm of your hand.
Wolfram Blog »
Read our views on math,
science, and technology.
Computable Document Format »
The format that makes Demonstrations
(and any information) easy to share and
interact with.
STEM Initiative »
Programs & resources for
educators, schools & students.
Computerbasedmath.org »
Join the initiative for modernizing
math education.
Step-by-Step Solutions »
Walk through homework problems one step at a time, with hints to help along the way.
Wolfram Problem Generator »
Unlimited random practice problems and answers with built-in step-by-step solutions. Practice online or make a printable study sheet.
Wolfram Language »
Knowledge-based programming for everyone.
Powered by Wolfram Mathematica © 2017 Wolfram Demonstrations Project & Contributors  |  Terms of Use  |  Privacy Policy  |  RSS Give us your feedback
Note: To run this Demonstration you need Mathematica 7+ or the free Mathematica Player 7EX
Download or upgrade to Mathematica Player 7EX
I already have Mathematica Player or Mathematica 7+