This blog has moved to www.mscroggs.co.uk.

Saturday, 30 November 2013

Rose & Crown, pt. 3

Way back in February*, I went with Jamie to see Dick Gaughan, the Scottish folk musician at Walthamstow Folk Club. When I got there, I found, to my surprise that the pub was a Rose & Crown!

Ye Olde Rose & Crown #3
Hoe Street, Walthamstow, London
3rd February 2013
Beer: 9/10
Service: 9/10
Atmosphere: 10/10
The pub had a nice interior, where we bought a pint each before ascending up a small rickety staircase to the room where the folk club was to be held.
The night began with some questionable singing from the landlord's family and friends, before Dick took the stage. Jamie had given me a copy of Handful of Earth for my birthday a few years before, but it was not until this evening that I truly appreciated how great a guitar player and singer Dick Gaughan is.
This pub really came close to being as great fun as the Rose & Crown in Oxford, although this was largely due to the musical entertainment, so viewed solely as a drinking hole, the great palace on North Parade remains undefeated...
*Through forgetfulness and laziness I'm only writing this up now.

Friday, 26 July 2013

Mathematical Views

Have you ever wondered what you would see if you were sitting at the origin and looking down at some spheres distributed on a logarithmic curve?

Thought not.

But why not take a look anyway? I've made a new page on Cats in Drag which lets you view this and other functions. If you want to suggest any other functions, please comment here and I'll get right on it.

Wednesday, 24 July 2013

"Uncanny" Royal Coincidence

A news story on the BBC Website caught my eye this morning. It reported the following "uncanny coincidence" between a Northern Irish baby and a Royal baby:
But both new mothers share the name Catherine, the same birthday - 9 January - and now their sons also share the same birth date.

~~ BBC News - Another Kate welcomes her own 'royal' baby

I decided to work out just how uncanny this is.

The Office for National Statistics states that 729,674 babies are born every year in the UK. This works out at 1,999 babies born each day, assuming that births are uniformly distributed, so there will be approximately 1,998 babies who share Price Nameless's birthday.

So, what is the chance of the mother of one of these babies having the same birthday as Princess Kate? To work this out I used a method similar to that which is used in the birthday "paradox", which tells us that in a group of 23 people there is a more than 50% chance of two people sharing a birthday, but that's another story.

First, we look at one of our 1,998 mothers. The chance that she shares Princess Kate's birthday is 1/365 (ignoring leap days). The chance that she does not share Princess Kate's Birthday is 364/365.

Next we work out the probability that none of our 1,998 mothers shares Princess Kate's birthday. As our mothers' birthdays are independent we can multiply the probabilities together to do this (this is why we are looking at the probability of not sharing a birthday instead of sharing a birthday). Our probability therefore is (364/365)1998 = 0.00416314317.

Back to the original question, we wanted to know the probability that one of our mothers shares Princess Kate's birthday. To calculate this we do take 0.00416314317 away from 1. This gives 0.99583685682 or 99.6%.

There is a 99.6% chance that there is a resident of the UK who shares the same birthday as Princess Kate and had a child on the same day.

Uncanny.

But let's be fair. The mother in our story is also called Kate. So what are the chances of that? In fact, the same method can be followed, working with the probability of having neither the same birthday or name as Princess Kate.

I think it is safe to assume that this would still be considered news-worthy if our non-princess was called Katie, Cate, Cathryn, Katie-Rose or any other name which is commonly shortened to Kate, so I included a number of variations and used this fantastic tool to find the probability of a mother being called Kate. The data only goes back to 1996, but as the name is dropping in popularity, we can assume that before 1996 at least 1.5% of babies were called Kate. Disregarding males, we can estimate that 3% of mothers are called Kate.

If anyone would like the details of the rest of the calculation, please comment on this post and I will include it here. For anyone who trusts me and isn't curious, I eventually found that the probability of none of our 1,998 mothers share the same name and birthday as Princess Kate is 0.84855028964. So the probability of another Kate having a child on the same day and sharing Princess Kate's birthday is 0.15144971035 or 15.1%. Just over one in seven.

So this is as uncanny as anything else which has a probability of one in seven, such as the Royal baby being born on a Monday (uncanny!).

Thursday, 11 July 2013

Raspberry Pi Weather Station

On 19 June, the USB temperature sensor I ordered from Amazon arrived. This sensor is now hooked up to my Raspberry Pi, which is taking the temperature every 10 minutes, drawing graphs, then uploading them here. Here is a brief outline of how I set this up (I'm writing this nearly two weeks after I did it so if you can't follow any of the steps let me know and I'll try to work out what I've missed out):

Reading the Temperature

I found this code and adapted it to write the date, time and temperature to a text file. I then set cron to run this every 10 minutes. It writes the data to a text file (/var/www/temperature2) in this format:

Plotting the Graphs

I found a guide somewhere on the internet about how to draw graphs with Python using Pylab/Matplotlib. If you have any idea where this could be, comment below and I'll put a link here.

In the end my code looked like this:

If there's anything in there you don't understand, comment below and I'll try to fill in the gaps.

Uploading the Graphs to catsindrag.co.uk

Finally, I wrote a php script to upload the graphs to catsindrag.co.uk/weather:


I hope this was vaguely interesting/useful. I'll try to add more details and updates over time. If you are building something similar, please let me know in the comments; I'd love to see what everyone else is up to.

Monday, 31 December 2012

Flags of the World

Have you ever wondered what colour you would get if you mixed all the colours in a flag?

Even if you haven't, have a look at what you would get: I made it and put it on Cats in Drag

Friday, 2 November 2012

Tube Map Platonic Solids, pt. 2

Following my previous post, I did a little more folding.

The post was linked to on Going Underground's Blog where it received this comment:
In response to which I made this from 48 tube maps:


Also since the last post, I left 49 tetrahedrons at tube stations in a period of just over two weeks. Here's a pie chart showing which stations I left them at:
Of these 49, only three were still there the next time I passed through the station:
Due to the very low recapture rate, little more analysis can be done. Although I do wonder where they all ended up. Do you work at one of those stations and threw some away? Or did you pass through a station and pick one up? Or was it aliens and ghosts?

For my next trick, I want to gather a team of people, pick a day, and leave one at every station that day. If you want to join me, comment on this post, tweet me or comment on reddit and we can formulate a plan. Including your nearest station(s) in your message will help us sort out who takes which stations...

Saturday, 6 October 2012

Tube Map Platonic Solids

This week, after re-reading chapter two of Alex's Adventures in Numberland (where Alex learns to fold business cards into tetrahedrons, cubes and octahedrons) on the tube, I folded two tube maps into a tetrahedron:
Following this, I folded a cube, an octahedron and an icosahedron:
The tetrahedron, icosahedron and octahedron were all made in the same way, as seen in Numberland: folding the map in two, so that a pair of opposite corners meet, then folding the sides over to make a triangle:
In order to get an equilateral triangle at this point, paper with sides in a ratio of 1:√3 is required. Although it is not exact, the proportions of a tube map are close enough to this to get an almost equilateral triangle. Putting one of these pieces together with a mirror image piece (one where the other two corners were folded together at the start) gives a tetrahedron. The larger solids are obtained by using a larger number of maps.

The cube—also found in Numberland—can me made by placing two tube maps on each other at right angles and folding over the extra length:
Six of these pieces combine to give a cube.

Finally this morning, with a little help from the internet, I folded a dodecahedron, thus completing all the Platonic solids:

To spread the joy of folding tube maps, each time I take the tube, I am going to fold a tetrahedron from two maps and leave it on the maps when I leave the tube. I started this yesterday, leaving a tetrahedron on the maps at South Harrow. In the evening, it was still there:
Do you think it will still be there on Monday morning? How often do you think I will return to find a tetrahedron still there? I will be keeping a tetrahedron diary so we can find out the answer to these most important questions...