Volume 9, Issue 2
Tricks of the Trade
In and Out
Download This Issue
Algebraic Programming in Mathematica
2. Coefficients of Polynomials and Series
Probably the best known use of algebraic programming is in solving combinatorial problems, where many solutions can be expressed in terms of so-called "generating functions." Many examples are considered in . Here I shall only briefly mention a problem that was sent to MathGroup in July 2001.
Q: Define a Mathematica function that counts the number of ways of partitioning a number into a fixed number of parts (repetitions allowed) taken from a given set.
Here is a solution that uses algebraic programming.
Here is an example.
The proof of the correctness of this solution is left to the reader. The above solution, while elegant, suffers from the usual defects of naive algebraic programming; it is fairly slow. Much faster solutions can be found in the MathGroup archives.
About Mathematica | Download Mathematica Player
Copyright © Wolfram Media, Inc. All rights reserved.