Two events, A and B, are independent when
\[P(A \textbf{ and } B) = P(A) \times P(B) \]We extend this to define independence of two random variables, X and Y.
Definition
Two random variables, \(X\) and \(Y\), are independent if all events about the value of \(X\) are independent of all events about the value of \(Y\).
This can be simplified considerably for discrete random variables.
Independence of discrete random variables
Two discrete random variables, \(X\), and \(Y\), are independent if and only if
\[ P(X = x \textbf{ and } Y = y) \; = \; P(X=x) \times P(Y=y) \qquad \text{ for all } x \text{ and } y \]When dealing with two or more random variables, we often use subscripts to distinguish between their probability functions. Two subscripts are used when referring to the joint probabilities for the two variables,
\[ p_{X,Y}(x, y) = P(X = x \textbf{ and } Y = y) \]Discrete random variables \(X\) and \(Y\) are therefore independent when
\[ p_{X,Y}(x, y) = p_X(x) \times p_Y(y) \qquad \text{ for all } x \text{ and } y \]Proving independence
In some scenarios, we can argue that variables should be independent because of the way that the experiment was conducted. Otherwise, independence must be checked using the definition before we can be sure that two variables are independent.
To prove independence, it is necessary to show that all combinations of x and y satisfy the relationship, but it is only necessary to find a single combination that does not work to prove that X and Y are not independent.
Question
A couple continue having children, stopping when they either have four children or get a boy, and the probability of each child being a girl is \(\frac {1} {2} \), independently of the genders of previous children.
Are the family size, X, and the number of girls, Y, independent?
(Solved in full version)