Skip to content

Instantly share code, notes, and snippets.

@Uberi
Created April 27, 2013 20:24
Show Gist options
  • Save Uberi/5474550 to your computer and use it in GitHub Desktop.
Save Uberi/5474550 to your computer and use it in GitHub Desktop.
k-element permutation count.
import math
def permutation_count(k, n):
"Computes the number of k-element permutations in a sequence of length n."
return math.factorial(n) / math.factorial(n - k)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment