ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 23 Sep 2011 04:47:36 -0500TypeError: Computation failed since Maxima requested additional constraintshttps://ask.sagemath.org/question/8340/typeerror-computation-failed-since-maxima-requested-additional-constraints/I have the following code:
N, n, f = var('N, n, f')
assume(N>0)
sum(binomial(N, n)*f^n*(1-f)^(N-n), n, (N+1)/2, N)
It gives me the following error message:
TypeError: Computation failed since Maxima requested additional constraints (try the command 'assume(N+1>0)' before integral or limit evaluation, for example): Is N+1 positive, negative, or zero?Thu, 22 Sep 2011 07:56:11 -0500https://ask.sagemath.org/question/8340/typeerror-computation-failed-since-maxima-requested-additional-constraints/Answer by kcrisman for <p>I have the following code:</p>
<pre><code> N, n, f = var('N, n, f')
assume(N>0)
sum(binomial(N, n)*f^n*(1-f)^(N-n), n, (N+1)/2, N)
</code></pre>
<p>It gives me the following error message:</p>
<pre><code> TypeError: Computation failed since Maxima requested additional constraints (try the command 'assume(N+1>0)' before integral or limit evaluation, for example): Is N+1 positive, negative, or zero?
</code></pre>
https://ask.sagemath.org/question/8340/typeerror-computation-failed-since-maxima-requested-additional-constraints/?answer=12680#post-id-12680This is a typical error message from Sage via Maxima.
But maybe I need an update from you. I get
sage: N, n, f = var('N, n, f')
sage: assume(N>0)
sage: sum(binomial(N, n)*f^n*(1-f)^(N-n), n, (N+1)/2, N)
sum((-f + 1)^(N - n)*f^n*binomial(N, n), n, 1/2*N + 1/2, N)
Thu, 22 Sep 2011 09:21:29 -0500https://ask.sagemath.org/question/8340/typeerror-computation-failed-since-maxima-requested-additional-constraints/?answer=12680#post-id-12680Comment by ck for <p>This is a typical error message from Sage via Maxima.</p>
<p>But maybe I need an update from you. I get </p>
<pre><code>sage: N, n, f = var('N, n, f')
sage: assume(N>0)
sage: sum(binomial(N, n)*f^n*(1-f)^(N-n), n, (N+1)/2, N)
sum((-f + 1)^(N - n)*f^n*binomial(N, n), n, 1/2*N + 1/2, N)
</code></pre>
https://ask.sagemath.org/question/8340/typeerror-computation-failed-since-maxima-requested-additional-constraints/?comment=21214#post-id-21214For some reason, it works now for me as well. (Maybe I had some inconsistent variable definitions I did not flush out or something). Thanks for checking.Fri, 23 Sep 2011 01:24:51 -0500https://ask.sagemath.org/question/8340/typeerror-computation-failed-since-maxima-requested-additional-constraints/?comment=21214#post-id-21214Comment by kcrisman for <p>This is a typical error message from Sage via Maxima.</p>
<p>But maybe I need an update from you. I get </p>
<pre><code>sage: N, n, f = var('N, n, f')
sage: assume(N>0)
sage: sum(binomial(N, n)*f^n*(1-f)^(N-n), n, (N+1)/2, N)
sum((-f + 1)^(N - n)*f^n*binomial(N, n), n, 1/2*N + 1/2, N)
</code></pre>
https://ask.sagemath.org/question/8340/typeerror-computation-failed-since-maxima-requested-additional-constraints/?comment=21210#post-id-21210Likely. Glad you're set now!Fri, 23 Sep 2011 04:47:36 -0500https://ask.sagemath.org/question/8340/typeerror-computation-failed-since-maxima-requested-additional-constraints/?comment=21210#post-id-21210