Dear list,

Setup : sage 5.11 on Debian amd64 self-compiled (Debian's compilers and 
tuned Atlas library) 

trying to put on paper the elementary proof that the convolution of two 
normals is a normal, I stumbled on what I think to be a disastrous bug. 
What follows is shown in text mode, but running it in emacs with sage-view 
or in the notebook with the "typeset" option is much clearer...

var("x,t,mu,sigma")
assume(x,"real",t,"real",mu,"real",sigma,"real",sigma>0)
phi(x,mu,sigma)=e^-(((x-mu)^2)/(2*sigma^2))/sqrt(2*pi*sigma^2)
var("m1,m2,s1,s2")
assume(m1,"real",m2,"real",s1,"real",s2,"real",s1>0,s2>0)
g(x,m1,m2,s1,s2)=integrate(phi(t,m1,s1)*phi(x-t,m2,s2),t,-oo,oo)

prints :

(x, m1, m2, s1, s2) |--> sqrt(1/2)*sqrt(pi)*e^(-1/2*(m1^2 + 2*m1*m2 + m2^2 
- 2*(m1 + m2)*x + x^2)/(s1^2 + 
s2^2))/(sqrt(pi*s1^2)*sqrt(pi*s2^2)*sqrt((s1^2 + s2^2)/(s1^2*s2^2)))

Ugly (in text mode), but exact.

h=g(x,m1,m2,s1,s2) # to get a symbolic expression
print h.denominator()

This prints

sqrt(pi*s1^2)*sqrt(pi*s2^2)

which is simple, but obviously *FALSE*. And, by the way,

maxima.denom(h).sage()

gives the much more reasonable :

sqrt(2)*sqrt(pi*s1^2)*sqrt(pi*s2^2)*sqrt((s1^2 + s2^2)/(s1^2*s2^2))

which, simplify_radical()ized (legitimate under our assumptions), gives the 
expected :

sqrt(2)*pi*sqrt(s1^2 + s2^2)

I think that this is a bug (what is used for this kind of expression ? 
Sympy ?). Has it been already reported ? Should I report it ?

HTH,

                                                                    
Emmanuel Charpentier

-- 
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.

Reply via email to