Archive for February, 2009

February 12th, 2009

If I were to ask most of you what the exact date and time was right now then you would probably give me an answer based on the Gergorian Calendar system.  For example as I type this sentence, the Gergorian time and date is  “13:50 and 20 seconds on 12th Feburary 2008.”

Of course, the Gregorian calendar isn’t the only calendar system that has been used over the course of history.  Some alternatives that spring to mind (some of which are still used) include the Julian Calendar, the Islamic calendar, the Chinese Calendar and the Roman Calendar.  Check out www.fourmilab.ch/documents/calendar/ for a few more examples.

The calendar type I want to discuss today is called Unix Time*

Unix time was created back in the 1970s to serve the time keeping needs of the first Unix based computers and it has been used by many operating systems ever since.  Unix time is very simple – it consists of nothing more than an integer which represents the number of seconds that have elapsed since 00:00 Universal time on January 1, 1970 in the Gregorian calendar.  This may seem like an odd date to start a calendar but they had to start somewhere and it coudn’t be too early since the Unix time had to fit into a 32bit integer. 

So why am I telling you this you may wonder?  Well, the Unix time will soon be 1234567890 which I find fun since I am a numbers nerd.  Since I live in the UK this will correspond to February 13, 2009 at 23:31:30 and I intend to celebrate (well it’s as good a reason as any)!

For some of you, 123456890 will correspond to Valentines day – giving you two reasons to celebrate on that particular day.  To find out exactly when this momentous date falls for you try the following Perl command

perl -e ‘print scalar localtime(1234567890),”\n”;’

Or if, like me, you prefer Python

python -c ‘import time; print time.ctime(1234567890)’

Mathematica doesn’t use Unix time – it measures time from midnight 1st Jan 1900 so to find out when it will be Unix time 1234567890 you need to do something like

DateString[AbsoluteTime[{1970,1,1,0,0,0}+1234567890]

Something else that I recently discovered about the number 1234567890 is that both 1234567890 + 1 and 1234567890^2 + 1 are prime (originally from Prime Curios but verified by me using Mathematica).

Finally, if 1234567890 is not interesting enough for you then maybe you are more impressed with the palindromic time of 1234554321 which occurs a few hours earlier – Fri 13 Feb 2009 19:45:21 UTC to be precise.

*As I type this I consider the possibility that there is a formal definition of the term ‘calendar’ and that Unix Time doesn’t fulfill it for some reason.  Feel free to correct me in the comments if this is the case.

February 7th, 2009

Here in the UK we have had more snow than we have seen in over 20 years and as a country we are struggling with it to say the least.  I have friends in places such as Finland who think that all this is rather funny…it takes nothing more than a bit of snow to bring the UK to its knees.

Anyway…all this talk of snow reminds me of a Wolfram Demonstration I authored around Christmas time called n-flakes.  It started off while I was playing with the so called pentaflake which was first described by someone called Albrecht Dürer (according to Wolfram’s Mathworld).  To make a pentaflake you first start of with a pentagon like this one.

pentagon

Your next step is to get five more identical pentagons and place each one around the edges of the first as follows

pentaflake construction

The final result is the first iteration of the pentaflake design.  Take a closer look at it….notice how the outline of the pentaflake is essentially a pentagon with some gaps in it?

pentaflake construction

Lets see what happens if we take this ‘gappy’ pentagon and arrange 5 identical gappy pentagons around it – just like we did in the first iteration.

pentaflake construction

The end result is a more interesting looking gappy pentagon. If we keep going in this manner then you eventually end up with something like this

pentaflake

Which is very pretty I think. Anyway, over at Mathworld, Eric Weisstein had written some Mathematica code to produce not only this variation of a pentaflake but also another one which was created by putting pentagons at the corners of the first one rather than the sides.  Also, rather than using identical pentagons, this second variation used scaled pentagons for each iteration.  The end result is shown below.

pentaflake construction

Looking at Eric’s code I discovered that it would be a trivial matter to wrap this up in a Manipulate function and produce an interactive version. This took about 30 seconds – the quickest Wolfram demonstration I had ever written. After submitting it (with due credit being given to Eric) I got an email back from the Wolfram Demonstration team saying ‘Why stop at just pentagons? Could you generalise it a bit before we publish it?’

So I did and the result was named N-flakes which is available for download on the Wolfram Demonstrations site. Along with pentaflakes, you can also play with hexaflakes, quadraflakes and triflakes. One or two of these usually go by slightly different names – kudos for anyone who finds them.

Quadraflake