Sunday, August 28, 2011

Review: Sage Beginner's Guide (Fantastic Book on Sagemath)

Sage Beginner's Guide  is an introductory book for the Sage math software, an open source mathematics system. Sage is a free alternative to Mathematica, Maple, and Matlab. The book does a great job explaining the basics of Sage. Each chapter is well written with my favorite "Time for Action", that allows the reader to explore the software and understand the experiment in depth. It is a great way to explore how things work and completely in line with what the book says "learning by doing: less theory, more results".

The first chapter is a tour of "what can be done with Sage". The second chapter deals with installing Sage across a variety of platforms. Chapter three eases the user into the sage interface, it discusses how to use the CLI, the notebook interface and get help. Chapter four is all about python; the chapter does a great job introducing python: one of the best I've seen in a book. It arms the reader to work with Sage and python.

Chapter five focuses on vectors, matrices and linear algebra. Sage include numpy and the chapter covers numpy in good detail. Chapter six is my favorite. I love plotting graphs, the chapter discusses various types of plots. The chapter does a great job explaining Matplotlib. Chapter seven is all about symbolic mathematics: integrals, differentials, ODE's, solving equations, finding roots, Taylor series and more. Chapter eight is about solving problems numerically and for me this is the best chapter in the book. It covers a variety of topics -- finding roots, maxima and minima of functions, gradients, integration, discrete Fourier transforms, window functions, solving ODE's. linear programming, constrained optimization to probability. Chapters five to eight are the meat of the book and I expect all readers to keep referring back to these chapters time and again.

Chapter nine is about advanced python programming, but I was a little let down based on what I had seen in chapter four. The chapter covers OOP, modules, exception handling and unit testing. What I did not like was the way the code is formatted and occupies a majority of the contents of the chapter. Chapter ten is about my favorite tool, LaTeX, it covers integration of LaTeX and Sage. No mathematical software is complete unless one can build interactive workbooks and the author does a great job explaining how to go about that business with interactive graphics and good typesetting.

Given the capabilities of Sage, the book fails to cover some of the discrete mathematics aspects, like graph theory, combinatorics and cryptography. To be fair, the author does mention in the preface the focus is on calculus, ODE and linear algebra.

Sage is a beast with several projects integrated under a single umbrella. This book meets the goals it sets out to achieve and does so in an incredible manner with clear definition of chapter goals, good summaries and excellent examples. The breadth of coverage of topics is very good for an introductory book on Sage. If there is one book I could recommend on getting started with Sage, it would be this "Sage beginners guide"

Dynamic programming for the binomial coefficient

More fun things, this time with some visualisation of what happens when memoisation is used and what happens when we don't. I don'...