Re: [sage-support] Error summing inverses of binomial coefficients

2013-07-18 Thread Kannappan Sampath
I guess this is a bug.

But, in case, you want a quick fix, you might want to write a program by
working this sum. This is not hard, once one realises that, one could
rearrange the definition of the Beta function and observe ($n geq k$):

$$\binom{n}{k}^{-1} = \int_0^1 t^k (1-t)^{n-k} dt$$

This should prove that the sum you're after is:

n+1/2^{n+1} sum(2^k/k, k, 1, n+1).

Hope this helps.

PS. If somebody can confirm that it is really a bug (not really familiar
with symbolic...), then, I'd open a ticket on trac.




On Thu, Jul 18, 2013 at 7:17 AM, Ed Scheinerman 
edward.scheiner...@gmail.com wrote:

 I am looking to evaluate $\sum_{k=0}^n 1/\binom{n}{k}$ so I type:

 sage: n = var('n')
 sage: k = var('k')
 sage: sum(1/binomial(n,k),k,0,n)
 (n + 1)*2^(-n)

 and that answer is wrong.

 For example, with n=10 we get

 sage: sum(1/binomial(10,k) for k in range(11))
 1433/630

 but the alleged answer of (n+1)*2^(-n) is 11/1024.

 --
 You received this message because you are subscribed to the Google Groups
 sage-support group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Error summing inverses of binomial coefficients

2013-07-17 Thread Ed Scheinerman
I am looking to evaluate $\sum_{k=0}^n 1/\binom{n}{k}$ so I type:

sage: n = var('n')
sage: k = var('k')
sage: sum(1/binomial(n,k),k,0,n)
(n + 1)*2^(-n)

and that answer is wrong.

For example, with n=10 we get

sage: sum(1/binomial(10,k) for k in range(11))
1433/630

but the alleged answer of (n+1)*2^(-n) is 11/1024.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.