in reply to Scrabble word arrangements with blank tiles
Now here's my attempt to answer your two questions. I think I got it right but... well, I've been known to bang the hammer on my thumb so it wouldn't hurt to double check my logic.
Permutations of 7 distinct letters out of a set of 26 = P(26,7)=(26!)/(26-7)!
Permutations of 6 distinct letters and one blank out of a set of 26 letters and 1 blank = P(26,6) * C(7,1) * 26 = P(26,6) * 7! / (1!*(7-6)! ) * 26
General formula, with 26 letters, b blanks (maximum 7), and in the rack 7-b distinct letters and b blanks: P(26,7-b) * C(7,b) * 26^b. With no blanks, this reduces to the "permutations of 7 distinct letters" above, and with all blanks this is P(26,0)*C(7,7) * 26^7 = 26^7. I think this answers your first question.
Now, the situation where duplicate letters are allowed is that you have b blanks with duplicates allowed on the other 7-b letters. This is a similar situation to before, only instead of using the permutation formula P we use the multinomial coefficient, which is the number of distinct permutations in a multiset. The multinomial coefficient M(n1,n2,nk) is (n1 + n2 + ... nk)! / (n1!n2!....nk!). IE, with a rack of 5 (for simplicity) if you have 2 as and 3 bs, the number of distinct permutations is ( 2 + 3 )! / (2!3!) = 10. If instead of a and b you take any two distinct letters, the number of permutations increases to 10 * ( 26 * 25 ) = M(2,3) * P(26,2). So, for the general case of a rack of 7 with b blanks and the other 7-b letters some multiset, I think we have M(n1,n2...n sub7-b) * P(26,7-b) * C(7,b) * 26^b. If I'm right about this that answers your second question.
Perl module links that may be of interest:
Hope this helps... and I'll keep updating this if I figure anything more out. (Already updated several times to cull out less promising search avenues)
UPDATE: Fixed incorrect formula for adding wildcards to the distinct letter scenario.
|
|---|