[Home]
Last updated on: Sat Aug 15 18:22:53 IST 2026

Inequalities


$\newcommand{\rightarrowA}{\stackrel{a.s.}{\longrightarrow}}$ $\newcommand{\rightarrowP}{\stackrel{P}{\longrightarrow}}$ $\newcommand{\v}{\mathbf}$ $\newcommand{\cov}{\mathrm{cov}}$ Inequalities
Last updated on: Sat Aug 15 18:22:53 IST 2026

1. Cauchy-Schwarz

Cauchy-Schwarz inequality $cov(X,Y)^2 \leq V(X)V(Y).$ Equality holds iff $\exists a,b,c\in{\mathbb R}~~P(aX+bY=c)=1.$

Proof: The result is obvious if $V(X)=0$ or $V(Y)=0.$ So let's consider the case where $V(X), V(Y)>0.$

Define $Z_1 = \frac{X-E(X)}{V(X)}$ and $Z_2 = \frac{Y-E(Y)}{V(Y)}.$

We know that $V(Z_1+Z_2)\geq 0.$

Derive from this $\cov(X,Y)\geq -1.$

Similarly, derive $\cov(X,Y)\leq 1$ from $V(Z_1-Z_2)\geq 0.$

Also equality holds iff $V(Z_1+Z_2)=0$ or $V(Z_1-Z_2)=0$, i.e., if $Z_1+Z_2$ or $Z_1-Z_2$ is degenerate.

So we have either $P(Z_1+Z_2=k)=1$ or $P(Z_1-Z_2=k)=1$ for some $k\in{\mathbb R}.$

In both cases we have $P(aX+bY=c)=1$ for some constants, $a,b,c,$ as required. [QED]

It is instructive to think about the Cauchy-Schwarz inequality from a geometric perspective. If we take two vectors , $\v u$ and $\v v$ in 2D or 3D, we have the identity $$\v u\bullet\v v = \| \v u\| \cdot \|\v v\|\cos \theta,$$ where $\theta$ is the angle between the two vectors.
Now, if we replace the two vectors by the random variables $X$ and $Y$, then their covariance plays the role of dot product. Indeed, covariance satisfies all the properties of a dot product (also called inner product in linear algebra). Then the role of length of a vector (called norm in linear algebra) is played by standard deviation, since $\|\v u\| = \sqrt{\v u\bullet\v u}.$

Similarly, $\sqrt{\cov(X,X)} = \sqrt{V(X)}.$

In this sense $\cos \theta = \frac{\cov(X,Y)}{\sqrt{V(X)V(Y)}}.$

Can we recover $\theta$ from this? Yes, using $cos ^{-1},$ provided the RHS is between $-1$ and $1.$ Well, the Cauchy-Schwarz inequality guarantees precisely that. In this geometric interpretation, $\cos \theta$ is called the correlation coefficient between $X$ and $Y.$

1.1. Problem set

EXERCISE 1: $X$ is a nonnegative random variable with finite second moment. Show that $P(X>0)\geq \frac{E^2(X)}{E(X^2)}.

Hint:

Think of $X$ as $X1_{X>0}.$

$

EXERCISE 2: Let $X_1,...,X_n$ be random variables with finite second moments. Show that $$V\left(\sum X_i\right) \leq \left(\sum\sqrt{V(X_i)}\right)^2.$$

EXERCISE 3: Show that $E|X-E(X)|\leq \sqrt{V(X)}$ for any random variable $X$ with finite second moment.

EXERCISE 4: If $E(X^2)=E(Y^2) = E(XY),$ then show that $P(X=Y)=1.$

2. Markov and Chebyshev inequalities

Let us start with a commonsense example.

EXERCISE 5: Average salary in a company is Rs 50,000. It is claimed that 30% of the employees are getting a salary of Rs 250,000 or more. Can this claim be true?

[Hint]

Of course not! Even if the other employess get no salary at all, the average must be at least $0.3\times 250,000,$ which exceeds the stated average.

In fact, no more than $\frac 15$ of the employees can make 250,000 or more. Since 50000/250000 = $\frac 15$.

The same reasoning leads to the following very useful inequality.

Markov inequality Let $X$ be a nonnegative random variable. Let $\epsilon>0.$ Then $P(X \geq \epsilon) \leq \frac{E(X)}{\epsilon}.$

Proof: Compare with $Y = \left\{\begin{array}{ll} \epsilon&\text{if }x\geq \epsilon\\ 0&\text{otherwise.}\end{array}\right..$

Note that $Y\leq X.$ Hence $E(Y^k)\leq E(X^k).$ But $E(Y^k) = P(X\leq \epsilon) \epsilon^k.$ Hence the result. [QED]

A point about the inequalities in the above theorem. There are two inequalities, one inside the probability, and one outside. Both are mixed inequalities. Obviously, you may make the first inequality strict (thereby weakening the result). However, you may not replace the other inequality with a strict one, because otherwise you will get $0 < 0$ for the degenerate random variable $X\equiv0$.

The following variant of the Markov inequality is due to Chebyshev.
Chebyshev is also credited with designing a quadruped robot-like linkage.
Chebyshev inequality Let $V(X)<\infty.$ Then $$ \forall \epsilon>0~~P(|X-E(X)| \geq \epsilon) \leq \frac{V(X)}{\epsilon^2}. $$

Proof: This is just Markov inequality with $k=2$ applied to the random variable $|X-E(X)|.$ [QED]

2.1. Problem set

EXERCISE 6: Give a counterexample to show that the nonnegativity assumption in the inequality may not be dropped.

EXERCISE 7: Let $X$ be any random variable (not necessarily nonnegative). Show that $$\forall \epsilon>0~~P(X\geq \epsilon) \leq \frac{E(X^2)}{\epsilon^2}.$$

EXERCISE 8: If you have solved the above exercise, you can also show that for any nonnegative random variable $X$ and any $\epsilon>0$ we have for each $k\in{\mathbb N},$ $$\forall \epsilon>0~~P(X\geq \epsilon) \leq \frac{E(X^k)}{\epsilon^k}.$$ Will higher values of $k$ necessarily give you better bounds?

EXERCISE 9: Prove that $\forall \epsilon>0~~\frac{1}{\sqrt{2\pi}}\int_{-\epsilon}^ \epsilon e^{-x^2/2}\, dx \leq \frac{1}{\epsilon^4}.$

3. Real life applications

Markov inequality is little more than commonsense, and naturally it finds many practical applications. Its greatest strength lies in the fact that it makes no assumption about the distribution of the the random variable other than through its expectation. For many real life random variables, estimating the mean is far easier than estimating the entire distribution.

Let us start with an interesting application from computer science. A class of algorithms called Las Vegas algorithms, approach a problem in a random way that is sure to arrive at the answer, but after a random number of steps.

One example is the randomised quick sort algorithm:
Here we sort an array of numbers by picking a random element from the array, and dividing the rest into two groups, depending on whether a number is $\leq$ or $>$ than the picked element. Then we do the same thing recursively to both the groups separately, and stop when the entire array is sorted.

Let $X$ denote the number steps in a Las Vegas algorithm. We often know $E(X)$ as a function of the input size. For instance, in the randomised quicksort algorithm $E(X) = n\log n,$ where $n$ is the length of the array (proof not part of this course). Then Markov inequality helps us to get an upper bound on the probability that the algorithm will take too long. This allows engineers to guarantee system satibility without knowing the exact distribution of $X.$

3.1. Problem set

EXERCISE 10: Let $X$ be the number of steps needed in a randomised quick sort algorithm. It is known that $E(X)=n\log n$ if the $n$ is the length of the array to be sorted. Find an upper bound for $P(X>10^6)$ if the input array has length $10^4.$

EXERCISE 11: (Router overload) A router receives a random number ($X$) of packets every millisecond. We know from the past that $E(X)=50.$ We do not know the distribution of $X.$ The router's buffer can hold 250 packets before overflowing. Help the network engineer to provide an uppr bound to the failure rate, $P(X\geq 250).$

EXERCISE 12: (Liquidity crisis) A bank has a large portfolio of small business loans. $X=$ number of defaulters in a single month. Past experience shows $E(X)=2M.$ Liquidity crisis will arise if $X\geq 20M.$ Bound the probability of that.

EXERCISE 13: (System downtime) A financial system tracks $X$ the downtime of the system per year. Past data shows $E(X)=15$ minutes. Crash would result if $X\geq 2$ hours. Bound its probability.

EXERCISE 14: (Volatile market) When the market is highly volatile market, an investment fund's historical data becomes useless. The only certain information is the current daily expected loss $E(X)=100,000.$ Upper bound $P(X\geq 1,000,000).$

EXERCISE 15:  (Primality testing) A randomised primality testing algorithm called the Miller Rabin test applies a random experiment on an input integer $n.$ The (random) output is either "Composite" or "Prime". There is theoretical guarantee that if it says "Composite", then the input is indeed composite. But if it says "Prime" then the input is composite with 0.25 probability.

Mathematically, let $$X = \left\{\begin{array}{ll}1&\text{if }\mbox{error}\\ 0&\text{otherwise.}\end{array}\right..$$ Then we have $E(X) = \frac 14.$ We run this experiment $k$ times independently (on the same input), and we output "Composite" if at least one run says so. Otherwise, we say "Prime".

Give an uppoer bound on the probability that this battery of $k$ tests makes an error. [This problem can also be solved without explicit use of Markov inequality.]

Project: Count-min sketch Imagine a stream of items going past you (like cars of different brands going down a road, or trees of different types as you walk through a forest). Each item belongs to one of a finite number of categories. The stream is running for a really long time (think of information packets passing through a busy computer connected to the internet). The number of categories is also huge (and not known beforehand). Your job is to keep track of the frequencies of the different categories you have seen so far. Tally marking is a very simple technique to achieve this. But if the number of categories is really huge, and most of them occur with negligible frequencies, tally marking is inefficient.

Here the count-min technique provides a more efficient approximate alternative.

So far as probability theory goes, it is a use of the Markov inequality. But before you get into the probability, you need to know about hash functions: functions that maps the huge set of categories to a much smaller set (whose elements we shall call buckets). Such functions may be constructed in a way that if $X_1,X_2,...$ are incoming categories and $h(\cdot)$ is the function, then $h(X_1), h(X_2),...$ behave like IID uniform random variables on the bucket set. Also, it is possible to construct different such functions $h_1,h_2,...$ such that the sequences generated from them behave line independent random variables. The functions, by the way, are themseleves deterministic, and are closely related to how a computer generates pseudo random numbers. Such functions are called hash functions.

While such a function cannot be one-one (it maps a finite set to a much smaller set), they are often used as quick-and-dirty versions of one-one functions (eg, checking integrity of downloaded files). This is the main idea behind the count-min algo, as well.

It is a project on the tougher side. The group may need to be large to distribute the work load.
Project: BJKST algorithm for counting distinct elements The set up is just like that for the last project. But here the aim is to estimate the number of unique categories seen so far (and not the frequency of any given category).

Here also you need to use hash functions. The difficulty level is comparable with the last project.