Ask Your Question
0

Binomial in a Summation

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

david8381 gravatar image

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

sage: var('k')

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
2

answered 2013-07-25 11:39:33 +0200

calc314 gravatar image

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

sum(binomial(SR(5),k),k,0,SR(5))

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

Stats

Asked: 2013-07-25 10:28:29 +0200

Seen: 1,370 times

Last updated: Jul 25 '13