Week 9
Problem 1
Consider four points on the real line, \(x_1=0\), \(x_2=1\), \(x_3=R\), and \(x_4=R+1\), where \(R>2\). Their similarity graph joins each point to its nearest neighbour, giving two connected components: the edges \(\{1,2\}\) and \(\{3,4\}\), each with similarity weight \(1\).
- Every vertex has degree \(1\), so \(\bfD=\bfI\) and the constraints from lecture simplify. The one-dimensional Laplacian eigenmap then minimizes \[ (y_1-y_2)^2+(y_3-y_4)^2 \quad\text{subject to}\quad \sum_{i=1}^4 y_i=0,\qquad \sum_{i=1}^4 y_i^2=1. \] Explain why it collapses each connected component to a point. Does the distance between the two resulting points depend on \(R\)?
- Instead, apply classical MDS in one dimension to all the original Euclidean distances \(\delta_{ij}=|x_i-x_j|\). Can it preserve all these distances exactly? Explain how its output changes as \(R\) increases, and why the two methods respond differently.
You do not need to compute any eigenvectors.
- Taking \(y_1=y_2=1/2\) and \(y_3=y_4=-1/2\) satisfies both constraints and gives energy zero, the smallest possible value. Every minimizer must therefore have \(y_1=y_2\) and \(y_3=y_4\). The constraints force these two values to be \(1/2\) and \(-1/2\), up to an overall sign, so the two embedded points are distance \(1\) apart, independently of \(R\).
- Yes: these are already Euclidean distances between points on a line, so classical MDS recovers the centered coordinates, up to reflection: \[ -\frac{R+1}{2},\quad -\frac{R-1}{2},\quad \frac{R-1}{2},\quad \frac{R+1}{2}. \] Each pair retains its internal distance \(1\), and the gap between the pairs is \(R-1\), which grows with \(R\). MDS receives the distances between the pairs as well as those within each pair. The similarity graph and its weights stay unchanged as \(R\) increases, so the eigenmap receives no information about the growing gap.
Problem 2
A path in a graph is a sequence of vertices joined by edges, and its length is the sum of the lengths of those edges. The shortest-path distance \(d_G(i,j)\) is the smallest length of any path from vertex \(i\) to vertex \(j\), with \(d_G(i,i)=0\). If there is no such path, the distance is infinite. Isomap measures distances by shortest paths in a neighbourhood graph, then applies classical MDS to those distances.
Consider points \(\bfx_1,\ldots,\bfx_n\) joined only by the edges of a chain, with positive edge lengths \(\ell_i=\|\bfx_{i+1}-\bfx_i\|_2\). The chain may bend through space.
Find positions \(t_1,\ldots,t_n\) on the real line such that \(|t_i-t_j|=d_G(i,j)\) for every pair \(i,j\). Explain what this tells us about applying one-dimensional MDS to these graph distances.
Set \(t_1=0\) and \(t_i=\ell_1+\cdots+\ell_{i-1}\) for \(i\geq2\). For \(i<j\), the unique simple path from \(i\) to \(j\) follows the chain, so \[ d_G(i,j)=\ell_i+\cdots+\ell_{j-1}=t_j-t_i=|t_j-t_i|. \] Detours cannot shorten a path because all edge lengths are positive. Thus the graph distances are exactly Euclidean distances between the \(t_i\) on a line. Classical MDS recovers these positions after centering, up to reflection: it straightens the chain while retaining its consecutive edge lengths, regardless of how the original chain bends.
Problem 3
Let \(s_1,s_2\) be independent random signs, each equally likely to be \(+1\) or \(-1\). Each choice of \((s_1,s_2)\) defines a linear map \[ f_{s_1,s_2}(x_1,x_2)=s_1x_1+s_2x_2. \] Consider the fixed points \(\bfa=(0,0)\) and \(\bfb=(1,1)\).
- What values can \(|f_{s_1,s_2}(\bfa)-f_{s_1,s_2}(\bfb)|^2\) take, and with what probabilities?
- Show that its expectation equals \(\|\bfa-\bfb\|_2^2\), even though no outcome preserves this squared distance exactly. Conclude why preserving squared distances in expectation does not imply that an individual random map preserves distances.
- We have \(f_{s_1,s_2}(\bfa)=0\) and \(f_{s_1,s_2}(\bfb)=s_1+s_2\). The signs agree with probability \(1/2\), giving squared distance \(4\), and disagree with probability \(1/2\), giving squared distance \(0\).
- The expected squared distance is \(\tfrac12\cdot4+\tfrac12\cdot0=2=\|\bfa-\bfb\|_2^2\). But the original distance is \(\sqrt2\), and the mapped distance is always either \(0\) or \(2\). Averaging over random maps can give the correct squared distance even when every individual map gets the distance wrong. This identity concerns the expectation of the squared distance, not the expectation of the distance itself.
Problem 4
A linear map \(f(\bfx)=\bfA\bfx\), with \(\bfA\in\Rbb^{k\times d}\) and \(k<d\), reduces the number of coordinates used to represent a point. In a random projection, \(\bfA\) is chosen at random; here, consider any fixed choice of \(\bfA\).
- Explain why there must be two distinct points in \(\Rbb^d\) that \(f\) sends to the same point.
- Does this rule out preserving all pairwise distances in a particular finite dataset? Give an example of three distinct points whose pairwise distances are all preserved by \(f(x_1,x_2)=x_1\). Explain the distinction between preserving distances throughout \(\Rbb^d\) and preserving distances within a given dataset.
- Now consider the finite dataset \(\mathbf{0},\bfe_1,\ldots,\bfe_d\), where \(\bfe_i\) are the standard basis vectors of \(\Rbb^d\). Show that preserving all its pairwise distances exactly would force \(\bfA\bfe_1,\ldots,\bfA\bfe_d\) to be orthonormal. Deduce that no choice of \(\bfA\in\Rbb^{k\times d}\) with \(k<d\) can preserve these distances exactly.
- Linear dependence gives a nonzero vector \(\bfv\) with \(\bfA\bfv=\mathbf{0}\). Thus \(f(\bfv)=f(\mathbf{0})\), although \(\bfv\neq\mathbf{0}\). The map cannot preserve the distance between these two points.
- No: for example, \((0,0)\), \((1,0)\), and \((3,0)\) map to \(0\), \(1\), and \(3\), retaining every pairwise distance. The map collapses vertical differences, but none of the differences between these data points is vertical. Part 1 guarantees a collapsed pair somewhere in the ambient space; it does not say that such a pair occurs in a given dataset.
- Since \(f(\mathbf{0})=\mathbf{0}\), preserving distances to the origin gives \(\|\bfA\bfe_i\|_2=1\) for every \(i\). For \(i\neq j\), the original squared distance is \(\|\bfe_i-\bfe_j\|_2^2=2\), so preservation requires \[ 2=\|\bfA\bfe_i-\bfA\bfe_j\|_2^2 =1+1-2(\bfA\bfe_i)^\top(\bfA\bfe_j). \] Thus the images are pairwise orthogonal unit vectors. They are linearly independent, so \(\Rbb^k\) could contain all \(d\) of them only if \(k\geq d\). Randomly choosing \(\bfA\) cannot overcome this obstruction to exact preservation; allowing small errors is essential if we want dimension reduction to work for arbitrary finite datasets.
Problem 5
Can classical MDS stretch distances? Let \(\bfx_1,\ldots,\bfx_n\in\Rbb^d\), with mean \(\bar\bfx\), and let \(\bfX\) have rows \((\bfx_i-\bar\bfx)^\top\). The input distances for MDS are \(\delta_{ij}=\|\bfx_i-\bfx_j\|_2\). Write the thin SVD of \(\bfX\) as \(\bfX=\bfU_r\Sigma_r\bfV_r^\top\), with singular values \(\sigma_1\geq\cdots\geq\sigma_r>0\). For \(1\leq m\leq r\), let \(\bfU_m\) and \(\bfV_m\) contain the first \(m\) left and right singular vectors, respectively, and let \(\Sigma_m=\operatorname{diag}(\sigma_1,\ldots,\sigma_m)\).
You may use that classical MDS on Euclidean distances returns the rows \(\bfy_i^\top\) of \[ \bfY=\bfU_m\Sigma_m=\bfX\bfV_m, \] up to rotation or reflection.
Your goal is to show that MDS cannot increase any pairwise distance, \[ \|\bfy_i-\bfy_j\|_2\leq\|\bfx_i-\bfx_j\|_2, \] and to determine when equality holds.
Fix a pair \(i,j\) and write \(\bfq=\bfx_i-\bfx_j\). Let \(\bfP=\bfV_m\bfV_m^\top\), the orthogonal projection onto \(S=\operatorname{span}\{\bfv_1,\ldots,\bfv_m\}\).
- Using \(\bfY=\bfX\bfV_m\), show that \(\bfy_i-\bfy_j=\bfV_m^\top\bfq\).
- Show that \(\|\bfV_m^\top\bfq\|_2^2=\|\bfP\bfq\|_2^2\). Hint: Remember your orthogonal projection properties!
- Finally, show that \[ \|\bfx_i-\bfx_j\|_2^2 =\|\bfy_i-\bfy_j\|_2^2+\|\bfq-\bfP\bfq\|_2^2. \] Conclude that \(\|\bfy_i-\bfy_j\|_2\leq\|\bfx_i-\bfx_j\|_2\). When does equality hold, and what does that say geometrically about \(\bfx_i-\bfx_j\) and \(S\)? Hint: Recall \(\bfq=\bfP\bfq+(\bfq-\bfP\bfq)\).
- Row \(i\) of \(\bfY=\bfX\bfV_m\) is \(\bfy_i^\top=(\bfx_i-\bar\bfx)^\top\bfV_m\). Transposing and subtracting gives \[ \bfy_i-\bfy_j =\bfV_m^\top\big((\bfx_i-\bar\bfx)-(\bfx_j-\bar\bfx)\big) =\bfV_m^\top\bfq. \] Both points have the same mean subtracted, so it cancels in their difference.
- Since \(\bfP\) is an orthogonal projection, \(\bfP^\top\bfP=\bfP\). Thus \[ \|\bfV_m^\top\bfq\|_2^2 =\bfq^\top\bfV_m\bfV_m^\top\bfq =\bfq^\top\bfP\bfq =\bfq^\top\bfP^\top\bfP\bfq =\|\bfP\bfq\|_2^2. \]
- Pythagoras gives \(\|\bfq\|_2^2=\|\bfP\bfq\|_2^2+\|\bfq-\bfP\bfq\|_2^2\). By parts 1 and 2, the first term on the right is \(\|\bfy_i-\bfy_j\|_2^2\), giving the claimed identity. The remaining term is nonnegative, so \(\|\bfy_i-\bfy_j\|_2\leq\|\bfx_i-\bfx_j\|_2\). Equality holds exactly when \(\bfq=\bfP\bfq\), that is, when \(\bfx_i-\bfx_j\in S\). Geometrically, the segment joining the points has no component in a discarded direction. The individual points need not lie in \(S\).