Comments

Tough nut! I think you are right about the answer being 3 there. You can see the code by typing `g.convolution??` and seeing what you get at the end. I'm wondering whether the wrong branch of the code is being taken at `if a1-b1<a2-b2:` but="" unfortunately="" have="" no="" definite="" answer="" for="" you="" yet="" on="" how="" to="" fix="" this.<="" p="">

@yideey: By the way, you can fix this yourself by opening the file at devel/sage/sage/functions/piecewise.py and making this switch of `fg2` and `fg4`, then running `sage -b`, which should work okay since it uses the Python included in Sage.

Agreed that it is wrong. After very odd results with something more complicated, I tried convolving two rectangular distributions of unequal width as a test. It is easy enough to show that the result should be a trapezoidal distribution. The result of the convolution in Sage was kind-of the right shape, but the top of the trapezium was detached, and too high by a factor of (exactly) 4.

I'm not a hacker, but would be happy to provide some test cases to somebody who wants to have a go at fixing the code.