I just switched to dvorak. Thank god this post is prefabricated…
Google first started dishing out more megabytes to Gmail users in April this year. Each time I have logged into one of my Gmail accounts, I have seen the wonderful storage counter they have on the Gmail homepage. I always figured it would be nice to know how much space they’re dishing out and over what time period, but it was never very high on my to do list. I just happened to have an essay due on Wednesday, and Gmail turned out to be the perfect catalyst for procrastination. Procrastination always gets the best of me. How can a report for English be more important than random mathematical endeavors anyway? Whilst I should have been weaving a story of world conquest, I was busy pouring through the Javascript that makes that hott counter run. The first code of note I came across was a definition of the a multidimensional array:
var CP = [
[ 1122879600000, 2450 ],
[ 1125558000000, 2550 ],
[ 1136102400000, 2950 ]
];
Being a *nix user and programmer with nothing better to do, I quickly realized that the three large numbers were dates written as the number of milliseconds after the Unix epoch. (1st January, 1970). It then follows that the second number in each sub array is the number of megabytes of storage Gmail users will have by the corresponding dates. Content with my time findings for the time being, I proceeded to play around with these numbers. This is where the linear algebra comes in. To find the rate of change between any two ‘installments’ of storage, one must compute the value ‘rise over run’, or similarly, ‘change in Megabytes over Change in time’.
Before continuing it is important to note that the first date is July 1st, 2005, the second is August 1st, 2005, and the third is January 1st 2006. We are currently in between the second and third installments. The rate of expansion between the second and third installments is given as:
Rate = (1136102400000-1125558000000)/(2950-2550) = (1 MB)/(26361000 ms)
Let t be the time, in seconds, since the Unix Epoch. The space available to Gmail users on any given date is then given as:
S=((t-1125558000000 ms))*((1 MB)/(26361000 ms)) + 2550
To be sure of this result and because I had nothing more exciting to do, I decied to write a PHP script to test the theory, which was of course correct. Writing that in PHP failed to waste a sufficient amount of time, so I decided a C++ version was in store… Let’s not go into that. ( C++ version )
Curious to see how Google approached the problem, I continued reading deeper into the source code. They used an equally effective part over whole method.
S=(t-1125558000000)/(1136102400000)*(2950-2550) + 2550
The real question here is: How much space will I have on October 4th, 2005 at 1533:27 EDT? ( Unix time: 1128454527)
S=(1128454527000-1125558000000 ms)*((1 MB)/(26361000 ms))+ 2550 = 2659.879253...MB
We shall see if I am right. In the meantime, it looks like I have quite a lucrative careerer in the field of insanity.