From vixen.cso.uiuc.edu!howland.reston.ans.net!spool.mu.edu!umn.edu!csus.edu!netcom.com!bert Wed Jul 28 11:17:54 CDT 1993 Article: 35536 of sci.math Newsgroups: sci.math Path: mp.cs.niu.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!spool.mu.edu!umn.edu!csus.edu!netcom.com!bert From: bert@netcom.com (Roberto Sierra) Subject: Re: HELP: need every day examples of using modulo arithmetic Message-ID: Summary: More Modulo Arithmetic Examples Organization: Tempered MicroDesigns References: <11539@ncrwat.Waterloo.NCR.COM> Date: Tue, 27 Jul 1993 15:09:58 GMT Lines: 867 In article , Benjamin.J.Tilly@dartmouth.edu (Benjamin J. Tilly) writes: > > |> My wife is trying to develop an math enrichment unit around modulo > > |> arithmetic for a course she is taking. > > |> > > |> She is looking for (somewhat simple) everyday examples of uses for > > |> modulo arithmetic. > > > > You could use the simple C-major scale, (white notes only), for mod 7; > > or the chromatic scale, (all notes), for mod 11. > > > Actually 2 of the "notes" (E to F and B to C) are really half-notes > (because they are only half as far apart as the others are) so there > are only 6 notes really... :-) A bit of MC (Musical Correctness) would appear to be in order here. I feel obligated to put my 2 cents in, being a musician. Actually, these figures are wrong. You'd use mod 7 for white notes (C major or A minor scale) and mod 12 for all the notes (chromatic scale). If you don't believe me, count up the following sequences C-D-E-F-G-A-B (7 tone C major scale) C-C#-D-D#-E-F-F#-G-G#-A-A#-B (12 tone chromatic scale) [EXTREMELY LONG-WINDED RUMINATIONS FOLLOW -- stop here if you like] The statement that there are only six notes really in the major scale is not at all true. The major scale CONTAINS seven notes (eight including the octave) -- they are DEFINED to be unequal intervals. The *total interval* of any scale over an octave will always be six whole tones (12 semitones). That is how whole tones & semitones are defined. It doesn't matter how many notes there are in the scale itself or how they're positioned. (Things get fairly dicey since the word 'tone' and 'note' are often used to refer to the same thing. However, 'whole tone' and 'half tone' or 'semitone' refer to *intervals*, not notes. Often the word 'tone' is used where 'whole tone' would be more musically correct). Note that there are seven notes in the natural minor scale as well, but they are not defined to be of equal interval either (how could they be, since there are seven of them?). In the key of C: C-D-Eb-F-G-Ab-Bb (7 tone C natural minor scale) Some scales contain jumps of three semitones or more and may contain very few notes. An extremely common example (upon which a disturbing number of pop hits and electric guitar solos is based) is the Pentatonic scale, containing only five notes and two jumps of three semitones. If you arpeggiate this scale a few times (plus the C at the end -- C-D-E-G-A-C, C-D-E-G-A-C), you'll probably want to start singing "I've got teardrops....". Yes, Motown also made a lot of money from these five notes. The pentatonic scale fits into almost any song *because* there are so few notes -- the notes are rarely dissonant even if you continue to play the same notes through common chord or key changes. In the key of C, the pentatonic scale is: C-D-E-G-A (5 tone pentatonic scale) An interesting sidebar: almost everyone in the US knows how to play one of two songs on the piano in the F# pentatonic scale. When you realize that this scale consists solely of the black keys starting at F# and you play one song by rolling your knuckles over the keys, you'll probably recognize what annoying tune I'm talking about. If you really must have an equidistant six-tone scale, there is a system called (rather appropriately) the Whole Tone Scale, which was used extensively by the jazz great, Thelonius Monk, and has continued to be popular in jazz circles. The Whole Tone scale in C would consist of the following notes: C-D-E-F#-G#-A# (6 tone whole tone scale) It has a characteristically 'circular' and 'bottomless' feel about it, and tends to suggest offbeat scales and modes. So if you're talking about music and modular arithmetic, you should be using mod 7 for major/minor scale systems (white keys, for example), and mod 12 for twelve tone chromatic systems. If you're teaching younger children, sticking to the white keys makes sense, since there's something about the number twelve which seems really intimidating. Note that for distance problems (start at D, move up six notes, down ten, up two -- where are you?) -- the white keys should suffice. However, in a bit I'm going to relate a couple of real cool practical music problems that were tailor-made for modular arithmetic. The only problem is that they are somewhat advanced, and only work in the chromatic tone 'space.' Acting as the 'Music Police' once again, I should warn you NOT to refer to the musical terms 'third', 'fourth', 'fifth' etc. when you talk about intervals on a white-key major scale. Why? Because unless you carefully construct the problems to avoid certain pitfalls, you'll hit black keys. For example, a fourth above F is Bb, *not* B. While B is three *notes* higher in the C major scale than F, it is not a *fourth* above F (FYI, it's a diminished fourth). A fourth is always five semitones, which will take you into the chromatic world, [sort of like sqrt(-1) -- eek! the world of imaginary numbers! ;-> ] Fortunately, unlike imaginary numbers, accidentals carry as much musical clout as their Caucasian cousins. (If only that were true of life as well). Summary: white keys -- talk about distances in terms of notes (can be used for any scale in any key). all keys -- talk about distances in terms of tones, whole tones and semitones, and you can introduce the concept of musical intervals. AS PROMISED -- COOL MUSIC THING-TO-DO #1 To belabor this point into the ground, one of the cooler things you could show your students is how to transpose various chords up and down the keyboard, but suppose you were to limit yourself to the whitebread C major scale. For example, the Cmajor chord is C-E-G. Similarly, the Fmaj chord is F-A-C and the Gmaj chord is G-B-D. OK, so we appear to be able to construct any major chord on the basis of intervals of thirds (two notes). Wrong. Try D major (D-F#-A). D-F-A is D minor (a diminished third snuck in). Similarly for E major (E-G#-B) and A major (A-C#-E). Things get really messed up at B -- B major is B-D#-F#, whereas your 'white-bread' B-D-F triad would actually be a B diminished triad, and wouldn't sound anything like a major triad. If you work in the 12-tone system, then the triads are really just the offsets 0-4-7 relative to some base key, and using modulo arithmetic you can simply slide these values up and down anywhere you like, or create 'inverted' forms of chords in which you rotate the notes and shift by a portion of an octave. For example, the 'root' position of C major is C-E-G (or 0-4-7 in interval-speak). The first inversion of C major would be E-G-C (or 4-7-12 relative to the same base note). It is OK to have the base note missing from the chore. The second inversion would therefore be G-C-E (7-12-16). Four-note chords will even have third invertions. CHASING YOUR TAIL -- COOL MUSIC THING-TO-DO #2 You'll find that if you follow intervals around long enough, you'll get back where you started and there's lots of modulo stuff going on. For instance, there's the circle of fourths (C-F-Bb-Eb-Ab-Db-Gb-B-E-A-D-G-C) and the circle of fifths (C-G-D-A-E-B-F#-C#-G#-D#-A#-F-C). Note that both of these circles touch every tone along the way exactly once (not counting the C tacked on the end, of course). Why is that? You can also circle around by different intervals, some of which skip by octaves and visit each note, some of which hit each note, but only within a single octave, and still others which hit only some of the notes. The question is, of the latter category, do all of these stay within the octave, or do some skip around? For example, if you move by thirds you'll hit C-E-G#-C. Not terribly interesting, but it forms what is called an augmented chord (like a major chord, but with an augmented fifth). Likewise, by moving by diminished thirds you'll hit C,Eb,Gb,A,C [notice that music theory actually distinguishes between flats (diminished intervals) and sharps (augmented intervals) because of where they appear relative to the original major scale] . This latter chord is called a diminished chord, add six, in which the third and fifth are diminished, and a sixth is thrown in for good measure. Circles of fourths and fifths play a heavy role in pop and jazz music, and understanding their 'modulo' nature can be really useful -- like the fact that two jumps across the circle of fourths or fifths in either direction translates to something like a second up or down (actually a ninth). Much of the flavor of music comes from the numerical nature of these intervals. Try playing this chord sequence: Cmaj for two beats A7 (below C) for two beats Dmaj (above C) for one beat G7 (below C) for one beat Cmaj for two beats. That should sound familiar. You just played a simple 'tag lick' -- or what you often tack on the end of a musical phrase to get back to the starting point (C in this case). You'll note that you're traversing the circle of fourths part way around, from A back to C. TERMINOLOGY Unfortunately, the thing most people have a *lot* of trouble with regarding musical intervals is the motivation behind the *names* of things (third, fifth, diminished third, etc). To set the record straight, the names come about from the major scale and are quite useful in explaining how major scale notes 'deform' into wayward notes as you switch from one scale or mode to another. Sort of like recording a 3-D space deformation. For example, the natural minor scale is largely the same as the major scale except for diminished (flattened) third, sixth and seventh tones. Thus the scale consists of C-D-Eb-F-G-Ab-Bb-C in the key of C. You wouldn't say you had an augmented fifth even though the augmented fifth is the same thing as a diminished sixth. You want to keep the perfect fifth (G) intact -- it's the sixth that is being flattened and deformed from the major scale. This is why you use the 'flat' symbols and not sharps. Music is an intricate, but surprisingly consistent system, considering its history. Lastly, there is a thing called modes -- kind of like a cheap way to develop variations of the major scale by simply starting the scale somewhere in the middle? Suppose we take the C major scale, C-D-E-F-G-A-B-C and begin end end with some other note in the sequence -- say F. The sequence, F-G-A-B-C-D-E-F, though close to the major scale for F, has a note wrong. The B should be a Bb for the F major scale. What's happening is that you are in the key of F (not C), but you are in what's called 'Lydian' mode. The effect of this mode on the F major scale is that you play an augmented fourth instead of the perfect fourth, hence F-G-A-B-C-D-E-F instead of F-G-A-Bb-C-D-E-F. Let's try another example. Suppose we start the C major scale with G. Now we have the scale G-A-B-C-D-E-F-G. If you play this, once again, you'll recognize right away that it isn't a G major scale. What's wrong? The F should be F# for G major. So we have a diminished seventh (also known as a dominant seventh) in place of the natural seventh (F#). This is known as the G Myxolidian mode, and is in the key of G, though closely related to the key of C. There's also the Dorian mode, Ionian mode, Phrygian mode, and others, but I won't go into them. Can you guess how many there are, all in all? If you guessed eight, you're right (the non-distorting mode, where you play C major starting at C) even has a name. Are any of these modes, besides the root mode, major scales? [The answer is no. They all contain distortions.] Are any two modes identical? [The answer is no -- they are all distinct modes exhibiting different distortions.] Confused yet? You may find the following chart useful in understanding the nomenclature of musical intervals. There may be a mistake here or there (it's late) -- so sue me. It's shown relative to middle C, but you could slide it around (mod 12) to any position you want. Note that there are downward intervals as well as upward ones, though they may take you to very different notes. Semitone Interval Note Name of Interval ======== ====== ================ -12 'C Octave (below) -11 'C# Seventh (below), also called natural seventh. -10 'D Dominant seventh (below), also called diminished seventh or augmented sixth. -9 'D# Sixth (below) -8 'E Augmented fifth (below) or diminished sixth. -7 'F Fifth (below), also called perfect fifth. -6 'F# Diminished fifth (below) or augmented fourth. Also called tritone, and one of my favorite intervals (basis of very eclectic scales). -5 'G Fourth (below), also called perfect fourth. -4 'G# Third (below). -3 'A Diminished third (below), or augmented second. Also called the minor third, the basis for minor chords and scales. -2 'A# Second (below). -1 'B Diminished second (below). 0 C Unison. The word 'tonic' refers to the note, not the interval. The interval is unison. Thus the tonic is C (in this chart), but it's interval (read 'delta') is zero, or unison. +1 C# Diminished second. +2 D Second. +3 D# Diminished third or augmented second. Also called the minor third, the basis for minor chords. +4 E Third. +5 F Fourth, also called perfect fourth. +6 F# Diminished fifth or augmented fourth. Also called the tritone. Note that the tritone and octave intervals are the only intervals which fall on the same note regardless of whether you go up or down (food for thought). +7 G Fifth, also called perfect fifth. Hugely overrated in Western culture. +8 G# Augmented fifth or diminished sixth. +9 A Sixth. +10 A# Dominant seventh, also called diminished seventh or augmented sixth. +11 B Seventh, also called natural seventh. +12 C' Octave (above). +13 C#' Diminished ninth. +14 D' Ninth. +15 D#' Augmented ninth or diminished tenth. +16 E' Tenth. +17 F' Eleventh. (and so on, ad nauseum) I went up to elevenths (+17 semitones) because lots of jazz chords include such intervals (or even thirteenths, which is really just a fancy sixth). Here are the intervals for some common types of chords. See if you can transpose these into any key. (For example, what are the notes present in a Bbm7 chord? How about an Ab6?) Major 0+4+7+12 (Tonic+Third+Fifth+Octave) Examples: Cmaj = C+E+G+C Ebmaj = Eb+G+Bb+Eb Minor 0+3+7+12 (Tonic+Minor Third*+Fifth+Octave) Examples: Cm = C+Eb+G+C Ebm = Eb+Gb+Bb+Eb Seventh 0+4+7+10 (Tonic+Third+Fifth+Dominant Seventh) Examples: C7 = C+E+G+Bb Ab7 = Ab+C+Eb+Gb Major Seventh 0+4+7+11 (Tonic+Third+Fifth+Natural Seventh) Examples: Cmaj7 = C+E+G+B Dmaj7 = D+F#+A+C# (perhaps the sappiest sounding chords in existence) Minor Seventh 0+3+7+10 (Tonic+Minor Third*+Fifth+Dominant Seventh) Examples: Cm7 = C+Eb+G+Bb Em7 = E+G+B+D Diminished 0+3+6+9 (Tonic+Diminished Third+Diminished Fifth+Sixth) Examples: Cdim = C+Eb+Gb+A Gbdim = Gb+A+C+Eb (note that Cdim, Ebdim, Gbdim and Adim use the same notes -- they are, in a sense, the same chord in a sense) Augmented 0+4+8+12 (Tonic+Third+Augmented Fifth+Octave) aka Demented Examples: Caug = C+E+G#+C Eaug = E+G#+C+E (notice, once again, that Caug, Eaug and G#aug have quite a lot in common). Sixth 0+4+7+9 (Tonic+Third+Fifth+Sixth) Examples: C6 = C+E+G+A E6 = E+G#+B+C# Minor Sixth 0+3+7+9 (Tonic+Minor Third+Fifth+Sixth) Examples: Cm6 = C+Eb+G+A Em6 = E+G+B+C# Ninth 0+4+7+11+14 (Tonic+Third+Fifth+Seventh+Ninth) Examples: C9 = C+E+G+B+D F#9 = F#+A#+C#+F+G# Add Nine 0+4+7+12+14 (Tonic+Third+Fifth+Octave+Ninth) Examples: C/add9 = C+E+G+C+D A/add9 = A+C#+E+A+B Suspended 4th 0+5+7+12 (Tonic+Fourth+Fifth+Octave) Examples: Csus4 = C+F+G+C Bbsus4 = Bb+Eb+F+Bb The 'A' in 'A-men' in hymns -- the fourth wants desperately to resolve to a third. Hence the name 'suspended'. Flat Five 0+4+6+12 (Tonic+Third+Diminished Fifth+Octave) Examples: C/-5 = C+E+Gb+C A/-5 = A+C#+Eb+A "Bert's 'Oh-No!' Suspense Chord:" (really just a funky augmented chord with a dissonant note thrown in) (-1)+0+4+8 (Diminished Second Below+Tonic+ Third+Augmented Fifth) Examples: Caug/B = B+C+E+G# Bbaug/B = A+Bb+D+F# (and on and on and on and...) * - The term 'minor third' is equivalent to 'diminished third' because of its prevalence of minor chords. SEVEN NOTES OR EIGHT IN A MAJOR SCALE? You know, it's interesting, that comment about there being seven days in the week, but eight notes in a major scale. Dammit, there *are* eight notes in a major scale. You can't stop on the 'B'. There's something that just *pulls* you over to that final C. I guess musical scales can overlap one another, but we don't get a second Sunday over the weekend to sit at the piano and ponder that fact. [Incidentally, musicians do think in mod 7, not mod 12, because it took me no time to convert a thirteenth to a sixth. Likewise it should take no time to realize that a second and a ninth, a diminished fourteenth and a dominant seventh, and so on, are all equivalent and separated by an octave. UGHH!! Enough music theory. I also wanted to supply you with some other examples I thought of which illustrate everyday uses for modular arithmetic. Here goes... [several examples deleted -- djr] I'd better stop while I'm behind... CLOSE PSEUDO-MODULO CONTENDERS There were a couple of things that almost made it into the list, but I decided they weren't modular enough for official release, having to do with interesting mathematics, though not-quite-modulo-enough-for- prime-time (playing the tuba), or definitely modulus-oriented, but perhaps a bit too complicated to explain to a ten year old (maybe I'm wrong about that). I'll describe them anyway since I think they're fairly interesting, mathematically speaking. Pardon my wordiness -- I've run out of caffeine and need sleep. THE ABACUS [description deleted -- djr] THE TUBA As my final 'cool' pseuedo-modular example, which didn't make it into the prime-time list because it's not really modular, there's the question of how to play the tuba. I should note that I'm primarily a guitar player -- to me the world is easily transposable. You slide your fingers up and down to shift by semitones (one semitone per fret), you shift your hot lick up or down a string to move up or down a fourth (guitars, basses, ukeleles and five-string banjos are tuned this way -- it's fifths for the violin family, mandolins and the four string tenor banjo, which is why I can't play them at all!). There's even a wonderful device called a capo so that if your new singer can't handle the key you learned to play the song in, you simply shift all the notes anywhere you want and the fingering stays the same. Not so for rest of the music world, with the possible exception of harmonica players, who simply use a harmonice tuned to a different pitch. For piano players who must transpose music to a different key, white keys become dark and dark keys become white in seemingly inexplicable ways, depending on the interval associated with the key change. Years of practice enable you to overcome this problem to a large extent. And it's even worse for most woodwind and horn instruments, for which there's a distinct fingering for each note. I've never understood how wind and horn players can deal with a song that needs to be transposed, since all of their carefully honed physical movements are thrown out the door (once again, I suspect it's a matter of practicing enough till it becomes second nature, or at least possible with a bit of effort. And then there's the tuba. I discovered one summer that the tuba has a valve arrangement that almost seems to yearn for math and computer types to come grapple with playing the instrument. The tuba's valve system is based purely on the concept of intervals. There are only three valves on the thing, which at first glance would imply that you'd get a total of eight notes out of the thing, right? (There are eight valve positions which could be expressed in binary terms -- 000, 001, 010, 011, 100, 101, 110 and 111). Since there are only eight notes, chances are you'd be limited to playing notes from a major scale, right? DEAD wrong. You'd be playing the first eight notes of the twelve-tone chromatic scale (C through G, say, though I believe tubas may be tuned to Eb). The tuba's valves do the following: The first raises whatever note you're playing by a semitone (1/12 octave). The second valve raises what you're playing a whole tone (2/12 octaves). Pressed together, they ADD, so you'd be up 3 semitones from where you started (usually C or Eb). The final valve gives you a whopping four semitone shift (4/12 octaves). Say, this IS beginning to look like binary -- 1, 2, 4 -- who invented the tuba anyway, IBM? Nope. It just makes sense. Now if you press all three valves together you get a total displacement of seven semitones (1+2+4) or a perfect fifth, and you can get all the notes in between by simply thinking in terms of binary. But, there's a better way to get a fifth, as we shall see. A fifth isn't much range for an instrument -- how is it that we can squeeze more notes out of the thing? Well, by controlling how your lips are pursed -- your ombature (don't ask me to spell this) -- you can raise the base note a fifth or an octave, and then offset from that note by fiddling with the valves. It's all additive. Thus, the mouth supplies the coarse tuning of 0, +7 and +12 semitones, and the fingers perform the fine tuning of the result by 0 to +7 to get any note desired in an octave and a half range! The only problem is that most math and computer science majors will relate to the concept of intervals fairly quickly, especially if they have any musical training, but won't have nearly enough *wind* in them to play for sustained periods. (I know. I nearly passed out several times when I tried to learn how to play the damned thing years ago. I weighed a scant 120 Lbs at the time, and it's no joke that most tuba players have -- ah -- more determination to say the least. I faired much better with the saxophone whose fingering scheme seems *totally* alien to a guitar player. So I thought about the tuba, and I thought that it was kind of modulo-like the way you generated the pitches. But since the coarse adjustment was by odd intervals (+7 and +5 as opposed to +7 and +14) I decided that the tuba fingering scheme, though interesting, just didn't cut it in the world of mainstream modulo arithmetic. Sorry to all you oompa-oompa-addicts out there -- don't come busting my door down to complain!!! SO THERE YOU HAVE IT... So by now you've learned how to read and play Mozart requiems on the tuba, instantly transposting them into any desired key, while balancing your checkbook on an abacus in your other hand (it only takes one hand to play the tuba -- the other is there just for support), right? Yeah right, good luck! :-/ This should give you plenty to think about. If only the part of the brain that deals with math and science were more closely associated with the visual and musical parts. Then learning music, seeing how it's written, and experiencing how it sounds as intangible flavors might more easily blend together. As it stands, you need to practice, practice to bring it all together! -- Roberto Sierra Tempered MicroDesigns San Francisco, CA