Last active
March 24, 2016 16:17
-
-
Save Scinawa/bfe3b060ba14f4a2fa9b to your computer and use it in GitHub Desktop.
Injective functions from N to X, up to a permutation of N
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
import itertools | |
s="ABCD" | |
rep=3 | |
a = [i for i in itertools.combinations(s, rep)] | |
len(a) == math.factorial(len(s)) / (math.factorial(rep) * math.factorial(len(s)-rep)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment