# Is it mathematically possible to create an equal temperament which matches just interval ratios?

I've coded a Python app which lets us have any number of semitones in an octave in order to experiment with microtonal music. I would like to ask if there's a possibility to create such an equal temperament which will match just interval ratios?

https://en.wikipedia.org/wiki/Equal_temperament#/media/File:Equal_Temper_w_limits.svg

As we can see on the figure above, there are 9 different equal temperaments, and 72-tet is closer to matching with just interval ratios than 12-tet. Is it mathematically possible to divide an octave the way it will perfectly match just interval ratios? For instance, 100-tet, 150-tet, etc.? Many thanks in advance!

• It's trivial to match to well beyond the limit of the human ear to distinguish the difference. I hope that's sufficient to meet your intent :-) – Carl Witthoft Apr 9 at 14:14
• @CarlWitthoft that may be true if you ignore acoustical interference, but if you don't ignore that it will be rather less trivial. – phoog Apr 9 at 23:33

By definition this is not possible.

Just intonation ratios are rational numbers, N/M where N, M are integers.

Equal temperament is based on defining the smallest ratio as the n-th root of 2, 2^(1/n).
For 12TET n = 12.

What you are basically asking is if an irrational number can be made to exactly match a ratio of integers. This will never be possible.

Since you are dealing with computers and code you probably know that 2^1/12 can not be expressed in binary with finite precision. This poses an even more interesting question in that realm. The real question is can you generate an equal tempered tuning in s/w that will match just to within a certain error tolerance? And to that the answer may be yes, but a purist would argue that the approximation is not truly equal tempered! The pragmatist would realize that no matter how hard we try we cannot ensure that instruments are tuned so that f(n+1/2)/f(n) = 2^(1/12) so the point is moot. And finally, at some point the human ear cannot tell the difference since there are physical limits to the resolution of our ear+brain system.

If you are willing to track down the limits of human resolution and account to finite precision in computer arithmetic then you might be able to generate an approximate 'TET' algorithm that provides you with Just frequency ratios that are both within the limit of human pitch discrimination and equal to within some error tolerance. That is the best you can hope for.

• I suggest improving this answer by removing the phrase "by definition" (this is impossible, but not by definition) and by explicitly explaining the fact that the n-th root of 2 is always an irrational number. If someone reads this answer not already knowing that the n-th root of 2 is always irrational, I think this answer is unlikely to make sense to them. (I apologize for the tone of my previous comment; I was being needlessly harsh.) – Tanner Swett Apr 11 at 4:04
• I understood the question as asking about 'true' equal temperament, but with n semitones per octave instead of 12. For that you have to show not just that 2^(1/12) is irrational but that 2^(m/n) is irrational, for all n>1 and all 1 <= m < n. I believe this is true, but as Tanner Swett says it's certainly not true "by definition" - it's a non-trivial result that caused a lot of blood, sweat and tears for the Pythagoreans. (And according to the legend at least, there really was blood!) – Nathaniel Apr 11 at 9:45
• What happened to all the other comments?! There is no reason for them to have been removed! This answer seems to have attracted trolls. The phase "by definition" does not refer to definitions in math but the definitions of the tuning systems themselves. I am not nor have I ever made the claim that you are focusing on regarding math. I am explaining why the two tuning system will not align and using known facts abut math in that explanation. – ggcg Apr 11 at 10:58
• Any one of us can reference a math text for more detail but inducing a thesis on it or reproduction of the proof here does not add to the explanation. As for not knowing that the n-th root of 2 is irrational reading that it is might be new info for some. Do you really think that if a reader has never heard of an irrational number or the fact that n-th root of 2 one such number that you would understand a proof of the same? That is not likely to be helpful. I think you are both misunderstanding both the meaning of the OP and the answer. – ggcg Apr 11 at 11:01

The other answers approach this from dividing the octave and showing that equal divisions must be irrational. Another way of looking at this is to consider whether we can compose an octave by successive multiplications with a rational number. The result is of course the same: we can't.

every integer greater than 1 either is a prime number itself or can be represented as the product of prime numbers and that, moreover, this representation is unique, up to (except for) the order of the factors.

Along with that, we need the definition of irreducible fraction:

Every rational number may be expressed in a unique way as an irreducible fraction a/b, where a and b are coprime integers, and b > 0.

Two numbers are "coprime" when they have no prime factor in common. Thus, a rational number can be expressed as the set of prime factors (with exponents) that defines its unique irreducible expression. For example, 81:64 may be expressed as 34 * 2−6. When you multiply ratios, you add the exponents of their prime factors. So the product of 3:2 and 5:4 (2−1 * 31 and 2−2 * 51) is 2−3 * 31 * 51, or 15:8.

You're looking for a ratio R that equally divides an octave into N parts, which means that RN equals 2. Can we identify such ratios?

The classic example is that of the perfect fifth, a ratio of 3:2. Other intervals may be found by raising that ratio to a certain power, adjusting the octave by multiplying or dividing by a power of 2. For example, the major second can be 9:8, which is the square of (3:2)2/2. The major third can be 81:64, which is (3:2)4/4. To generate all the pitches in the circle of fifths, keep multiplying. When you get back to C (which some authors will call B♯), you end up with a pitch slightly higher than seven octaves above than the one you started with. The ratio of those two frequencies is 312:212. You can't arrive precisely at the same pitch class because the prime factorization includes 3 with a non-zero exponent.

By generalizing, we can show that the same is true for every ratio R that is not itself a power of 2. (If R is a power of 2, then you have defined one-tone equal temperament, a system in which there is only one pitch class and in which the base interval is the octave or a multiple thereof, which is not interesting. This is the same as dividing the octave using the first root of 2, which is of course 2.)

Consider ratio R with at least one prime factor P unequal to 2. As with the example of the perfect fifth, every time you multiply a frequency by R, the magnitude of P's exponent in the resulting frequency is greater than it was in the original frequency. The goal is to achieve a result where P's exponent is zero, but each multiplication takes us farther from that result. It is therefore impossible.

Of course, one of the things about equal temperament is that 27/12 is so close to 1.5 that perfect fifths are close enough to pure for most purposes. From the standpoint of ratios, this comes about because 3^12 (531,441) is fairly close in value to 2^19 (524,288). You might find decent approximations by looking for numbers that are similarly close in value to some power of two.

In practice, though, I think people who have explored N-tone equal temperament as an approximation of just intonation have chosen N such that some power of the Nth root of 2 is close in value to 1.25 (the ratio of the just major third). If you're interested in some other interval then you can experiment with values of N to find a close approximation to that interval.

I feel compelled to close with this warning, however: if you have too many divisions of the octave, the system is not useful for human musicians. It's only going to be useful for a computer. If you're looking into such a system as an approximation of variable-pitch just intonation, the programmer (or the program) will have to choose which of the several notes to use. In 53-tone equal temperament, a whole step can be 8/53 or 9/53 of an octave in size. In variable-pitch just intonation, a whole step can be 10:9 ratio or a 9:8 ratio. It's basically the same problem. Why not just program your computer to use variable-pitch just intonation?

• While this is interesting how does it address the question. You seem to criticism the assumption that the octave is divided into equal step then use the fact that these are irrational to illustrate that the comparison to Just won't work. But that is in fact the definition of a TET tuning system (is it not)? What more info do we gain by first assuming that it isn't? Or is it just another way to get there. – ggcg Apr 9 at 21:15
• @ggcg I am not criticizing the decision to divide the octave into equal steps. I am proving that those steps cannot be defined as ratios. The question asks whether it's possible to have an ET tuning system where they are rational. Other answers approach this by asking whether the equal divisions can be rational; this answer asks whether ratios can define the equal divisions. "What...do we gain by first assuming that it isn't?": One way to prove that two things cannot coexist is to assume that they do and arrive at a logical contradiction. "Or is it just another way to get there": yes. – phoog Apr 9 at 22:21
• @ggcg for example, a classic proof the square root of two is irrational is to assume that it is rational, and then show that its irreducible fraction representation must have even numbers as both the numerator and denominator. But that means that the numerator and denominator are not coprime, which means that the fraction is not in fact irreducible, which is contrary to the assumption, which proves that the assumption is false. In this case, we assume that there is a rational equal division of an octave and then show that it cannot exist. – phoog Apr 9 at 22:29
• That is interesting but not necessary for the discussion imo we can use what we know to discuss the mismatch between these two systems without proving or disproving the known facts about them. The fact is that the nth root of 2 is irrational and that tet systems take the nth root of 2 as the ratio of a step. From there the rest follows. – ggcg Apr 9 at 22:43
• @ggcg if you already know that the Nth root of 2 is irrational, yes (where N is greater than 1). But if you knew that you probably wouldn't be asking this question. – phoog Apr 9 at 22:50

As I understand the question, this is pure mathematics:

No it is impossible. No matter, how many divisions you have, say n, the step width will always be nth root of two and therefore an irrational number.

The just relations are rational numbers, so there will always be approximations, but the more you choose, i. e. the higher n is, the closer you will be able to approach.

• But note that what is impossible with limited-precision digital (computer or not) representations of numbers is totally possible in the physical world. We do that all the time: We draw circles with a compass, and we draw and build rectangles. We can also tune a piano to whatever irrational intervals we desire, to the limit of the precision of execution and measurement (which is, in our analog world, essentially infinite for all practical purposes). – Peter - Reinstate Monica Apr 11 at 12:17
• @Peter-ReinstateMonica indeed. That reminds me of learning about the impossibility of representing 1/3 as a decimal. I thought "that means it's impossible to divide anything else exactly in thirds." And then I immediately realized that if the thing being divided in thirds is a multiple of three then it is possible to divide it exactly in thirds. But of course precision of measurement is not infinite, so there will always be rational values (indeed an infinite number of them) that are so close to the theoretical irrational value as to be indistinguishable. – phoog Apr 11 at 14:58
• @phoog But the essentially unknown precision is infinitely more likely an irrational number! That's something that occurred to me some time ago: That -- running counter to our intuition -- in our physical reality we actually never have true rational numbers. If you try to divide a chocolate bar fairly, you cannot hit 1/2, try as you might. Instead, you are off by a bit, and that will virtually always be an irrational number. (And if you start to argue with atoms I counter with quantum fluctuations ;-). ) – Peter - Reinstate Monica Apr 11 at 15:34
• @Peter-ReinstateMonica well sure. But theoretically it would be possible to use a fraction that is so close to the 12th root of 2 as to be practically indistinguishable. I wonder what range of beating rates is implied by the maximum precision of time measurement. – phoog Apr 11 at 15:57
• @Peter-ReinstateMonica it looks like the precision of an atomic clock allows for a beating period of roughly 60 million years at 440 Hz. – phoog Apr 11 at 16:12

You can't even get an equal temperament system* in which fifths and octaves are perfect. This is simply because if you had a system of equal steps in which an octave was A steps large and a twelfth was B steps large, it would stand to reason that B octaves would be equal to A twelfths, since both would be an interval of AB steps. This can't happen though: a just twelfth is the ratio 3:1 and an octave 2:1. If you stack multiples of an interval, you raise its ratio to a power - but no positive power of 3 equals a power of 2, given that powers of 3 are all odd and powers of 2 are all even. This reasoning basically applies to all pairs of intervals - two rational numbers sharing a power is a very special property.

Otherwise said: a fifth is equal to log(1.5)/log(2) octaves (about .585) and this number cannot be represented as a ratio of integers. However, you can try to approximate it by rational numbers - using, for instance, the convergents to that ratio (which are, in a sense, the best approximations of up to a given maximum denominator), you would get the following sequence of approximations to the ratio:

0/1, 1/1, 1/2, 3/5, 7/12, 24/41, 31/53, 179/306, ...

Where the number 7/12 would be interpreted to mean that a fifth is about 7 tones in 12TET - which is, of course, a familiar fact. These particular denominators will do far better than other fractions with a similarly large denominator in approximating a fifth - for instance, 7/12 is only off by about 3 parts per 2000 - which is far better than the approximation that log(1.5)/log(2) by rounding to the nearest hundredth: 0.58, despite this latter approximation using a denominator of 100 as 58/100. The approximation 31/53 is only off by about 1 part per 20000, which is pretty good for an approximation whose denominator is just 53.

Of course, it's a bit harder to say what happens when you suddenly want ratios other than fifths and octaves and composites of them - if you wanted just octaves, fifths, and thirds, you would search for a denominator (number of steps) such that both log(3)/log(2) (for twelfths) and log(5)/log(2) (for major third + two octaves) were close to fractions with this denominator - and this not as mathematically straightforward as approximating just a pair of intervals (but still impossible to do perfectly).

(*Notwithstanding that you could expand to multiple dimensions with multiple kinds of equal steps - for instance a Tonnetz or isomorphic keyboard represents exactly this where one dimension has steps of perfect fifths and the other major thirds - which also then leads to minor thirds along another direction. Of course, you lose the linear nature of a keyboard this way, since now you're dealing with two ratios - and you still don't have octaves, though you could imagine adding yet a third axis!)

Other answers do a good job of proving why no non-trivial exact solution can exist. For completeness, I'll note that there is a trivial solution, albeit not especially useful musically - one note per octave. All ratios of pitches differ by some power of two, which is always an integer and thus "just" - trivially so, as only one pitch class is allowed.

• This is very confusing. You seem to be saying that this relation holds regardless of tuning system. It simply is not true that "All ratios of pitches differ by some power of two". – ggcg Apr 9 at 21:09
• If you have one note per octave (1-TET), as in my answer, this relation does indeed hold and my claim is true. You'd have e.g. A440 followed immediately by A880, A1760, etc. No interval smaller than an octave is allowed. Take any set of pitches and they will indeed differ by some whole number of octaves - thus, a power of two. – Aoeuid Apr 9 at 21:48
• Now I understand just how trivial the trivial case is. You weren't saying that, for example the set {A, G} had all notes and their octaves having integer ratios but that each set is the singleton {A}, or {G} along with all octaves, in an equivalence class for example [{A}]. Yes everything is the same. Mono-tone. – ggcg Apr 9 at 22:04
• My answer mentions the trivial case. – phoog Apr 10 at 1:07