Ask Your Question
1

sage doesn't evaluate

asked 9 years ago

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

If I say f(x) = sum(k,k,0,x) and then f(2), I get 3, of course, but if I say g(x) = (binomial(10,k),k, 0,x) and then g(2), sage doesn't evaluate, just returns the definition with x replaced by 2. Why? Thanks

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 9 years ago

rws gravatar image

updated 9 years ago

Use simplify_full:

sage: f(x) = sum(k,k,0,x)
sage: f
x |--> 1/2*x^2 + 1/2*x
sage: f(x) = sum(binomial(10,k),k, 0,x)
sage: f
x |--> sum(binomial(10, k), k, 0, x)
sage: f(2)
sum(binomial(10, k), k, 0, 2)
sage: f(2).simplify_full()
56
Preview: (hide)
link

Comments

Maybe I'm using an older version. The answer I get for f(2).simplify_full() is 3628800 * sum(1/(factorial(k) * factorial(-k + 10)), k,0,2)

mariopablo gravatar imagemariopablo ( 9 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 9 years ago

Seen: 514 times

Last updated: Oct 15 '15