The Mathematica Journal
Volume 9, Issue 2


In This Issue
Tricks of the Trade
In and Out
Trott's Corner
New Products
New Publications
News Bulletins
New Resources

Download This Issue 

About the Journal
Editorial Policy
Back Issues
Contact Information

Algebraic Programming in Mathematica
Andrzej Kozlowski

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 [2]. 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.