Answer:
35,829,630 melodies
Explanation:
There are 12 half-steps in an octave and therefore
arrangements of 7 notes if there were no stipulations.
Using complimentary counting, subtract the inadmissible arrangements from
to get the number of admissible arrangements.
can be any note, giving us 12 options. Whatever note we choose,
must match it, yielding
. For the remaining two white key notes,
and
, we have 11 options for each (they can be anything but the note we chose for the black keys).
There are three possible arrangements of white key groups and black key groups that are inadmissible:
White key notes can be different, so a distinct arrangement of them will be considered a distinct melody. With 11 notes to choose from per white key, the number of ways to inadmissibly arrange the white keys is
.
Therefore, the number of admissible arrangements is: