Quarter Life Crisis

The world according to Sven-S. Porst

« ZealotryMainApple TV »

Primes

487 words

A while back a friend called and started talking to me about prime numbers and how it looked like you’d always get one by a formula that came down to 2 to some clever power minus 1. My initial reaction to this – as that of anyone who took a basic course in number theory would be – was to shrug this off. This just isn’t how prime numbers work. If there were such simple ways of finding new prime numbers it’d be pretty big news. And people certainly made a big effort to find those.

Still, my friend was very enthusiastic and insisted. Obviously the first two examples worked. And then numbers started being too big to check this on the fly. But at least those didn’t have prime factors like 3 or 5. In the end, of course, it turned out that already the third example wasn’t prime anymore as a quick check with a computer gave.

What I found quite amusing about this was the different way of handling the problems. My friend is a physicist. And he is familiar with tools like Matlab to handle maths problems with a computer. While I wouldn’t describe Matlab as ‘wonderful’, I would at least say it is a very powerful and efficient tool for numerical computations. If you need a Fourier transform of a huge vector (whose number of entries hopefully is a power of two…), Matlab is a good way to go. But those are quick and dirty computations with fussy floating point numbers. Useful for data analysis and simulations but not for handling primes.

When playing with Matlab I once noticed to my amusement that it is so enormously powerful that it will even invert matrices which aren’t invertible – say a matrix with random entries in which one row has been zeroed out. That’s probably due to the efficient numerical algorithms in use. And when keeping in mind that such a degenerate matrix is very close to an invertible one anyway, it’s probably a reasonable approach. But it’s also a point where you can see a big difference between pure math and more applied uses of mathematical techniques. While in numerical computations and many applications being a tiny bit off won’t matter too much, pure math is all about the precision. More about the question whether that matrix is invertible than what its inverse is.

On the mathematical side of things, people use applications like Mathematica or Mupad which don’t have the numerical performance of Matlab in many instances but they get the precision right. And of course they have a simple command for splitting a number up in its prime factors.

Fun to see how different areas are quite different culturally. But a bit depressing as well to be reminded that having learned a bit more about primes already kept me from being enthusiastic about this problem.


Unrelated link: More on primes.

March 27, 2007, 0:35

Comments

Comment by Paul D.: User icon

Maybe I’m totally missing the point of your post, but it’s trivial to generate primes: n! + 1 (n-factorial plus one) is always prime by definition. It’s nothing special though, because there are plenty of other primes that are harder to find.

March 27, 2007, 13:20

Comment by ssp: User icon

Hmm, maybe I’m totally missing the irony of your comment, but the last time I checked 25 wasn’t a prime.

You may want to read the ancient proof of why there are infinitely many primes to see how far from being true your statement is.

March 27, 2007, 20:22

Comment by d.w.: User icon

Amusing — I’ve had some professional involvement with Matlab from the perspective of getting it to work with one of my company’s products, but nothing beyond the “will it launch on these compute nodes if I throw these command-line options” level. :)

March 29, 2007, 21:54

Comment by ssp: User icon

Was that painful Dave? I remember trying to run Matlab on a Mac a few years back and eventually just gave up because it was more hassle than running it remotely.

And while it is quite a fascinating and powerful tool (which I only ever seriously used in some course on signal processing) I thought that Matlab was a bit of a pain. At least back then it wasn’t really platform independent (ie we had to use it on Windows machines for the Wavelet Toolbox) and it even had Endianness issues when moving files from whatever Sun machines they had to the Windows machines.

March 29, 2007, 22:35

Comment by d.w.: User icon

Well, from our perspective, it wasn’t particularly difficult, because once we’ve successfully gotten the correct application to spin up at the right time on the right compute nodes, our job is pretty much over. :)

March 30, 2007, 19:21

Add your comment

« ZealotryMainApple TV »

Comments on

Photos

Categories

Me

This page

Out & About

pinboard Links

People

Ego-Linking