Mathematica Module Guide


We assume you have already had an introductory course in computer programming or have experience writing moderately large, complex, well-documented programs. If not, we strongly recommend taking an introductory programming course (CSE501N or CSE131) before you take this course. Students without a formal introductory course in programming generally don't do very well.


In this module, you will learn how to use Mathematica (recently re-branded as The Wolfram Language) for mathematical computation and as a general purpose programming language. Most students in the class have never used Mathematica before and most of those who have have not used it as a general purpose programming language. If you are thinking

The choice of programming language is mostly a matter of convenience and personal preference. Most anything can be done in most any language, but it may be easier in some languages than in others.

What you will learn

After successful completion of this module you will have the basic tools you need for developing sofware in Mathematica.The abilities you should come away from this module with are:

  1. Use Mathematica notebooks to interactively carry out simple symbolic and numeric mathematical computations.
  2. Use Mathematica documentation to find functions that do something you want to do.
  3. Work with lists, matrices, and general-purpose trees including generating them, selecting parts of them, joining them, and mapping functions over them.
  4. Write general-purpose functions (code) in Mathematica including defining local variables, applying functions repeatedly (looping or mapping), and carrying out different computations depending on the value of a variable or expression (branching).
  5. Write code that lives up to my standards of style and readability.
  6. Write functional programs in which side effects are kept to a minimum.
  7. Use Wolfram Workbench, an Eclipse-based integrated development environment (IDE), for developing and testing Mathematica code.
  8. Carry out simple test-driven development.
  9. Use svn, version control system, to keep a history of your code as you develop it and share it with others (team-mates or the TAs).

Do this before the first class, if possible

Learning resources

There is a new online tutorial/textbook on Mathematica by Stephen Wolfram which you can find here. The nice thing about it is that there are exercises at the end of each of the short chapters. The bad thing is that it emphasizes the interactive functionality over writing code so it takes a while to get to some of the stuff you need. But definitely worth looking at! I will try to make reference to it at appropriate places.

Day 1

In Class

Before the next class

Day 2

In Class

Before the next class

Read: To turn in: Complete and turn in all three notebooks:

Day 3

In Class

Before the next class

Read To turn in: