[Maxima] Simplifying gamma distributions
macrakis at alum.mit.edu
Wed Apr 4 12:52:34 CDT 2012
As a general rule, simplification works best when there is a single
representation for a given concept. If Maxima were designed for
convenience of implementation, we'd probably represent all trig and
hyperbolic functions in the exponential form, we'd represent abs(x) as
x*unit_step(x) or as (if x>=0 then x else -x) or ..., etc.
On the other hand, users have different preferences. In this case, some
prefer factorial (with the connotation, but not the requirement, that the
argument is integer), others prefer gamma, and I suppose some might even
prefer product(i,i,1,n) (for integer arguments). My personal preference
would be to standardize on an internal representation and simply treat
factorial and gamma as different *external* representations. The problem
with this is that it adds another confusing piece of global state (e.g.
factorial_display_form: "!" or 'gamma). It also means that you can't mix
gamma and factorial in a single expression.
Another alternative implementation simply *annotates* each individual
instance of gamma/factorial with the preferred display form, starting with
the form it was input in. This sounds more confusing to me. (And of
course we'd need to figure out what to do with non-user-input cases.)
A sort of compromise between the two would be to have a global
factorial_display_form which is set by the user's first input of gamma or
"!". But this could be confusing, too -- especially if some library
function happens to set the default....
But in any case, internally, gamma and "!" should be the same, and
minfactorial/mingamma etc. should not have to worry about the two forms.
On Tue, Apr 3, 2012 at 15:12, Oliver Kullmann <O.Kullmann at swansea.ac.uk>wrote:
> What I don't understand:
> Why are there two functions, factorial and gamma?
> Is there a different pragmatics behind it?
> If not, shouldn't the simplifications yield the same?
> And if one is going for "maximal strength" simplification,
> shouldn't one always apply makefact, since apparently
> Maxima understands factorial better than gamma?
> On Tue, Apr 03, 2012 at 04:43:23PM -0500, Barton Willis wrote:
> > > I am trying to simplify:
> > >
> > > gamma(a+1)/gamma(a) and maxima keeps spitting out gamma(a+1)/gamma
> > > (a) but it should equal a.
> > >
> > > Does anyone know how to simplify this?
> > On way
> > (%i6) gamma(a+1)/gamma(a);
> > (%o6) gamma(a+1)/gamma(a)
> > (%i7) minfactorial(makefact(%));
> > (%o7) a
> > Maybe somebody knows a more direct way.
> > Barton
> > _______________________________________________
> > Maxima mailing list
> > Maxima at math.utexas.edu
> > http://www.math.utexas.edu/mailman/listinfo/maxima
> Maxima mailing list
> Maxima at math.utexas.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Maxima