Why maths matter, especially to liberal arts students

Yesterday morning I was listening to WNYC/NPR during my commute. The reporter was explaining De Beers’ claim of supply shortage of diamonds and there will be a price increase of 5% a year for the next 5 years. In closing of the story, the reporter said something about the effect of price hike of 25%, thus implying that 5% annual increase over 5 years equals to 25% increase in total!

Wrong!

Let’s take a look at the concept of compound interest. First let’s say we start with the price of a mythical diamond at $100. At the end of first year, we increase price by 5%. That is $100 + ($100 x 5%) = $105.

So at the beginning of second year, the price of the mythical diamond is now at $105. At the end second year, we increase price by 5% again. This time $105 + ($105 x 5%) = $110.25.

Repeat this for the next three years:

Year 3: $110.25 + ($110.25 x 5%) = $115.76

Year 4: $115.76 + ($115.76 x 5%) = $121.55

Year 5: $121.55 + ($121.55 x 5%) = $127.63

So at the beginning of fifth year, the last price increase puts the final price of our mythical diamond at $127.63.

But what about the 25% increase in 5 years? Ok, let’s see.

$100 + ($100 x 25%) = $125

Huh! That’s clearly not the same as $127.63!

So my message to liberal arts graduates who may (or may not) become a reporter who would work on story involves numbers: brush up your maths skill!

My Golf GTI

Ever since I bought the Golf GTI back in March I always planned to take photos of it with nice background. It finally took Leah being stranded in the UK by volcano ash and a burst of sunny weather today to get me to do it.

All of them are taken using my Canon 50D with 50mm f1.8, handheld. This is also the first time I used Aperture 3 in a more in-depth editing role. The brush-in adjustment feature is absolutely awesome!

The whole collection is on Flickr but here are a sample:

Front view

Rear view
GTI badge

Escape the ‘RM’ in ORM using MongoDB

Last week we hit the customary ORM wall when we had to model a Many-To-Many relationship in our domain model. Even with Castle ActiveRecord we were still being forced to create either association table on the database schema, or an equivalent class to leverage ActiveRecord’s automatic schema creation. Added on top the need to manage SQL Server instances, we decided to take a fresh look at storage options that will allow us to continue coding with minimal friction on persistance.

Getting a cue from a former colleague at ThoughtWork, I started looking into the NoSQL movement. MongoDB seems to be getting a fair amount of press recently so I decided to try it out. Using NoRM as the .Net driver for MongoDB, I was able to covert our (still very small) codebase from using ActiveRecord to MongoDB in about 2 hours.

The process was made easier by our use of Repository pattern so most of the changes are concentrated in all the repositories methods (CRUD and queries). One potential side benefit is that because MongoDB is so fast, it is now possible to test data queries along side regular unit tests with minimal cost in time. This is generally not possible with RDBMS data storage.

* One of the useful tip I’ve come across is how to run MongoDB as Windows service.

Website Built with WordPress.com.

Up ↑

%d bloggers like this: