# Sum of density functions

Consider four pdf $$f_1(x), \ldots, f_4(x)$$. For any $$x$$, $$f_1(x) \neq \cdots \neq f_4(x)$$. Can we prove that $$f_1(x) + f_2(x) \neq f_3(x) + f_4(x)$$ for some $$x$$?

• My first thought with this sort of thing is usually to consider if I can come up with a counterexample. Have you tried that? You'd be amazed how often it's a productive line to pursue. Commented May 6 at 6:47
• An easy counterexample is the following: let the support of $x$ be $(0,1)$, and $f_k(x)=b_k\mathbb{I}(x\in [0,0.5])+(2-b_k)\mathbb{I}(x\in (0.5,1])$ be piecewise uniform PDFs with $b_k\in (0,2)$. Then if $b_1=3/2, b_2=1/2, b_3=1/4, b_4=7/4$, we have that $f_1(x)\neq f_2(x)\neq f_3(x)\neq f_4(x)$ for all $x\in(0,1)$, but $f_1(x)+f_2(x)=f_3(x)+f_4(x)=2$ for all $x\in(0,1)$. Commented May 6 at 12:11
• @Zhanxiong Your doubt is likely predicated on the implicit assumption that the $f_i$ are continuous ;-).
– whuber
Commented May 6 at 13:59
• @whuber Understood now. Another naive counterexample would be letting $f_3=1/3f_1+2/3f_2$, $f_4=2/3f_1+1/3f_2$. This construction is not related to the domain of $f$. Commented May 6 at 14:24
• @Zhanxiong - that was the point underlying whuber's comment beginning "Your doubt is likely predicated..." Commented May 6 at 15:39

## 2 Answers

That result does not follow from the assumptions, as I will show with a (constructive) counterexample.

### Intuition

The idea is that since $$f_1+f_2=f_3+f_4$$ are sums of pdfs, we can start with that sum (which must be twice some pdf $$f$$) and try to split it into sums of functions that (i) are themselves pdfs and (ii) never agree at any argument $$x.$$ The validity of the conclusion comes down to whether this partitioning is ever possible.

The Intermediate Value Theorem of elementary Calculus tells us that if the $$f_i$$ are continuous, then the necessarily continuous differences $$f_i-f_j$$ must have zeros: that is, there will be at least one number $$x$$ at which they agree. Thus, in any counterexample at least three of the $$f_i$$ must have discontinuities. This leads us to contemplate where these discontinuities occur. In the following construction, they will happen at the boundary of a region $$\mathcal A.$$

### Analysis and Notation

Let $$f$$ be a probability density function (pdf) that is nonzero everywhere. An example is the PDF of any Normal distribution.

Let $$\mathcal A$$ be any measurable set in the support of $$f$$ with probability $$1/2.$$ That is,

$$\frac{1}{2} = \int_{\mathcal A} f(x)\,\mathrm dx.$$

Such sets always exist; for instance, you can take $$\mathcal A = (-\infty, m]$$ where $$m$$ is the median of $$f.$$

As is conventional, let $$\mathcal I$$ designate an indicator function, so that $$\mathcal I_{\mathcal A}(x) = 1$$ when $$x\in\mathcal A$$ and otherwise $$\mathcal I_{\mathcal A}(x) = 0.$$

I will construct counterexamples determined by a parameter $$0\lt p \lt 1$$ by defining

$$\phi_p(x) = 2f(x) \left[p \mathcal I_{\mathcal A}(x) + (1-p)\left(1 - \mathcal I_{\mathcal A}(x)\right)\right].$$

(These functions rescale the values of $$f$$ by $$2p$$ on the set $$\mathcal A$$ and by $$2(1-p)$$ on its complement.)

Every $$\phi_p$$ is a pdf because (a) its values are non-negative and (b) it integrates to unity:

\begin{aligned} \int \phi_p(x)\,\mathrm dx &= 2p\int_{\mathcal A} f(x)\,\mathrm dx + 2(1-p)\left(1 - \int_{\mathcal A} f(x)\,\mathrm dx\right) \\&= 2p\left(\frac{1}{2}\right) + 2(1-p)\left(\frac{1}{2}\right) \\&= 1.\end{aligned}

Notice, too, the relationship between each $$\phi_p$$ and $$\phi_{1-p}:$$

$$\phi_p(x) + \phi_{1-p}(x) = 2f(x) \left[(p + (1-p)) \mathcal I_{\mathcal A}(x) + ((1-p) + 1-(1-p))\left(1 - \mathcal I_{\mathcal A}(x)\right)\right] = 2f(x)$$

for all $$x.$$ That is, $$\phi_p$$ and $$\phi_{1-p}$$ can serve as possible values of $$f_1$$ and $$f_2$$ or as possible values of $$f_3$$ and $$f_4.$$

Here's the punch line:

When $$p\ne q$$ (and both values lie between $$0$$ and $$1$$), $$\phi_p(x)\ne \phi_q(x)$$ for all $$x.$$

Proof.

Recall $$f(x)\ne 0$$ for any $$x.$$ When $$x\in\mathcal A,$$ $$\phi_p(x) = 2p f(x) \ne 2q f(x) = \phi_q(x).$$ Otherwise, when $$x\notin \mathcal A,$$ $$\phi_p(x) = 2(1-p)f(x)\ne2(1-q)f(x)=\phi_q(x).$$ That covers all the possibilities, QED.

In this schematic (but accurate) figure, $$\mathcal A$$ is the set of $$x$$ subtended by the gray region.

### Counterexample

Let $$p$$ and $$q$$ be two numbers between $$0$$ and $$1,$$ but (a) neither equals $$1/2,$$ (b) $$p\ne q,$$ and (c) $$p\ne 1-q.$$ Observe that

$$\phi_p + \phi_{1-p} = 2f = \phi_q + \phi_{1-q},$$

yet since $$p,1-p,q$$ and $$1-q$$ are all distinct, all four of the $$\phi_*$$ in this expression never agree on any $$x.$$

• Good analysis (+1), especially demonstrating the process of analyzing the implication of the condition "$f_1(x) \neq \cdots \neq f_4(x)$". Commented May 7 at 16:17

If you are willing to consider the terminology "pdf" or "density" in its advance (i.e., measure theoretic) sense, more trivial counterexamples (compared with @whuber's great answer) can be easily constructed.

By "advance sense", I meant that given a probability space $$(\Omega, \mathscr{F}, P)$$, any non-negative measurable function $$f: \Omega \to \mathbb{R}$$ satisfying \begin{align*} P(A) = \int_A fd\mu, \; A \in \mathscr{F} \end{align*} is defined as a density of the probability measure $$P$$ with respect to another measure $$\mu$$ (which dominates $$P$$). For more discussions on this topic, check this Wolfram MathWorld link and our own Cross Validated discussion.

If you accepted this view, let us set $$\Omega = \{0, 1\}$$, $$\mathscr{F} = 2^\Omega$$, $$\mu$$ is the counting measure, and \begin{align*} f_i(0) = p_i, f_i(1) = 1 - p_i, \quad i = 1, 2, 3, 4. \tag{1}\label{1} \end{align*} It then follows that \begin{align*} & f_1(0) + f_2(0) = p_1 + p_2, f_3(0) + f_4(0) = p_3 + p_4. \end{align*}

It is clear now that for any distinct $$0 < p_1, \ldots, p_4 < 1$$ such that $$p_1 + p_2 = p_3 + p_4$$, $$\eqref{1}$$ can serve as a counterexample. For example, $$p_1 = 0.1, p_2 = 0.8, p_3 = 0.3, p_4 = 0.6$$.