My toy piano keyboard has 7 distinct white notes: letters A-G in English alphabet. I'm going to create a melody by playing three random notes. I am not allowed to repeat any notes and the melody cannot be ended with E, F or G. How many different melodies can I play?
Examples:
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
How did you know you had to start thinking about the possibilities from the last note and not from the first?
Log in to reply
We can choose from first note itself. But we will have problem because we need to track whether we have chosen E, F, G in the first two notes or not, As we need to know for the final note how many possible way there are
Every question of permutation and combination have a hidden clue or constraint which builds the way to solving, always try looking for constraint in such questions.
The last note is the most restricting of the options. Deal with that first then you can choose from the remaining choices.
Let T be the total number of distinct possibilities of choosing the keys, then T = 7 * 6 * 5 = 210. But we know that T includes the possibilities such that the arrangement ends with E, F, G, so we need to substract them, x1, x2 and x3 respectively.
We know that x1 = 6 * 5 * 1 because we are forcing to end it with E.
x1 = x2 = x3.
So answer = T - 3 * x1 = 210 - 90 = 120.
I totally understand how you get 210. But can you elaborate the x1, x2, x3? x1=6 5 1?
Since it is forced to end the arrangement with E, options for 1st position = 6 (i.e. 7 -1--> E) options for 2nd position = 5 options for 3rd position =1 (since we are forcing it to end with E) x1 = 6 5 1 = 30
Now, same for arrangements ending with F and G. total will be same for those(here, x2 and x3) too, i.e. 30
Total number of arrangements possible = 210 Total number of arrangements not allowed = x1+x2+x3 = 30+30+30 = 90
Total number of arrangements possible with the given rules = 210 - 90 = 120.
At first, let's consider the impossibilities. If we have to end the last note with E,F or G, there are 3 ways to do it. Chosing the end note, Now we are left with 2 positions to be filled with 6 notes in hand which can be done in 6P2 or 6 x 5 = 30 ways. Since we can choose the last note in 3 ways and the first two notes in 30 ways, there can be 3 x 30 =90 ways to create a melody which will end with E, F or G.
But the total ways of creating a melody without the end note condition is to choose 3 positions with any 7 notes which can be done in 7 x 6 x 5= 210 ways. Now if we eliminate the impossible, whatever remains, however improbable must be truth. So, the number of melodies that can be played without choosing the last note as E, F or G has to be = 210-90 = 120.
I like your Sherlock Holmes quote, Ruhel. :)
You CANNOT end the tune with notes E, F, or G.
Log in to reply
That's what he said, he just substracted the combos where E, F and G are last from the total number of combos. I used the same approach but I started with the total and then calculated the EFG and substracted it
There are other elegant solutions. Just wanted to share mine. :)
We have to choose three from the set "ABCDEFG".
The last note cannot be "EFG" . Make a partition of the given set like this :- "ABCD | EFG".
As the first two notes can take from the second part , i.e "EFG" , we get we get the following cases :
Case 1 :- 0 Notes taken from second part (i.e. "EFG) by the first two notes which means we have to choose the all three notes from "ABCD" , we can do it in 4 X 3 X 2 ways . That is 24 ways
Case 2 :- 1 Note taken from second part by the first two notes. That is the first note can chose from "EFG" in 3 ways and the second note from "ABCD" in 4 ways and the third note must be chosen from first part "ABCD" of which 1 was already selected in second note. Hence 3 ways for third note. Therefore we have is 3 X 4 X 3 i.e. 36 ways . We should also count the possibilities where the first note is chosen from "ABCD" and second from "EFG", which will again have 36 ways. Hence the total number of ways is 36 + 36 which is 72 ways.
Case 3 :- 2 Notes taken from second part by the first two notes. That is both, the first and second note take from "EFG". The number of possibilities are 3 X 2 and third note takes from "ABCD" that is there are 4 ways. The total number of ways are 3 X 2 X 4 that is 24 ways.
Now adding all the cases , ( we are using sum rule here as we have three ways Case 1 or Case 2 or Case 3 to choose from) :- The total number of ways are :- 24 + 72 +24 = 120 ways.
I used the same logic, but when I saw discussion I realized that this is an overcomplicated approach. Better reasoning is to choose one of 4 possible for the last position first, and then choose what is left for the 2nd and first.
Thanks, I tried doing it that way, but I got confused. Your comment really helped me!
Begin by determining total number of possible 3 note combinations. Since there are 7 notes, the permutations are 7 6 5 or 210. Since there is an equal distribution, each note may be used up to 30 times in various unique combinations. Since 3 notes are not permitted in the final position, 210-(3*30)=120.
4 ( 3 × 2 + 3 × 3 ) + 3 ( 4 × 3 + 2 × 4 ) = 1 2 0
really didn't understood at first but after grabbing my pen and paper and making a flow chart got this multiplication
Sorry, I cannot explain as I don't know how to convert math equations to latex in these sites
Problem Loading...
Note Loading...
Set Loading...
There are 4 ways to choose the last note (we cannot use E,F and G). Next we can choose the second note. There are 6 ways of doing that, because we can't choose the one we used as the last one. Using the same reasoning we can choose the first note from 5 remaining unused notes. In total this gives 4 ∗ 5 ∗ 6 = 1 2 0 melodies.