Lecture 2: Number Theory and Rhythms Try the following trick: with

advertisement

Math in Music Jan. 2009

Lecture 2: Number Theory and Rhythms

Try the following trick: with one hand, beat out a rhythm of 3 beats per unit time, and with the other hand beat out a rhythm of 2 beats per unit time. You’ll hear a complicated joint rhythm that can make music interesting. (Talented drummers can beat 4 against 5, or even

6 against 7.) These are called isorhythms, and they arise from two parts that are repeating patterns of different lengths. Today I want to consider the mathematical problem of calculating how often two repeating patterns of different lengths become synchronized.

For example, at the end of Brahms’ second symphony there’s a short passage in 4/4 time, in quarter notes, that goes C-E-G-C-E-G-C-E-G.

Here, Brahms has the wind players repeating a 3-beat motif (really just a triad) while everyone else is playing in 4-beat bar. If this kept going, how many beats elapse before the “C” is at the beginning of the bar? 12, because that’s the lowest number of beats that’s both divisible by 3 (the number of beats in the motif) and 4 (the number of beats in the bar).

A related mathematical problem is to find the period of the sum of two sine waves at the same time. Suppose we add together the sine waves y = Sin[ (

π

/2) t ] and y = Sin[ (

π

/3) t ]

The period of the first sine function is 2 π /( π /2) = 4 seconds, and the period of the other is 6 seconds. The period of the sum of these two waves is the shortest time that’s a whole number times 4 and a whole number times 6. The answer is 12 again, but notice that it’s not just the product of 4 times 6.

Let’s get more precise about what we’re doing.

Defn For two integers x and y, the lowest common multiple lcm(x,y) is the least positive integer k such that x|k and y|k.

[We use the “divides” notation: x|y means that y=mx for integer m.]

Math in Music Jan. 2009

Note that we stipulate that the lcm be positive, since every integer divides zero. [Why?]

Example: lcm(3,7) = 21, lcm(3,9)=9, lcm(6,9) = 18, lcm(6,10)=30

Is there formula for the lowest common multiple? Why can’t we just say that lcm(x,y)=xy? The example of lcm(6,10)=30 shows that, when x and y share a common factor (in this case, 2), we have to cancel that out in the product, so that lcm(6,10) = 6 × 10 / 2 = 30. In this case 2 is called the greatest common divisor of the two numbers.

Defn For two integers x and y, the greatest common divisor gcd(x,y) is the greatest positive integer d such that d|x and d|y.

Then lcm(x,y) = xy/gcd(x,y); for example, lcm(12,30) = 12 × 30/6 =60 since gcd(12,30)=6.

However, we don’t have a formula for the gcd of x and y. Instead, we have an algorithm, i.e., an explicit procedure which will produce the gcd in a finite number of steps.

The Euclidean Algorithm for finding gcd(x,y).

For simplicity, suppose x,y are positive.

First, note that if one of x and y divides the other, then whichever one is smaller will be the gcd. For example, gcd(3,9)=3.

However, suppose that x is smaller than y, and doesn’t divide y. Then we can make our problem easier by taking away multiples of x from y.

In other words, suppose that y = m x + r for a number r such that 0 < r < x.

(This just says that r is the remainder when we divide y by x.)

If d divides x and y, then d divides r.

(Proof: because d divides x, then d divides mx, so d divides y-mx = r.)

It follows that gcd(x,y) = gcd(r,x). Now we can start over with two smaller numbers x and r. If r divides x, then we’re done and gcd(x,y)=gcd(r,x)=r. Otherwise, we can divide r into x and replace x by the remainder---in other words, apply the same step again.

Math in Music Jan. 2009

Because the numbers get smaller every time, this procedure has to finish after a finite number of divisions.

Example: Find gcd(12, 40).

1. Since 40 = 3 × 12+4, then gcd(12,40) = gcd(4,12).

2. Since 4 divides 12, gcd(4,12)=4. (Hence, lcm(12,40)=12 × 40/4=120.)

Example: Find gcd(30,88).

1. Since 88=2 × 30+28, then gcd(30,88)=gcd(28,30).

2. Since 30=1 × 28+2, then gcd(28,30)=gcd(2,28).

3. Since 2 divides 28, gcd(2,28)=2.

Example: Find gcd(15,32).

1. Since 32=2 × 15+2, then gcd(15,32)=gcd(2,15).

2. Since 15=7 × 2+1, then gcd(2,15)=gcd(1,2).

3. Since 1 divides 2, then gcd(1,2)=1.

Example: Find gcd(7,30).

Since 30=4 × 7 + 2, then gcd(7,30)=gcd(2,7).

Since 7=3 × 2 +1, then gcd(2,7)=gcd(1,2)=1.

Corollary If d=gcd(x,y), then there are integers k and l such that k x + l y = d.

Proof At each step in the Euclidean algorithm, with d=gcd(x,y)=gcd(r,x), if we have d=k x + l r, then we can substitute r = y – nx to get d = k x + l (y-nx) = l y + (k-l n) x. So, if d is an integer linear combination of the smaller numbers, it’s also an integer linear combination of the larger numbers. Then, at the last stage of the

Euclidean algorithm, d is one of the two numbers x and y, so it’s

QED. definitely a linear combination then.

When gcd(x,y)=1, we say that x and y are relatively prime .

As you can see from these examples, x and y don’t have to be prime numbers to be relatively prime. However, the converse is true:

Math in Music Jan. 2009

Theorem If p and q are distinct prime numbers, then gcd(p,q)=1, and lcm(p,q)=pq.

Before we prove this, let’s recall what prime numbers are:

Defn A positive integer p>1 is prime if its only positive divisors are 1 and itself.

Examples: 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,....

Proof of the theorem: Suppose d>0 divides p and q. Because d|p, then either d=1 or d=p. Because d|q, then either d=1 or d=q.

Since p ≠ q, then d=1. Thus, gcd(p,q)=1. QED.

=================

A Musical Example

In the winter of 1940-1941, the French composer Olivier Messiaen was interned in a German POW camp Stalag VIIIa. He happened to be imprisoned with three other musicians (a violinist, a cellist, and a clarinet player), and as the German officer in charge of the camp was fairly liberal, Messiaen was encouraged to compose a piece for his fellow prisoners to play. The result was the “Quartet for the End of

Time”. (The title refers to the Book of Revelations, which Messiaen doesn’t literally depict, but which exerts more of a symbolic influence on the composition.) In the first movement, the “Liturgie de Crystal”, the piano repeats a 17-note rhythm over and over again while repeating a pattern of 29 chords. [see finTemp.pdf]

So, since 17 and 29 are prime numbers, then lcm(17,29)=17 × 29=493.

In other words, it takes 493 notes for the piano part to repeat!

This quasi-repetition, similar but always shifting, is how Messiaen conveys a sense of timelessness in this movement.

[play musical excerpt]

===========================================================

Math in Music Jan. 2009

Prime Numbers and Rhythms

In Western music, we almost always divide the music into equal-length bars, and each bar is divided into the same number of beats, usually 4 but sometimes 2 or 3 or 6. In time signatures like 2/4 or 3/4 or 4/4, the first number is how many beats in the bar, and the denominator

(1/4 in these cases) tells how long one beat is.

(A “quarter note” doesn’t really stand for a quarter of a bar, except in

4/4 meter. Rather, it’s an arbitrary reference unit for time; the speed of the music is usually indicated by how many quarter notes are played in a minute.) The rhythm of a piece of popular Western music is dictated by the choice of time signature, and then how we split up that regular succession of bars.

Example rhythms: Star-Spangled Banner (3/4); The Yellow Rose of

Texas (4/4); Greensleeves (6/8).

Underlying each of these melodies is a steady pulse, that divides the bar into 2, 3, or 4 equal units. (Note: in the case of Greensleeves, the bar is first broken into two halves, and then each of those halves is divided into three eighth-notes.)

It’s rare in Western music for the bar to be divided into a prime number of beats (other than 2 or 3). Here are two examples of

5/4 time from classical music:

[scherzo of Symphony #6, Tchiakowsky]

[1st movement “Mars” from The Planets, Holst]

In these cases, the bar is divided into two pieces of unequal length, 3 beats in the first half, 2 beats in the second. The same is true of the theme from the TV series “Mission Impossible”. My point is that when the number of beats per bar is a prime number more than 3, instead of thinking of the bar as a unit sliced into smaller pieces (divided rhythm), we start to think of the bar as assembled from smaller units of long and short lengths (additive rhythm).

Fibonacci Rhythms

In non-Western cultures (Slavic, African, and in particular Indian music) much more complicated rhythms have been invented in this

Math in Music Jan. 2009 way. The proliferation of rhythmic patterns poses some interesting counting problems for mathematicians.

For example, suppose you assemble a rhythm from short and long pulses, with the long ones twice the length of the short ones.

So, the short pulse is one beat and the long one is two beats.

If the total length of the bar is, say, 2 beats or 3 beats or 4 beats, how many possible rhythms are there?

2= 1+1=2

3=1+1+1=2+1=1+2

(2 possibilities)

(3 possibilities)

4=1+1+1+1=2+1+1=1+2+1=1+1+2=2+2 (5 possibilities)

The number of possibilities increases rapidly with the length of the bar:

# of beats 1 2 3 4 5 6 7

# of rhythms 1 2 3 5 8 13 21

Perhaps you recognize these as Fibonnaci numbers. A Fibonacci sequence is defined by the property that each number in the sequence is the sum of the previous two. If F_n is the nth Fibonacci number, the this property is expressed by the recurrence relation

F_{n+1} = F_n + F_{n-1}

(To get the sequence started, we usually specify F_0=1 and F_1=1.)

Although this sequence bears the name of a 15th century Italian, the problem of counting how many rhythms are possible was solved----and the Fibonacci sequence discovered earlier---by a 12th century Indian mathematician named Hemachandra!

(Note that Hemachandra was actually more concerned with the number of possible rhythms for poetry; therefore, we’ll call these rhythms built out of 1-beat and 2-beat pulses poetic rhythms .)

But why does the Fibonacci relationship show up in the numbers of poetic rhythms? Think of it this way: if R_n is the number of such rhythms with n beats, then we can get a rhythm with one more beat (i.e., n+1 beats) in it by just adding a short pulse onto the end of

Math in Music Jan. 2009 an n-beat rhythm. We can also get a rhythm with n+1 beats by adding one long pulse on the end of an n-1 beat rhythm. For example, starting with the three-beat rhythms

1+1+1=2+1=1+2 we can add an extra beat on the end and get a 4-beat rhythm:

1+1+1+1=2+1+1=1+2+1.

Or we can start with the 2-beat rhythms

1+1=2 and add a long pulse on the end and get the other 4-beat rhythms:

1+1+2=2+2.

Since every 4-beat rhythm ends either with a short or long pulse, this gives us all of them. So, we’ve shown that

R_4 = R_3 + R_2, the same relation as the Fibonacci numbers.

Similarly, R_{n+1}=R_n + R_{n-1}, so the sequences coincide exactly.

Aside It seems difficult to calculate Fibonacci numbers using the recurrence relation. If I asked you what the 17th Fibonacci was, you’d have to calculate the previous 16 numbers before you could tell me the 17th. However, there is an easier way of doing this.

Suppose that x is a root of the quadratic equation x^2 = x+1. Then the powers of x satisfy x^(n+1)=x^n+x^(n-1), the same relationship as the

Fibonacci numbers satisfy. Now, that quadratic equation actually has two roots: phi = (1+ √ 5)/2, and (1-phi) = (1√ 5)/2. The sequence of powers of phi and the sequence of powers of 1-phi both satisfy the

Fibonacci recurrence relation. So, all we have to do is to combine these two sequences in the right way so as to get the same starting points (F_0=F_1=1). We get

F_n = (phi^{n+1} - (1-phi)^{n+1})/ √ 5.

Note: phi ≈ 1.618 is the so-called golden ratio; when n is large, each

Fibonacci number is approximately phi times the previous one.

============

Math in Music Jan. 2009

Folk dance rhythms from the Balkans are also built out of long and short units, but the long units are 1.5 times the length of the short units. Here are some examples from Bulgaria:

Paidushko: 5 beats = 2+3

Ruchenitsa: 7 beats = 2+2+3

Lesnoto: 7 beats = 3+2+2

Daichovo: 9 beats=2+2+2+3

[track 15]

[track 7]

[track 3]

Grancharsko: 9 beats=2+3+2+2

Kopanitsa: 11 beats=2+2+3+2+2

Buchimish: 15 beats=2+2+2+2+3+2+2 [track 8]

I’ll refer these as Balkan rhythms.

However, note that the Ewe people of West Africa also use rhythms built additively out of 2’s and

3’s, and these rhythms have influenced Carribean music. For example, there are the

Bomba (Puerto Rico) 8 beats = 3+3+2

Clave (Cuba) 12 beats=2+2+3+2+3

Math in Music Jan. 2009

Assignment: Listen to BBC Lecture 1 (available on my web page); read Harkelroad Ch.2

Problems:

1. Use the Euclidean algorithm to find the following:

(a) gcd(78,144) (b) lcm(15,72)

2. Show that if an integer m satisfies m|x and m|y, then m|gcd(x,y).

[Hint: use the Corollary]

3. Find all the 6-beat poetic rhythms.

4. Show that lim_{n to infinity} F_{n+1}/F_n = phi.

5. List all the 9-beat Balkan rhythms.

6. Suppose B_n is the number of Balkan rhythms with n beats. (Note that B_1=0 since we can only use pulses of length 2 or 3.) Find a recurrence relation for B_n, and calculate B_n up to n=12.

7* (Bonus problem). Poetic 4-beat rhythms like 1+1+1+1 and 2+2 have translational symmetry: if you shift all the barlines some number of beats ahead (1 in the first example, 2 in the second), the rhythm stays the same. Develop a recurrence relation for the number of n-beat poetic rhythms without translational symmetry.

Download