Here is an original reproducible finite set with 40 points and 512 coordinates. Let be the first four vectors of the standard basis of . With point indices , generateThe four groups have different centers, and the standard normal random variables perturb all 512 coordinates. Generate the coordinates in row order using NumPy's PCG64 pseudorandom number generator with seed 20261013. Then keep this finite set fixed. A second PCG64 stream with seed 424242 generates a matrix of independent random variables with the standard normal distribution; divide it by to obtain the Gaussian Johnson–Lindenstrauss transform.
For all 780 unordered pairs, compute the distance ratio . In this draw, its minimum is approximately and its maximum , giving a maximum relative error in Euclidean distance of about . The squared-distance ratios instead range from approximately to : their maximum relative error is about . Thus this particular draw fails a 20% distance tolerance. The Johnson–Lindenstrauss lemma does not assert that every draw into 32 dimensions must succeed.
The two bands of original Euclidean distances distinguish pairs within a group from pairs between groups. Their spread after the linear map shows why checking an average distance is insufficient: the Johnson–Lindenstrauss lemma controls every pair. The dashed 20% distance band is an illustrative tolerance, not a confidence interval or a squared-distance band. The affine hull of 40 points has dimension at most 39; 512 is the ambient coordinate count, and no full-dimensionality assumption is required. For this draw the bi-Lipschitz distortion is approximately .
Now keep the same points and draw 48 fresh Gaussian Johnson–Lindenstrauss transforms for each target dimension . NumPy's
SeedSequence(314159).spawn(240) supplies distinct PCG64 streams, ordered first by target dimension, then by draw. Each stream generates a new random matrix, normalized by ; no map is a row prefix of another map. Each plotted value isThe observed median maximum relative errors in Euclidean distance are approximately , , , , and , respectively. All pairs fall inside the 20% distance tolerance in , , , , and of the 48 draws, respectively. These are computations on one synthetic finite set, rather than optimal dimension bounds or measured physical data. The displayed quantiles describe the sampled maps; they do not certify a success probability for other sets. Even at 128 dimensions, 13 of the sampled maps fail this tolerance.
The practical benefit is that each point acquires fewer coordinates while its pairwise Euclidean distances can remain useful. The choice of target dimension balances compression, accuracy, and failure probability. For example, a conservative sufficient squared-distance tolerance with and gives by the explicit bound above. Here that exceeds the ambient dimension, so the identity map is better for a certified guarantee. The much smaller dimensions in the plots illustrate observed behavior without claiming that this sufficient bound is sharp.
Linear congruential generator 2026-10-14
Choose integers , , and a seed . Iterate and return . This gives a deterministic finite-state pseudorandom number generator with output in . A nonzero increment gives a mixed generator; gives a multiplicative generator. Its period is at most , but even a full period does not guarantee good multidimensional uniformity or statistical independence.
Past exam of the mathematics course of the University of Cambridge 2001 iii Paper 23 4 b Solution Created 2026-10-03 Updated 2026-10-14
One method applies inverse transform sampling to the standard normal cumulative distribution function: , followed by for mean and standard deviation . Numerical approximations to are needed, and the endpoints must be avoided.
A convenient alternative is the Box-Muller transform. From independent uniforms setThe radial probability density function is for , and the angle is independently uniform on . Dividing their joint density by the polar-coordinate Jacobian determinant givesThus the outputs are independent standard normal distribution draws. Apply to obtain other normal means and variances. With finite pseudorandom number generators, this is an approximation to the ideal independent-uniform model; poor dependence in the input stream is not cured by the transform.
Past exam of the mathematics course of the University of Cambridge 2008 iii Paper 47 3 a Solution Created 2026-10-03 Updated 2026-10-14
A good pseudorandom number generator for Monte Carlo integration should have approximately uniform outputs, a period much longer than the intended run, and negligible detectable dependence both serially and in higher-dimensional tuples. It should be fast, reproducible from a seed, portable enough to reproduce a calculation, and numerically precise enough for the required tail probabilities. Values strictly inside avoid singularities in logarithmic inverse transform sampling. Separate simulations also need well-separated streams or seeds, rather than accidentally identical streams. A pseudorandom number generator is deterministic; these properties mean that it imitates independent uniform distributions sufficiently well for the application, not that its outputs are literally independent.
Pseudorandom number generator 2026-10-14
A pseudorandom number generator is a deterministic state-update algorithm producing numbers intended to imitate an independent sequence from a prescribed probability distribution. For Monte Carlo integration, desirable features include good one-dimensional and multidimensional uniformity, a period far longer than the calculation, negligible detectable dependence, reproducible seeds, sufficient numerical precision and fast generation. Uniform marginal distributions alone do not provide independent draws.

