Proving $|P(A\cap B)-P(A)P(B)|\leq \frac{1}4$ 
Let $A$ and $B$ be two events of a probability space. Prove that  $\displaystyle|P(A\cap B)-P(A)P(B)|\leq \frac{1}4$

I think it's a very challenging problem, and I've made no progress so far ...
Can someone give me a hint ?
 A: Note that
$\begin{align}
|P(A\cap B) - P(A)P(B)| &= |E[1_A1_B] - E[1_A]E[1_B]|\\
&= |Cov(1_A,1_B)|\\
&= |E[\{1_A-P(A)\}\{1_B-P(B)\}]| \\
&\leq \sqrt{V(1_A)}\sqrt{V(1_B)}
\end{align}$
where the last inequality follows from Cauchy-Schwarz for the following inner product on $L^2(P)$
$$\langle X,Y\rangle = E[XY].$$
Next, $V(1_A) = E[1_A^2] - E[1_A]^2 = E[1_A] - E[1_A]^2 = E[1_A](1-E[1_A])\leq \frac 14$, hence the claim.
A: Probably the most succinct proof, shamelessly adapted from another answer:
If $P(B)=0$ or $P(B)=1$ the inequality is trivial, so we may assume $P(B)\in (0,1)$. Then note that $$\begin{align}|P(A\cap B)-P(A)P(B)|
&= \left|P(B)P(B^c)\left[ \frac{P(A\cap B)}{P(B)P(B^c)} - \frac{P(A\cap B)+P(A\cap B^c)}{P(B^c)} \right]\right|\\ 
&= \left|P(B)P(B^c)\left[\frac{P(A\cap B)(1-P(B))}{P(B)P(B^c)}-\frac{P(A\cap B^c)}{P(B^c)} \right]\right|\\
&=P(B)P(B^c)|P(A\mid B)-P(A\mid B^c)|\\
&=P(B)(1-P(B))\underbrace{|P(A\mid B)-P(A\mid B^c)|}_{\leq 1}\\
&\leq \frac 14
\end{align}$$
because $x(1-x)\leq \frac 14$ when $x\in [0,1]$.
A: first, look at this, $$0 \leq x \leq1 \to x(1-x)\leq \frac 14$$
 now  if $$* \space 0\leq y\leq x\leq1 \to y(1-x)\leq x(1-x)\leq \frac 14$$
and 
  if $$** \space 0\leq x\leq y\leq1 \to x(1-y)\leq y(1-y)\leq \frac 14$$
we know $$P(A \cap B)\leq \min \{P(A ),P(B) \}\leq \max \{P(A ),P(B) \}$$
first suppose $P(A)=x,P( B)=y,y\leq x$
with respect to *
you will have 
$$|P(A\cap B)−P(A)P(B)|\leq |\max \{P(A ),P(B) \}−P(A)P(B)|=|x-xy|=|x(1-y)|≤\frac{1}{4}$$
as a second step,suppose $P(A)=x,P( B)=y,y\geq x$
you will have
(with respect to **)
$$|P(A\cap B)−P(A)P(B)|\leq |\max \{P(A ),P(B) \}−P(A)P(B)|=|y-xy|=|y(1-x)|≤\frac{1}{4}$$
A: Let's call $\;P(A)=x\;$, $\;P(B)=y\;$, and suppose $x\le y$.
  We have
$$
\max\{0,x+y-1\}\le P(A\cap B)\le \min\{x,y\}=x
$$
Then, if $\;P(A\cap B)\ge xy\;$, we have
$$
|P(A\cap B)-xy|=P(A\cap B)-xy\le x-xy\le x-x^2\le \frac{1}{4}
$$
On the other hand, if $\;P(A\cap B)\le xy\;$, and $\;x+y\le 1\;$, 
$$
|P(A\cap B)-xy|=xy-P(A\cap B)\le xy\le x(1-x)\le \frac{1}{4}
$$
The last case is $\;P(A\cap B)\le xy\;$,  and $\;x+y\ge 1\;$, 
$$
|P(A\cap B)-xy|=xy-P(A\cap B)\le xy-x-y+1=(1-x)(1-y)\le x(1-x)\le \frac{1}{4}
$$
A: We know that $P(A), P(B), P(A \cap B) \geq 0$.
We have 2 cases:


*

*Case 1: $P(A \cap B) \leq P(A)P(B)$. In this case, let $P(A) = x \in [0; 1]$. Thus $P(B) \leq 1-x + P(A \cap B)$. Hence
$$
| P(A \cap B) - P(A)P(B) | \leq | P(A \cap B)(x-1) + x(1-x) | \leq x(1-x)
$$

*Case 2: $P(A \cap B) \geq P(A)P(B)$. In this case, let $P(A \cap B) = y \in [0; 1]$, $P(A) = y + u$ and $P(B) = y + v$ for some small but non-negative values of $u$ and $v$. Hence
$$
| P(A \cap B) - P(A)P(B) | = | y - y^2 - yu - yv - uv | \leq y(1-y)
$$
A: We have $2$ cases. Either $\mathbb P(A)\mathbb P(B) \le \mathbb P(A \cap B)$ or $\mathbb P(A \cap B) \le \mathbb P(A)\mathbb P(B)$.
Doing the first one:
We have then LHS: $\mathbb P(A \cap B) - \mathbb P(A)\mathbb P(B) $.
Note that both $\mathbb P(A \cap B) \le \mathbb P(A)$ and $\mathbb P(A \cap B) \le \mathbb P(B)$ holds, so we can bound the LHS by (both):
$\mathbb P(A)(1-\mathbb P(B))$ and $\mathbb P(B)(1-\mathbb P(A))$. By multiplying those we get $\mathbb P(A)(1-\mathbb P(A)) \cdot \mathbb P(B)(1-\mathbb P(B))$
Using $x(1-x) \le \frac{1}{4}$ if $x \in [0,1]$ we get that the product is bounded by $\frac{1}{16}$ so at least one of $\mathbb P(A)(1-\mathbb P(B))$, $\mathbb P(B)(1-\mathbb P(A))$ is bounded by $\frac{1}{4}$.
Now for the second one:
Our LHS : $\mathbb P(A)\mathbb P(B) - \mathbb P(A \cap B)$. 
Note that $\mathbb P(A \cap B) \ge \max\{ \mathbb P(A) + \mathbb P(B) - 1, 0\}$
Again we can have $2$ cases:
1) if $0 \ge \mathbb P(A) + \mathbb P(B) - 1$, then we can bound LHS by $\mathbb P(A)\mathbb P(B)$, but since $\mathbb P(A) + \mathbb P(B) \le 1$ we get that $\mathbb P(A)\mathbb P(B) \le \min\{ \mathbb P(A)(1-\mathbb P(B)) , \mathbb P(B)(1-\mathbb P(A)) \}$, which we showed earlier is less than $\frac{1}{4}$
2) if $0 \le \mathbb P(A) + \mathbb P(B) - 1$, we can bound LHS by $\mathbb P(A)\mathbb P(B) - \mathbb P(A) -\mathbb P(B) + 1$ and then it is enough to show:
$\mathbb P(A)\mathbb P(B) - \mathbb P(A) - \mathbb P(B) \le -\frac{3}{4}$ which is equal to
$\mathbb P(A) + \mathbb P(B) - \mathbb P(A)\mathbb P(B) \ge \frac{3}{4} $
But we have (in this case) $\mathbb P(A) + \mathbb P(B) \ge 1$. So let $\mathbb P(A) + \mathbb P(B) = 1 + t$ for some $t \in [0,1]$. Obviously, $\mathbb P(A) \in [0,1]$, too.
We get $1 + t - (1+t-\mathbb P(A))\mathbb P(A) \ge \frac{3}{4}$
All we have to do is find maximum of $(1+t - \mathbb P(A))\mathbb P(A))$ with fixed $t \in [0,1]$. Looking at derivative, with respect to $\mathbb P(A)$ we get it's equal to $(1 + t -\mathbb P(A)) - \mathbb P(A) = 1+t - 2\mathbb P(A)$ and it equals $0$ iff $\mathbb P(A) = \frac{1+t}{2}$ which is a maximum ( due to our parabola having $-$ near square power)
Plugging it, we get $1 + t - (\frac{1+t}{2})(\frac{1+t}{2}) $, and writing $\frac{1+t}{2} = s$, we get $2s-s^2 - \frac{3}{4} \ge 0$, where $s \in [\frac{1}{2},1]$
Again, looking for minimum, we get it's either at $\frac{1}{2}$ or $1$
Plugging those values, we get both are $\ge 0$, so our first inequality is true.
A: Here is another proof (quite similar to others already written here) for the mega-powerful Edith Kosmanek's inequality :
Let $(\Omega, \mathcal{F}, \mathbb{P})$ a probability space.
Notice that $\{A, \overline{A}\}$ is a complete system of events of $\mathcal{F}$. Hence using the formulum of total probabilities we get :
$\mathbb{P}(A\cap B)-\mathbb{P}(A)\mathbb{P}(B)= \mathbb{P}(\overline{A})\mathbb{P}(A\cap B) - \mathbb{P}(A)\mathbb{P}(\overline{A}\cap B)$.
Also remark that for any $A$ and $B$ which are exclusive events of $\mathcal{F}$, $\mathbb{P}(A)\mathbb{P}(B)\le \dfrac{1}{4}$. Indeed using the increasing property of the probability measure and the fact that $B \subseteq \overline{A}$ we get that : $\mathbb{P}(A)\mathbb{P}(B)\le \mathbb{P}(A)\mathbb{P}(\overline{A})= \mathbb{P}(A)-(\mathbb{P}(A))^2 \le \dfrac{1}{4}$ (quick study of the function $x \mapsto x(1-x)$ on $[0,1]$).
Consequently we have that $\overline{A}$ and $A\cap B$ are exclusive events of $\mathcal{F}$ and it is the same thing for $A$ and $\overline{A}\cap B$.
Hence $\mathbb{P}(A\cap B)-\mathbb{P}(A)\mathbb{P}(B)\le \dfrac{1}{4}-\mathbb{P}(A)\mathbb{P}(\overline{A}\cap B) \le \dfrac{1}{4}$. Indeed, $\mathbb{P}(A)\mathbb{P}(\overline{A}\cap B)\in [0,\frac{1}{4}]$.
And $\mathbb{P}(A)\mathbb{P}(B)- \mathbb{P}(A\cap B) \le \dfrac{1}{4}- \mathbb{P}(\overline{A})\mathbb{P}(A\cap B) \le \dfrac{1}{4}$. Indeed, $\mathbb{P}(\overline{A})\mathbb{P}(A\cap B) \in [0, \frac{1}{4}]$.
Then we finally get : $\vert \mathbb{P}(A\cap B)-\mathbb{P}(A)\mathbb{P}(B) \vert \le \dfrac{1}{4}$.
A: Since $P(A)\ge P(A\cap B)$ and $P(B)\ge P(A\cap B)$ you have that $$P(A)P(B)\ge P(A\cap B)^2$$ which gives $$P(A\cap B)-P(A)P(B)\le P(A\cap B)-P(A\cap B)^2=P(A\cap B)(1-P(A\cap B))$$ Now for $p:=P(A\cap B)$, the right hand side is equal to $$f(p)=p(1-p)$$ for $p\in [0,1]$. This function is a quadratic function that attains it's maximum in the midpoint between it's roots ($p=0$ and $p=1$), that is at $p=1/2$.

Now the other side follows from the first side, if you use that $P(A\cap B)+P(A\cap B')=P(A)$ or equivalently $$P(A\cap B)=P(A)-P(A\cap B')$$ which gives you that $$P(A)P(B)-P(A\cap B)=P(A)P(B)-P(A)+P(A\cap B')=P(A\cap B')-P(A)P(B')$$ where the right hand side is $\le \dfrac{1}{4}$ due to first inequality we proved above (since the above inequality holds for every $A,B$, it holds also for $B'$ in place of $B$). This gives you also the other side.
A: Here's a nice simple proof that is just algebra and a tad of high school calculus.
First, to do careful book-keeping, we write $P(A=a,B=b)$ instead $P(A\cap B)$ for a pair of outcomes $(a,b)$. Then we have
$$
\begin{align}
\bigl|P(A=a,B=b) - P(A=a)P(B=b)\bigr|
&= \bigl|P(A=a|B=b)P(B=b) - P(A=a)P(B=b)\bigr|\\
&= P(B=b) \cdot \bigl|P(A=a|B=b) - P(A=a)\bigr|.
\end{align}
$$
Next we need to get a handle on the quantity $|P(A=a|B=b) - P(A=a)|$. We can do this by marginalizing over the possible values of $B$:
$$
\begin{align}
\bigl|P(A=a|B=b) - P(A=a)\bigr| = \Bigl|P(A=a|B=b) - \sum_{b'} P(A=a,B=b')\Bigr| \\
= \bigl|P(A=a|B=b) - P(A=a,B=b) - P(A=a,B\not=b)\bigr|\\
= \bigl|P(A=a|B=b) - P(A=a|B=b)\,P(B=b) - P(A=a,B\not=b)\bigr|.
\end{align}
$$
We can factor $P(A=a|B=b)$ out of the first two terms giving us
$$
\begin{align}
\bigl|(1 - P(B=b)) \,  P(A=a|B=b) - P(A=a,B\not=b)\bigr| =\\
\bigl|P(B\not=b) \, P(A=a|B=b) - P(A=a,B\not=b)\bigr|.~~
\end{align}
$$
Last we can write $P(A=a,B\not=b)$ as the product $P(A=a|B\not=b)\,P(B\not=b)$ so that we can factor out $P(B\not=b)$:
$$
\begin{align}
\bigl|P(B\not=b) \, P(A=a|B=b) - P(A=a,B\not=b)\bigr| =\\
\bigl|P(B\not=b) \, P(A=a|B=b) - P(A=a|B\not=b)\,P(B\not=b)\bigr|=\\
P(B\not=b)\,\bigl|P(A=a|B=b) - P(A=a|B\not=b)\bigr|.
\end{align}
$$
This makes the original quantity, $|P(A=a,B=b) - P(A=a)P(B=b)|$, equal to
$$
P(B=b) \, P(B\not=b)\,\bigl|P(A=a|B=b) - P(A=a|B\not=b)\bigr|.
$$
Notice that $|P(A=a|B=b) - P(A=a|B\not=b)| \in [0,1]$ and that
$$
P(B=b)\cdot P(B\not=b) = P(B=b)\cdot (1 - P(B=b))
$$
We can use basic calculus to show that the function $f(x) = x\cdot (1-x)$ is maximized at $x=1/2$. Therefore, $P(B=b)\cdot (1 - P(B=b))$ is maximized when $P(B=b) = 1/2$.
Therefore, the original quantity is less than $(1/2)\cdot (1/2) = 1/4$.
