# 随机算法 (Spring 2014)/Concentration of Measure

Jump to navigation Jump to search

# The Bounded Difference Method

Combining Azuma's inequality with the construction of Doob martingales, we have the powerful Bounded Difference Method for concentration of measures.

## For arbitrary random variables

Given a sequence of random variables $\displaystyle{ X_1,\ldots,X_n }$ and a function $\displaystyle{ f }$. The Doob sequence constructs a martingale from them. Combining this construction with Azuma's inequality, we can get a very powerful theorem called "the method of averaged bounded differences" which bounds the concentration for arbitrary function on arbitrary random variables (not necessarily a martingale).

 Theorem (Method of averaged bounded differences) Let $\displaystyle{ \boldsymbol{X}=(X_1,\ldots, X_n) }$ be arbitrary random variables and let $\displaystyle{ f }$ be a function of $\displaystyle{ X_0,X_1,\ldots, X_n }$ satisfying that, for all $\displaystyle{ 1\le i\le n }$, $\displaystyle{ |\mathbf{E}[f(\boldsymbol{X})\mid X_1,\ldots,X_i]-\mathbf{E}[f(\boldsymbol{X})\mid X_1,\ldots,X_{i-1}]|\le c_i, }$ Then \displaystyle{ \begin{align} \Pr\left[|f(\boldsymbol{X})-\mathbf{E}[f(\boldsymbol{X})]|\ge t\right]\le 2\exp\left(-\frac{t^2}{2\sum_{i=1}^nc_i^2}\right). \end{align} }
Proof.
 Define the Doob Martingale sequence $\displaystyle{ Y_0,Y_1,\ldots,Y_n }$ by setting $\displaystyle{ Y_0=\mathbf{E}[f(X_1,\ldots,X_n)] }$ and, for $\displaystyle{ 1\le i\le n }$, $\displaystyle{ Y_i=\mathbf{E}[f(X_1,\ldots,X_n)\mid X_1,\ldots,X_i] }$. Then the above theorem is a restatement of the Azuma's inequality holding for $\displaystyle{ Y_0,Y_1,\ldots,Y_n }$.
$\displaystyle{ \square }$

## For independent random variables

The condition of bounded averaged differences is usually hard to check. This severely limits the usefulness of the method. To overcome this, we introduce a property which is much easier to check, called the Lipschitz condition.

 Definition (Lipschitz condition) A function $\displaystyle{ f(x_1,\ldots,x_n) }$ satisfies the Lipschitz condition, if for any $\displaystyle{ x_1,\ldots,x_n }$ and any $\displaystyle{ y_i }$, \displaystyle{ \begin{align} |f(x_1,\ldots,x_{i-1},x_i,x_{i+1},\ldots,x_n)-f(x_1,\ldots,x_{i-1},y_i,x_{i+1},\ldots,x_n)|\le 1. \end{align} }

In other words, the function satisfies the Lipschitz condition if an arbitrary change in the value of any one argument does not change the value of the function by more than 1.

The diference of 1 can be replaced by arbitrary constants, which gives a generalized version of Lipschitz condition.

 Definition (Lipschitz condition, general version) A function $\displaystyle{ f(x_1,\ldots,x_n) }$ satisfies the Lipschitz condition with constants $\displaystyle{ c_i }$, $\displaystyle{ 1\le i\le n }$, if for any $\displaystyle{ x_1,\ldots,x_n }$ and any $\displaystyle{ y_i }$, \displaystyle{ \begin{align} |f(x_1,\ldots,x_{i-1},x_i,x_{i+1},\ldots,x_n)-f(x_1,\ldots,x_{i-1},y_i,x_{i+1},\ldots,x_n)|\le c_i. \end{align} }

The following "method of bounded differences" can be developed for functions satisfying the Lipschitz condition. Unfortunately, in order to imply the condition of averaged bounded differences from the Lipschitz condition, we have to restrict the method to independent random variables.

 Corollary (Method of bounded differences) Let $\displaystyle{ \boldsymbol{X}=(X_1,\ldots, X_n) }$ be $\displaystyle{ n }$ independent random variables and let $\displaystyle{ f }$ be a function satisfying the Lipschitz condition with constants $\displaystyle{ c_i }$, $\displaystyle{ 1\le i\le n }$. Then \displaystyle{ \begin{align} \Pr\left[|f(\boldsymbol{X})-\mathbf{E}[f(\boldsymbol{X})]|\ge t\right]\le 2\exp\left(-\frac{t^2}{2\sum_{i=1}^nc_i^2}\right). \end{align} }
Proof.
 For convenience, we denote that $\displaystyle{ \boldsymbol{X}_{[i,j]}=(X_i,X_{i+1},\ldots, X_j) }$ for any $\displaystyle{ 1\le i\le j\le n }$. We first show that the Lipschitz condition with constants $\displaystyle{ c_i }$, $\displaystyle{ 1\le i\le n }$, implies another condition called the averaged Lipschitz condition (ALC): for any $\displaystyle{ a_i,b_i }$, $\displaystyle{ 1\le i\le n }$, $\displaystyle{ \left|\mathbf{E}\left[f(\boldsymbol{X})\mid \boldsymbol{X}_{[1,i-1]},X_i=a_i\right]-\mathbf{E}\left[f(\boldsymbol{X})\mid \boldsymbol{X}_{[1,i-1]},X_i=b_i\right]\right|\le c_i. }$ And this condition implies the averaged bounded difference condition: for all $\displaystyle{ 1\le i\le n }$, $\displaystyle{ \left|\mathbf{E}\left[f(\boldsymbol{X})\mid \boldsymbol{X}_{[1,i]}\right]-\mathbf{E}\left[f(\boldsymbol{X})\mid \boldsymbol{X}_{[1,i-1]}\right]\right|\le c_i. }$ Then by applying the method of averaged bounded differences, the corollary can be proved. For any $\displaystyle{ a }$, by the law of total expectation, \displaystyle{ \begin{align} &\quad\, \mathbf{E}\left[f(\boldsymbol{X})\mid \boldsymbol{X}_{[1,i-1]},X_i=a\right]\\ &=\sum_{a_{i+1},\ldots,a_n}\mathbf{E}\left[f(\boldsymbol{X})\mid \boldsymbol{X}_{[1,i-1]},X_i=a, \boldsymbol{X}_{[i+1,n]}=\boldsymbol{a}_{[i+1,n]}\right]\cdot\Pr\left[\boldsymbol{X}_{[i+1,n]}=\boldsymbol{a}_{[i+1,n]}\mid \boldsymbol{X}_{[1,i-1]},X_i=a\right]\\ &=\sum_{a_{i+1},\ldots,a_n}\mathbf{E}\left[f(\boldsymbol{X})\mid \boldsymbol{X}_{[1,i-1]},X_i=a, \boldsymbol{X}_{[i+1,n]}=\boldsymbol{a}_{[i+1,n]}\right]\cdot\Pr\left[\boldsymbol{X}_{[i+1,n]}=\boldsymbol{a}_{[i+1,n]}\right] \qquad (\mbox{independence})\\ &= \sum_{a_{i+1},\ldots,a_n} f(\boldsymbol{X}_{[1,i-1]},a,\boldsymbol{a}_{[i+1,n]})\cdot\Pr\left[\boldsymbol{X}_{[i+1,n]}=\boldsymbol{a}_{[i+1,n]}\right]. \end{align} } Let $\displaystyle{ a=a_i }$ and $\displaystyle{ b_i }$, and take the diference. Then \displaystyle{ \begin{align} &\quad\, \left|\mathbf{E}\left[f(\boldsymbol{X})\mid \boldsymbol{X}_{[1,i-1]},X_i=a_i\right]-\mathbf{E}\left[f(\boldsymbol{X})\mid \boldsymbol{X}_{[1,i-1]},X_i=b_i\right]\right|\\ &=\left|\sum_{a_{i+1},\ldots,a_n}\left(f(\boldsymbol{X}_{[1,i-1]},a_i,\boldsymbol{a}_{[i+1,n]})-f(\boldsymbol{X}_{[1,i-1]},b_i,\boldsymbol{a}_{[i+1,n]})\right)\Pr\left[\boldsymbol{X}_{[i+1,n]}=\boldsymbol{a}_{[i+1,n]}\right]\right|\\ &\le \sum_{a_{i+1},\ldots,a_n}\left|f(\boldsymbol{X}_{[1,i-1]},a_i,\boldsymbol{a}_{[i+1,n]})-f(\boldsymbol{X}_{[1,i-1]},b_i,\boldsymbol{a}_{[i+1,n]})\right|\Pr\left[\boldsymbol{X}_{[i+1,n]}=\boldsymbol{a}_{[i+1,n]}\right]\\ &\le \sum_{a_{i+1},\ldots,a_n}c_i\Pr\left[\boldsymbol{X}_{[i+1,n]}=\boldsymbol{a}_{[i+1,n]}\right] \qquad (\mbox{Lipschitz condition})\\ &=c_i. \end{align} } Thus, the Lipschitz condition is transformed to the ALC. We then deduce the averaged bounded difference condition from ALC. By the law of total expectation, $\displaystyle{ \mathbf{E}\left[f(\boldsymbol{X})\mid \boldsymbol{X}_{[1,i-1]}\right]=\sum_{a}\mathbf{E}\left[f(\boldsymbol{X})\mid \boldsymbol{X}_{[1,i-1]},X_i=a\right]\cdot\Pr[X_i=a\mid \boldsymbol{X}_{[1,i-1]}]. }$ We can trivially write $\displaystyle{ \mathbf{E}\left[f(\boldsymbol{X})\mid \boldsymbol{X}_{[1,i]}\right] }$ as $\displaystyle{ \mathbf{E}\left[f(\boldsymbol{X})\mid \boldsymbol{X}_{[1,i]}\right]=\sum_{a}\mathbf{E}\left[f(\boldsymbol{X})\mid \boldsymbol{X}_{[1,i]}\right]\cdot\Pr\left[X_i=a\mid \boldsymbol{X}_{[1,i-1]}\right]. }$ Hence, the difference is \displaystyle{ \begin{align} &\quad \left|\mathbf{E}\left[f(\boldsymbol{X})\mid \boldsymbol{X}_{[1,i]}\right]-\mathbf{E}\left[f(\boldsymbol{X})\mid \boldsymbol{X}_{[1,i-1]}\right]\right|\\ &=\left|\sum_{a}\left(\mathbf{E}\left[f(\boldsymbol{X})\mid \boldsymbol{X}_{[1,i]}\right]-\mathbf{E}\left[f(\boldsymbol{X})\mid \boldsymbol{X}_{[1,i-1]},X_i=a\right]\right)\cdot\Pr\left[X_i=a\mid \boldsymbol{X}_{[1,i-1]}\right]\right| \\ &\le \sum_{a}\left|\mathbf{E}\left[f(\boldsymbol{X})\mid \boldsymbol{X}_{[1,i]}\right]-\mathbf{E}\left[f(\boldsymbol{X})\mid \boldsymbol{X}_{[1,i-1]},X_i=a\right]\right|\cdot\Pr\left[X_i=a\mid \boldsymbol{X}_{[1,i-1]}\right] \\ &\le \sum_a c_i\Pr\left[X_i=a\mid \boldsymbol{X}_{[1,i-1]}\right] \qquad (\mbox{due to ALC})\\ &=c_i. \end{align} } The averaged bounded diference condition is implied. Applying the method of averaged bounded diferences, the corollary follows.
$\displaystyle{ \square }$

## Applications

### Occupancy problem

Throwing $\displaystyle{ m }$ balls uniformly and independently at random to $\displaystyle{ n }$ bins, we ask for the occupancies of bins by the balls. In particular, we are interested in the number of empty bins.

This problem can be described equivalently as follows. Let $\displaystyle{ f:[m]\rightarrow[n] }$ be a uniform random function from $\displaystyle{ [m]\rightarrow[n] }$. We ask for the number of $\displaystyle{ i\in[n] }$ that $\displaystyle{ f^{-1}(i) }$ is empty.

For any $\displaystyle{ i\in[n] }$, let $\displaystyle{ X_i }$ indicate the emptiness of bin $\displaystyle{ i }$. Let $\displaystyle{ X=\sum_{i=1}^nX_i }$ be the number of empty bins.

$\displaystyle{ \mathbf{E}[X_i]=\Pr[\mbox{bin }i\mbox{ is empty}]=\left(1-\frac{1}{n}\right)^m. }$

By the linearity of expectation,

$\displaystyle{ \mathbf{E}[X]=\sum_{i=1}^n\mathbf{E}[X_i]=n\left(1-\frac{1}{n}\right)^m. }$

We want to know how $\displaystyle{ X }$ deviates from this expectation. The complication here is that $\displaystyle{ X_i }$ are not independent. So we alternatively look at a sequence of independent random variables $\displaystyle{ Y_1,\ldots, Y_m }$, where $\displaystyle{ Y_j\in[n] }$ represents the bin into which the $\displaystyle{ j }$th ball falls. Clearly $\displaystyle{ X }$ is function of $\displaystyle{ Y_1,\ldots, Y_m }$.

We than observe that changing the value of any $\displaystyle{ Y_i }$ can change the value of $\displaystyle{ X }$ by at most 1, because one ball can affect the emptiness of at most one bin. Thus as a function of independent random variables $\displaystyle{ Y_1,\ldots, Y_m }$, $\displaystyle{ X }$ satisfies the Lipschitz condition. Apply the method of bounded differences, it holds that

$\displaystyle{ \Pr\left[\left|X-n\left(1-\frac{1}{n}\right)^m\right|\ge t\sqrt{m}\right]=\Pr[|X-\mathbf{E}[X]|\ge t\sqrt{m}]\le 2e^{-t^2/2} }$

Thus, for sufficiently large $\displaystyle{ n }$ and $\displaystyle{ m }$, the number of empty bins is tightly concentrated around $\displaystyle{ n\left(1-\frac{1}{n}\right)^m\approx \frac{n}{e^{m/n}} }$

### Pattern Matching

Let $\displaystyle{ \boldsymbol{X}=(X_1,\ldots,X_n) }$ be a sequence of characters chosen independently and uniformly at random from an alphabet $\displaystyle{ \Sigma }$, where $\displaystyle{ m=|\Sigma| }$. Let $\displaystyle{ \pi\in\Sigma^k }$ be an arbitrarily fixed string of $\displaystyle{ k }$ characters from $\displaystyle{ \Sigma }$, called a pattern. Let $\displaystyle{ Y }$ be the number of occurrences of the pattern $\displaystyle{ \pi }$ as a substring of the random string $\displaystyle{ X }$.

By the linearity of expectation, it is obvious that

$\displaystyle{ \mathbf{E}[Y]=(n-k+1)\left(\frac{1}{m}\right)^k. }$

We now look at the concentration of $\displaystyle{ Y }$. The complication again lies in the dependencies between the matches. Yet we will see that $\displaystyle{ Y }$ is well tightly concentrated around its expectation if $\displaystyle{ k }$ is relatively small compared to $\displaystyle{ n }$.

For a fixed pattern $\displaystyle{ \pi }$, the random variable $\displaystyle{ Y }$ is a function of the independent random variables $\displaystyle{ (X_1,\ldots,X_n) }$. Any character $\displaystyle{ X_i }$ participates in no more than $\displaystyle{ k }$ matches, thus changing the value of any $\displaystyle{ X_i }$ can affect the value of $\displaystyle{ Y }$ by at most $\displaystyle{ k }$. $\displaystyle{ Y }$ satisfies the Lipschitz condition with constant $\displaystyle{ k }$. Apply the method of bounded differences,

$\displaystyle{ \Pr\left[\left|Y-\frac{n-k+1}{m^k}\right|\ge tk\sqrt{n}\right]=\Pr\left[\left|Y-\mathbf{E}[Y]\right|\ge tk\sqrt{n}\right]\le 2e^{-t^2/2} }$

### Combining unit vectors

Let $\displaystyle{ u_1,\ldots,u_n }$ be $\displaystyle{ n }$ unit vectors from some normed space. That is, $\displaystyle{ \|u_i\|=1 }$ for any $\displaystyle{ 1\le i\le n }$, where $\displaystyle{ \|\cdot\| }$ denote the vector norm (e.g. $\displaystyle{ \ell_1,\ell_2,\ell_\infty }$) of the space.

Let $\displaystyle{ \epsilon_1,\ldots,\epsilon_n\in\{-1,+1\} }$ be independently chosen and $\displaystyle{ \Pr[\epsilon_i=-1]=\Pr[\epsilon_i=1]=1/2 }$.

Let

$\displaystyle{ v=\epsilon_1u_1+\cdots+\epsilon_nu_n, }$

and

$\displaystyle{ X=\|v\|. }$

This kind of construction is very useful in combinatorial proofs of metric problems. We will show that by this construction, the random variable $\displaystyle{ X }$ is well concentrated around its mean.

$\displaystyle{ X }$ is a function of independent random variables $\displaystyle{ \epsilon_1,\ldots,\epsilon_n }$. By the triangle inequality for norms, it is easy to verify that changing the sign of a unit vector $\displaystyle{ u_i }$ can only change the value of $\displaystyle{ X }$ for at most 2, thus $\displaystyle{ X }$ satisfies the Lipschitz condition with constant 2. The concentration result follows by applying the method of bounded differences:

$\displaystyle{ \Pr[|X-\mathbf{E}[X]|\ge 2t\sqrt{n}]\le 2e^{-t^2/2}. }$

# Dimension Reduction

Consider a problem as follows: We have a set of $\displaystyle{ n }$ points in a high-dimensional Euclidean space $\displaystyle{ \mathbf{R}^d }$. We want to project the points onto a space of low dimension $\displaystyle{ \mathbf{R}^k }$ in such a way that pairwise distances of the points are approximately the same as before.

Formally, we are looking for a map $\displaystyle{ f:\mathbf{R}^d\rightarrow\mathbf{R}^k }$ such that for any pair of original points $\displaystyle{ u,v }$, $\displaystyle{ \|f(u)-f(v)\| }$ distorts little from $\displaystyle{ \|u-v\| }$, where $\displaystyle{ \|\cdot\| }$ is the Euclidean norm, i.e. $\displaystyle{ \|u-v\|=\sqrt{(u_1-v_1)^2+(u_2-v_2)^2+\ldots+(u_d-v_d)^2} }$ is the distance between $\displaystyle{ u }$ and $\displaystyle{ v }$ in Euclidean space.

This problem has various important applications in both theory and practice. In many tasks, the data points are drawn from a high dimensional space, however, computations on high-dimensional data are usually hard due to the infamous "curse of dimensionality". The computational tasks can be greatly eased if we can project the data points onto a space of low dimension while the pairwise relations between the points are approximately preserved.

## Johnson-Lindenstrauss Theorem

The Johnson-Lindenstrauss Theorem states that it is possible to project $\displaystyle{ n }$ points in a space of arbitrarily high dimension onto an $\displaystyle{ O(\log n) }$-dimensional space, such that the pairwise distances between the points are approximately preserved.

 Johnson-Lindenstrauss Theorem For any $\displaystyle{ 0\lt \epsilon\lt 1 }$ and any positive integer $\displaystyle{ n }$, let $\displaystyle{ k }$ be a positive integer such that $\displaystyle{ k\ge4(\epsilon^2/2-\epsilon^3/3)^{-1}\ln n }$ Then for any set $\displaystyle{ V }$ of $\displaystyle{ n }$ points in $\displaystyle{ \mathbf{R}^d }$, there is a map $\displaystyle{ f:\mathbf{R}^d\rightarrow\mathbf{R}^k }$ such that for all $\displaystyle{ u,v\in V }$, $\displaystyle{ (1-\epsilon)\|u-v\|^2\le\|f(u)-f(v)\|^2\le(1+\epsilon)\|u-v\|^2 }$. Furthermore, this map can be found in expected polynomial time.

## The random projections

The map $\displaystyle{ f:\mathbf{R}^d\rightarrow\mathbf{R}^k }$ is done by random projection. There are several ways of applying the random projection. We adopt the one in the original Johnson-Lindenstrauss paper.

 The projection (due to Johnson-Lindenstrauss) Let $\displaystyle{ A }$ be a random $\displaystyle{ k\times d }$ matrix that projects $\displaystyle{ \mathbf{R}^d }$ onto a uniform random k-dimensional subspace. Multiply $\displaystyle{ A }$ by a fixed scalar $\displaystyle{ \sqrt{\frac{d}{k}} }$. For every $\displaystyle{ v\in\mathbf{R}^d }$, $\displaystyle{ v }$ is mapped to $\displaystyle{ \sqrt{\frac{d}{k}}Av }$.

The projected point $\displaystyle{ \sqrt{\frac{d}{k}}Av }$ is a vector in $\displaystyle{ \mathbf{R}^k }$.

The purpose of multiplying the scalar $\displaystyle{ \sqrt{\frac{d}{k}} }$ is to guarantee that $\displaystyle{ \mathbf{E}\left[\left\|\sqrt{\frac{d}{k}}Av\right\|^2\right]=\|v\|^2 }$.

Besides the uniform random subspace, there are other choices of random projections known to have good performances, including:

• A matrix whose entries follow i.i.d. normal distributions. (Due to Indyk-Motwani)
• A matrix whose entries are i.i.d. $\displaystyle{ \pm1 }$. (Due to Achlioptas)

In both cases, the matrix is also multiplied by a fixed scalar for normalization.

## A proof of the Theorem

We present a proof due to Dasgupta-Gupta, which is much simpler than the original proof of Johnson-Lindenstrauss. The proof is for the projection onto uniform random subspace. The idea of the proof is outlined as follows:

1. To bound the distortions to pairwise distances, it is sufficient to bound the distortions to the length of unit vectors.
2. A uniform random subspace of a fixed unit vector is identically distributed as a fixed subspace of a uniform random unit vector. We can fix the subspace as the first k coordinates of the vector, thus it is sufficient to bound the length (norm) of the first k coordinates of a uniform random unit vector.
3. Prove that for a uniform random unit vector, the length of its first k coordinates is concentrated to the expectation.

### From pairwise distances to norms of unit vectors

Let $\displaystyle{ w\in \mathbf{R}^d }$ be a vector in the original space, the random $\displaystyle{ k\times d }$ matrix $\displaystyle{ A }$ projects $\displaystyle{ w }$ onto a uniformly random k-dimensional subspace of $\displaystyle{ \mathbf{R}^d }$. We only need to show that

\displaystyle{ \begin{align} \Pr\left[\left\|\sqrt{\frac{d}{k}}Aw\right\|^2\lt (1-\epsilon)\|w\|^2\right] &\le \frac{1}{n^2}; \quad\mbox{and}\\ \Pr\left[\left\|\sqrt{\frac{d}{k}}Aw\right\|^2\gt (1+\epsilon)\|w\|^2\right] &\le \frac{1}{n^2}. \end{align} }

Think of $\displaystyle{ w }$ as a $\displaystyle{ w=u-v }$ for some $\displaystyle{ u,v\in V }$. Then by applying the union bound to all $\displaystyle{ {n\choose 2} }$ pairs of the $\displaystyle{ n }$ points in $\displaystyle{ V }$, the random projection $\displaystyle{ A }$ violates the distortion requirement with probability at most

$\displaystyle{ {n\choose 2}\cdot\frac{2}{n^2}=1-\frac{1}{n}, }$

so $\displaystyle{ A }$ has the desirable low-distortion with probability at least $\displaystyle{ \frac{1}{n} }$. Thus, the low-distortion embedding can be found by trying for expected $\displaystyle{ n }$ times (recalling the analysis fo geometric distribution).

We can further simplify the problem by normalizing the $\displaystyle{ w }$. Note that for nonzero $\displaystyle{ w }$'s, the statement that

$\displaystyle{ (1-\epsilon)\|w\|^2\le\left\|\sqrt{\frac{d}{k}}Aw\right\|^2\le(1+\epsilon)\|w\|^2 }$

is equivalent to that

$\displaystyle{ (1-\epsilon)\frac{k}{d}\le\left\|A\left(\frac{w}{\|w\|}\right)\right\|^2\le(1+\epsilon)\frac{k}{d}. }$

Thus, we only need to bound the distortions for the unit vectors, i.e. the vectors $\displaystyle{ w\in\mathbf{R}^d }$ that $\displaystyle{ \|w\|=1 }$. The rest of the proof is to prove the following lemma for the unit vector in $\displaystyle{ \mathbf{R}^d }$.

 Lemma 3.1 For any unit vector $\displaystyle{ w\in\mathbf{R}^d }$, it holds that $\displaystyle{ \Pr\left[\|Aw\|^2\lt (1-\epsilon)\frac{k}{d}\right]\le \frac{1}{n^2}; }$ $\displaystyle{ \Pr\left[\|Aw\|^2\gt (1+\epsilon)\frac{k}{d}\right]\le \frac{1}{n^2}. }$

As we argued above, this lemma implies the Johnson-Lindenstrauss Theorem.

### Random projection of fixed unit vector $\displaystyle{ \equiv }$ fixed projection of random unit vector

Let $\displaystyle{ w\in\mathbf{R}^d }$ be a fixed unit vector in $\displaystyle{ \mathbf{R}^d }$. Let $\displaystyle{ A }$ be a random matrix which projects the points in $\displaystyle{ \mathbf{R}^d }$ onto a uniformly random $\displaystyle{ k }$-dimensional subspace of $\displaystyle{ \mathbf{R}^d }$.

Let $\displaystyle{ Y\in\mathbf{R}^d }$ be a uniformly random unit vector in $\displaystyle{ \mathbf{R}^d }$. Let $\displaystyle{ B }$ be such a fixed matrix which extracts the first $\displaystyle{ k }$ coordinates of the vectors in $\displaystyle{ \mathbf{R}^d }$, i.e. for any $\displaystyle{ Y=(Y_1,Y_2,\ldots,Y_d) }$, $\displaystyle{ BY=(Y_1,Y_2,\ldots, Y_k) }$.

In other words, $\displaystyle{ Aw }$ is a random projection of a fixed unit vector; and $\displaystyle{ BY }$ is a fixed projection of a uniformly random unit vector.

A key observation is that:

 Observation The distribution of $\displaystyle{ \|Aw\| }$ is the same as the distribution of $\displaystyle{ \|BY\| }$.

The proof of this observation is omitted here.

With this observation, it is sufficient to work on the subspace of the first $\displaystyle{ k }$ coordinates of the uniformly random unit vector $\displaystyle{ Y\in\mathbf{R}^d }$. Our task is now reduced to the following lemma.

 Lemma 3.2 Let $\displaystyle{ Y=(Y_1,Y_2,\ldots,Y_d) }$ be a uniformly random unit vector in $\displaystyle{ \mathbf{R}^d }$. Let $\displaystyle{ Z=(Y_1,Y_2,\ldots,Y_k) }$ be the projection of $\displaystyle{ Y }$ to the subspace of the first $\displaystyle{ k }$-coordinates of $\displaystyle{ \mathbf{R}^d }$. Then $\displaystyle{ \Pr\left[\|Z\|^2\lt (1-\epsilon)\frac{k}{d}\right]\le \frac{1}{n^2}; }$ $\displaystyle{ \Pr\left[\|Z\|^2\gt (1+\epsilon)\frac{k}{d}\right]\le \frac{1}{n^2}. }$

Due to the above observation, Lemma 3.2 implies Lemma 3.1 and thus proves the Johnson-Lindenstrauss theorem.

Note that $\displaystyle{ \|Z\|^2=\sum_{i=1}^kY_i^2 }$. Due to the linearity of expectations,

$\displaystyle{ \mathbf{E}[\|Z\|^2]=\sum_{i=1}^k\mathbf{E}[Y_i^2] }$.

Since $\displaystyle{ Y }$ is a uniform random unit vector, it holds that $\displaystyle{ \sum_{i=1}^dY_i^2=\|Y\|^2=1 }$. And due to the symmetry, all $\displaystyle{ \mathbf{E}[Y_i^2] }$'s are equal. Thus, $\displaystyle{ \mathbf{E}[Y_i^2]=\frac{1}{d} }$ for all $\displaystyle{ i }$. Therefore,

$\displaystyle{ \mathbf{E}[\|Z\|^2]=\sum_{i=1}^k\mathbf{E}[Y_i^2]=\frac{k}{d} }$.

Lemma 3.2 actually states that $\displaystyle{ \|Z\|^2 }$ is well-concentrated to its expectation.

### Concentration of the norm of the first $\displaystyle{ k }$ entries of uniform random unit vector

We now prove Lemma 3.2. Specifically, we will prove the $\displaystyle{ (1-\epsilon) }$ direction:

$\displaystyle{ \Pr[\|Z\|^2\lt (1-\epsilon)\frac{k}{d}]\le\frac{1}{n^2} }$.

The $\displaystyle{ (1+\epsilon) }$ direction is proved with the same argument.

Due to the discussion in the last section, this can be interpreted as a concentration bound for $\displaystyle{ \|Z\|^2 }$, which is a sum of $\displaystyle{ Y_1^2,Y_2^2,\ldots,Y_k^2 }$. This hints us to use Chernoff-like bounds. However, for uniformly random unit vector $\displaystyle{ Y }$, $\displaystyle{ Y_i }$'s are not independent (because of the constraint that $\displaystyle{ \|Y\|=1 }$). We overcome this by generating uniform unit vectors from independent normal distributions.

The following is a very useful fact regarding the generation of uniform unit vectors.

 Generating uniform unit vector Let $\displaystyle{ X_1,X_2,\ldots,X_d }$ be i.i.d. random variables, each drawn from the normal distribution $\displaystyle{ N(0,1) }$. Let $\displaystyle{ X=(X_1,X_2,\ldots,X_d) }$. Then $\displaystyle{ Y=\frac{1}{\|X\|}X }$ is a uniformly random unit vector.

Then for $\displaystyle{ Z=(Y_1,Y_2,\ldots,Z_k) }$,

$\displaystyle{ \|Z\|^2=Y_1^2+Y_2^2+\cdots+Y_k^2=\frac{X_1^2}{\|X\|^2}+\frac{X_2^2}{\|X\|^2}+\cdots+\frac{X_k^2}{\|X\|^2}=\frac{X_1^2+X_2^2+\cdots+X_k^2}{X_1^2+X_2^2+\cdots+X_d^2} }$.

To avoid writing a lot of $\displaystyle{ (1-\epsilon) }$'s. We write $\displaystyle{ \beta=(1-\epsilon) }$. The first inequality (the lower tail) of Lemma 3.2 can be written as:

\displaystyle{ \begin{align} \Pr\left[\|Z\|^2\lt \frac{\beta k}{d}\right] &= \Pr\left[\frac{X_1^2+X_2^2+\cdots+X_k^2}{X_1^2+X_2^2+\cdots+X_d^2}\lt \frac{\beta k}{d}\right]\\ &= \Pr\left[d(X_1^2+X_2^2+\cdots+X_k^2)\lt \beta k(X_1^2+X_2^2+\cdots+X_d^2)\right]\\ &= \Pr\left[(\beta k-d)\sum_{i=1}^k X_i^2+\beta k\sum_{i=k+1}^d X_i^2\gt 0\right]. &\qquad (**) \end{align} }

The probability is a tail probability of the sum of $\displaystyle{ d }$ independent variables. The $\displaystyle{ X_i^2 }$'s are not 0-1 variables, thus we cannot directly apply the Chernoff bounds. However, the following two key ingredients of the Chernoff bounds are satisfiable for the above sum:

• The $\displaystyle{ X_i^2 }$'s are independent.
• Because $\displaystyle{ X_i^2 }$'s are normal, it is known that the moment generating functions for $\displaystyle{ X_i^2 }$'s can be computed as follows:
 Fact 3.3 If $\displaystyle{ X }$ follows the normal distribution $\displaystyle{ N(0,1) }$, then $\displaystyle{ \mathbf{E}\left[e^{\lambda X^2}\right]=(1-2\lambda)^{-\frac{1}{2}} }$, for $\displaystyle{ \lambda\in\left(-\infty,1/2\right) }$

Therefore, we can re-apply the technique of the Chernoff bound (applying Markov's inequality to the moment generating function and optimizing the parameter $\displaystyle{ \lambda }$) to bound the probability $\displaystyle{ (**) }$:

\displaystyle{ \begin{align} &\quad\, \Pr\left[(\beta k-d)\sum_{i=1}^k X_i^2+\beta k\sum_{i=k+1}^d X_i^2\gt 0\right]\\ &= \Pr\left[\exp\left\{(\beta k-d)\sum_{i=1}^k X_i^2+\beta k\sum_{i=k+1}^d X_i^2\right\}\gt 1\right] \\ &= \Pr\left[\exp\left\{\lambda\left((\beta k-d)\sum_{i=1}^k X_i^2+\beta k\sum_{i=k+1}^d X_i^2\right)\right\}\gt 1\right] &\quad (\text{for }\lambda\gt 0)\\ &\le \mathbf{E}\left[\exp\left\{\lambda\left((\beta k-d)\sum_{i=1}^k X_i^2+\beta k\sum_{i=k+1}^d X_i^2\right)\right\}\right] &\quad \text{(by Markov inequality)}\\ &= \prod_{i=1}^k\mathbf{E}\left[e^{\lambda(\beta k-d)X_i^2}\right]\cdot\prod_{i=k+1}^d\mathbf{E}\left[e^{\lambda\beta k X_i^2}\right] &\quad (\text{independence of }X_i)\\ &= \mathbf{E}\left[e^{\lambda(\beta k-d)X_1^2}\right]^{k}\cdot\mathbf{E}\left[e^{\lambda\beta k X_1^2}\right]^{d-k} &\quad \text{(symmetry)}\\ &=(1-2\lambda(\beta k-d))^{-\frac{k}{2}}(1-2\lambda\beta k)^{-\frac{d-k}{2}} &\quad \text{(by Fact 3.3)} \end{align} }

The last term $\displaystyle{ (1-2\lambda(\beta k-d))^{-\frac{k}{2}}(1-2\lambda\beta k)^{-\frac{d-k}{2}} }$ is minimized when

$\displaystyle{ \lambda=\frac{1-\beta}{2\beta(d-k\beta)}, }$

so that

\displaystyle{ \begin{align} &\quad\, (1-2\lambda(\beta k-d))^{-\frac{k}{2}}(1-2\lambda\beta k)^{-\frac{d-k}{2}}\\ &= \beta^{\frac{k}{2}}\left(1+\frac{(1-\beta)k}{(d-k)}\right)^{\frac{d-k}{2}}\\ &\le \exp\left(\frac{k}{2}(1-\beta+\ln \beta)\right) &\qquad (\text{since }\left(1+\frac{(1-\beta)k}{(d-k)}\right)^{\frac{d-k}{(1-\beta)k}}\le e)\\ &= \exp\left(\frac{k}{2}(\epsilon+\ln (1-\epsilon))\right) &\qquad (\beta=1-\epsilon)\\ &\le \exp\left(-\frac{k\epsilon^2}{4}\right) &\qquad (\text{by Taylor expansion }\ln(1-\epsilon)\le-\epsilon-\frac{\epsilon^2}{2}), \end{align} }

which is is $\displaystyle{ \le\frac{1}{n^2} }$ for the choice of k in the Johnson-Lindenstrauss theorem that

$\displaystyle{ k\ge4(\epsilon^2/2-\epsilon^3/3)^{-1}\ln n }$.

So we have proved that

$\displaystyle{ \Pr[\|Z\|^2\lt (1-\epsilon)\frac{k}{d}]\le\frac{1}{n^2} }$.

With the same argument, the other direction can be proved so that

$\displaystyle{ \Pr[\|Z\|^2\gt (1+\epsilon)\frac{k}{d}]\le \exp\left(\frac{k}{2}(-\epsilon+\ln (1+\epsilon))\right)\le\exp\left(-\frac{k(\epsilon^2/2-\epsilon^3/3)}{2}\right) }$,

which is also $\displaystyle{ \le\frac{1}{n^2} }$ for $\displaystyle{ k\ge4(\epsilon^2/2-\epsilon^3/3)^{-1}\ln n }$.

Lemma 3.2 is proved. As we discussed in the previous sections, Lemma 3.2 implies Lemma 3.1, which implies the Johnson-Lindenstrauss theorem.