Ask Your Question

Binomial in a Summation

asked 2013-07-25 10:28:29 +0100

david8381 gravatar image

updated 2013-07-25 10:29:12 +0100

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 11:39:33 +0100

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 10:28:29 +0100

Seen: 1,355 times

Last updated: Jul 25 '13