Piano Forum

Topic: Mathematical fun with Music  (Read 3812 times)

Offline m1469

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 6638
Mathematical fun with Music
on: May 21, 2005, 10:55:26 PM
(2+2= 4)(4+4= 8))(8+8=16)(16+16=32)(32+32= 64)(64+64=128)(128+128= 256)(256+256= 512)...


Combonational Analysis

Fundamental Principle of Counting

    Combinatorial analysis, which includes the study of permutations and combinations, is concerned with determining the number of logical possibilities of some event without necessarily enumerating each case.  The following basic principle of counting is used throughout.

Fundamental Principle of Counting : If some event can occur in n1 different ways, and if, following this event, a second event can occur in n2 different ways, and, following this second event, a third event can occur in n3 different ways, ..., then the number of ways the events can occur in the order indicated is n1, n2, n3.....

(a)  Suppose a license plate contains two letters followed by three digits with the first digit not zero.  How many different license plates can be printed ?

Each letter can be printed in 26 different ways, the first digit in nine ways and each of the other two digits in 10 ways.  Hence

26x26x9x10x10 = 608,400

different plates can be printed.

(b)  In how many ways can an organization containing 26 memebers elect a president, treasurer, and secretary (assuming no person is elected to more than one position) ?

      The president can be elected in 26 different ways; following this, the treasurer can be elected in 25 different ways (since the person chosen president is not eligible to be treasurer); and, following this, the secretary can be elected in 24 different ways.  Thus, by the above principle of counting, there are

26x25x24 = 15,600

different ways in which the organization can elect the officers.



Okay, here is an easy one to start with :


(c)  Suppose a piano keyboard contains 88 keys and a "motive" contains 5 notes:  1-quaver  followed by  4-semi-quavers.  (Not based on functionality) How many different motives can be formed if only one of the notes can be repeated ? 

Please show your work  ;)
"The greatest thing in this world is not so much where we are, but in what direction we are moving"  ~Oliver Wendell Holmes

Offline Tash

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 2248
Re: Mathematical fun with Music
Reply #1 on: May 21, 2005, 11:23:24 PM
oh god i haven't done maths in so long. it's a realy shame actually i love maths. i'll give it a try this week!
'J'aime presque autant les images que la musique' Debussy

Offline pianonut

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 1618
Re: Mathematical fun with Music
Reply #2 on: May 21, 2005, 11:26:57 PM
well, rhythm has got to be one of those mathematical points of interest (as well as form).

in chopins ballade op. 38 (dedicated to schumann - the miniature specialist) he has a sort of miniature section and then the virtuosic section - miniature - virtuosic and then miniature.  i guess rondos with the A-B-A-C-A-B-A sort of form are mathematical.  in measure 115 you have a wild codetta (1st return of A section +addition) that adds accidentals that keep adding measures past the amount that would be equal to the first A section.  beethoven started doing this, too, with piano music and symphonic music.

anyway, my point is a composer starts with a framework that is mathematical (symmetrical) and then manipulates it to his liking.  how far the frame is bent is completely up to the composer.

i notice with chopin that he is unusual in his choice of how many beats he will use for the start of a piece.  in many pieces you have a simple upbeat or an extra beat-but for this particular piece you have two upbeats that lead into two more upbeats?  it's almost as if he is teasing you with the simplicity of the beginning.  showing that he knew just as much (if not more) than schumann about simplicity.  yet, he was a genius at seeing a 'whole' of a virtuosic showpiece (even with simpleness added).  he uses that little motive in 6/8 to great advantage in the speeded up parts (using dotted quarters in rh and full sixteenth note runs in lh).  
do you know why benches fall apart?  it is because they have lids with little tiny hinges so you can store music inside them.  hint:  buy a bench that does not hinge.  buy it for sturdiness.

Offline m1469

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 6638
Re: Mathematical fun with Music
Reply #3 on: May 21, 2005, 11:27:57 PM
Actually... LOL I don't know if I can figure it out  ;D  I keep getting stuck on the third possiblity  ::)

"The greatest thing in this world is not so much where we are, but in what direction we are moving"  ~Oliver Wendell Holmes

Offline pianonut

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 1618
Re: Mathematical fun with Music
Reply #4 on: May 21, 2005, 11:32:58 PM
5=5  since you used the word 'can' be repeated (1 is added for the non repetitive motive)

7 different patterns of 5= 35

88x 35= 3080

that's my simple guess (for c)
do you know why benches fall apart?  it is because they have lids with little tiny hinges so you can store music inside them.  hint:  buy a bench that does not hinge.  buy it for sturdiness.

Offline pianonut

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 1618
Re: Mathematical fun with Music
Reply #5 on: May 21, 2005, 11:34:21 PM
am i correct that the quavers and semi-quavers don't enter the computation?  or, am i a wanna-be geek.
do you know why benches fall apart?  it is because they have lids with little tiny hinges so you can store music inside them.  hint:  buy a bench that does not hinge.  buy it for sturdiness.

Offline m1469

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 6638
Re: Mathematical fun with Music
Reply #6 on: May 21, 2005, 11:37:02 PM
am i correct that the quavers and semi-quavers don't enter the computation? or, am i a wanna-be geek.

Yes, you are correct, I included them only to stop people from trying to figure out rhythmic possibilities within the equation.



88x88x87x86x85 =

This is the equation I come up with (based on the ones above it), but I don't know that it is correct.  If only one note can be repeated, wouldn't the second note be the only other one that has 88 possibilities?  and then down from there?  I think that's wrong.

"The greatest thing in this world is not so much where we are, but in what direction we are moving"  ~Oliver Wendell Holmes

Offline pianonut

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 1618
Re: Mathematical fun with Music
Reply #7 on: May 21, 2005, 11:46:45 PM
i think that would be correct if you added them all instead of multiplying (could be wrong)  where is i-am-a-robot when you need him?

88+88+87+86+85 x 12= 5,208
do you know why benches fall apart?  it is because they have lids with little tiny hinges so you can store music inside them.  hint:  buy a bench that does not hinge.  buy it for sturdiness.

Offline m1469

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 6638
Re: Mathematical fun with Music
Reply #8 on: May 21, 2005, 11:51:13 PM
Well, looking at the examples above, thery were multiplied.  I think they are supposed to be mulitplied, but what I don't know is what if the second note was not a repeat of the first (though it still had 88 possibilities, it just turned out to be a different one), then wouldn't the third note maintain 88 possibilities?  and so on if every note were not repeated until the last?  So, there must be another factor.
"The greatest thing in this world is not so much where we are, but in what direction we are moving"  ~Oliver Wendell Holmes

Offline pianonut

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 1618
Re: Mathematical fun with Music
Reply #9 on: May 21, 2005, 11:52:08 PM
do you know the answer mayla?  this is going to mess up my brain until i know the correct answer.  with all of the homework my 10 year old is bringing home (that has to be answer correctly, according to her) i have been double and triple checking math problems that i have little to no expertise in.  and, as in this problem, coming up with multiple answers from which my daughter may choose.  she usually ends up doing it herself. it really bothers me though, and i keep thinking about the questions for a long time afterwards.  i must be a wanna-be mathematician.
do you know why benches fall apart?  it is because they have lids with little tiny hinges so you can store music inside them.  hint:  buy a bench that does not hinge.  buy it for sturdiness.

Offline m1469

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 6638
Re: Mathematical fun with Music
Reply #10 on: May 21, 2005, 11:55:07 PM
well I only know the answer if I know the equation and I don't think I know it for sure and now it's going to bother me.  Actually, I just got inspired about this and decided to bust out my math books from Uni and see what kind of trouble I could stir up.  I am a will-be   mathematician  (positive thinking) ;D

(I actually love math)
"The greatest thing in this world is not so much where we are, but in what direction we are moving"  ~Oliver Wendell Holmes

Offline pianonut

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 1618
Re: Mathematical fun with Music
Reply #11 on: May 21, 2005, 11:58:39 PM
wait a minute (lightbulb going off)  adding one more note to doubled note

89+89+88+88+88x12=5,304
do you know why benches fall apart?  it is because they have lids with little tiny hinges so you can store music inside them.  hint:  buy a bench that does not hinge.  buy it for sturdiness.

Offline pianonut

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 1618
Re: Mathematical fun with Music
Reply #12 on: May 22, 2005, 12:00:11 AM
where are my car keys?
do you know why benches fall apart?  it is because they have lids with little tiny hinges so you can store music inside them.  hint:  buy a bench that does not hinge.  buy it for sturdiness.

Offline m1469

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 6638
Re: Mathematical fun with Music
Reply #13 on: May 22, 2005, 12:06:02 AM
wait a minute (lightbulb going off)  adding one more note to doubled note

89+89+88+88+88x12=5,304

Well, "88" represents the number of piano keys=# of possibilities, so I think there cannot be any more than 88 possibilities.
"The greatest thing in this world is not so much where we are, but in what direction we are moving"  ~Oliver Wendell Holmes

Offline cadenz

  • PS Silver Member
  • Jr. Member
  • ***
  • Posts: 62
Re: Mathematical fun with Music
Reply #14 on: May 22, 2005, 12:09:17 AM
heres my answer. i dunno if its right:

88 keys
5 note motif
one note may repeat

notes are labelled A,B,C,D,E

possibilities are that, there are either all different, or that one note repeated.
if they are all different the amount of possibilites is 88*87*86*85*84
should there be repeats, it depends on which note is repeated.
if B, the second note, is repeated, B only has one choice:
88*1*87*86*85
if C is repeated:
88*87*1*86*85
if D is repeated:
88*87*86*1*85
if E is repeated:
88*87*86*85*1

the sum of all these possibilities is
88*87*86*85*84 + 88*1*87*86*85 + 88*87*1*86*85 + 88*87*86*1*85 + 88*87*86*85*1 = 84*(88*87*86*85) + 4*(88*87*86*85) = 88*(88*87*86*85)
= 88*88*87*86*85
= 4924951680
for n keys with r notes in such a motif:

n*n!/(n-r+1)!

Offline pianonut

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 1618
Re: Mathematical fun with Music
Reply #15 on: May 22, 2005, 12:22:10 AM
you've replicated something too many times!  are you sure?  can you prove it backwards?
do you know why benches fall apart?  it is because they have lids with little tiny hinges so you can store music inside them.  hint:  buy a bench that does not hinge.  buy it for sturdiness.

Offline m1469

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 6638
Re: Mathematical fun with Music
Reply #16 on: May 22, 2005, 12:24:17 AM
heres my answer. i dunno if its right:

88 keys
5 note motif
one note may repeat

notes are labelled A,B,C,D,E

possibilities are that, there are either all different, or that one note repeated.
if they are all different the amount of possibilites is 88*87*86*85*84
should there be repeats, it depends on which note is repeated.
if B, the second note, is repeated, B only has one choice:
88*1*87*86*85
if C is repeated:
88*87*1*86*85
if D is repeated:
88*87*86*1*85
if E is repeated:
88*87*86*85*1

the sum of all these possibilities is
88*87*86*85*84 + 88*1*87*86*85 + 88*87*1*86*85 + 88*87*86*1*85 + 88*87*86*85*1 = 84*(88*87*86*85) + 4*(88*87*86*85) = 88*(88*87*86*85)
= 88*88*87*86*85
= 4924951680
for n keys with r notes in such a motif:

n*n!/(n-r+1)!

 4924951680

That is the same answer I get with this equation here :  

88x88x87x86x85 =

This is the equation I come up with (based on the ones above it), but I don't know that it is correct.  

So I declare us CORRECT !!! unless we get proven wrong.  :-

It is interesting that we arrived at the same answer from two different ways.
"The greatest thing in this world is not so much where we are, but in what direction we are moving"  ~Oliver Wendell Holmes

Offline pianonut

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 1618
Re: Mathematical fun with Music
Reply #17 on: May 22, 2005, 12:29:18 AM
that's just wrong!  there was no number 12 discussed (as in 12 notes of the chromatic scale = 12 possibilities within the 88 note pattern of which one note is added because of a repetition).  am i misunderstanding the question?  or, am i hopeless as a logical thinking human being.  ok. 5 note motive moving the hand up chromatically 88 times with however many motives at each stop.  (going to the piano, proving my mathematical genius).
do you know why benches fall apart?  it is because they have lids with little tiny hinges so you can store music inside them.  hint:  buy a bench that does not hinge.  buy it for sturdiness.

Offline m1469

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 6638
Re: Mathematical fun with Music
Reply #18 on: May 22, 2005, 12:33:12 AM
Well, in this case I am considering each of the 88 piano keys as it's own entity and therefore a distinct possibility, not just 12 notes in a chromatic scale (repeated).  So I don't think the number 12 needs discussion. 

But I suppose in the crossover in music the lines get a little grey... LOL
"The greatest thing in this world is not so much where we are, but in what direction we are moving"  ~Oliver Wendell Holmes

Offline chopinetta

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 402
Re: Mathematical fun with Music
Reply #19 on: May 22, 2005, 12:35:50 AM
oh gee... if only i know what motives are... and quavers... i happen to have had some whole year of combinatorics... this is a stupid post... don't read.
"If I do not believe anymore in tears, it is because I see you cry." -Chopin to George Sand
"How repulsive this George Sand is! is she really a woman? I'm ready to doubt it."-Chopin on George Sand

Offline m1469

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 6638
Re: Mathematical fun with Music
Reply #20 on: May 22, 2005, 12:40:16 AM
well it doesn't really matter what they are if you know there are 5 slots total and 88 original choices, so tell us if we are correct... please  ;D
"The greatest thing in this world is not so much where we are, but in what direction we are moving"  ~Oliver Wendell Holmes

Offline pianonut

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 1618
Re: Mathematical fun with Music
Reply #21 on: May 22, 2005, 12:42:23 AM
combinatorics.  well then, answer the question.  don't make us suffer unneccessarily.  we know what motives are.  we know what quavers are.  we want to know how to calculate.  caculating women are like george sand.  
do you know why benches fall apart?  it is because they have lids with little tiny hinges so you can store music inside them.  hint:  buy a bench that does not hinge.  buy it for sturdiness.

Offline chopinetta

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 402
Re: Mathematical fun with Music
Reply #22 on: May 22, 2005, 01:15:43 AM
well, then it's got to be 88*88*87*86*85 which is equal to some big number. it all boils down to that equation. believe me. that is the fundamental counting principle. and i strongly disagree to just adding them all.

multiply multiply multiply!!!
"If I do not believe anymore in tears, it is because I see you cry." -Chopin to George Sand
"How repulsive this George Sand is! is she really a woman? I'm ready to doubt it."-Chopin on George Sand

Offline cadenz

  • PS Silver Member
  • Jr. Member
  • ***
  • Posts: 62
Re: Mathematical fun with Music
Reply #23 on: May 22, 2005, 12:56:38 PM
thinking about it some more, i don't think 88*88*87*86*85 is the answer.

you have two situations one where a note repeats and one where all notes are unquie, well the part where all notes are unique is easy, it is P(88,5) = 88*87*86*85*84.

but the part where one note repeats is a bit more complicated.
here you only use up four of the piano keys, so the number of possible 4 note sequences on the piano is P(88,4) = 88*87*86*85.
now for each one of these four note sequences one of the notes repeats, in no set order, so if the sequence of notes happens to be ABCD you could have these ways of arranging a repeated note:
AABCD
ABACD
ABCAD
ABCDA
that is for repeating note A, and there are 4 ways to repeat the note A, if the note B, C or D was repeated instead, there are also 4 ways of arranging it. so in all for each of the four note sequences there are 16 different ways of dealing with a repeated note. so this gives as the answer:

= P(88,5) + P(88,4)*16
= 88*87*86*85*84 + 88*87*86*85*16
= 100*88*87*86*85
= 5596536000 (a lot)
i'm sure most of them don't sound very good though :(

Offline Dazzer

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 1021
Re: Mathematical fun with Music
Reply #24 on: May 22, 2005, 01:45:12 PM
I'd say that sounds about right.

- thumbs up -

perhaps if we restricted it to an octave. and to add in some interesting twists, allow for flexible rhythms.

Offline rhapsody in orange

  • PS Silver Member
  • Full Member
  • ***
  • Posts: 233
Re: Mathematical fun with Music
Reply #25 on: May 22, 2005, 02:00:39 PM
Hmm I've got 4924951680 too!
Yep and you've gotta multiply the different possibilities..
So considering the case where there is a repeated note in the motif,
number of possible motives = 88*87*86*85*4 (any of the 4 notes previously used can be repeated)
And for the case where there are no repeated notes in the motif,
number of possible motives = 88*87*86*85*84
Therefore, total number of possible motives = 88*87*86*85*84 + 88*87*86*85*4
which is the figure on top =)
when words fail, music speaks

Offline m1469

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 6638
Re: Mathematical fun with Music
Reply #26 on: May 22, 2005, 03:31:19 PM
thinking about it some more, i don't think 88*88*87*86*85 is the answer.

you have two situations one where a note repeats and one where all notes are unquie, well the part where all notes are unique is easy, it is P(88,5) = 88*87*86*85*84.

but the part where one note repeats is a bit more complicated.
here you only use up four of the piano keys, so the number of possible 4 note sequences on the piano is P(88,4) = 88*87*86*85.
now for each one of these four note sequences one of the notes repeats, in no set order, so if the sequence of notes happens to be ABCD you could have these ways of arranging a repeated note:
AABCD
ABACD
ABCAD
ABCDA
that is for repeating note A, and there are 4 ways to repeat the note A, if the note B, C or D was repeated instead, there are also 4 ways of arranging it. so in all for each of the four note sequences there are 16 different ways of dealing with a repeated note. so this gives as the answer:

= P(88,5) + P(88,4)*16
= 88*87*86*85*84 + 88*87*86*85*16
= 100*88*87*86*85
= 5596536000 (a lot)
i'm sure most of them don't sound very good though :(


Okay, this stupid problem kept me up without sleep until something clicked (dont' know if it's correct for sure).   This equation is supposed to be built upon a somewhat static progression of events:  If n1 happens, then these are the remaining choices for n2,n3 and so on, not just possible combinations taken out of real time, added together.  Does this make sense? 

I am in a hurry right now so I will come back and argue a little (he he) and explain my thinking. 

So in short I think that 88*88*87*86*85 may still be correct.

m1469
"The greatest thing in this world is not so much where we are, but in what direction we are moving"  ~Oliver Wendell Holmes

Offline TheHammer

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 254
Re: Mathematical fun with Music
Reply #27 on: May 22, 2005, 05:13:38 PM
thinking about it some more, i don't think 88*88*87*86*85 is the answer.

you have two situations one where a note repeats and one where all notes are unquie, well the part where all notes are unique is easy, it is P(88,5) = 88*87*86*85*84.

but the part where one note repeats is a bit more complicated.
here you only use up four of the piano keys, so the number of possible 4 note sequences on the piano is P(88,4) = 88*87*86*85.
now for each one of these four note sequences one of the notes repeats, in no set order, so if the sequence of notes happens to be ABCD you could have these ways of arranging a repeated note:
AABCD
ABACD
ABCAD
ABCDA
that is for repeating note A, and there are 4 ways to repeat the note A, if the note B, C or D was repeated instead, there are also 4 ways of arranging it. so in all for each of the four note sequences there are 16 different ways of dealing with a repeated note. so this gives as the answer:

= P(88,5) + P(88,4)*16
= 88*87*86*85*84 + 88*87*86*85*16
= 100*88*87*86*85
= 5596536000 (a lot)
i'm sure most of them don't sound very good though :(
Okay, that is confusing...
First I really thought, Cadenz's first approach was correct. After reading his second one, I thought that was wrong. I tried to eplain it, but stumbled and came out with exactly the same as he. But now I have something different - argh!

Okay, we know that there are 88*87*86*85*84 possibilities, when no note is repeated.

Now, Cadenz, second approach is, that, when a note is repeated, there are 4 possibilites which note this may be, and four possibilities where this note is to be in the motif, so, this way:

 88*87*86*85*4
 88*87*86*4*85
 88*87*4*86*85
 88*4*87*86*85
=88*87*86*85*16

Okay. My problem is the following. If the "repeated" note is, for example, the second, how can there be 4 possibilities? I mean, only a note which is actually played can be repeated. You might argue that one has to think in a more abstract way, assuming that the other notes are already there, so that they can repeated, even if they come after the "repeated" one. Well, I say only one thing: redundancy.

Imagine you repeat note D as the second one:
ADBCD - okay? but isn't this exactly the same as ABCDB (so repeating the second note as the last one)? The note names don't have anything to do with it, we are talking about possibilities, and then they are the same.
On the other hand, the more I think about it, it gets frustratingly meaningless, and I am not a bit sure about this... :-\

So, if you consider redundant paths, there are fewer possibilities:
 88*87*86*85*4
 88*87*86*3*85
 88*87*2*86*85
 88*1*87*86*85
=88*87*86*85*10

  88*87*86*85*10
+88*87*86*85*84
=88*87*86*85*94

Can someone knowledgeable please enlighten us.

Offline m1469

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 6638
Re: Mathematical fun with Music
Reply #28 on: May 22, 2005, 05:28:32 PM
Okay, this is starting to obsess me now.  Here is why I think that my original equation in sufficient ( 88*88*87*86*85 )


Now, within linear time = at each progressive point of arrival/ each note slot we have x amount of choices depending on what happened previously (not possible combinations out of time ):

note #1 : there are 88 possibilities

note #2 : there remain 88 possibilities (because any note can be repeated)

note #3 : there are only 87 possibilites, because even if note #2 did not repeat note #1, note #3 cannot repeat both #1 and #2, so there is one less possiblility.

note #4 and #5 follow the same principle as note #3

That's what makes sense to me anyway and this seems sufficient  :-

m1469
"The greatest thing in this world is not so much where we are, but in what direction we are moving"  ~Oliver Wendell Holmes

Offline xvimbi

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 2439
Re: Mathematical fun with Music
Reply #29 on: May 22, 2005, 05:59:47 PM
That's quite correct, m1469, as far as I can see. It doesn't even matter whether one allows one note to be repeated or a note to be used again. "Repeat" means it has to be used right away:

AABCD
ABBCD
ABCCD
ABCDD

whereas, "used again" means any of the above, plus

ABCAD
ABCDB, etc.

In any case, after the first note has been played, there is always one less possibility than previously, plus one for the fact that any one of the already played notes can be used again.

88*(87+1)*(86+1)*(85+1)*(84+1)

Offline TheHammer

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 254
Re: Mathematical fun with Music
Reply #30 on: May 22, 2005, 06:31:06 PM
That's quite correct, m1469, as far as I can see. It doesn't even matter whether one allows one note to be repeated or a note to be used again. "Repeat" means it has to be used right away:

AABCD
ABBCD
ABCCD
ABCDD

whereas, "used again" means any of the above, plus

ABCAD
ABCDB, etc.

In any case, after the first note has been played, there is always one less possibility than previously, plus one for the fact that any one of the already played notes can be used again.

88*(87+1)*(86+1)*(85+1)*(84+1)

Okay, m1469, would you please clarify if "repeat" means instantly repeat (which would go well with your solution) or means just "use again" in the motif.
I think it is of great importance, since then we have to pay attention to the position of the repeated note as well, as Cadenz has pointed out.

Offline m1469

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 6638
Re: Mathematical fun with Music
Reply #31 on: May 22, 2005, 06:36:26 PM
Okay, ooopsies, sorry.  I mean "used again" anywhere  (I actually did not think about there being a difference  :-[ ). 

Anyway, as xvimbi pointed out and what makes sense to me, I don't see how it makes a difference.

m1469
"The greatest thing in this world is not so much where we are, but in what direction we are moving"  ~Oliver Wendell Holmes

Offline xvimbi

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 2439
Re: Mathematical fun with Music
Reply #32 on: May 22, 2005, 07:17:36 PM
Okay, m1469, would you please clarify if "repeat" means instantly repeat (which would go well with your solution) or means just "use again" in the motif.
I think it is of great importance, since then we have to pay attention to the position of the repeated note as well, as Cadenz has pointed out.

No, it won't make a difference as m1469 pointed out that I pointed that out.  :D

Offline TheHammer

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 254
Re: Mathematical fun with Music
Reply #33 on: May 22, 2005, 07:53:47 PM
No, it won't make a difference as m1469 pointed out that I pointed that out. :D
Okay, now that will take some time...
Here is my point, I have no idea how to prove it mathematically, but I nearly killed my mind thinking about it. Neither your nor our approach has a flaw I could describe in a mathematical way... ???
But, we have still the power of TESTING!
Let's make things a bit easier: You want to play a 3-note motif, you can choose from four
note (ABCD) and one note may be repeated. According to your solution, there should be 48 possibilities (first note 4 possibilities, second note three possibilities plus possible repeat, third note two possibilities plus possible repeat: 4*4*3=48) That is your approach, isn't it? It is the exact way you have solved the original problem (if I am wrong HERE, then I shamefully admit my stupidity!)
According to my approach: Go through without repeat: 4*3*2=24 possibilities
with repeats: Three general possibilities to place the repeats without redundance:
XYX; XXY, XYY (I choose other letter to avoid confusion, but have perhaps reached the opposite, have I? :P)
And for the X there are four possibilites (ABCD), for the Y 3 remaining. 4*3*3=36

And 24+36=60
So basically, with ABCD, can you form 60 or 48 different motifs? Let us follow your approach, beginning with A as the first note, then we have four different possibilities for the second, three for the third, right?

AAB
AAC
AAD
ABA
ABC
ABD
ACA
ACB
ACD
ADA
ADB
ADC (12 possibilities, change the first note four times: 12*4=48)

This way? There are ABCD as the second note, and then three other possibilities for the third, correct? Well...
Do you have spotted the fallacy? No? Then try to find ABB, ACC, ADD in this list!!!!! :o
You have simply ignored the possibility that the next notes could be repeated as well!!! (If I have missed your approach in any way, I am very sorry, but I think I am right.)

If you add the three missing motifs to the list, you got 15 possible motifs beginning with A. Multiply with 4 and you have my (my!my!my! ;D) solution: 60

(You can also try it with my method, there are six no-repeats in the list, as I predicted (24/4=6). Then along XXY we have 3 possibilities (AAB,AAC,AAD), as well for XYX (ABA,ACA,ADA) and XYY(ABB,ACC,ADD).)


So the solution for the original problem must be (I think): 88*87*86*85*94=5260743840   as I pointed out in a previous post. 8)

Offline xvimbi

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 2439
Re: Mathematical fun with Music
Reply #34 on: May 22, 2005, 10:17:17 PM
So the solution for the original problem must be (I think): 88*87*86*85*94=5260743840   as I pointed out in a previous post. 8)

Now, I think you are right :D In fact, whoever sends me the biggest chunk of chocolate is right ;D ;D

Seriously, I think you are. It does make a difference! Vive la différence!

Offline jim_24601

  • PS Silver Member
  • Jr. Member
  • ***
  • Posts: 99
Re: Mathematical fun with Music
Reply #35 on: May 22, 2005, 10:42:35 PM
I agree with The Hammer, assuming we're taking "repeated" to mean "used again in any position". Let's take it a note at a time.

There are 88 possibilities for the first note.
There are also 88 possibilities for the second note, because we're allowed to repeat a note. However, one of those possibilities is different: it's the one that actually does repeat the first note. So we've now got 88*(1+87). I shall mark in red the possibility within each set of brackets that involves a repeated note.
The third note has either 87 or 88 possibilities depending on whether a note has already been repeated. But TWO of those 88 possibilities in the latter case repeat a previous note. (Since the previous notes must have been different). The score is now 88*(1*87+87*(2+86)). Or taking the 87s out of the brackets and summing the red terms, 88*87*(3+86).
For the fourth note, there are either 86 or 88 possibilities. (Since if there's been a repeat, there are now 2 different notes which must be avoided). If there hasn't been a repeat, the whole keyboard is available but THREE possibilities repeat a note. We have 88*87*(3*86+86*(3+85). Or rearranging again, 88*87*86*(6+85).
The fifth note has 85 possibilities if there's been a previous repeat, or 88 if not, of which 4 introduce a repeat of their own. 88*87*86*85*(10+84). In other words, what TheHammer said.

If you look in the brackets at each step, the white term is just the next lower number and the red is a triangular number. It's quite an interesting series. If nPr is the number of ways to choose r objects (in order) from a set of n (in this case notes on a piano keyboard) with no repeats, what we're looking at is with one repeat, nP(r-1)*(r-1)*r/2+nPr. The bit in red is the equivalent to the red number above, it's the "extra" cases introduced by our one repeat. It's just the formula for the (r-1)th triangular number.

In fact, you can look at it in a different way. You have your original nPr = 4701090240 tunes of 5 unique notes. Set those aside, and now generate all the tunes with a repeated note by taking a tune with 4 unique notes and inserting a new note which is the same as one of the existing ones, in a certain position. There are nP(r-1) = 55965360 such 4 note tunes, each of which has 4 notes that you can copy into 5 places (before the start, or after any of the others. HOWEVER since each of these new tunes has a repeated note, you can generate each in 2 ways e.g. the tune ABCEC can be generated by inserting a C into the middle of tune ABEC or at the end of tune ABCE. So there are actually only half this many. (Or if you had r-1 notes to insert in r places you would have (r-1)*r/2 new tunes ... recognise that formula?) In other words, 55965360*4*5/2 = 559653600. Add this to the previous 4701090240 tunes and you get 5260743840. Well fancy that.

Now, who wants to do 2 repeats?

Offline rhapsody in orange

  • PS Silver Member
  • Full Member
  • ***
  • Posts: 233
Re: Mathematical fun with Music
Reply #36 on: May 22, 2005, 11:21:36 PM
Hmm so can the repeated note be repeated more than once? For example, can I have a 5 note motif built on only 1 repeated note?
If that's the case, I have
 88*87*86*85*84 (no repeated note)
+88*1*1*1*1        (5 repeated notes)
+88*87*2*1*1      (4 repeated notes)
+88*87*86*3*1    (3 repeated notes)
+88*87*86*85*4  (1 repeated note)
= 4926942328
when words fail, music speaks

Offline chopinetta

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 402
Re: Mathematical fun with Music
Reply #37 on: May 23, 2005, 12:23:10 AM
well, IS ANYONE HERE FAMILIAR WITH THE PIGEON HOLE THEOREM? that'll explain why the answer is as simple as 88*88*87*86*85.
"If I do not believe anymore in tears, it is because I see you cry." -Chopin to George Sand
"How repulsive this George Sand is! is she really a woman? I'm ready to doubt it."-Chopin on George Sand

Offline chopinetta

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 402
Re: Mathematical fun with Music
Reply #38 on: May 23, 2005, 12:39:21 AM
oh yeah. to those who have very long solutions, i guess you have to add some more. considering your work, you'll have to subtract the repeated possibilities. just a tip.

this is really getting very confusing.
"If I do not believe anymore in tears, it is because I see you cry." -Chopin to George Sand
"How repulsive this George Sand is! is she really a woman? I'm ready to doubt it."-Chopin on George Sand

Offline cadenz

  • PS Silver Member
  • Jr. Member
  • ***
  • Posts: 62
fun with two repeats
Reply #39 on: May 23, 2005, 01:07:06 AM
for two repeats.

one key can either be played 3 times
or two keys can be played twice

for one key being played 3 times:

in a 5 note motif involving one key being played 3 times, it only takes up 3 actual different keys. there are C(88,3) possible 3 key chords available on the keyboard.

there are 3 keys available to repeat and for each of these instances there are 5!/3! ways to arrange the notes
giving total amount of 5 note motifs where one note is played 3 times of C(88,3) * 3 * 5!/3! = 88*87*86/(1*2*3) * 3 * 5!/3! = 88*87*86*10 = P(88,3)*10 = 6584160

in the case of two keys being played twice:

number of 3 key chords = C(88,3) = 88*87*86/(1*2*3)
there are 3 ways to choose which keys are played twice
and for each of these three ways there are 5!/(2!*2!) = 5!/4 ways to arrange them
giving total amount of 88*87*86/(1*2*3) * 3* 5!/4 = 88*87*86*5!/8 = 9876240

so the total amount of 5 note motifs for having two repeats is 16460400

adding this to the total amount of 5 note motifs with no or one repeat gives 5277204240

Offline chopinetta

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 402
Re: Mathematical fun with Music
Reply #40 on: May 23, 2005, 09:56:13 AM
hmm... here's a better idea... let's take scenario number 1, no repeats. that'll be P(88,5).

then take the repetitions. that would be 88*1*87*86*86, 88*87*1*86*85 and so on. so the motives with repetitions would be 4P(88,4)

adding, P(88,5) + 4P(88,4), which is surprisingly equal to 88*88*87*85...
"If I do not believe anymore in tears, it is because I see you cry." -Chopin to George Sand
"How repulsive this George Sand is! is she really a woman? I'm ready to doubt it."-Chopin on George Sand

Offline pianonut

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 1618
Re: Mathematical fun with Music
Reply #41 on: May 23, 2005, 10:06:33 AM
smokes a cigar and listens in.
do you know why benches fall apart?  it is because they have lids with little tiny hinges so you can store music inside them.  hint:  buy a bench that does not hinge.  buy it for sturdiness.

Offline cadenz

  • PS Silver Member
  • Jr. Member
  • ***
  • Posts: 62
Re: Mathematical fun with Music
Reply #42 on: May 23, 2005, 10:14:10 AM
hmm... here's a better idea... let's take scenario number 1, no repeats. that'll be P(88,5).

then take the repetitions. that would be 88*1*87*86*86, 88*87*1*86*85 and so on. so the motives with repetitions would be 4P(88,4)

adding, P(88,5) + 4P(88,4), which is surprisingly equal to 88*88*87*85...

the reason this doesn't work out is because, if we were to do it like this, this is what we'd do:

concerning repeats:
on the first choice you have 88 possibilities.
on the second choice you have 1 choice if its a repeat:
88*1      but after one repeat there can be no more so...
88*1*87*86*85
if we have the repeat later:
88*87       now there are two choices for a repeat, can either repeat the first note or the second note:
88*87*2*86*85
if we have the 4th note repeating
88*87*86*3*85
fith note
88*87*86*85*4

which is 10*88*87*86*85 = 10*P(88,4)

final answer being P(88,5) + 10*P(88,4) = 5260743840

Offline pianonut

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 1618
Re: Mathematical fun with Music
Reply #43 on: May 23, 2005, 10:22:57 AM
are you sure you are counting motives (groups of five) and not notes.  if you are, there sure are a lot more than i realized (even if a note is 'used again' and not simply repeated).

aabcd
abacd
abcad
abcda

abbcd
abcbd
abcdb
acdbb


accdb
acdcb
acdbc
adbcc

add -  oh dear, i've gotten distracted.  ok if there are approximately 16 combinations starting with each letter, and then also variations.  that would be at least 16x5x88=7,040
do you know why benches fall apart?  it is because they have lids with little tiny hinges so you can store music inside them.  hint:  buy a bench that does not hinge.  buy it for sturdiness.

Offline jim_24601

  • PS Silver Member
  • Jr. Member
  • ***
  • Posts: 99
Re: Mathematical fun with Music
Reply #44 on: May 23, 2005, 01:05:35 PM
+88*87*86*85*4  (1 repeated note)

It's 10, not 4. You aren't considering the possibility that it might not be the first note that is repeated. (There are 4 ways of repeating the first note, 3 ways of repeating the second, 2 of repeating the third and one of repeating the fourth; it's that triangular number again).

= 4926942328

... so you've managed to get a number that's lower than the answer we've agreed for only zero or one repeats.

However, you correctly point out that we haven't considered cases where the repeated note is repeated more than once. Let's do those. We've already considered no repeats and one repeat (one of the notes occurs exactly twice).

I'm going to denote the kth triangular number by T(k) now, because it's quicker.

Now, we can generate all possible 5-note tunes where one note occurs exactly three times by inserting notes as we did before. Take all possible 4-note tunes with exactly one repeat. This is easy, we already have a general formula for that. With r=4 there are nP3*T(3) of them, or 88*87*86*6. We can now insert a new note in any of 5 places as before, however we don't have a choice as to which note now, because it has to be the one that's already been repeated. Also, since there are 3 occurrences of the same note each new tune can be generated in 3 ways (e.g. ABACA can be made from BACA, ABCA or ABAC), so we must divide by 3. In other words, there are 88*87*86*6*5/3 new tunes, or in general, nP(r-2)*T(r-2)*r/3 tunes of r notes with one note repeated twice.

For the next step, using the formula from the previous paragraph with r=4, we get 88*87*3*4/3 4-note tunes to expand. Now each new tune can be generated in 4 ways, so we need to multiply by 5/4 and we get 88*87*3*4/3*5/4 new tunes, or nP(r-3)*T(r-3)*(r-1)/3*r/4 in general.

The last step (quiet at the back there) in the same way takes 88*1*3/3*4/4 tunes (since R(1)=1) and expands them to give 88*1*3/3*4/4*5/5. Or nP(r-4)*T(r-4)*(r-2)/3*(r-1)/4*r/5 in general.

Of course, the last step reduces to just 88 tunes, which is obviously the case as these are the tunes with 5 notes the same, so the only choice is the starting note.

I'm going to try to lay everything out neatly using the typewriter font now. We've got

88 *  87 *  86 *  85 *  84 +
88 *  87 *  86 *  85 *  10 +
88 *  87 *  86 *  6  * 5/3 +
88 *  87 *  3  * 4/3 * 5/4 +
88 *  1  * 3/3 * 4/4 * 5/5


tunes in total. If I've not made a mistake entering it into the calculator that comes out as 5267366368. It isn't a very interesting number but it is a very interesting table we've got above. You might say that, for each row, the 88,87 ... numbers handle the unique notes, the 1,3,6,10 choose a note to repeat, and the fractions distribute the repeated notes among the others.

You can generate longer and longer tunes by adding numbers to the right (and adding a new row at the top to be the "all unique" case. The bottom row will always be 88 because it'll always be multiplied by 1. Not surprising since there's only really one note to choose. The next row up is more interesting. No matter how many notes we add, all the numbers in it will always cancel out except the first two and the last. You can explain this by, for r notes:

Choose a note (88) and repeat it r-1 times.
Choose a different note (87).
Choose a place to put the new note (r).
These are the r-note tunes with all the notes the same except one, and there are always 88*87*r of them.

I don't know if there's a simple formula for the total number of possible tunes in the general case, allowing only one note to be repeated but that any number of times. I haven't worked it out yet. Feel free.

Offline jim_24601

  • PS Silver Member
  • Jr. Member
  • ***
  • Posts: 99
Re: Mathematical fun with Music
Reply #45 on: May 23, 2005, 01:20:23 PM
I just thought of something else. We can expand the triangular terms in the table using T(r)=r*(r+1)/2. So then we get the new table

88 *  87 *  86 *  85 *  84 +
88 *  87 *  86 *  85 * 4/1 * 5/2 +
88 *  87 *  86 * 3/1 * 4/2 * 5/3 +
88 *  87 * 2/1 * 3/2 * 4/3 * 5/4 +
88 * 1/1 * 2/2 * 3/3 * 4/4 * 5/5


(Exercise for the reader: why isn't there a 5/1 on the top row to go with all the others?) Oh, and that second row again: 2/1, 3/2, 4/3, 5/4, ... recognise that? It's the harmonic series. Now that's a fun coincidence.

Offline m1469

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 6638
Re: Mathematical fun with Music
Reply #46 on: May 23, 2005, 04:10:47 PM
OKAY OKAY


Now, just in case it still matters, I would like to try to explain (again) what exactly I meant for the rules of the equation.  When I said "repeated" I meant: a single note may be used twice and only twice, anywhere in the motif (it is only an option) and the remaing must be individually unique. 

(I think this can still be misunderstood)

m1469  (he he he... *confused about where I am, who I am, what's happening*)
"The greatest thing in this world is not so much where we are, but in what direction we are moving"  ~Oliver Wendell Holmes

Offline abell88

  • PS Silver Member
  • Sr. Member
  • ***
  • Posts: 623
Re: Mathematical fun with Music
Reply #47 on: May 23, 2005, 08:25:43 PM
It's perfectly clear, m1469...your question, that is...but Probability, Combinations and Permutations are the things in math that I always instinctively answer absolutely incorrectly.   :(

Offline cadenz

  • PS Silver Member
  • Jr. Member
  • ***
  • Posts: 62
Re: Mathematical fun with Music
Reply #48 on: May 23, 2005, 08:34:50 PM
OKAY OKAY


Now, just in case it still matters, I would like to try to explain (again) what exactly I meant for the rules of the equation.  When I said "repeated" I meant: a single note may be used twice and only twice, anywhere in the motif (it is only an option) and the remaing must be individually unique. 

(I think this can still be misunderstood)

m1469  (he he he... *confused about where I am, who I am, what's happening*)

what do you mean? does that mean it has to be repeated next to itself like..... abbcd, or abccd, rather than abcad ? cuz otherwise its still what we've been doing as far as i know

Offline rhapsody in orange

  • PS Silver Member
  • Full Member
  • ***
  • Posts: 233
Re: Mathematical fun with Music
Reply #49 on: May 23, 2005, 11:13:31 PM
what do you mean? does that mean it has to be repeated next to itself like..... abbcd, or abccd, rather than abcad ? cuz otherwise its still what we've been doing as far as i know
I think m1469 means the repeated note can happen anywhere in the motif (including repeated next to itself). So abcd, abccd and abcad are considered possible motives..
when words fail, music speaks
For more information about this topic, click search below!
 

Logo light pianostreet.com - the website for classical pianists, piano teachers, students and piano music enthusiasts.

Subscribe for unlimited access

Sign up

Follow us

Piano Street Digicert