Ask Your Question

# What does Sage offer for expression manipulations?

I heard that advanced expression manipulation isn't Sage's strong side. But are there simple conversions like convert(expr, X) where X is in {factorial, binomial, Gamma, hypergeom, partfrac, etc.. }?

For example how to convert (n!/k!)*binomial(k,n-k) to factorials? With Maple this would look like:

convert( (n!/k!)*binomial(k,n-k), factorial);

edit retag close merge delete

## 1 Answer

Sort by » oldest newest most voted

You can try to simplify your expression as follows:

sage: var('k,n')
(k, n)
sage: expr = n.factorial()/k.factorial()*binomial(k,n-k)
sage: expr.factorial_simplify()
factorial(n)/(factorial(2*k - n)*factorial(-k + n))

more

## Comments

Thanks. See my follow-up question 30440: What guarantees simplify?

## Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

## Stats

Asked: 2015-11-02 06:07:04 +0200

Seen: 140 times

Last updated: Nov 02 '15