Tutorials › Statistical Theory I - Probability and Distribution Theory › A Variable Cannot Be Independent of Its Own Nonconstant Function

Independence and Dependence · Tutorial 245 of 994

A Variable Cannot Be Independent of Its Own Nonconstant Function

Use shared events to prove dependence between a finite-support random variable and any function that varies across its possible values.

Intermediate 10 min read

What You'll Learn

  • State the finite-support condition needed for the dependence result
  • Prove that a nontrivial event determined by both variables rules out independence
  • Check dependence directly using probabilities from a joint distribution
  • Distinguish a function that varies on the support from one that only varies elsewhere
  • Recognize why a constant function of a random variable is independent of it

Introduction

A random variable and a function of that same variable share the same underlying outcome. If the function distinguishes between possible values of the original variable, that shared information prevents independence. This conclusion does not require a complicated calculation of every joint probability: one suitably chosen event is enough.

The condition matters. A function might vary over its entire domain but take just one value on the values the random variable can actually attain. In that case the function of the random variable is constant, and the dependence conclusion does not apply. We will make this distinction precise and use discrete examples to see both situations.

Setup and Definitions

Definition: The support of a finite-support random variable \(X\) is the finite set \(S=\{x:P(X=x)>0\}\). A function \(g\) is nonconstant on the support of \(X\) if there are \(x_1,x_2\in S\) such that \(g(x_1)\ne g(x_2)\). The transformed random variable is \(Y=g(X)\). We assume \(g\) is measurable, so \(Y\) is a random variable.

Independence of \(X\) and \(Y\) means that for every pair of measurable sets \(A\) and \(B\), \(P(X\in A,\;Y\in B)=P(X\in A)P(Y\in B)\). In the finite examples below, it is enough to check particular events: finding even one pair for which this equality fails proves dependence.

A Shared-Event Principle

The basic mechanism is that some event can be described using \(X\) alone and also using \(Y=g(X)\) alone. If that event has probability strictly between zero and one, independence would require it to be independent of itself, which is impossible.

Lemma: Suppose \(X\) and \(Y\) are independent random variables. If an event \(E\) belongs to both \(\sigma(X)\) and \(\sigma(Y)\), then \(P(E)\) is either zero or one. Here \(\sigma(X)\) denotes the events determined by \(X\), and likewise for \(\sigma(Y)\).

Proof. Since \(E\) is determined by each variable and \(X,Y\) are independent, the events \(E\in\sigma(X)\) and \(E\in\sigma(Y)\) are independent. Applying the definition of independence to this pair of events gives

$$ P(E)=P(E\cap E)=P(E)P(E)=P(E)^2. $$

The equation \(p=p^2\) for \(p=P(E)\in[0,1]\) has only the solutions \(p=0\) and \(p=1\). Therefore \(P(E)\) must be zero or one. \(\square\)

Main Result

Theorem: Let \(X\) be a random variable with finite support \(S\), and let \(g\) be measurable. If \(g\) is nonconstant on \(S\), then \(X\) and \(g(X)\) are not independent.

Proof. Because \(g\) takes at least two different values on \(S\), choose one value \(c\in g(S)\) such that at least one point of \(S\) maps to \(c\), while at least one other point maps to a value different from \(c\). Define

$$ E=\{g(X)=c\}. $$

This event is determined by \(X\), since \(E=\{X\in\{x:g(x)=c\}\}\). It is also determined by \(Y=g(X)\), since \(E=\{Y=c\}\). Thus \(E\) belongs to both \(\sigma(X)\) and \(\sigma(Y)\).

At least one support point maps to \(c\), and every support point has positive probability, so \(P(E)>0\). At least one support point maps elsewhere, so \(P(E)<1\). If \(X\) and \(Y\) were independent, the lemma would force \(P(E)\) to be zero or one. This contradiction proves that they are dependent. \(\square\)

The finite-support assumption makes the relevant values and events especially transparent. The proof's central condition is that \(g(X)\) has a level event with probability strictly between zero and one. For finite support, nonconstancy on the support guarantees such an event.

Worked Discrete Examples

Worked Example: A Bernoulli Variable and Its Identity Function

Let \(X\sim\operatorname{Bernoulli}(0.3)\), so \(P(X=1)=0.3\) and \(P(X=0)=0.7\), and set \(Y=g(X)=X\). Check whether \(X\) and \(Y\) are independent.

The function \(g(x)=x\) takes different values at the two support points, so the theorem already implies dependence. We can verify it from the definition. For the events \(A=\{X=1\}\) and \(B=\{Y=1\}\), \(A\) and \(B\) are the same event. Hence

$$ P(X=1,Y=1)=0.3,\qquad P(X=1)P(Y=1)=0.3(0.3)=0.09. $$

Since \(0.3\ne0.09\), the independence equality fails. In particular, copying a nondegenerate random variable does not create an independent variable.

Worked Example: A Threshold Function

Suppose \(X\) takes values \(0,1,2\) with probabilities \(0.2,0.5,0.3\), respectively, and define \(Y=\mathbf{1}\{X\geq1\}\), where the indicator is one when its condition holds and zero otherwise. Determine whether \(X\) and \(Y\) are independent.

The event \(Y=1\) is exactly the event \(X\geq1\), so

$$ P(Y=1)=P(X=1)+P(X=2)=0.5+0.3=0.8. $$

Use \(A=\{X\geq1\}\) and \(B=\{Y=1\}\). These are the same event, so their intersection also has probability \(0.8\). But the product of their probabilities is

$$ P(A)P(B)=0.8(0.8)=0.64. $$

Because \(P(A\cap B)=0.8\ne0.64=P(A)P(B)\), \(X\) and \(Y\) are dependent. Here the function does not preserve every value of \(X\), but it still separates the support into two nonempty groups, producing a nontrivial shared event.

Worked Example: A Many-to-One Function Still Gives Dependence

Let \(X\) be uniform on \(\{-1,0,1\}\), and define \(Y=X^2\). The function sends both \(-1\) and \(1\) to \(1\), so it is not one-to-one. Are \(X\) and \(Y\) independent?

The support probabilities are \(P(X=-1)=P(X=0)=P(X=1)=1/3\). Since \(Y=0\) exactly when \(X=0\),

$$ P(Y=0)=\frac{1}{3},\qquad P(X=0,Y=0)=\frac{1}{3}. $$

If \(X\) and \(Y\) were independent, the last probability would instead equal

$$ P(X=0)P(Y=0)=\frac{1}{3}\cdot\frac{1}{3}=\frac{1}{9}. $$

The probabilities differ, so the variables are dependent. The fact that two support points are merged by \(g\) does not remove the shared information: the event \(Y=0\) still identifies the event \(X=0\).

Why the Support Condition Matters

The phrase “nonconstant function” must be interpreted relative to the values \(X\) can actually take. For example, define \(g(x)=x(3-x)\), which is not a constant function on the real line. If \(X\) takes values only in \(\{1,2\}\), then \(g(1)=2\) and \(g(2)=2\). Consequently \(g(X)=2\) with probability one. The function varies elsewhere, but it does not vary on the support of \(X\).

A constant random variable is independent of every random variable. Indeed, if \(Y=c\) with probability one, then for any measurable sets \(A,B\), if \(c\in B\),

$$ P(X\in A,Y\in B)=P(X\in A)=P(X\in A)P(Y\in B), $$

because \(P(Y\in B)=1\). If \(c\notin B\), both sides of the independence equality are zero. Thus the support condition in the theorem rules out precisely this kind of exception.

Common Mistake

Incorrect reasoning: “\(g\) is a nonconstant formula, so \(X\) and \(g(X)\) must be dependent.” This overlooks the possibility that \(X\) never takes values where the formula changes. In the example \(X\in\{1,2\}\) and \(g(x)=x(3-x)\), the formula is nonconstant on its domain, but \(g(X)\) is constant.

Correction: Check whether \(g\) takes different values on the positive-probability support of \(X\). If it does, the theorem proves dependence. If it does not, then \(g(X)\) is constant with probability one, and it is independent of \(X\). The distinction is about the distribution of \(X\), not about how \(g\) behaves at unattainable inputs.

Key takeaway: For finite-support \(X\), if \(g\) separates even two possible values of \(X\), some nontrivial event is determined by both \(X\) and \(g(X)\). Such an event cannot be independent of itself, so \(X\) and \(g(X)\) cannot be independent.

Check Your Understanding

For each question, focus on the values that have positive probability.

  1. If \(X\) takes values \(2\) and \(5\) with positive probability and \(Y=3X+1\), which event can be used to show that \(X\) and \(Y\) are dependent?
  2. Suppose \(X\) has support \(\{0,1,2,3\}\) and \(g(x)=\mathbf{1}\{x\text{ is even}\}\). Why does the theorem apply?
  3. Can a nonconstant function on the real line produce a constant \(g(X)\)? Give a finite-support example.
  4. State the shared-event lemma and explain why its conclusion contradicts an event having probability strictly between zero and one.
  5. If \(g(X)\) is constant with probability one, is it independent of \(X\)? Justify your answer using the definition of independence.