# Teddy Rocks Maths Essay Competition 2022: Student Winner

## Zoe Burr: The Music of Maths

“A thoroughly enjoyable read which strikes the perfect balance between explanation and entertainment. The maths of music is a popular choice of topic in the competition, but never have I seen it explained so clearly and so intuitively. After reading Zoe’s essay I now feel I completely understand the reasons behind the traditional notes that we use – and that’s very impressive given my lack of musical talent!”

Dr Tom Crawford

Congratulations to Zoe! Here is the winning essay in full.

“Music is the pleasure the human soul experiences from counting without being aware that it is counting.”

Gottfried Wilhelm von Leibniz

What Leibniz was hinting at in this quote is the underlying mathematical regularity that underlies what we experience as music.

When it comes down to it, music is nothing more than vibrations in air particles, which led me to ask myself the following question: What is it that sets apart the unbearable sounds of nails on a blackboard or a relentless siren, from the bliss and elegance of Bach’s finest compositions? I may even go as far as to ask, is there a formula for perceived beauty in music?

This is the same question that Pythagoras asked 500 years before the birth of Christ. Legend has it, Pythagoras heard hammers pounding iron outside a blacksmith’s workshop and realised that some of the hammers seemed to create harmonious sounds with each other. On further investigation, Pythagoras tried striking pairs of these hammers in unison to see if the sounds of the two hammers would mesh to create a harmony. He discovered that hammers which created a harmony had a simple mathematical relationship between their masses, whereas hammers that created disharmony did not.

We can think of this “simple mathematical relationship” as a simple fraction or ratio, such as two hammers where one weighs twice as much as the other, or one is two thirds of the other’s weight.

Imagine a guitar string. When you pluck the string it creates a sound because the vibration of the string produces a sound wave which is eventually received by our ears. The pitch of the sound we hear is determined by the frequency of this sound wave. The formula below shows that frequency (and therefore pitch) is dependent on three things: the string’s tension (T), the string’s density (μ) and finally, the string’s length (l). Therefore, when we pluck a single guitar string, if we keep all of these factors the same it will always produce the same pitch. If we then place a finger at a point along the string to reduce the length of the string that vibrates when it is plucked, the length of the string is reduced, and therefore the frequency of the wave and the pitch we hear changes.

Similarly to what Pythagoras observed between the hammers and their masses, when the length of two strings have a simple mathematical ratio the sound they make will be harmonious. For example, if we put our finger halfway along a guitar string to half the length of the section that vibrates, the sound created will have a different pitch, but will be harmonious to the sound produced when we pluck the full length of the string, since a half is a simple mathematical ratio.

In fact, the formula shows us that when we halve the string’s length, we are doubling the frequency. By doubling the frequency, we are able to get the same note as if we pluck the full string, but in a pitch exactly one octave higher (the next time a note with the same letter name appears on a keyboard). If we then once again half the string’s length (1/4 of the length of the original string) the frequency would now be 4 times the original frequency and we can progress up yet another octave (two octaves higher than when we plucked the full string). Similarly, plucking 1/8th of the length of the string will give us a frequency of 8 times the frequency of the full string and so will go up yet another octave, and so on ad infinitum. Since we are multiplying by powers of 2, the relationship between the musical notes and frequency is exponential. The two diagrams above visually show this exponential relationship between frequency and pitch and the idea of a doubling frequency as an A note is shown increasing by octaves.

Let’s now imagine a keyboard like the one pictured above. We’ve now established that when we increase pitch by an octave (for example from the C on the left of this keyboard to the C on the right of this keyboard) frequency doubles. We also established that this doubling in frequency is exponential. If you were to count the number of keys in the picture – black and white keys included – you will count 13 keys. This therefore means to get from the C on the left to the C on the right, we have to take 12 steps between adjacent keys. Each step between a key and the one directly to its right, for example from D to D#, from E to F, or from F# to G represents the same perceived increase in pitch and so we would multiply the frequency of the lower note by the same amount each time to get the frequency of the note one step up. Since between the two Cs, frequency doubles, and since frequency increases exponentially, each of the twelve individual steps between the two Cs that we take from each note to the one that is adjacent on its right will see frequency to increase by multiplying by 12th root of 2 or 21/12.

How about if we want to move between two keys that aren’t adjacent or an octave apart? Let’s say C has a frequency of 100Hz. When we move one step to the right, we get C#, which should have a frequency of 100Hz x 21/12. Now let’s say we want to take two steps from C to get to D. If C has a frequency of 100Hz we would have to multiply this by 21/12  twice to move up two steps. This means multiplying the frequency of C by 21/12 x 21/12 = 22/12 = 21/6 to get the frequency of a D note.

Our ears are incredibly sensitive to the frequency ratios between different notes. When the ratio between the frequencies of two notes is a simple ratio, the sound created sounds pleasant and is called conssonance. Whereas when the ratio between the frequencies of two notes is not a simple ratio, the notes will sound like they disagree, which is called dissonance.

For example, the most basic chord is played by playing three notes simultaneously: the tonic, major third, and perfect fifth. If you aren’t familiar with music jargon, this is simply the 1st, 3rd and 5th note you would play in a major scale, so if we want to play a C chord, this would use the notes C, E, and G. These notes are highlighted in green on the diagram below. This chord sounds tuneful to our hears, and here is the maths that tells us why!

If we refer back to our keyboard diagram, we can see that the gap between the the first two of the three notes in our C chord (C and E) is 4 steps. Since we learnt earlier that for each step, the frequency multiplies by 21/12, from C to E, the frequency will have multiplied by (21/12 )4 = 24/12 = 21/3 = 1.2599. This is awfully close to the simple whole number ratio 4:5 and so creates a sound of consonance. If we now look at the gap between the first and last notes in our chord (C and G), we can count that there are 7 steps between them. This must mean that the frequency of G is the frequency of C multiplied by (21/12 )7 = 27/12 = 1.498 which is approximately the whole number ratio 2:3 and so also creates a sound of consonance.

Contrastingly, one pair of notes that creates a clashing sound of dissonance would be C and F#. They have a gap of 6 steps and so F# will have a frequency (21/12)6 = 21/2 = 1.4142… This is an irrational number that is not close to any simple whole number ratio, which creates dissonance.

When two or more notes are played at the same time, their individual waves will interact with each other to create a resultant wave. The diagram on the left below shows the regular wave pattern of the resultant wave created by the harmonious sound of C and G notes being played together. On the other hand, the diagram on the right side shows that playing a C and F# simultaneously results in a more chaotic resultant waveform which we hear as a sensation of dissonance.

I hope that from reading this article you can now see how simply remarkable our ears are, to have the ability to detect patterns and flag up the presence of this regularity as a pleasing sound in our brains. I’d like to refer back to the quote from Leibniz that I opened this article with, which remarks: “Music is the pleasure the human soul experiences from counting without being aware that it is counting”. This quote truly does sum up just how magnificently our bodies are able to analyse signals in order to discover patterns that we can experience as the joy of listening to music!