Hi,

I've submitted a patch

http://sagetrac.org/sage_trac/ticket/628

for making "binomial" work as one would
expect for symbolic expressions, in cases like this:

sage: n=var('n')
sage: binomial(n+1,n-1)
n*(n + 1)/2

by defining binomial(x,m)=binomial(x,x-m) whenever x-m is an
integer.

This would be consistent with the way in which Maxima defines the
binomial function.

http://maxima.sourceforge.net/docs/manual/en/maxima_31.html#SEC126

is it reasonable to treat the symbolic variable n  as an integer?. In
this case, I think that this will give the results that one would
exprect.

However, in gemeral, I think that having domains for symbolic
variables would be essential for performing symbolic calculations, and
get correct results (but certainly could make a CAS much more
complex).

Currently Sage does not have a way to specify
that a symbolic variable belongs to a certain domain (for example that
n is a symbolic variable
representing an integer). I think that, the calculus package
implicitly assumes that symbolic variable represents a real number.
[In fact, I think that Axiom is the only free CAS with this feature,
but I'm not sure about that]


Consider for example the expression

sqrt(x**2)

If x is a real number, it can be simplified to

abs(x)

However, if x where known to be a positive real number, it could be
simplified to

x

On the other hand, if x is a complex number, that expression could be
problematic (since it depends on choosing a branch for the square root)

Another classical example is the binomial  (x+y)^2=x^2 + 2xy + y^2
that holds if x and y commute. If one wants to build a CAS that can operate
on non commuting objects, it is essential to have domains for symbolic
variables.

just to share some ideas on that...

Pablo

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to