Live data from Hacker News

Ask HN: How many *playable* combinations of piano keys are there?

news.ycombinator.com

1–10 of 16 posts

Ask HN: How many *playable* combinations of piano keys are there?

#1
Given a span of 15 notes for one hand; and two hands I make it out to be less than 49 billion but the exact number eludes me (fingering constraints, duplicate notes between the two hands when they overlap).

The 49 billion is 3003 (15 choose 5) * 73 (the number of positions you could do that in) squared.

Anybody good at math with a more accurate number?

Re: Ask HN: How many *playable* combinations of piano keys are there?

#3
Some overlap gets reduced by always assuming that the "lowest" finger is choosen to a specific key and seeing how many combinations can be reached from there upwards.

Also allowing for not all fingers of a hand being used. Since one finger is set, we only look what the remaining 4 can reach:

14 choose 4 + 14 choose 3 + 14 choose 2 + 14 + 1 = 1471

this works for 74 positions for the lowest finger. For the top 14 positions we have to allow all fingers of the hand to be inside the 14, so here we have to add 14 choose 5 = 2002

so 1471 * 74 + (1471 + 2002) = 112327 should be accurate for one hand (or + 1 if we consider the "no fingers of this hand used at all"). That squared is 12.6 billion, but of course there's overlap in there too between the hands. Don't have a clever idea for that one right now that's not just enumerating scenarios...

Re: Ask HN: How many *playable* combinations of piano keys are there?

#4
post #3

Some overlap gets reduced by always assuming that the "lowest" finger is choosen to a specific key and seeing how many combinations can be reached from there upwards. Also allowing for not all fingers of a hand being used. Since one finger is set, we only look what the remaining 4 can reach: 14 choose 4 + 14 choose 3 + 14 choose 2 + 14 + 1 = 1471 this works for 74 positions for the lowest finger. For the top 14 posit…

Ah clever, totally missed that not all have to be used, thank you for this! I think you meant 12 billion?

Re: Ask HN: How many *playable* combinations of piano keys are there?

#5
post #4
post #3

Some overlap gets reduced by always assuming that the "lowest" finger is choosen to a specific key and seeing how many combinations can be reached from there upwards. Also allowing for not all fingers of a hand being used. Since one finger is set, we only look what the remaining 4 can reach: 14 choose 4 + 14 choose 3 + 14 choose 2 + 14 + 1 = 1471 this works for 74 positions for the lowest finger. For the top 14 posit…

Ah clever, totally missed that not all have to be used, thank you for this! I think you meant 12 billion?

yes, edited.

Re: Ask HN: How many *playable* combinations of piano keys are there?

#7
post #3

Some overlap gets reduced by always assuming that the "lowest" finger is choosen to a specific key and seeing how many combinations can be reached from there upwards. Also allowing for not all fingers of a hand being used. Since one finger is set, we only look what the remaining 4 can reach: 14 choose 4 + 14 choose 3 + 14 choose 2 + 14 + 1 = 1471 this works for 74 positions for the lowest finger. For the top 14 posit…

[deleted]

Re: Ask HN: How many *playable* combinations of piano keys are there?

#8
post #3

Some overlap gets reduced by always assuming that the "lowest" finger is choosen to a specific key and seeing how many combinations can be reached from there upwards. Also allowing for not all fingers of a hand being used. Since one finger is set, we only look what the remaining 4 can reach: 14 choose 4 + 14 choose 3 + 14 choose 2 + 14 + 1 = 1471 this works for 74 positions for the lowest finger. For the top 14 posit…

For two hands, assume the second hand is to the right (edit: to the left may be a bit easier to do) of the first one (the keys pressed _could_ overlap, but such combinations can be played with non-overlapping hands, too)

Then, use the above to compute how often there are x keys to the right (edit: left may make computations slightly easier) of the first hand for x in 0, 1, …, 87, repeat the exercise above for those smaller keyboards (derive a formula to speed things up), and multiply/add up everything (for the second hand, _do_ count “no key pressed” as a valid option)

I’ll leave doing the additions as an exercise.

Re: Ask HN: How many *playable* combinations of piano keys are there?

#9
Might also note that when the hand is stretched to its full range you can’t necessarily hit all possible combinations of notes within the range. (That is, the index finger can’t reach everything between the middle of the range and the thumb’s full extent.)

Re: Ask HN: How many *playable* combinations of piano keys are there?

#10
post #9

Might also note that when the hand is stretched to its full range you can’t necessarily hit all possible combinations of notes within the range. (That is, the index finger can’t reach everything between the middle of the range and the thumb’s full extent.)

Yes, this is the complex bit that I can't get a handle (pun intended) on, the degree to which the geometry of the hand constrains the problem.
Post reply on HN