Las Vegas, Monte Carlo, and Integer Factorization

Monte Carlo algorithms typically have a fixed runtime but a variable error rate.

Las Vegas algorithms have a variable runtime but a fixed (i.e. zero) error rate.

Stanisław Ulam came up with the idea of Monte Carlo methods in 1946 and Nicholas Metropolis coined the term “Monte Carlo” the next year.

László Babai coined the term “Las Vegas algorithm” in 1979 as a pun on Monte Carlo.

Las Vegas factoring algorithm in the news

There’s a new paper on GitHub titled Unconditional Integer Factorization in Time LN[1/3, O(1)]. It is a Las Vegas algorithm because it always [1] returns a correct factorization, though the time it takes to execute is random.

What is unconditional about the new algorithm? The analysis of the new algorithm does not depend on any unproven assumptions. Before there was a proof of the (Generalized) Riemann Hypothesis, many theorems were conditional because they assumed the GRH. The fastest integer factorization algorithms are not dependent on GRH but are dependent on other widely believed but unproven conjectures.

The notation LN[α, c], commonly used in computational number theory, stands for

exp(c (log N)α (log log N)1−α)

The fastest commonly used factorization method at this time is the GNFS (general number field sieve). Its runtime is

LN[1/3, (64/9)1/3 + o(1)] ≈ LN[1/3, 1.923]

This means that the c term is (64/9)1/3 = 1.923 plus a term that goes to zero as N increases.

For the new algorithm, the α term is the same as GNFS but the c term is something less than 105. This is a bound on the worst-case expected time. The runtime is not as good as GNFS but the runtime proof does not depend on any unproven assumptions. The best unconditional algorithm before this recent result was LN[1/2, 1].

 

[1] Las Vegas algorithms halt with probability 1. In practice they terminate, but strictly speaking they are partial functions, functions that give a correct result when they terminate.

Covering a body with eight smaller copies of itself

It’s obvious that you could cover a cube with smaller cubes. You could, for example, take a cube with side 1 and cover it with cubes of side ½ centered on each corner.

It’s not as obvious how you would cover a ball with smaller balls, but you could cover the unit ball with balls of radius ½√3 centered at the points (±½, ±½, ±½).

Covering a sphere with eight smaller spheres

In fact, you could cover a ball with four smaller balls [1].

Now consider an arbitrary convex shape K in three dimensions with non-empty interior. Is it possible to cover K by copies of itself? Since K has non-empty interior, you could cover K by putting a smaller version of K around every point. And if K is compact, then this cover has a finite subcover. But there might be a lot of elements in this finite cover. What’s the minimum number possible in general? It takes eight cubes to cover a cube, so the minimum is at least 8. But could some odd shape take more?

Hadwiger’s covering conjecture says that K can be covered by eight copies of itself. That is, there exists a scaling constant 0 < λ < 1 and shift vectors vi such that

K \subseteq \bigcup_{i=1}^8 (\lambda K + v_i)

Dror Aiger, Sariel Har-Peled, and Goran Žužić posted a proof of Hadwiger’s conjecture on arXiv yesterday. The abstract to their paper says “The proof was discovered using an experimental harness on top of Gemini 4 Carbon and formally verified in Lean 4.”

I’ve heard good things about the Google’s new Carbon model. This is the first announcement of a major theorem proved with the assistance of a Google model that I’ve noticed.

Related posts

[1] Inscribe the vertices of regular tetrahedron on the unit sphere, then multiply the vectors representing the vertices by ⅓. Center spheres of radius ⅔√2 at each vertex.

Polynomials and Planets

A couple days ago I wrote about how the force of gravity varies over the surface of an oblate planet. Earth is slightly oblate, i.e., it has an equatorial bulge, and this oblateness has a significant effect on satellite orbits. More on that here.

The fictional planet Mesklin in Hal Clement’s novel Mission of Gravity is extremely oblate due to its rapid rotation, and apparent gravity varies by two orders of magnitude between the equator and the poles. As science fiction authors often do, Clement took some aspect of familiar experience and exaggerated it to make it easier to appreciate.

The gravitational potential of an oblate spheroid as a function of the polar angle θ is proportional to

1 − J2 P2(cos θ)

where P2 is the second Legendre polynomial. There are more terms of the form

J2n P2n(cos θ)

but the most significant term is the one with coefficient J2, hence the J2 effect.

I learned about Legendre polynomials long before I learned about gravity calculations, and so my first reaction when seeing the result above would be that gravitational calculations are another example of places where Legendre polynomials pop up. While this is true, it’s historically backward. Legendre discovered the polynomials that now bear his name because they came up in his gravitational calculations.

It would be more historically informed to say that the polynomials falling out of Legendre’s exploration of gravity have found applications elsewhere, and often for the same reasons: because they fall out of calculations involving radial symmetry. That’s why they appear in E&M, acoustics, and quantum mechanics.

Legendre polynomials also appear in applications that have nothing to do with radial symmetry. For example, the most common form of Gaussian quadrature is based on Legendre polynomials. More on that here.

Finite Projective Spaces

Just as there are finite projective planes, there are also finite projective spaces of higher dimension.

The axioms of a projective space are

  1. Any two distinct points lie on exactly one line.
  2. If A, B, C, and D are distinct points and the lines AB and CD meet, then the lines AC and BD also meet.
  3. Every line contains at least three points.
  4. There are at least two lines.

The second axiom is subtly different from its counterpart for projective planes. It allows for skew lines but not parallel lines. There’s no explicit concept of dimension in these axioms, but dimension can be well-defined by induction.

What I find most interesting about finite projective spaces is that they are in some sense simpler than projective planes. Usually higher dimensions allow for more complicated behavior, but at least as far as classification goes, higher dimensional spaces are simpler.

Finite projective planes are not determined by the number of points they contain. As mentioned in this post, there are four different projective planes with 10 points. It is unknown how many different projective planes there are with 17 points; there are at least 22. But for dimension d ≥ 3, there is at most one projective space with a specified number of points.

Given a prime power q, there is a unique field F with q elements, and one can construct a projective space of dimension d over F analogously to how one constructs a real projective space of dimension d: Take the non-zero vectors in Fd + 1 and mod out by non-zero scalar multiples. And up to isomorphism this is the only way to construct a finite projective space if d ≥ 3. In technical terms, finite projective planes can be non-Desarguesian but higher-dimensionsal projective spaces cannot.

Related posts

Two generators suffice

Every finite simple group is generated by at most two elements. This is a consequence of the classification of finite simple groups (CFSG).

Not only that, with high probability any two elements chosen at random will work. For non-Abelian finite simple groups G, the probability that two randomly chosen elements will generate G approaches 1 as the size of the group |G| → ∞ [1].

Note that this result was published before the CFSG was complete. The list of finite simple groups was complete, and widely believed to be complete, but the proof that it was complete was not finished.

[1] W. M. Kantor and A. Lubotzky, “The probability of generating a finite classical group,” Geometriae Dedicata 36 (1990), 67–87.

Gravity on an oblate planet

A spherical planet is not a point mass, but the gravity on the surface is the same as if the mass were concentrated at a point in the center. If a planet is not spherical but rather an oblate spheroid, the point-mass approximation doesn’t work.

Suppose a planet has equatorial radius a and polar radius b, with a significantly larger than b. We’ll compare the point-mass model with the uniform density model.

Oblate spheroid

If the surface of the planet were a massless shell, with all the mass concentrated at a point in the center, the force of gravity would be inversely proportional to the square of the distance to the center. Gravity at the poles would be proportional to 1/b² and gravity on the equator would be proportional to 1/a². The ratio of the polar gravity to equatorial gravity would be (a/b)².

The model above grossly overestimates the variation in gravity. It’s not even useful for moderately oblate planets, such as the one we live on.

It’s true that if a/b is nearly 1 then the gravity ratio is also near 1, but the approximation overestimates the effect of flattening by an order of magnitude.

Flattening is defined to be

ε = 1 − b/a.

Assuming the planet has uniform density, the ratio of polar gravity to equatorial gravity has the following expansion in ε:

1 + ε/5 + (9/175) ε² + …

Now a/b = 1/(1 − ε) and so

(a/b)² = 1/(1 − ε)² = 1 + 2ε + 3ε² + …

To first order approximation, the effect of flattening is ε/5, but the point-mass approximation estimates the effect as 2ε, off by a factor of 10.

I became interested in this problem because I started reading a novel that takes place on an oblate spheroidal planet Mesklin with enormous variation in gravitational strength from pole to equator [1]. On a more nearly spherical planet like Earth, oblateness still matters a great deal when calculating satellite orbits. This is called the J2 effect.

Update: Here is a plot of gravity and apparent gravity on Mesklin as functions of latitude. Apparent gravity varies from 3 g at the equator to 665 g at the poles.


[1] Hal Clement, Mission of Gravity, serialized in 1953, published as a book in 1954. The planet in the novel rotates every 18 minutes, which explains why it is so oblate. The rotation also increases the ratio of apparent gravity because centrifugal force decreases the apparent gravity at the equator.

 

What is the Generalized Riemann Hypothesis?

There were two proofs of the Riemann Hypothesis (RH) announced today: one AI-generated and one human-generated.Both claimed to prove something more general, the Generalized Riemann Hypothesis (GRH) which of course includes RH as a special case.

The RH says that the all the zero of the Riemann zeta function ζ(s) in the critical strip, i.e. the region of the complex plane where s has real part between 0 and 1, occur on the central line Re(s) = ½.

There is a ladder of conjectures of that replace ζ(s) with ever more general families of functions, always with the same conclusion, that all the zeros in the critical strip lie on the central line.

The bottom rung of the latter is the Riemann Hypothesis with ζ(s). The next rung up is the Generalized Riemann Hypothesis for the class of functions L(s, χ). The higher rungs are more abstract than I care to get into.

The Riemann zeta function is defined to be analytic continuation of the function

\zeta(s) = \sum_{n=1}^\infty \frac{1}{n^s}

The expression above is only valid for s with real part greater than 1, but the function can be uniquely extended to the entire complex plane, except for the point s = 1, by analytic continuation.

The functions L(s, χ) replace the numerator in the sum above with a function χ(n).

L(s, \chi) = \sum_{n=1}^\infty \frac{\chi(n)}{n^s}

Again this function is defined by the series above where the series converges and extended by analytic continuation to the rest of the complex plane. The remaining work is to describe the class of functions the χ belong to. Importantly this class of functions includes the constant function χ(n) = 1, which corresponds to ζ(s).

The functions χ(n) are called Dirichlet characters of modulus m, for positive integer m, which means χ: ℤ → ℂ satisfies

  1. χ(ab) = χ(a) χ(b)
  2. χ(a) = 0 iff gcd(a, m) > 1
  3. χ has period m.

For example, χ could be a Legendre or Jacobi symbol with n on top and m on bottom. For the Legendre symbol m must be an odd prime, and for the Jacobi symbol m is only required to be an odd number.

Supersequences and Superpermutations

A word is universal if it contains every permutation of its alphabet as a subsequence: the letters must appear in order, but gaps are allowed.

For example, you can find all six permutations of the digits 1, 2, and 3 inside the string 1231213. Not all permutations can be found as a contiguous substring—that would be a superpermutation—but all can be found as a subsequence.

The word

01234567890123456780293451670823451960782134506978231405678213904567823109456782301

is universal for the set of 10 digits. This word was discovered some time ago, but Jason Davies has recently proved that this the smallest universal word on 10 digits. It has 83 characters, and Davies proved that no word of 82 characters is universal over the digits. See his paper here.

I’m surprised that all 10! = 3,628,800 permutations of 10 digits can be found as subsequences of such a relatively short word.

Universal words, or supersequences, are easily confused with superpermutations. See OEIS sequences A062714 and A180632. Minimal length superpermutations are necessarily longer than minimal length supersequences [1] since the requirements on the former are stricter, requiring permutations to appear as contiguous substrings and not merely as subsequences. In other words, every superpermutation is a supersequence, but not vice versa.

For example,

123412314231243121342132413214321

is a minimal superpermutation on four symbols while

123412314213

is a minimal supersequence.

Note that it’s trivial to produce a supersequence: just concatenate all n! permutations of the symbols into one sequence. But finding minimal supersequences and minimal superpermutations is challenging.

 

[1] For n = 1 or 2 the minimal supersequence and minimal superpermutation are the same. For n > 2 they are not.

Orbital footnote

A couple days ago I wrote a post about the orbit of a new dwarf planet candidate. The article says the newly discovered object, ED138, has an orbital period of 281.1 years and is “46 times farther from the sun than Earth is.”

The earlier post showed that we can infer from Kepler’s third law that the orbit must be elliptical, and that therefore the phrase “46 times farther from the sun” is ambiguous. The post worked out the orbit of ED138 under the assumption that the object is 46 AU from the sun at its aphelion, the point in its orbit furthest from the sun.

But what if is “46 times farther from the sun” refers to the average distance from the sun? I added a footnote to the post to explore this possibility. I wanted to expand that footnote into its own post because there’s something I find interesting about it.

If the maximum distance of ED138 from the sun is 46 AU, then the orbit is an ellipse with eccentricity e =  0.072. My intuition was that if we assumed the average distance from ED138 to the sun is 46 AU it wouldn’t make much difference. But it does. In this case the eccentricity becomes e = 0.38, about five times larger.

The outer ellipse, plotted in blue, is the orbit assuming 46 AU is the maximum distance. It’s nearly circular. The blue dot is the position of the sun, near the center of the ellipse.

The inner ellipse, plotted in orange, is the orbit assuming 46 AU is the mean distance. It’s noticeably more elliptical. The orange dot is the position of the sun, further away from the center of the ellipse.

Update: Someone pointed out an error in my original post, and I updated the plot. Now I’m back to the difference between the two orbits not being so big. As always, the change in eccentricity makes more of a difference to the position of the sun in the orbit than to the shape of the orbit.

Related posts

The longest polynomial level set

Let p(z) be a polynomial with leading coefficient 1, i.e. a monic polynomial. What is the maximum length of the curve

{z : |p(z)| = 1}

for each degree n?

Erdős conjectured that the maximum length was obtained by the polynomial p(z) = zn − 1. He was right, as Teng Zhang proved recently.

Examples

Here’s an example for degree five. The maximum length is obtained by p(z) = z5 − 1.

This curve has length 15.02.

Here’s the corresponding curve for p(z) = z5 − z

which has length 6.909.

In general the level set {z : |p(z)| = 1} need not be connected, in which case the length is the sum of the lengths of the components.

Here’s an example that tweaks the constant parameter of the optimal curve p(z) = z5 − 1.1.

This curve has (total) length 14.59.

Details

The length of the maximum curve for given n is the length for the polynomial p(z) = zn − 1. The only curves obtaining the maximum length are translations and rotations of this curve.

Note that for n = 1 the maximum curve is a circle and for n = 2 the curve is the lemniscate of Bernoulli. The general curve is called the Erdős lemniscate of order n, generalizing Bernoulli’s lemniscate.

The maximum length for given n is

21/n B(1/n, 1/2n)

where B is the beta function.

The Erdős lemniscates look similar to the “rose” curves r = cos(nθ), but these curves are not polynomial level sets.

Related posts