# How to prove there is no positive and continuous function satisfying some conditions

Let $\alpha \in \mathbb R$. How could I prove there isn't any positive and continuous function $f$ such that the following conditions hold?

• $\int_{0}^1 f(x)dx=1$
• $\int_{0}^1 xf(x)dx=\alpha$
• $\int_{0}^1 x^2f(x)dx=\alpha ^2$
-
If $\alpha\le 0$ or $\alpha\ge 1$, then $$\alpha-\alpha^2= \int_0^1 (x-x^2)f(x)dx >0$$ Because $x(1-x)\ge 0$, $f(x)>0$ on $[0,1]$, so we derive a contradiction. But I don't know in case of $0<\alpha <1$. – Hanul Jeon Feb 28 '13 at 20:40

gt6989b's answer is a great answer, but it's probable that the OP isn't used to the language of probability. Here's the same proof, but written in the language of calculus instead.

If we happen to think of looking at $\int_0^1 (x-\alpha)^2f(x)\,dx$, we see that \begin{align*} \int_0^1 (x-\alpha)^2f(x)\,dx &= \int_0^1 (x^2-2\alpha x+\alpha^2)f(x)\,dx \\ &= \int_0^1 x^2 f(x)\,dx - 2\alpha \int_0^1 x f(x)\,dx + \alpha^2 \int_0^1 f(x)\,dx \\ &= \alpha^2-2\alpha(\alpha)+\alpha^2(1) = 0. \end{align*} But the function $(x-\alpha)^2f(x)$ is nonnegative. The only way that the integral of a nonnegative function over an interval can equal $0$ is if the function is identically $0$. But this implies that $f(x)=0$ everywhere (except possibly at $x=\alpha$), which makes $\int_0^1 f(x)\,dx = 1$ impossible.

-
nice proof. thanks – Maisam Hedyelloo Feb 28 '13 at 21:09

The first criterion implies $f$ is a pdf - so $$\alpha = \mathbb{E}X \quad \text{and} \quad \alpha^2 = \mathbb{E}[X^2]$$ so existence of such $f$ implies there exists and random variable such that $$\mathbb{E}[X^2] = \mathbb{E}[X]^2,$$ which implies $X$ has 0-variance, so $X$ is constant, equal everywhere to its expected value.

But that makes $f(x) = 0$ everywhere except $f(\alpha) = 1$ (and the integration not Riemann, but e.g. Riemann-Stieltjes), but then $f$ is not continuous.

-

Consider the Hilbert space $L^2([0,1],\mathbb{R})$ with the standard inner product $\langle f,g \rangle = \int^1_0 f(x) g(x) dx.$ Suppose such an $f$ exists, so that $g=\sqrt{f}$ is also positive and continuous. Then the conditions read as:

• $\| g\|=1$
• $\langle xg,g \rangle= \alpha$
• $\| xg \|=\alpha$

Thus we have that $\langle xg,g \rangle = \| xg\| \| g\|,$ which is the equality case of the Cauchy-Schwarz inequality. Hence there exists a $\beta\in\mathbb{R}$ such that $xg=\beta g$ almost everywhere, which can only be true if $g=0$ almost everywhere - but this contradicts the first condition. Therefore, no such $f$ exists.

-