Monday, 29 December 2008

Numerical Methods on Multiple Machines

Linear algebra routines can be parallelized and run on a grid using the theory of parallel algorithms.
http://www.cs.utexas.edu/users/plapack/papers/ipps98/ipps98.html

This is Cannons algorithm for matrix multiplication.
http://orca.st.usm.edu/~seyfarth/sc730/cannon.html

MonteCarlo computation is also a good candidate for parallel processing.

The following Java programs (for computational physics) are not parallelised but are interesting nonetheless.

http://www.physics.unlv.edu/~pang/cp2_j.html

Wednesday, 24 December 2008

Programming Stochastic Processes - including HMMs

An excellent course on stochastic processes from Technical University of Denmark is here.

Lecture 12 explains Hidden Markov Models.

A lot of work is done to build the foundations of DTMC and CTMC (discrete- and continuous- time Markov chains).

Another great book on stochastic processes with lots of example applications (e.g. from physics and electrical engineering) is by Emmanuel Parzen at Texas A&M University.

A particularly interesting anecdote from the book is how Einstein's equation involving the Wiener process was used to deduce the Avogadro number from Brownian motion experiments.  The Avogadro number is the number of particles (atoms or molecules) in on mole of a substance.

Knuth Volume 2 (Seminumerical Algorithms) describes the basic stochastic simulation techniques.

Vol2 also contains an unusually deep analysis of Euclid's algorithm to compute gcd(one of the oldest known algorithms) and prime factorisation.

Tuesday, 23 December 2008

SAGE and Cython - Mathematics in Python

SAGE is an open source mathematics system with a Python-based interface (95% of the code is Python).

http://www.sagemath.org/download-source.html


You will see in the source code to SAGE that there are .pxd files, used to declare functions and classes in a C-extension module. This is a Cython convention. Cython makes it easy to write C-extensions for Python.

Sunday, 23 November 2008

Math and CS Research Departments

Princeton

Some notable contemporary names at Princeton include Brian Kernighan (of awk fame - Aho, Weinberger and Kernighan) and Andrew Appel. BK is also involved in a very interesting project called AMPL a modelling language for mathematical programming.

Princeton is also famous as the place Alonzo Church, the American mathematician, did his PhD in mathematics and published a paper in 1936 on an "undecidable problem" which introduced the lambda calculus that inspired the creation of the LISP programming language.

http://www.cs.princeton.edu/

Inria

Inria have published an interesting series of monographs for 2008, including the use of temporal logic as a verification tool.
http://www.inria.fr/publications/editeurs/edit_monographies.fr.html

UNSW

Project on compiling Haskell to Java.
http://www.cse.unsw.edu.au/~pls/thesis-topics/ghcjava.html

Friday, 21 November 2008

Project Martingale (Java API for Derivatives Pricing)

http://martingale.berlios.de/Martingale.html#code

Sample signatures: public class BrownianMotion extends StochasticProcess; public class DigitalRandomSequence extends LowDiscrepancySequence (methods to compute L2-discrepancy). Utilises JFreeChart created by Object Refinery based ici.

Saturday, 15 November 2008

Basic Calculus and Vector Calculus Concepts for Computer Programmers

The MIT website outlines the basic rules of differentiation, which should be second-nature to any mathematical programmer.

It revises rules like product rule (to differentiate xln(x), breaking the product xln(x) into the sum of two products), chain rule (to differentiate sin(ln(x)) and quotient rule (to differentiate (ln(x)/cos(x)).

Programmers should also have a basic knowledge of limits. Like...what is the limit of sinx as x tends to zero? (you can guess this one from the graph). More tricky, what is the limit of sinx/x as x tends to zero? Don't know? Find out here.

Concepts of vector calculus (a.k.a. vector analysis, which has its roots in the theory of quaternions) like scalar and vector fields and grad (or "nabla"), div ("divergence") and curl should also be clearly understood and examples done. The link above also covers basic 2D and 3D co-ordinate systems (i.e. cylindrical and spherical coordinates versus cartesian and polar co-ordinates) essential in graphics programming.

An example of a scalar field would be temperature in a room, where a scalar temperature (in Kelvins say) can be associated to every 3D vector in the room. An example of a vector field would be an electrical force field where each vector has a magnitude and direction in which the force is acting.

Puzzle: is light a vector or a scalar field? Why?