Chapter 3. Similarity, distance, and the angle

Data Mining as Observation, draft 0.3, 2026-09-09. Week 3 of ECE 514. Reading due before this chapter is TSK 2.4 [1]. Every number below traces to a committed file listed in the last section.

Every method in the rest of this course rests on a notion of which two rows are alike. Classification, clustering, outlier detection, and retrieval each begin by asking that question and each inherits the answer as a hidden assumption. This chapter is about the answer.

The standard treatment offers a menu. Euclidean distance, the Minkowski family, cosine similarity, Jaccard and simple matching for binary data, correlation, and a weighted combination for mixed types. The menu is correct and the reader should know it. What the menu does not say is how to choose. This chapter says that a distance is a decision about what to ignore, that the decision is right or wrong only relative to the consumer that reads the result, and that the most consequential entry on the menu, cosine against Euclidean, is a theorem about spectral embeddings in disguise. It ends with two claims about hubs that sounded right and were refuted under seal.

3.1 A distance is a choice of what to ignore

Take two rows of a table as vectors. Euclidean distance reads every coordinate at the scale it arrives in. Cosine similarity reads the angle between the two vectors and ignores both lengths. Jaccard reads which binary attributes are shared and ignores how many are jointly absent. Correlation reads the shape of the two rows after each has its mean removed and its spread divided out. The weighted combination for mixed types reads each attribute through the rule for its type and ignores the rest. Three of these are similarities rather than distances, and the distinction matters for what follows. Cosine, Jaccard, and correlation are scores that grow with nearness, and each induces a distance, the angle for cosine, one minus the coefficient for Jaccard, and one minus the correlation for correlation. The angle and the Jaccard distance are metrics. One minus the correlation is not, since it can fail the triangle inequality, and its square root is. When the chapter says distance it means the induced distance, and when it says similarity it means the score.

Each of these is a quotient, in the sense of section 0.6. It takes the space of all possible rows, declares a set of transformations that should not change the answer, and reports a distance on the classes that remain. Cosine declares that scaling a row by any positive number should not change the answer. Correlation declares that shifting and scaling should not. Jaccard declares that joint absence should not. The Euclidean distance declares nothing and is therefore the identity quotient. It ignores nothing and is at the mercy of every unit choice, which is why the session deck demonstrates its scale dependence live and why standardization is the first move in almost every pipeline.

Chapter 1 wrote an observer as a consumer, an output metric, and a budget. A distance function is the output metric. Choosing one is choosing which transformations of the data the consumer will not see. The chapter's whole argument is that the choice cannot be made from the data alone. It has to be made from the consumer.

3.2 Cosine versus Euclidean is a statement about the reader

The session deck poses the choice as a question of when direction is the signal and magnitude is the nuisance. That framing is right, and it is worth seeing what it costs to get wrong.

Two errors of the same size that a consumer ranks four to one. Take two error distributions with the same total variance. The first spreads 0.3 of it along the horizontal axis and 1.7 along the vertical. The second is the reverse. Every consumer-blind metric, mean squared error, trace, total variance, reads them as identical, because the trace, the sum of the variances (section 0.3), is 2.0 for each. Now take a consumer that reads a single direction fifteen degrees from horizontal. The distortion it experiences is the variance of the error along its read direction, computed as in section 0.3. Against the first distribution that reads 0.39. Against the second it reads 1.61. Two errors that every classical metric calls equal are ranked 4.1 to one by the consumer. A second consumer reading at 75 degrees ranks them the other way. Neither ranking is visible to any metric that does not name a reader, and both are computed rather than drawn in the figure script the observation program ships. The prospective version of this, on real estimation and control systems, inverted the verdict in 100 percent of trace-matched systems.

$$\begin{gathered} d_O(u)=u^{\top}\Sigma\,u, \qquad u=(\cos15^\circ,\ \sin15^\circ), \\ \Sigma_1=\operatorname{diag}(0.3,1.7),\ \Sigma_2=\operatorname{diag}(1.7,0.3), \qquad d_O=0.394\ \text{vs}\ 1.606. \end{gathered} \tag{3.1}$$

The flip in this form, the opposite rankings, the equal traces, and the two readings to three decimals, is machine-checked in Lean in appendix C.

Two readers, two rankings, one pair of errorserror 1, diag(0.3, 1.7)error 2, diag(1.7, 0.3)reader at 15 degreesreader at 75 degreeserror 1error 200.511.52variance the reader sees15 degrees, error 1 0.3940.39415 degrees, error 2 1.6061.60615 degrees75 degrees, error 1 1.6061.60675 degrees, error 2 0.3940.39475 degreesratio 4.1 to one, in opposite directions
Figure 3.1. The four-to-one flip. Two error distributions with trace 2.0, a reader at 15 degrees, and a reader at 75 degrees. Each reader ranks the two distributions the opposite way.

Cosine against Euclidean is this figure with a different quotient. Cosine reads direction and discards length. If the consumer reads direction, cosine is the right quotient and Euclidean wastes resolution on a nuisance. If the consumer reads length, cosine has thrown the signal away and the cosine number can be arbitrarily good while the consumer's number is arbitrarily bad. Chapter 11 has the measured instance, a codec that reads cosine 0.995 while the reader's output collapses by three orders of magnitude, and it states the condition under which direction-only is safe. The consumer's metric must be carried by the tangential part of the displacement between vectors. For cosine ranking over roughly isotropic embeddings it is. For a softmax reading per-channel scale it is not. The test is whether moving between two nearby rows turns the vector or only lengthens it. Where it turns, the angle carries the geometry.

That the squared Euclidean distance is the identity reader's quadratic form, and that rescaling one coordinate changes which of two rows is nearer, are machine-checked in Lean in appendix C.

That every unit reader reads an isotropic covariance the same, and that two codes with the variances exchanged are read alike by a reader off the diagonal exactly when the variances agree, so that the flip needs anisotropy, are machine-checked in Lean in appendix C.

That condition is not a heuristic. It is the mechanism of a theorem about the most important embedding in unsupervised data mining, and the next section states it.

3.3 The magnitude of a spectral embedding is degree noise, and the angle keeps the geodesics

Spectral clustering, which returns in week nine, builds a neighbourhood graph over the rows, takes the eigenvectors of the graph's Laplacian with the smallest eigenvalues, which are the smoothest functions on the graph (section 0.10), embeds each row as its values in those eigenvectors, and clusters the embedding. One step of the standard algorithm has always looked arbitrary. Ng, Jordan, and Weiss row-normalize the embedding [6], projecting every row onto the unit sphere, before clustering. They did it because it improved results.

The collapse. The commute time between two nodes is the expected number of steps a random walk needs to travel from one to the other and back, and section 0.10 describes the scaling of the spectral embedding whose Euclidean distance equals it. Von Luxburg, Radl, and Hein proved that this distance degenerates as the graph grows [17]. For a random neighbourhood graph sampled from a smooth manifold, a curved surface in the sense of section 0.10, of dimension three or more, the resistance between two nodes, which is the commute time divided by the number of edges, converges to the sum of the reciprocals of their degrees, uniformly over pairs. The distance loses all dependence on where the two nodes are and keeps only how connected each one is. Read as a verdict on the tool, spectral embedding dies at scale.

$$R(i,j)=\sum_{k\ge2}\frac1{\lambda_k}\left(\frac{u_k(i)}{\sqrt{d_i}}-\frac{u_k(j)}{\sqrt{d_j}}\right)^{2}\ \longrightarrow\ \frac1{d_i}+\frac1{d_j}\quad(n\to\infty,\ \dim\ge3). \tag{3.2}$$

Where the geometry went. Put each node's low-mode embedding vector in polar form, a radius times a direction on the unit sphere. The commute distance is exactly the Euclidean distance in the full embedding, so the collapse theorem is a statement about that distance. A squared distance that is a sum of one term per node is the squared distance of a simplex, in which the points are mutually orthogonal and each point's squared length is its own term. The one surviving degree of freedom per node is the radius, and the radius converges to one over the square root of the degree. The radius is degree noise. Measured on the substrates below, the correlation between radius and degree runs from 0.92 to 0.99. The low eigenvectors, meanwhile, converge to the smoothest functions on the manifold itself, and the embedding built from a fixed number of them preserves geodesic distance up to a constant factor, which section 0.10 calls bi-Lipschitz. Sampling density multiplies each embedding vector by a positive scalar. Dividing that scalar out pointwise is row normalization, and what remains is the direction of an embedding whose Euclidean distances are comparable to geodesics.

$$X_i=r_i\,\theta_i,\qquad r_i\ \to\ \frac1{\sqrt{d_i}},\qquad \theta_i=\frac{X_i}{\|X_i\|}\in S^{m-1}. \tag{3.3}$$

The measurement. On a two-dimensional torus with known geodesics [18], the angle of the low-mode embedding alone preserves the ranking of geodesic distances at a Spearman correlation (section 0.8) of 0.93, flat as the number of modes grows. The magnitude alone preserves it at 0.03. The full embedding, magnitude times direction, preserves it at about 0.75 and decays as modes are added. A random-mode control reads about 0.01 throughout.

substrateemergent dimensionangle-only Spearmanrandom-mode control
two-torus, reference20.930.01
king lattice20.820.01
swiss-roll trajectory20.930.01
emergent rewriting-system manifold2.07 plus or minus 0.010.82 plus or minus 0.010.01
causal set, Lorentzian2.9 to 10.7, fails0.570.01
small world, geometry destroyed3.6 to 4.3, fails0.450.00

Lorentzian geometry is the geometry of spacetime, in which the separation between two events can be zero or negative, so no Euclidean embedding can represent it, and a causal set is a graph built from such a geometry. It is included as a substrate that should fail. The control fails everywhere it should and the metric degrades exactly where the geometry is Lorentzian or has been destroyed. The program's own description is that this is a geometry detector, not a magic wand.

Angle-only Spearman against geodesic distance, by substrate00.250.50.751Spearman correlationtwo-torus, angle only 0.930.93two-torus, random-mode control 0.010.01two-torusking lattice, angle only 0.820.82king lattice, random-mode control 0.010.01king latticeswiss roll, angle only 0.930.93swiss roll, random-mode control 0.010.01swiss rollrewriting model, angle only 0.820.82rewriting model, random-mode control 0.010.01rewriting modelcausal set, angle only 0.570.57causal set, random-mode control 0.010.01causal setsmall world, angle only 0.450.45small world, random-mode control 00small worldrung 4 floor 0.75angle onlyrandom-mode controlthe last two substrates should fail and do
Figure 3.2. Angle-only spectral coarse-graining preserves geodesic rank on substrates with genuine low-dimensional geometry and fails where the geometry is Lorentzian or destroyed. The random-mode control reads near zero throughout.

The folk practice, explained. Row normalization is the projection onto the angular coordinate. The angular coordinate is the read subspace of any consumer that ranks by geodesic distance. That coordinate is the one the collapse spares. A step taken for a decade because it improved results is the optimal quotient for a specific, nameable observer. The theorem writes down what the practice already knew.

What is proved and what is not. The radial half is a rigorous consequence of the collapse theorem plus the spectral identity for commute time, for intrinsic dimension three and above. Dimension two is a borderline with logarithmic corrections and is treated empirically. In dimension one the radius stays informative. The angular half is split three ways, and one more word is needed to state it. A filter is the rule for how much weight each eigenvector gets in the embedding. The commute filter divides each eigenvector by the square root of its eigenvalue. The heat filter multiplies it by an exponentially decaying function of the eigenvalue, which suppresses the high modes faster. At a fixed number of modes, angular distance is locally bi-Lipschitz to geodesic distance under stated hypotheses, and unconditionally so on the flat torus. Uniformly in the number of modes, the bi-Lipschitz form is a theorem for the heat filter and is false for the commute filter, because high modes raise the angular speed like the square root of the eigenvalue, exactly on the circle, and the stretch factor grows without bound. The rank form, that the angular ranking of pairs stays faithful uniformly in the number of modes, is proved for intrinsic dimension three and below through a theorem that the ranking converges to a fixed ranking determined by the manifold alone, exactly rank one on the circle and on the sphere and projective space in two and three dimensions, and reduces to the positivity of one geometric coefficient. That positivity on general manifolds is open, and the obstruction sits at dimension four.

The false statement in that list was the program's own earlier claim. Version 0.8 of the theory paper asserted the metric form uniformly in the number of modes at fixed scale, and a later proposition in the same paper refuted it. The refutation is carried in the ledger as the first standing negative, and it is what keeps the theorem from over-claiming. The angle survives. It does not survive uniformly in the mode count for every filter.

Two further negatives sit beside the result. A reframing of the embedding in hyperbolic geometry was tested with controls and rejected. A spectacular raw correlation of negative 0.98 between emergent curvature and rewriting activity deflated, once the hub structure was partialled out, to negative 0.14, a tautology about hubs rather than a dynamical law. Across twenty emergent manifolds from five rule families, angular fidelity falls with emergent dimension along a line near 1.09 minus 0.157 times the dimension, and the program reports that as a five-family exploratory trend, clustered by rule, not as a law.

That geodesic distance is symmetric, obeys the triangle inequality on a connected graph, and that the geodesic-rank reader's nearest neighbour is unchanged by a strictly increasing transform of the distances, are machine-checked in Lean in appendix C. The radius-and-angle claim itself is the measurement above.

That row normalization puts every embedded row on the unit sphere, leaves the cosine between rows unchanged, and ignores a positive rescaling of a row, is machine-checked in Lean in appendix C.

For the data-mining reader the payoff is concrete. When the rows of a table are embedded spectrally, the cosine between two embedded rows is the right similarity and the Euclidean distance between them is the wrong one, not by taste but because the Euclidean distance has been proved to converge to a function of two degrees. The week-nine algorithm already knows this. Now the reader knows why.

3.4 Distance concentration is the reader running out of resolution

The session deck closes with the curse of dimensionality. Draw points at random in a cube of increasing dimension and the ratio between the farthest and nearest neighbour of a query converges to one. Everything becomes equidistant, and nearest-neighbour methods, density estimates, and distance-based outlier scores lose their contrast.

Read through the observer, concentration is the identity quotient failing. A Euclidean reader weighs every coordinate equally. In high dimension most coordinates carry nuisance for any particular consumer, and the sum of many nuisance terms dominates the few directions that carry signal, so every distance is mostly the same noise. The remedy the rest of the course pursues, dimensionality reduction in week four, feature selection, and learned representations in week eleven, is in every case a quotient that discards directions the consumer does not read. The contrast comes back when the reader stops paying for directions it does not use.

The algebra of the narrowing, that the relative spread of a squared distance summed over independent coordinates is the variance over the dimension times the squared mean, falls with the dimension, and drops below any resolution at some dimension, is machine-checked in Lean in appendix C. That real data obey the independence model is not a theorem, and the section says where they do not.

The measurement instrument of chapter 11 reports a related floor with every reading. When a consumer reads r directions of a d-dimensional input, the overlap a random guess would achieve is r over d. Below that floor a similarity number is chance, and the instrument prints the floor beside the number so that the reader cannot mistake one for the other. A similarity score reported without its chance level is the high-dimensional version of a distance reported without its units.

3.5 Hubs are made by the queries

Take a corpus of vectors, find each vector's ten nearest neighbours, and count how many times each vector appears in some other vector's list. In low dimension the count is about ten for everyone. In the dimensions embeddings occupy, a few vectors appear in hundreds of lists and a large fraction appear in almost none. The first are hubs and the second are anti-hubs. The skewness of the count distribution is the standard summary [19]. Hubness emerges with dimension for exactly the reason of section 3.4. When distances concentrate, tiny systematic advantages decide the top ten, and a point slightly closer to the data mean, or sitting where the data is slightly denser, wins many lists at once.

The skewness does not say what the hubs are. A real text corpus and a synthetic look-alike were measured at essentially the same count skewness [12]. The real corpus's busiest point appeared in 78 lists. The synthetic corpus's busiest point appeared in 369. In the real corpus, being a hub was predicted by local density, with correlation about 0.67 against the negative tenth-neighbour distance, and hubs sat about eight percent below the population's local scale. In the synthetic corpus, hubs were 34 percent closer to the mean than average. One scalar, two mechanisms, and the remedies differ. Centrality hubs call for centering. Density hubs call for mutual-proximity rescaling. Applying one remedy to the other mechanism wastes the fix.

The count needs a null. The benchmark that measures hubness scores it against a Poisson null [16]. The Poisson distribution gives the probability of each count when slots are handed out at random, and section 0.9 works the example with this chapter's numbers. If retrieval slots were assigned to points with no structure at all, the busiest of n points would still reach a count that grows with the number of points and with the slots per point. The measured busiest count divided by that no-structure ceiling is the hub excess. A value of one means the busiest point is no busier than chance would make it. The benchmark's own docstring says to use the excess, not the raw share, whenever the claim is about the corpus rather than about a workload, and it defines a budget parameter, queries times k over corpus size, that any statistic compared across corpus sizes must hold fixed or be expressed without.

$$\text{hub excess}=\frac{\max_i N_k(i)}{c^{\star}},\qquad c^{\star}=\max\{c:\ n\Pr[\mathrm{Poisson}(\mu)\ge c]\ge1\},\qquad \mu=\frac{n_q\,k}{n}. \tag{3.4}$$

The Poisson ceiling on the busiest point, mean count 0.1, fifty thousand points0123456789101112retrieval countexpected points, log scale0.1110100100010000count 0, expected 4.52e+04 pointscount 1, expected 4.52e+03 pointscount 2, expected 226 pointscount 3, expected 7.54 pointscount 4, expected 0.189 pointscount 5, expected 0.00377 pointscount 6, expected 6.28e-05 pointscount 7, expected 8.98e-07 pointscount 8, expected 1.12e-08 pointscount 9, expected 1.25e-10 pointscount 10, expected 1.25e-12 pointscount 11, expected 1.13e-14 pointscount 12, expected 9.45e-17 pointsone point expectedceiling 3measured busiest count 12measured 12, excess 4
Figure 3.3. Hub excess. Five hundred queries hand ten thousand retrieval slots to fifty thousand points, a mean of 0.1 per point. Under the Poisson null the busiest point reaches 3. A measured busiest count of 12 is an excess of 4.

The queries decide. The counts are collected over a query set, so hubness is a property of the corpus together with the query distribution, the distance, and k. A corpus that looks mildly hubby under its own rows as queries can look extremely hubby under a real workload that keeps visiting the same regions. The benchmark then asked the question directly on a real corpus of 1024-dimensional embeddings with one thousand committed real queries. Of eight latent features, the best single predictor of who gets retrieved, for all four response variables at every partition size, was a scalar measure of how much query mass sits near a point. Seven features of local corpus geometry, density, three neighbour radii, radius slope, local intrinsic dimension, and anisotropy, together added at most 20 percent to what that one scalar already carried, against a registered threshold of 25 percent on three of four responses. Zero of four cleared it. The registered failure clause reads that retrieval response depends on the latent code essentially through one axis, query exposure. A point is not a hub because of where it sits. It is a hub because of what the queries ask for.

That the skewness of the count distribution is unchanged by a shift and a positive rescaling and is zero for a symmetric distribution is machine-checked in Lean in appendix C.

For a project this means one thing. Any hubness number in a report names the query set it was computed with. The corpus-to-corpus reading is not a substitute for the workload.

3.6 Two hubness stories that were tested and failed

Hubness invites mechanisms. Two were proposed inside the program, sealed, and refuted. Both are kept at the prominence of the results around them.

A density quotient that only works inside diffusion. Inside spectral methods there is a known family of density normalizations, indexed by an exponent [20], in which the exponent one removes the sampling density and recovers the manifold's Laplace operator. The proposal was that the same exponent-one quotient would restore invariant fidelity in at least one non-spectral setting, direct retrieval, product-quantized search, or diffusion distance computed without the spectrum. The prereg was sealed and the claim was tested four times. In direct retrieval and quantized search the quotient hurt, because density is not in the retrieval base and the database density is entangled with the signal, so down-weighting it removes signal and manufactures anti-hubs. In diffusion distance the exponent one was indeed optimal, but the restoration was under two percent and a uniform-density control gained as much, 0.015 against 0.019. The density-removal mechanism is absent outside the operator it was found in. The retained positive is narrow and exact. Exponent one is the optimal diffusion exponent, and that effect is confined to the spectral operator.

Hubness does not weaken Bell. Because hubness depends on the query distribution, someone will eventually notice that a Bell experiment has queries. Each side of the experiment chooses a measurement setting, and the settings select which correlation is measured. If query-dependent concentration meant that the four correlations entering the inequality were averaged over four different populations, the standard bound would not apply. The program sealed a constraint-first audit [13]. With the shared state sampled independently of the settings, each side responding only to its own setting, and every emitted trial counted, the four-term combination reached a maximum of 2.00000 across 72 configurations spanning dimension three to 128, concentrated density cores, and heavily skewed sampling weights. The correlation between the combination and the hubness statistic was negative 0.036. The same trials, rescored by keeping only pairs in which both sides registered an outcome, read 2.7308. Three deliberately broken controls fired, post-selection at 2.748 with no-signalling intact, measurement dependence at 2.386, and broken locality at 3.174. The violation was the accounting. What survived is a vocabulary for one of the assumptions behind the inequality. What did not survive is a mechanism.

The second story is included in a data-mining textbook for one reason. The reasoning that produced it was the same reasoning that produced section 3.5, and it was wrong. A framework that explains hubness correctly will generate hypotheses that sound like it and are false, and the only defence is the seal.

3.7 What a similarity choice must state

A project report that uses any distance or similarity states the following beside its first use.

A report that chooses cosine because it is conventional, without naming the reader, will be returned with this list.

Exercises

Warm-up

  1. For each of Euclidean distance, cosine similarity, correlation, and Jaccard, name the transformation it ignores and one consumer for which ignoring it is wrong.
  2. Explain why standardizing the columns of a table changes the geometry a Euclidean reader sees rather than the quotient, and name the operation in chapter 2 that does change the quotient.
  3. A reader at 45 degrees is applied to the two distributions of section 3.2. Which does it prefer, and by how much?
  4. In one sentence each, state what von Luxburg, Radl, and Hein proved and what the polar decomposition added.
  5. Explain why row normalization of the spectral embedding discards exactly the degree and nothing else.
  6. Why must the random-mode control in the substrate table read near zero for the rest of the table to mean anything?
  7. Why is hub excess preferred over the raw maximum count when the claim is about the corpus?
  8. Give a data-mining example, not from this chapter, in which the same corpus has different hubs under two workloads.
  9. The hubness-and-Bell audit reached a maximum of exactly 2.00000 rather than a value near 2. Explain why equality rather than approximate equality made the audit more sensitive.
  10. State the difference between a rank-faithful embedding and a bi-Lipschitz one, and say which the substrate table measures.

By hand

  1. A reader at angle phi from horizontal experiences distortion 0.3 times cosine squared of phi plus 1.7 times sine squared of phi against the first distribution of section 3.2, and the same expression with 0.3 and 1.7 exchanged against the second. Find the angle at which the two distortions are equal. Compute both distortions at 30 degrees and their ratio.
  2. A star graph has one centre joined to five leaves. Compute the resistance between two leaves and between the centre and a leaf, treating each edge as a unit resistor. Compare each to the sum of the reciprocals of the two degrees, and state for which pair the von Luxburg limit is already exact.
  3. Three nodes are embedded in the plane at angles 0, 90, and 180 degrees. Their geodesic distances are 90, 180, and 90 degrees for the pairs AB, AC, and BC. Compute the angle-only distances, the chord lengths on the unit circle, and confirm they rank the pairs the same way as the geodesics. Now give node B radius 3 and the others radius 1, compute the full Euclidean distances, and state which pair's rank is broken.
  4. Two hundred queries each retrieve five neighbours from a corpus of ten thousand points. Compute the mean count, the Poisson ceiling, and the hub excess of a point with count 9.
  5. For points drawn uniformly in a cube, the ratio of the standard deviation of squared distance to its mean shrinks like one over the square root of the dimension. By what factor does the relative spread of distances shrink from dimension 10 to dimension 1000?
  6. Two corpora have the same count skewness. In the first the busiest point has count 78 and sits 8 percent below the population's local scale. In the second the busiest point has count 369 and sits 34 percent closer to the mean than average. Name the mechanism in each and the remedy the chapter prescribes.

Programming

  1. Standardize a numeric dataset from your project and compute its ten nearest neighbours under Euclidean and cosine distance. Report the fraction of rows whose neighbour sets differ. For three rows where they differ, state which metric the downstream consumer should trust and why.
  2. Reproduce the four-to-one figure of section 3.2 numerically. Construct two diagonal error covariances with the same trace and a reader at a stated angle, and report the projected variance under each. Sweep the angle from 0 to 90 degrees and plot the ratio.
  3. Build a k-nearest-neighbour graph on a swiss roll or a sampled torus, compute the ten lowest non-trivial eigenvectors of the normalized Laplacian, and embed each point. Report the Spearman correlation between geodesic distance and each of angle-only distance, magnitude-only distance, and full distance, at five, ten, and twenty modes. State which of the three decays.
  4. Repeat exercise 19 on a random graph with the same number of nodes and edges. Report the same three correlations and explain why they should all be near zero.
  5. In a synthetic cube of dimension 2, 10, 100, and 1000, report the ratio of farthest to nearest neighbour distance for one hundred random queries. Then project onto the five coordinates that carry a planted signal and report the ratio again.
  6. For your project's vector corpus, compute the neighbour-count distribution under the corpus's own rows as queries and under your real query set. Report the busiest count, the Poisson no-structure ceiling, and their ratio, for both query sets.
  7. Classify the busiest twenty points of your corpus as centrality hubs or density hubs by their percentile in the centrality and local-density distributions. State which remedy each class calls for.
  8. Write one hypothesis about hubness in your corpus that you believe. Write the falsification bar. Commit both, then test it and report the outcome against the bar.

Answers to the warm-up and by-hand problems are collected in the answer key at the end of the book.

Homework 3. Choose the quotient

Assigned in week 3, due Sunday of week 4. Twenty points. Uses the dataset from your project proposal.

Part A, three metrics (5 points). Programming exercise 17, plus correlation as a third metric. A table of pairwise neighbour-set overlap between the three metrics. One paragraph naming the consumer in your project and the metric it should read, with the reason.

Part B, the angle (6 points). Programming exercises 19 and 20 on a synthetic manifold of your choice. The two tables side by side. One paragraph stating which distance decays and why the random graph reads zero.

Part C, hubs (6 points). Programming exercises 22 and 23 on your project corpus, or on a public embedding corpus if your project has none. The Poisson ceiling computed, not estimated. The busiest twenty points classified.

Part D, the memo (3 points). One page. The five items of section 3.7 stated for your project. A memo that chooses cosine because it is conventional earns zero for this part.

Preregistration. Before running Part C, commit a file stating whether you expect your corpus's hubs to be density-driven or centrality-driven and what count excess you expect. Include the commit hash in the submission. The prediction is not graded on being right. It is graded on having been made.

Sources for every number

Paths are relative to a checkout of the named repository, at the commit and with the access status listed in appendix A, all under github.com/ahb-sjsu unless appendix A says otherwise. Shas, DOIs, and versions are as recorded in the source files on 2026-09-03. A row is reproduced by opening the cited lines at that commit, and where a row names a script the command is the one the repository's README gives for it.

SectionClaimSource
3.2traces 2.0, diagonals 0.3 and 1.7, consumers at 15 and 75 degrees, distortion 0.39 vs 1.61, 4.1 to one, computed not drawnobservation-theory\assets\make_flip_figure.py:4-24,107-119
3.2100 percent verdict inversion in trace-matched systems, GO-EC-2geometric-observation\claims\LEDGER.md rows GO-EC-2 to GO-EC-7
3.2condition (A2), tangential displacementturboquant-pro\docs\KV_KEYS_FINDING.md:61-86; geometric-observation\chapters\ch09_legibility.md:42-54
3.3resistance converges to 1 over d_i plus 1 over d_j, simplex argument, radius converges to 1 over root d_ithe-angular-observer\theorem.md:110-146
3.3radius against degree correlation 0.92 to 0.99the-angular-observer\README.md:135-139
3.3angle 0.92 flat in m, magnitude 0.03, full 0.75 decayingwolfram-observer-bridge\theorem.md:1-20; the-angular-observer\theorem.md:187-224
3.3substrate tablethe-angular-observer\README.md:99-109
3.3row normalization is the projection onto the read subspace of the geodesic-rank consumergeometric-observation\chapters\ch09_legibility.md:31-41; geometric-observation\chapters\ch03_historical_precursors.md:98-110
3.3proven versus conjectured ledger, d at least 3, d equals 2 borderline, fixed-m conditional theorem, heat filter uniform, commute metric form false, Green-kernel rank limit for d at most 3, obstruction at d equals 4the-angular-observer\theorem.md:84-107,147-224; the-angular-observer\README.md:150-185
3.3the self-refuted v0.8 claim, NEG-1the-angular-observer\README.md:170-175; geometric-observation\chapters\ch16_honest_negatives.md NEG-1
3.3hyperbolic rejected, curvature negative 0.98 to negative 0.14, trend 1.09 minus 0.157 d across 20 manifolds and 5 familiesthe-angular-observer\README.md:111-147,183-185
3.4chance overlap rank over dim reported with every readingreadscope\README.md:200-222; readscope\readscope\metrics.py:31-99
3.578 vs 369, density correlation about 0.67, 8 percent vs 34 percent, centering vs mutual-proximity rescalingturboquant-pro\docs\HUBNESS_PRIMER.md:38-59,140-160
3.5Poisson null, hub excess, budget parameteropenvector-bench\openvector_bench\hubness.py:41-100
3.5query mass best single feature at every K for all four responses, seven features add at most 20 percent, threshold 1.25 on three of four, zero of four, 1000 real queries, 1024 dimensionsopenvector-bench\results\R13_STAGE0_RESULT.md:40-50; openvector-bench\results\R13_STAGE1_RESULT.md:1-40
3.6GO-5 refuted in four attempts, under 2 percent, control 0.015 vs 0.019, alpha hurts in direct and quantized retrieval, NEG-11geometric-observation\claims\LEDGER.md rows GO-5 and NEG-11; geometric-observation\experiments\GO5-diffusion-distance-NOTES.md
3.6Bell audit, max S 2.00000 across 72 configurations, d 3 to 128, correlation negative 0.036, post-selected 2.7308, controls 2.748, 2.386, 3.174, seed 20260817, sealed at 6e825d8geometric-observation\articles\2026-08-03-hubness-does-not-weaken-bell.md:1-60; geometric-observation\claims\LEDGER.md row NEG-15; geometric-observation\results\GO-bell-geometry-audit.json

previous, Chapter 2. Data, measurement, and what an observer can read  ยท  next, Chapter 4. Dimensionality reduction as consumer-relative compression