User:Sintel/Expected Dirichlet coefficient for temperaments

From Xenharmonic Wiki
Revision as of 01:45, 11 May 2026 by Sintel (talk | contribs) (link badness article)
Jump to navigation Jump to search

In the context of regular temperament theory, a natural question is how well a given temperament approximates just intonation relative to its complexity. The Dirichlet coefficient gives a quantitative way to measure this. This is the same as the "badness" used on the wiki, though the derivation here is given for the regular Euclidean norm for clarity.

Given a target vector [math]\displaystyle{ y \in \mathbb{R}^n }[/math], such as the vector of log-primes in some p-limit, and a rank-k temperament X, the Dirichlet coefficient is defined as:

[math]\displaystyle{ d(y, X) \cdot H(X)^{\frac{n}{n-k}} }[/math]

where [math]\displaystyle{ d(y, X) }[/math] is the projective distance between the target vector and the temperament, and [math]\displaystyle{ H(X) }[/math] is the height (or complexity) of the temperament. Both of these quantities can be computed straightforwardly using the temperament's Plücker coordinates.

This coefficient generalizes Dirichlet's approximation theorem. A fundamental result in Diophantine approximation by W. M. Schmidt[1] states that for any valid target vector y, there exists a constant [math]\displaystyle{ C_{n,k} }[/math] such that there are infinitely many rational subspaces X which satisfy:

[math]\displaystyle{ d(y, X) \cdot H(X)^{\frac{n}{n-k}} \le C_{n,k} }[/math]

The exponent is critical or sharp for this problem: if we replace the exponent by [math]\displaystyle{ \tfrac{n}{n-k} + \epsilon }[/math] for some [math]\displaystyle{ \epsilon > 0 }[/math], then we find only finitely many solutions.

By analyzing the distribution of rational points on the Grassmannian, we can derive the expected value for this coefficient, giving us a baseline to determine whether a temperament is a "good" or "bad" approximation relative to its complexity. Importantly, this measure does not take into account any kind of psychoacoustics, so it is not in any way "calibrated" to human tolerance to tuning error. Instead, it is a purely mathematical metric of coincidence. The upside is that this is robust over an arbitrary range of complexities and does not rely on any free parameters or empirical weights.

Motivating example: equal temperaments in the 5-limit

To understand the Dirichlet coefficient, let's look at rank-1 temperaments (equal temperaments) in the 5-limit (n=3). Our target vector is the standard just intonation vector of log-primes:

[math]\displaystyle{ y =[\log_2(2), \log_2(3), \log_2(5)] \approx [1, 1.585, 2.322] }[/math]

An equal temperament is defined by a line through the origin with a rational slope. For example, 12-equal temperament corresponds to the line passing through the integer vector [math]\displaystyle{ X_{12} =[12, 19, 28] }[/math]. This approximation is good in the sense that the ratios of its coordinates closely match the target vector:

[math]\displaystyle{ \frac{19}{12} \approx \log_2(3), \quad \frac{28}{12} \approx \log_2(5) }[/math]

Because we are in 3D, the wedge product used to define projective distance reduces to the standard cross product. The projective distance is the sine of the angle [math]\displaystyle{ \theta }[/math] between the temperament line and the JI vector:

[math]\displaystyle{ d(X_{12}, y) = \sin(\theta) = \frac{\|X_{12} \times y\|}{\|X_{12}\| \|y\|} \approx 0.00276 }[/math]

Since the angle is extremely small (which is always the case for any reasonable temperament) we can take [math]\displaystyle{ \sin(\theta) \approx \theta }[/math].

The height is simply the Euclidean norm of the integer vector:

[math]\displaystyle{ H(X_{12}) = \sqrt{12^2 + 19^2 + 28^2} \approx 35.902 }[/math]

For an equal temperament (k=1) in the 5-limit (n=3), the critical exponent is 3/2. This is equivalent to the classical Dirichlet theorem for simultaneous approximation of two irrational numbers.

Plugging this into our formula gives the Dirichlet coefficient for 12-ET:

[math]\displaystyle{ C_{12} = d(X_{12}, y) \cdot H(X_{12})^{3/2} \approx 0.00276 \times 35.902^{1.5} \approx 0.595 }[/math]

We can compare this to the coefficients of some other 5-limit equal temperaments. Lower values indicate that the temperament is exceptionally accurate for its size, while higher values indicate poor approximations.

Temperament Dirichlet coefficient
53-ET 0.467
12-ET 0.595
34-ET 0.716
20-ET 3.855
33-ET 4.621
52-ET 6.125

Note: the point here is not to argue over which of these is "better", just that this measure generally agrees on which equal temperaments contain good approximations to 5-limit JI relative to their size.

Generalizing to higher rank

For higher-rank temperaments, we rely on Schmidt's general formula. A rank-k temperament in an n-prime limit is viewed as a rational k-dimensional subspace [math]\displaystyle{ X \in \mathrm{Gr}(k, n) }[/math]. By slight abuse of notation, we will identify X directly with its Plücker coordinates.

As defined in the article on Plücker coordinates, the height is simply the Euclidean norm of the (reduced) Plücker coordinates, and the projective distance is given by:

[math]\displaystyle{ d(X, y) = \frac{\|X \wedge y\|}{\|X\| \|y\|} }[/math]

This has the same interpretation in terms of the sine of the minimal angle between the subspace and the target.

According to Schmidt's theorem on metric Diophantine approximation[1], the critical exponent balancing distance and height for approximating a target vector y by a k-dimensional rational subspace X is exactly [math]\displaystyle{ \tfrac{n}{n-k} }[/math], so we immediately obtain:

[math]\displaystyle{ d(y, X) \cdot H(X)^{\frac{n}{n-k}} }[/math]

While we typically assume y to be the log-primes for some p-limit, this property holds for any target vector in [math]\displaystyle{ \mathbb{R}^n }[/math], and so it cleanly generalizes to any subgroup.

Deriving the heuristic constant

For the case n=2, Hurwitz's theorem states that the best possible constant is [math]\displaystyle{ \tfrac{1}{\sqrt{5}} \approx 0.447 }[/math]. Not much is known about the exact constant needed to obtain a tight bound in the general case.

Counting temperaments

To determine the expected bound, we must first know how many temperaments exist up to a certain complexity. Another classical result by Schmidt[2] gives the asymptotic distribution of primitive (i.e., torsion-free) sublattices, which directly correspond to temperaments.

The number of rank-k temperaments with a complexity bounded by [math]\displaystyle{ H(X) \le H_{\max} }[/math] grows as:

[math]\displaystyle{ \#\left\{ X: H(X) \le H_{\max} \right\} \sim c_{n, k} H_{\max}^n }[/math]

The constant cn,k is given by the formula:

[math]\displaystyle{ c_{n, k} = \frac{1}{n} \binom{n}{k} \prod_{i=1}^{k} \frac{V(n-i+1)}{V(i)} \cdot \frac{\zeta(i)}{\zeta(n-i+1)} }[/math]

where [math]\displaystyle{ V(m) = \frac{\pi^{m/2}}{\Gamma(m/2+1)} }[/math] is the volume of the m-dimensional Euclidean unit ball, and [math]\displaystyle{ \zeta }[/math] is our good old friend, the Riemann zeta function (with the convention that the pole at [math]\displaystyle{ \zeta(1) }[/math] is treated as 1).

The distribution of random temperaments

We can find the expected minimum distance for a given maximum height by treating the temperaments as being randomly distributed on the Grassmannian manifold. This is asymptotically true by the equidistribution of rational points.[3]

By rotational invariance, projecting a fixed target vector y onto a random k-plane is statistically identical to projecting a random unit vector onto a fixed plane.

The squared projective distance is the complement of the squared length of the projection ([math]\displaystyle{ \cos^2 \theta }[/math]). From standard probability theory, the squared length of a projection of a random unit vector in [math]\displaystyle{ \mathbb{R}^n }[/math] onto a plane follows a Beta distribution. Therefore, the squared distance is distributed as:

[math]\displaystyle{ \sin^2(\theta) \sim \mathrm{Beta}\left(\frac{n-k}{2}, \frac{k}{2}\right) }[/math]

For some search distance r, the volume (with respect to the normalized Haar measure of the Grassmannian) is given by the cumulative Beta distribution:

[math]\displaystyle{ \text{Vol}(d(X,y) \le r) = \frac{1}{B\!\left(\frac{n-k}{2}, \frac{k}{2}\right)} \int_0^{r^2} s^{\frac{n-k}{2}-1}(1-s)^{\frac{k}{2}-1}\, ds }[/math]

When r is small, [math]\displaystyle{ (1-s)^{k/2 - 1} \to 1 }[/math], so the leading term is:

[math]\displaystyle{ \begin{aligned} \mathrm{Vol}(d(X,y) < r) &\approx \frac{1}{B\!\left(\frac{n-k}{2}, \frac{k}{2}\right)} \cdot \frac{r^{n-k}}{\frac{n-k}{2}} \\[10pt] &= \frac{\Gamma\!\left(\frac{n}{2}\right)}{\Gamma\!\left(\frac{k}{2}\right)\,\Gamma\!\left(\frac{n-k+2}{2}\right)}\, r^{n-k} \end{aligned} }[/math]

Since there are [math]\displaystyle{ c_{n, k} H_{\max}^n }[/math] planes available, the expected number that fall in this radius is:

[math]\displaystyle{ \mathbb{E}[\#\{X : H(X) \leq H_{\max},\ d(y,X) \leq r\}] \approx c_{n,k} \cdot H_{\max}^n \cdot \frac{\Gamma\!\left(\frac{n}{2}\right)}{\Gamma\!\left(\frac{k}{2}\right)\,\Gamma\!\left(\frac{n-k+2}{2}\right)} \cdot r^{n-k} }[/math]

Setting this equal to 1 and taking the (n-k)-th root, we find:

[math]\displaystyle{ r \cdot H_{\max}^{\frac{n}{n-k}} \approx \left( c_{n,k} \frac{\Gamma\!\left(\frac{n}{2}\right)}{\Gamma\!\left(\frac{k}{2}\right)\,\Gamma\!\left(\frac{n-k+2}{2}\right)} \right) ^ {\frac{-1}{n-k}} }[/math]

which recovers the same critical exponent, but now with an explicit constant Ch for our Dirichlet bound.

A temperament with a coefficient much better than this is exceptional: the heuristic says you would need to search through exponentially more planes to find it by chance.

The following table gives the values of Ch for some small dimensions:

n k = 1 k = 2 k = 3 k = 4
2 1.645
3 1.071 0.574
4 1.011 0.400 0.345
5 1.012 0.435 0.235 0.263

References

  1. 1.0 1.1 Wolfgang M. Schmidt. On Heights of Algebraic Subspaces and Diophantine Approximations. Annals of Mathematics, Vol. 85, No. 3 (1967), pp. 430-472, theorem 15 doi:10.2307/1970352
  2. Wolfgang M. Schmidt. Asymptotic formulae for point lattices of bounded determinant and subspaces of bounded height. Duke Mathematical Journal Vol. 35 No. 2, pp. 327-339 (1968), theorem 1 doi:10.2307/1970352
  3. Wolfgang M. Schmidt. The distribution of sub-lattices of Zm. Monatshefte für Mathematik Vol. 125 No. 1, pp 37–81 (1998) doi:10.1007/BF01489457