ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 25 May 2013 18:58:21 -0500Verifying that a symbolic expression in two variables is 0.http://ask.sagemath.org/question/10149/verifying-that-a-symbolic-expression-in-two-variables-is-0/I want to verify using SAGE that the expression:
${~~n~+1\choose k}~2^{-n~-1} - {~n\choose k}~2^{-n} + {~n\choose ~k~}~2^{-n~-1} + {~n \choose ~k-1}~2^{-n~~-1}$
is identically zero.
The SAGE script for this is:
**binomial(n+1,k)*2^(-n-1) - binomial(n,k)*2^(-n) + binomial(n,k)*2^(-n-1) + binomial(n,k-1)*2^(-n-1)**
I have tried using full_simplify() but it doesn't boil the expression down to zero.
Please help.
Thanks.Thu, 23 May 2013 18:33:21 -0500http://ask.sagemath.org/question/10149/verifying-that-a-symbolic-expression-in-two-variables-is-0/Answer by tmonteil for <p>I want to verify using SAGE that the expression:</p>
<p>${~~n~+1\choose k}~2^{-n~-1} - {~n\choose k}~2^{-n} + {~n\choose ~k~}~2^{-n~-1} + {~n \choose ~k-1}~2^{-n~~-1}$</p>
<p>is identically zero.</p>
<p>The SAGE script for this is:</p>
<p><strong>binomial(n+1,k)<em>2^(-n-1) - binomial(n,k)</em>2^(-n) + binomial(n,k)<em>2^(-n-1) + binomial(n,k-1)</em>2^(-n-1)</strong></p>
<p>I have tried using full_simplify() but it doesn't boil the expression down to zero.</p>
<p>Please help.</p>
<p>Thanks.</p>
http://ask.sagemath.org/question/10149/verifying-that-a-symbolic-expression-in-two-variables-is-0/?answer=14964#post-id-14964The reason is that your expression is not equal to zero !!!
If you multiply your expression by $2^{n+1}$, and simplify the two bionmials in the middle, you get ${n+1\choose k} - {n\choose k} + {n \choose k-1}$
This can not be zero since ${n+1\choose k} + {~n \choose k-1}$ is usually bigger than ${n\choose k}$ (unless $k>n+1$).Thu, 23 May 2013 22:58:41 -0500http://ask.sagemath.org/question/10149/verifying-that-a-symbolic-expression-in-two-variables-is-0/?answer=14964#post-id-14964Comment by caffeinemachine for <p>The reason is that your expression is not equal to zero !!!</p>
<p>If you multiply your expression by $2^{n+1}$, and simplify the two bionmials in the middle, you get ${n+1\choose k} - {n\choose k} + {n \choose k-1}$</p>
<p>This can not be zero since ${n+1\choose k} + {~n \choose k-1}$ is usually bigger than ${n\choose k}$ (unless $k>n+1$).</p>
http://ask.sagemath.org/question/10149/verifying-that-a-symbolic-expression-in-two-variables-is-0/?comment=17644#post-id-17644Ah yes! My bad. The expression I was supposed to wrestle with was:
binomial(n+1,k)2^(-n-1) - binomial(n,k)2^(-n) + binomial(n,k)2^(-n-1) - binomial(n,k-1)2^(-n-1)
and yes sage is able to bring it down to zero. Thanks so much.
I made a sign mistake. Really sorry. And thanks for your kind reply.Sat, 25 May 2013 18:58:21 -0500http://ask.sagemath.org/question/10149/verifying-that-a-symbolic-expression-in-two-variables-is-0/?comment=17644#post-id-17644