Music And Measure Theory

Music And Measure Theory


I have two seemingly unrelated challenges
for you. The first relates to music, and the second gives a foundational result in measure
theory, which is the formal underpinning for how mathematicians define integration and
probability. The second challenge, which I’ll get to about halfway through the video, has
to do with covering numbers with open sets, and is very counter-intuitive. Or at least,
when I first saw it I was confused for a while. Foremost, I’d like to explain what’s going
on, but I also plan to share a surprising connection it has with music.
Here’s the first challenge. I’m going to play a musical note with a given frequency,
let’s say 220 hertz, then I’m going to choose some number between 1 and 2, which
we’ll call r, and play a second musical note whose frequency is r times the frequency
of the first note, 220. For some values of this ratio r, like 1.5, the two notes will
sound harmonious together, but for others, like the square root of 2, they sound cacophonous.
Your task it to determine whether a given ratio r will give a pleasant sound or an unpleasant
one just by analyzing the number and without listening to the notes.
One way to answer, especially if your name is Pythagoras, might be that two notes sound
good when the ratio is a rational number, and bad when it is irrational. For instance,
a ratio of 3/2 gives a musical fifth, 4/3 gives a musical fourth, of 8/5 gives a major
sixth, etc. Here’s my best guess for why this is the case: a musical note is made up
of beats played in rapid succession, for instance 220 beats per second. When the ratio of frequencies
of two notes is rational, there is a detectable pattern in those beats, which, when we slow
it down, we hear as a rhythm instead of as a harmony. Evidently when our brains pick
up on this pattern, two notes sound nice together. However, most rational numbers actually sound
pretty bad, like 211/198, or 1093/826. The issue, of course, is that these rational number
are somehow more “complicated” than the other ones, our ears don’t pick up on the
pattern of the beats. One simple way to measure the complexity of a rational number is to
consider the size of its denominator when it is written in reduced form. So we might
edit our original answer to only admit fractions with low denominators, say less than 10.
Even still, this doesn’t quite capture harmoniousness, since plenty of notes sound good together
even when the ratio of their frequencies is irrational, so long as it is close to a harmonious
rational number. And it’s a good thing, too, because many instruments such as pianos
are not tuned in terms of rational intervals, but are tuned such that each half-step increase
corresponds with multiplying the original frequency by the 12th root of 2, which is
irrational. If you’re curious about why this is done, Henry at minutephysics recently
did a video which gives a very nice explanation. This means that if you take a harmonious interval,
like a fifth, the ratio of frequencies when played on a piano will not be a nice rational
number like you expect, in this case 3/2, but will instead be some power of the 12th
root of 2, in this case 2^{7/12}, which is irrational, but very close to 3/2. Similarly,
a musical fourth corresponds to 2^{5/12}, which is very close to 4/3. In fact, the reason
it works so well to have 12 notes in the chromatic scale is that powers of the 12th root of 2
have a strange tendency to be within a 1% margin of error of simple rational numbers.
So now you might say a ratio r will produce a harmonious pair of notes if it is sufficiently
close to a rational number with a sufficiently small denominator. How close depends on how
discerning your ear is, and how small a denominator depends on the intricacy of harmonic patterns
your ear has been trained to pick up on. After all, maybe someone with a particularly acute
musical sense would be able to hear and find pleasure in the pattern resulting from more
complicated fractions like 23/21 or 35/43, as well as numbers closely approximating these
fractions. This leads to an interesting question: Suppose
there is a musical savant, who find pleasure in all pairs of notes whose frequencies have
a rational ratio, even super complicated ratios that you and I would find cacophonous. Is
it the case that she would find all ratios r between 1 and 2 harmonious, even the irrational
ones? After all, for any given real number you can always find rational numbers arbitrarily
close it, just as 3/2 is close to 2^{7/12}. Well, this brings us to challenge number 2.
Mathematicians like to ask riddles about covering various sets with open intervals, and the
answers to these riddles have a strange tendency to become famous lemmas and theorems. By “open
interval”, I just mean the continuous stretch of real numbers strictly greater than some
number a, but strictly less than some other number b, where b is of course greater than
a. My challenge to you involves covering all the rational numbers between 0 and 1 with
open intervals. When I say “cover”, all that means is that each particular rational
number lies in at least one of your intervals. The most obvious way to do this is to just
use the entire interval from 0 to 1 itself and call it done, but the challenge here is
that the sum of the lengths of your intervals must be strictly less than 1.
To aid you in this seemingly impossible task, you are allowed to use infinitely many intervals.
Even still, the task might feel impossible, since the rational numbers are dense in the
real numbers, meaning any stretch, no matter how small, contains infinitely many rational
numbers. So how could you possibly cover all rational numbers without just covering the
entire interval from 0 to 1 itself, which would mean the total length of your open intervals
has to be at least the length of the entire interval from 0 to 1.
Then again, I wouldn’t be talking about this if there was not a way to do it.
First, we enumerate the rational numbers between 0 and 1, meaning we organize them into an
infinitely long list. There are many ways to do this, but one natural way I’ll choose
is start with ½, followed by ⅓ and ⅔, then ¼ and ¾, we don’t write down 2/4
since it has already appeared as ½, then all reduced fractions with denominator 5,
all reduced fractions with denominator 6, continuing on and on in this fashion. Every
fraction will appear exactly once in this list, in its reduced form, and it gives us
a meaningful way to talk about the “first” rational number, the “second” rational
number, the 42nd rational number, things like that.
Next, to ensure that each rational is covered, we are going to assign one specific interval
to each rational. Once we remove the intervals from the geometry of our setup and just think
of them in a list, each one responsible for only one rational number, it seems much clearer
that the sum of their lengths can be less than 1, since each particular interval can
be as small as you want and still cover its designated rational. In fact, the sum can
be any positive number. Just choose an infinite sum with positive terms that converges to
1, like ½+¼+⅛+… on and on with powers of 2, then choose any desired value epsilon>0,
like 0.5, and multiply all terms by epsilon so that we have an infinite sum converging
to epsilon. Now scale the nth interval to have a length equal to the nth term in the
sum. Notice, this means your intervals start getting really small, really fast, so small
that you can’t really see most of them in this animation, but it doesn’t matter, since
each one is only responsible for covering one rational.
I’ve said it already, by I’ll say it again because it’s so amazing: epsilon can be
whatever positive number we want, so not only can our sum be less than 1, it can be arbitrarily
small! This is one of those results where even after
seeing the proof, it still defies intuition. The discord here is that the proof has us
thinking analytically, with the rational numbers in a list, but our intuition has us thinking
geometrically, with the rationals as a dense set on the interval, where you can’t skip
over any continuous stretch of numbers since each stretch contains infinitely many rationals.
So let’s get a visual understanding of what’s going on.
Brief side note here: I had trouble deciding on how to illustrate small open intervals,
since if I scale the parentheses with the interval, you won’t be able to see them
at all, but if I just push the parentheses together, they cross over in a way that it
potentially confusing. Nevertheless, I decided to go with the ugly chromosomal cross, so
keep in mind that the interval they represent is the tiny stretch between the centers of
each parenthesis. Okay, back to the visual intuition.
Consider when epsilon=0.3, meaning if I choose a number between 0 and 1 at random,
there is a 70% that it is outside all those infinitely many intervals. What does it look
like to be outside the intervals? Well, the square root of 2 over 2 is among those 70%,
and I’m going to zoom in it. As I do so I’ll draw the first 10 intervals in the
list within our scope of vision. As we get closer to the square root of 2 over 2, even
though you will always find rationals within your field of view, the intervals placed on
top of those rationals get really small really fast. One might say that for any sequence
of rational numbers approaching the square root of 2 over 2, the intervals covering the
elements of this sequence shrink faster than that sequence converges.
Notice, intervals are really small if they show up very late in the list, and rationals
show up late in the list when they have large denominators, so the fact that the square
root of 2 over 2 is among the 70% not covered by our intervals is in a sense a way to formalize
the otherwise vague idea that the only rational numbers “close” to it have large denominators.
That is to say, the square root of 2 over 2 is cacophonous.
In fact, let’s use a smaller epsilon, say 0.01, and shift our setup to lie on top of
the interval from 1 to 2 instead of from 0 to 1. Then which numbers fall among the elite
1% covered by our tiny intervals? Almost all of them are harmonious! For instance, the
harmonious irrational number 2^{7/12} is very close to 3/2, which has a relatively fat interval
sitting on top of it, and the interval around 4/3 is smaller, but still fat enough to cover
2^{5/12}. Which members of the 1% are cacophonous? Well, the cacophonous rationals, meaning those
with high denominators, and irrationals that are very very very close to them. However,
think of the savant who finds harmonic patterns in all rational numbers. You could imagine
that for her, harmonious numbers are precisely those 1% covered by the intervals, provided
that her tolerance for error goes down exponentially for more complicated rationals.
In other words, the seemingly paradoxical fact that you can have a collection of intervals
densely populate a range while only covering 1% of its values corresponds to the fact that
harmonious numbers are rare, even for the savant. I’m not saying this makes it the
result more intuitive, in fact, I find it quite surprising that the savant I defined
could find 99% of all ratios cacophonous, but the fact that these two ideas are connected
was simply too beautiful not to share.

Only registered users can comment.

  1. If you quizzed people who rave about such videos, you'd get garbage back. Some of the content in this video was downright incorrect.

  2. 4:01 "powers of 12th root of two tend to have this strange tendency to be within 1% margin of error from simple rational numbers"
    This fact always fascinated me. Why is this so? Why literally all 12 of those powers are close to a rational? Because this is literally the reason for all modern fretted instruments such as guitar to exist.

    Another question: do intervals that are not powers of 2^(1/12) sound harmonous as well? For example, does 7/5 sound pleasing? Or maybe it's pythogoreans were wrong and it's not rational fractions that sound harmonous, but rather 2^(1/12) increments instead?

  3. This is a preamble to how time duration timing modulation becomes condensed matter and conformal fields of quantization information. Harmonics align in e-Pi-i, resonant reinforcement cofactors of phase-locked multi-phase state AM-FM numberness, ..and cacophony dissipates as low durability positioning probabilities.. Incomprehensible without the researcher's experience in Math-Phys-Chem and sensibly derived Philosophy begun in Music.

  4. 9:08 this is nice and all but how does a set of arbitrarily small numbers cover some of those bigger numbers, say 1/2? Sure we can take all the numbers in the world and shrink their sum by multiplying each by some ridiculously small number. But I don't get how ϵ/2 is supposed to be the same as 1/2, when ϵ < 1.

  5. I get that a lot of people find your videos very helpful, and I respect the amount of work you put into them. But I know I can't be alone when I say there is something about your presentation that makes even simple subjects impossible to understand. It's possible I'm just not within your demographic as I have no real formal education in mathematics, but I still enjoy the videos produced by Numberphile, Stand Up Maths, and SingingBanana and they are able to compress complicated subjects into more digestible pieces. Your videos just end up being a bunch of words that I understand individually but not when placed in the order that you've chosen.

    I'm really trying to figure out why though, so that I could maybe offer some actual criticism and not "This isn't good, make it better" because it's obvious that a lot of people enjoy your videos. But I really don't know where they go so wrong as to make matters overly complicated and impossible to follow. I really just end up staring at your visuals and my brain unfocuses because it's trying to catch up and understand while you've moved onto the next topic, with no real flow from the previous one
    .

    For example at 0:51 you claim that the two notes don't sound good together, but for all the examples given I found them quite enjoyable, the root 2 provided, for example, was a hauntingly beautiful minor sound, you then lead into your next statement and I'm still trying to figure out what wasn't supposed to sound good. I think it's possible it's due to your 220Hz being played constantly so our brains are able to adjust to that noise so when new notes were introduced it's almost as if we're just hearing that one sound coming in, but I don't know. Either way when you start looking for numbers that sound good together I was thinking that the argument was quite flawed as it's all personal taste. Which could be the issue with that segment – it's too arbitrary.

    But even when we moved into the second part with the measures I was still left lost. In part this is due to you having words written on the screen while speaking different words. This is a fairly big no-no because we can't listen to you and understand what you are saying if we're trying to read and understand a completely different statement (for example 6:55).

    The challenge laid out at 5:52 is "Using an infinite amount of intervals, cover all of the rational numbers between 0 and 1 with open intervals. Where each rational number lies within one or more intervals and the sum of the length of all intervals is less than 1." This is an overly complicated way of saying what you want, but it boils down to you want us to wrap each number within a set (the set of rational numbers between 0 and 1) with an interval. I can't be alone in thinking that this "challenge" isn't really a challenge. Like let's say I want you to wrap each integer number between 0 and 100 with an interval that can be any real number where the sum of the lengths of all intervals are less than 100. Clearly this would be foolish to issue it as a challenge because an interval from 0.9 to 1.1 would contain 1, 1.9 and 2.1 would contain 2, etc. You are using the same challenge but instead of a set of integers it's a set of rational numbers, but surely the method is the same, you just wrap each individual rational number in it's own interval that is arbitrarily close to the number within your set. In other words for each number (n) within your set the interval would be n-x to n+x where x is so small that it's almost essentially 0.

    The issue with your video, I think, is you presented this "challenge" clearly with the intention of teaching us some math, which is great, an easy challenge can lead to interesting math, but then your presentation falls flat. At 8:15 you begin talking about infinite sums, which I have to imagine is the point of your challenge at this point, however, it's completely skimmed over and I have no idea what point you were trying to make. You lose me when you start talking about epsilon, and then at 9:00 you assume that the previous statement was a proven fact, when you just barely outlined the method without really proving anything. Of course, then you start talking about your proof where I'm still trying to figure out why were were talking about infinite sums.

    I do have to admit that while writing out this comment and re-watching your video it has begun to make much more sense, but I think that's also a problem I can't watch each of your videos 5 times so that I can understand what is being said. There's just something missing from your presentation style or maybe we just don't mesh well. At 8:22 I'm still confused as to why we're scaling with epsilon within an infinite sum and why we are factoring the sum up by epsilon. That all makes no sense to me even after 5 times of watching it.

  6. Truly spectacular video ! Went through the Conservatory of Music in Paris and barely ever touched the relation between music and mathematics, even thought they are so intricately linked ! Absolute pleasure to watch !

  7. @1:00 is 2^(7/12) as harmonious as 1.5?
    can you feel the difference?
    you know we work now with Bach's notes,
    not Pythagoras?

    check what Bach did and what Leibniz said:
    https://it.wikipedia.org/wiki/Temperamento_equabile#Vantaggi_e_svantaggi

  8. @1:25 I see you're working with Pythagoras' notes here…

    anyway, it's all rational numbers and not just those like 1/n,
    because you have that mod2 with octaves,
    which allows the numerator to grow, right?

  9. I am a professional musician for more than 30 years and my understanding of music theory is excellent…. I didn't understand this video at all.

  10. This information is very important for sounddesigners and synthesists (synthesizer-'nerds') who use frequency modulation (FM-synthesis) as soundsynthesis method/technique.

  11. Why use ‘she’? Women don’t represent themselves in this field like men do. Using ‘she’ isn’t doing anything but obfuscating a real issue. It’s ignorant.

  12. Amazing! Thanks for sharing the knowledge with the world. By the way, quarter tones (common in middle-eastern music) are underrated. The first quarter-tone appears as the 7th harmonic corresponding to the rational number 7/8 but yet trained western ears don't recognize it as a pleasant interval. If you are experimenting with these ideas, definitely give quarter tones a try, you may start to love them.

  13. To clarify, is the Lebesgue measure of all the rational numbers 0, or is the Lebesgue measure of the rational numbers within a finite interval 0?

  14. That was very interesting to say the least. Thanks. Periods a thing imo that nature is sporadic in many ways.

  15. One thing: choosing an epsilon and converting rationals with intervals as you defined makes something that measures less than epsilon, not epsilon. So the probability of discord is more than 1-epsilon. That's because the little intervals overlap.

  16. This is mind boggling. If there was a gap between two intervals of positive length, there would be some rationals missed out so it seems there can't be any gaps.
    But as I think about there can be gaps of measure 0, eg in-between (3,pi) and (pi,4).
    So with uncountably many irrationals missed out, they could have a positive measure in total, leaving a measure smaller than 1 for all the open intervals containing the rationals.
    So with some deeper thought it does make sense

  17. the Lebesgue measure of the set of rational numbers is 0. All I remembered from the painful Analysis lesson…

  18. Man you playing synthesized audio in background and talking at the same time.. well thats very bad cant here sound properly.

  19. I watch all your videos. This is very enlightening. I ask only for one thing: ALWAYS TRANSLATE TO PORTUGUESE.

  20. excellent ! good explaining; powers of the 12th root of 2 fall within 1% of rational nodes. The rarity of harmonious intervals is demonstrated by knowledge of the positions and pitches of natural 'harmonics' (standing waves) of a plucked string. The quarter-tone and micro-tonal intervals played by expressive musicians can be seen as taking the listeners ear to rationals just nearby the arbitrary 12-note chromatic intervals.

  21. “For others, like square root of 2, it sounds cacophonous.”
    Me: beautiful, amazing lydian modal interchange

  22. Surely the low tolerance for error of the more complicated ratios is why they aren't used in tuning systems. I'd imagine only the human voice could utilise them effectively.

  23. For the 2nd part, couldn't the entire proof be summed up in just one sentence that the rationals are countably infinite whereas the set of real numbers is uncountable infinity (which I guess are always larger ) ?

  24. The work behind these videos is amazing, I love the dedication and the ability to explain hard things on an accessible way for all.

  25. What if you order them (rational number) differently? If, for example, I switch number 1 with number 223/117 then 223/117 would have a larger interval than 1. Thus, according to your reasoning, it would sound better. It's seems an arbitrary decision to me.

  26. I believe that the beauty of music does not depend on the perfect mathematical composition, but on the unparalleled capacity for creation, the union, in the musical composition of the human being who creates it.

  27. Nice hypothesis. But wrong. In reality no irrational proportions sound harmonic. Our ear is only incapable to discern it from a rational proportion that is next to it. Not every rational proportion sounds harmonic. There are only two base ones: Fifth (3/2) and Octave (2/1). All other proportions sound harmonic as long as they are (small) compositions of those two. The less compositions there are the better the proportion sounds harmonic. Every harmonic proportion can be written as 2^n * 3^m, where n and m are integers. If there is any other prime number than 2 and 3 in the prime decomposition of the reduced denominator or fraction, the proportion sounds not perfectly harmonic.

  28. When I was first taught Calculus, the teacher used the epsilon-delta method. Thanks Mr. Rushing. Rest in Peace.

  29. why are you trying to define which interval will sounds pleasant yet music are full of unpleasant intervals which sounds beautiful all in the song

    btw i know there is pure science interest to search for any answers

  30. As a complete song can be heard in one note And one note can hold the landscapes of that song There it is ,everything supports everything

  31. I've never heard you say "maths".  Thank you for that.  The word is "math".  Putting an s on the end is as irritating as fingernails on a chalkboard.

  32. 👍 nice topic .. Would be interesting to see which value ranges for epsilon correspond to how humans perceive cacophony.. And whether musicians have a significant different range

  33. also the cantor set is an uncountable set with measure 0 🙂

    Nice video never thought of it that way.

  34. As we descrease epsilon from 1 through to 0, when does sqrt(2) show up in the "uncovered set"? When does (1+sqrt(5))/2 show up? etc…

  35. We must create a music that uses only rational ratios instead of "close to rational", maybe it will give even a moee harmonic music.

  36. @3blue1brown, what is the measure theory theorem? I would like to have a look at it. I also have a question about it, since the rationals are dense in the reals and the number of numbers between 0 and 1 are uncountably infinite, then the number of rationals is also uncountably infinite, correct? If so, then how can we take an uncountable number of numbers and put them into a countably infinite list? Thanks!

  37. Any number (with the implied whole number numerator and) a whole number denominator (nevermind sufficiently small) is necessarily rational. So isn't the "rational and" harmony requirement redundant/superfluous?

  38. Wait, does that margin of error have anything to with the tempering of the piano?

    I understand that there will always be a margin of error, but perhaps the margin would be smaller if this theory were tested on a guitar?

  39. The tuning you describe is "equal temperment". It's not the only possible tuning system, and in fact wasn't widely adopted until the twentieth century. There's a whole universe of other temperaments that alter the spacing of intermediate notes in an octave slightly in order to maximize the number of ideal fifths and major thirds. These were much more prevalent in Renaissance times, and can actually be easier to tune by ear.

    This is also why different keys of the same type, eg B maj and C maj, historically had different characters. The various non-equal temperaments cause transposed chords to have slightly different patterns of dissonance..

  40. This is one of my favorite videos but the voice quality is pretty miserable. It would be sweet if you could do a re-upload redubbed with your new mic

  41. @3Blue1Bronw – just dropping you a line to let you know that we recently published an album which theory is based also on this video. thanks for this incredible inspiration! here is the link:
    https://dthed.bandcamp.com

  42. 繁中的最後一段翻譯:fractal dimension應該譯為“分形维数”,譬如“謝爾賓斯基三角形”這樣的分形,豪斯多夫維是log(3)/log(2)≈1.585

  43. When and where did you think about it? It is very beautifull but it seems (it may sound weird to say) useless, of course i can prove something very "small" with "big guns"

  44. Being a mathematician/musician I naturally clicked on this. I expected an all too familiar explanation of roots of 2 approximating 3/2, but was pleasantly surprised you went into new (to me) territory). Really hit a nerve: I hated measure theory in college because it's weirdness seemed so disconnected from giving me insight into things I care about. But here it is, understanding this infinite series does help my intuition around what intervals sound good. Furthermore, it helps give me intuition around the fact that there are qualitatively fewer rationals than irrationals…the Cantor diagonalization proof is convincing for verifying the truth of that fact, but does nothing for my intuition, whereas your explanation does. And of course the countability of rationals plays a key role in the proof.

  45. Should you also point out that the (intrinsic) uncertainty in which you can determine the frequency of a sound is proportional with the inverse of the measurement time?

  46. I have been producing music for 10 years. But also in things like fractals. I don't understand math at all. But this is amazing stuff. Do re mi fa so, meets fibonacci meets sick techno beats on mdma with fractal visuals beaming out of the warehouse projector. It all makes sense now 😀

  47. Pythagoras was wrong. But that's not so surprising, we have had a lot of time for musical theory after him. Musical intervals (and indeed simple tones) are too complex to analyze with simple models. Why? Because a tone is made up of not only one frequency, but many, just count all the intervals and rhythms and patterns one can find by removing a certain pattern of the waves in the tone. If one do this with two simultaneous tones, there are just too many patterns to keep track on, and three simultaneous tones generate even more possible combinations.
    Another important effect is the effect of experience: something we have heard, for example a tune, will not be sounding the same the next time we hear it due to memory effects. There are many perceptual effects that filters what we hear as well, and a theory should be recognizing these effects to be useful as well, if we want to be able to predict what we will hear from a musical stimulus.

  48. I understood everything up until you introduced the notion of sets, and then started making equations for them using epsilon and 2^n
    !
    !
    !
    But something in my brain understands, do you know how I know? I love music, especially good music.

  49. 9:00 Is it weird that I found it blatantly obvious, that you can make the ranges arbitrarily small? Since they only have to cover that one rational inside, which itself has no spatial extent, in an infinite sea of irrationals between the rationals.

Leave a Reply

Your email address will not be published. Required fields are marked *