Last active
December 10, 2015 20:48
-
-
Save kenthorvath/4490222 to your computer and use it in GitHub Desktop.
Question for Nathan re: Thief of Baghdad
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How many unique permutations are there for a sequence of size n with n_i number of elements of type e_i? | |
E.g. | |
The sequence [a a b b] has 4 elements with n_1 = 2; n_2 = 2; and elements e_1 = a and e_2 = b. | |
The unique permutations of this sequence are: | |
1: a a b b | |
2: a b a b | |
3: a b b a | |
4: b a b a | |
5: b b a a | |
6: b a a b | |
Update: OK, so it turns out to me (n_1 + n_2)! / (n_1 ! * n_2 !) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment