As ddrake pointed out when reviewing Trac #9240, I had misunderstood
the docstring of factorial() and so in Sage factorial(x) is in fact
equal to gamma(x+1):

sage: factorial(5)
120
sage: factorial(1/2)
1/2*sqrt(pi)
sage: factorial(1/21)
gamma(22/21)

Is this supposed to be the case?  If so then I will change the
documentation of factorial() to make this clear.

Best,

Tom


On 15 June, 01:14, David Kirkby <david.kir...@onetel.net> wrote:
> On 15 June 2010 05:21, Tom Coates <t.coa...@imperial.ac.uk> wrote:
>
>
>
>
>
> > Dear sage-devel,
>
> > I believe that the following:
>
> > sage: gamma(x).full_simplify()
> > factorial(x - 1)
>
> > is not correct, because in Sage factorial(x) is defined only if x is a
> > non-negative integer.  The problem arises because behind the scenes
> > full_simplify() uses Maxima, and for Maxima factorial(x) is equivalent
> > to gamma(x+1).
>
> > I can think of two ways to fix this.  Given a symbolic expression
> > symb, we could:
>
> > a)  make symb.full_simplify() return an expression in terms of gamma()
> > rather than an expression in terms of factorial();
>
> > b)  check whether symb contains any subexpression of the form
> > gamma(foo).  If so, symb.full_simplify() should return an expression
> > in terms of gamma(); if not, symb.full_simplify() should return an
> > expression in terms of factorial().
>
> > Option (a) is easy to implement but I think it is the wrong way to
> > go.  There may be many Sage users who would want to simplify
> > expressions containing factorials (e.g. combinations of binomial
> > coefficients) but who don't know what the gamma function is.
>
> I'd agree with that.
>
> Dave

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to