ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 05 Jul 2017 09:16:33 +0200symbolic functions and boolhttps://ask.sagemath.org/question/38181/symbolic-functions-and-bool/`d=var('d')`
$d$ is integer and $d>4$
f(d)=1/6*(d^2 - sqrt(d^2 + 8*d - 8)*d + 23*d - sqrt(d^2 + 8*d - 8) - 26)*(d - sqrt(d^2 + 8*d - 8) + 4)/(d + 1)
How can I show that $f(d)\ge 0$
`bool(f(d)>=0)` and `bool(f(d)<0)` return falseparkjrWed, 05 Jul 2017 09:16:33 +0200https://ask.sagemath.org/question/38181/Compare elements of a recursive defined sequencehttps://ask.sagemath.org/question/10163/compare-elements-of-a-recursive-defined-sequence/I define the recursive sequence as:
A, b, c = var('A, b, c')
def Sequence_rec(k):
x = 0
for i in range(1,k+1):
x = x + (A - x)/((c-i+2)^b)
return x
For the parameters the assumptions are:
assume(A>0,c>0,b>0)
assume(c, 'integer')
I'm interested in the elements of Sequence_rec(k) with k<=c. The following relation has to be true for the defined sequence considering the given assumptions:
assume(c>2)
bool(Sequence_rec(4) > Sequence_rec(3))
But Sage computes it is false! The following plot shows the difference is positive:
plot((Sequence_rec(4) - Sequence_rec(3))(A=1,c=3),b,(0,100))
How can I force Sage to compare the elements of the sequence `bool(Sequence_rec(n+1) > Sequence_rec(n)) = true` for any positive integer n correctly? Thank you for your advice!
Kurt
KurtMWed, 29 May 2013 11:02:26 +0200https://ask.sagemath.org/question/10163/