## Mathematica - symbolic representation

Find help with Math software, Engineering software, Graph software, Scientific software, Maple, Mathematica, Matlab, Pari/GP, calculators: Casio Classpad / TI Voyage / HP ...

### Mathematica - symbolic representation

Hey

I have a considerably long formula involving binomial coefficients. I wish to tell Mathematica to give a (symbolic) representation of these binomial coefficients, but I don't know how. For example in

$..(-2 + n)(-1 + n)*A + (-2 + n)(-1 + n)(-3 + n)*B..$

I would like to get

$.. 3!A\binom{n}{3}/n + 4!B\binom{n}{4}/n...$

How can I do that?

Cheers,
maxiim
maxiim
Newcomer

Posts: 12
Joined: Tue Dec 13, 2011 4:55 am

### Re: Mathematica - symbolic representation

Generally Mathematica is pretty stupid. You should be able to do it with something like
Code: Select all
`f[x_] := LeafCount[x] - Count[x, _Binomial, {0, Infinity}] +  15 Count[x, _Plus, {0, Infinity}]Simplify[(n - 2) (n - 1) A + (n - 3) (n - 2) (n - 1) B, ComplexityFunction -> f]`

where the choice of f makes it very expensive to write + or - signs (and free to write binomials) to nudge it in the right direction. But even FullSimplify will just stay at its local minimum; to get the simplified answer you need not only to give it the whole expression, but pass it with Hold.

Code: Select all
`Simplify[Hold[3! A Binomial[n, 3]/n + 4! B Binomial[n, 4]/n], ComplexityFunction -> f]`

You could try some version of /. but that will be fairly inflexible.
Pari/GP: this is the program I probably mentioned in my post. Windows users can get it at http://pari.math.u-bordeaux.fr/pub/pari ... -2-6-1.exe

CRGreathouse
Global Moderator

Posts: 12066
Joined: Sat Nov 25, 2006 9:52 am
Location: UTC -5

### Re: Mathematica - symbolic representation

Hi CRGreathouse

Generally Mathematica is pretty stupid.

I find Mathematica is some powerful software, however, in some regards (like this one), it can be a censored!

Back to the problem:
Id like Mathematica to transform the expression I have, that is

$..(-2 + n)(-1 + n)*A + (-2 + n)(-1 + n)(-3 + n)*B..$

to the representation with binomial coefficients without having to type all of them manually.
(I have a large number of terms, so it would be very helpful).

In more general terms, is it possible to transform a given expression in terms of built-in Mathematica functions?

cheers,
maxiim
maxiim
Newcomer

Posts: 12
Joined: Tue Dec 13, 2011 4:55 am