Ask Your Question

Binomial in a Summation

asked 2013-07-25 03:28:29 -0500

david8381 gravatar image

updated 2013-07-25 03:29:12 -0500

sage: var('k')


sage: sum(binomial(5,k),k,0,5)

I get an error "cannot convert k to int"

But if instead I try something like sum(binomial(n,k),k,0,n), everything is just fine.

Anyone know how I can get around this?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-07-25 04:39:33 -0500

calc314 gravatar image

Sum is working only in a symbolic ring. So you can convert your integers to the symbolic ring as follows:


You can also use the add command:

add([binomial(5,k) for k in [0..5]])
edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools


Asked: 2013-07-25 03:28:29 -0500

Seen: 1,022 times

Last updated: Jul 25 '13