Created
July 8, 2014 09:02
-
-
Save timcdlucas/b086cd2cc3a240f1c477 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from sympy import * | |
from sympy import init_printing ; | |
init_printing() | |
n, k = symbols('n k') | |
s1 = summation(k, (k, 0, n)) # works fine | |
s2 = summation((factorial(n)*n**k)/factorial(k)*factorial(n-k), (k, 0, n)) # works but gives crazy results | |
s3 = summation((factorial(n)*n**k)/(factorial(k)*factorial(n-k)), (k, 0, n)) # python hangs | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment