Gittins Index

Some time ago I came across this subject almost by accident and I have written a few algorithms to try out the computation of this index.
Sonin's algorithm was the most recent one at that time and it was published only in form of some slides which could be downloaded from his homepage.

Quite surprisingly now in 2009 I haven't found any implementation of these pretty interesting algorithms in the public domain, so I'm making my own versions available here.
Niño-Mora has published a faster algorithm in 2007, I don't have that one.

The scripts run on Matlab or Octave and can be affected by rounding errors.  Their purpose was entirely didactic, nevertheless you could use them to debug a more robust version.