Number of pulsations given an specific keyboard

39 Views Asked by At

I am given a piano that has 88 keys and I am asked to find how many different melodies with 123 pulsations (each pulsation has obviously one key) are there. However, there is a restriction: there has to be exactly one key that does not appear in the melody. My attempt is the following:
To begin with, I choose which of the keys does not appear: there are $88$ options.
To continue, since each pulsation is different and the keys too (the order is important here), this is the same as looking for the number of surjective applications between a set of $123$ elements and another with the remaining $87$ elements. There are $87!S(123,87)$ of these applications, where $S(n,k)$ is a Stirling number of the second kind.
Therefore, using the product rule, there are $88\cdot87!\cdot S(123,87) = 88!\cdot S(123,87)$ different melodies given this restriction. Am I right?