# The Beauty of Math

Math? Beauty? Ahuh. Yep, math has beauty, whether you want to admit it or not. I know you're excited to hear this, so I won't wait to tell you why: math is pure and all about perfection and elegance. The world of mathematics is a perfect world. It's not bound by any rules of nature. That's where its beauty lies. There are no exceptions to rules. If you solve a problem, the solution is what matters. Not whether it can be calculated efficiently, none of that matters in mathematics. Is the proof tidy, neat and elegant? Great! No, this is not one of those "Church of XML":http://www.zefhemel.com/archives/2004/09/12/the-church-of-xml articles that are actually very ironic. It's true, I'm not a fan of math per se. I don't enjoy doing math, but you got to admit, it's beautiful to derive a whole world from just a couple of axioms.

Now let's see what happens if you take something from mathematics, say set theory, and use it in the real world, say in computer science. Set theory deals with sets (shocker). What have we done with sets in computer science? Databases. A database table is basically just a set of "tuples":http://en.wikipedia.org/wiki/Tuple (which we call rows). We query this data using SQL(Structured Query Language), which is basically just an extension of set operations we know from set theory. SQL allows you to do unions (JOINs), intersections (using a smart WHERE clausule), substractions (DELETE) and additions (INSERT). On top of that there are some filtering and ordering capabilities.

Databases may very well be one of the purest implementations of a mathematic principle. But then I "hear":http://zef.cc/~jaap/index.php?p=48 (sorry, linked post is in Dutch) that some companies hold SQL competitions. Nice idea. Contestants are asked to formulate a query that is judged on the following criteria: * Correctness * Elegance * Efficiency

The first two are fine. But the third? The performance of a query? Do we have to take the actual implementation of the database engine into account now? Are we going to benchmark the execution speeds of queries? Let's say we would still be in the perfect math world. How would that sound? A query is nothing more than a question. Does a question have a performance? Is asking "What's your name?" higher-performing than "May I please request how your parents decided to call you when you were born?" Do we want to deal with that? The answer is the same. Well, except if you decided to change your name since your birth.

But that's not how the real world works. Time is money. If you can rewrite a query to something that's a bit more unnatural, though performs better in practice, you're going to do it. Computer scientists have to deal with trade-offs, mathematicians don't.

I think math may very well be the only thing in the world not bound by worldly rules. Pi doesn't snap when you use it too quickly. *e* doesn't explode if multiple people use it at once. And x doesn't heat up when you make it one millionth of an inch small.