Archive for November, 2008

November 10th, 2008

The latest edition of the Carnival of Mathematics has been published over at Number Warrior. There is some superb stuff in this one with articles on the stability of eigenvalues, the probability of probabilities, the use of computers in mathematics, the arc lengths of Lissajous curves, how Fourier Transforms were used to analyse a song by the Beatles and much more.

The level of mathematics needed to follow all of the articles varies considerably which is great because it means that there should be something for everyone – from high school to research.

November 8th, 2008

As more and more people start upgrading to MATLAB 2008b they are uncovering problems with the new Mupad symbolic engine. The latest one was sent to me by Robert in the comments section of my review of the new symbolic toolbox. In the old version of MATLAB (2008a and below) the symbolic toolbox has no problems at all with the following integral

syms x
int((sin(x))^2/x,x)

ans =
1/2*log(x)-1/2*cosint(2*x)

but the new version using the Mupad engine simply cannot do anything with it:

Warning: Explicit integral could not be found.
> In sym.int at 64

Strictly speaking, this isn’t a bug at all but it does expose a limitation of the new system. I have filed an incident report with The Mathworks just in case they are not aware of this issue so hopefully it will be improved in a future version. Thanks to Robert for letting me know about this one.

If you are a user of MATLAB (or any other piece of mathematical software for that matter) then feel free to let me know if you discover any more issues like this. I will always inform the vendor once I have confirmed the problem but I am happy to keep your name to myself if that is what you prefer.

If you enjoyed this article, feel free to click here to subscribe to my RSS Feed.

November 5th, 2008

Today is my brothers birthday but, as is traditional between the two of us, I completely forgot to send him a card. There is little point in sending it now as it would turn up very late – he lives in America and I am in England you see.

So..I hope you’ll all join me in wishing my little brother a very happy birthday.

Cheers bro – hope to see you soon,

Mike

November 4th, 2008

One comment about my recent review of the new symbolic toolbox for MATLAB 2008b was that I didn’t mention any bugs. To be fair to me I simply didn’t know of any back then but things change so here is one for your viewing pleasure. The following problem with the solve command was originally mentioned on the matlab newsgroup a few days ago.

solve ('x^(5/2) + x^(1/2) = 42')

ans =
0

The solution should have been as follows (found with version 2007b of MATLAB and the symbolic toolbox)

ans =
4.3694949188853387526809476648368
-3.5354997083462823180109844585991-2.6744595794528774961538687374412*i
-3.5354997083462823180109844585991+2.6744595794528774961538687374412*i

Mathworks are aware of the problem and I am sure a fix will be released soon. So why have I chosen to focus on this you may ask?

Well, I have a rather strange relationship with bugs like this in computer algebra software in that I think that they are immeasurably useful! I love finding bugs in programs like MATLAB and Mathematica and will often make as much noise as possible about them. Is this because I hate the likes of Wolfram Research and Mathworks? Do I want to rip into them at every possible opportunity? Do I enjoy seeing big companies fail?

Not even close. Quite the opposite in fact.

Systems such as Mathematica and MATLAB seem almost impossibly powerful – they can do calculations that are far beyond my feeble little mind and they can do plenty of things beyond the ken of much more powerful minds too. It’s very tempting to take whatever results they spit out and present them as the correct answer. Always. All the time. Without exception. Mathematica/MATLAB gives this or that answer so it must be true! Right?

Wrong! So wrong that I go a funny shade of red whenever I see this opinion being expressed. Computer programs are developed by ordinary, everyday people just like you and me. They just happen to be rather good at programming computers. People make mistakes so we should expect that the programs they create will make mistakes too. This is no big deal and is nothing to lose sleep over – it’s just the way things are. I make mistakes, you make mistakes and Shock! Horror! MATLAB makes mistakes too.

Once you know and accept this you simply factor it into the way you work. When you plug a problem into Mathematica or MATLAB make sure that you think about the result you expect to get. Does the output look reasonable or is it clearly a load of old hogwash? If it does look reasonable then can you compute it via another method to check that there is nothing wrong with the first algorithm you tried?

How much does the correct result matter? If it is a matter of life and death then check it again and again. Then once more just for good measure. If it doesn’t matter so much then maybe check it just the once – or maybe not at all if it’s no big deal. Just be aware that it might be wrong.

There is no need to be too concerned though since one of the reasons why bugs like the one above are so interesting is that they are actually quite rare. I can sit in front of MATLAB day after day and never uncover a single bug – it’s pretty good at what it does to be fair. So…you can safely trust MATLAB – most of the time at least :)

I think that the occasional bug or two is good for the soul as they remind us that nothing is infallible – not even programs like MATLAB and it’s almost a shame that The Mathworks fixes them so quickly. So…go forth and find bugs. Don’t be afraid of them but learn from them. When you do find one, please tell me all about it though as I love a good bug! It’s probably best to tell the vendor about it too though, after all they are the ones who can fix it.

Finally, if anyone from The Mathworks or Wolfram Research is reading this, then I have a request if I may. Take a look through your bug database and try to pick out a really juicy one for us. It could be a symbolic integral that your system couldn’t do or maybe a numerical result that is so far from being correct it’s not even funny. Why did your program fail with that particular problem? If it is a straightforward programming bug then it’s probably not very interesting to the general reader but if there is something tricky about the mathematics that you had to overcome then I bet there will be a lot of people who would be interested in hearing about it.

Me for one!

If you enjoyed this article, feel free to click here to subscribe to my RSS Feed.

November 2nd, 2008

Last night I started the upgrade from Ubuntu 8.04 (Hardy Heron) to Ubuntu 8.10 (Intrepid Ibex) on my new Dell XPS M1330 laptop. I prefer to do a dist-upgrade rather than a clean install and I am pleased to say that it all went quite smoothly.

The only minor problem I have come across so far is that I lost sound on Youtube videos. The fix was straightforward:

sudo apt-get install flashplugin-nonfree-extrasound

Many people have written about the new features in Ubuntu 8.10 so I won’t re-cover that old ground but I will say that nothing in the upgrade broke my installs of Mathematica 6.0.3 and MATLAB 2008b – everything seems to just work and this latest version of Ubuntu feels great.