Posts Tagged ‘maths’

Leeds restaurants in numbers

Tuesday, December 22nd, 2015 | Food

Earlier this month I launched the 5th edition of the Leeds Restaurant Guide. Now, with five editions behind us and several years of data, I decided it would be interesting to see what we could mine from that information.

Number of restaurants

You might expect the number of restaurants in Leeds to be going up. It is, but only slightly.chart_restaurant_count

This graph shows the total number of restaurants. Over the past two and a half years the number of restaurants has increased 10%. These are not the same restaurants though. It is a case of them opening faster than they are closing.


This graph shows the number of new restaurants opening and old restaurants closing between each edition. Restaurants have consistently opened while closures have been more sporadic. It is worth noting though that the release of each edition of the guide has not been equally spaced, even though it is shown this way on the graph, so that distorts the picture somewhat.

How we rate

Most restaurants are likely to be middle-of-the-road, with some not so good restaurants, some very good restaurants, and a few poor and excellent restaurants at either ends. So what happens when you plot frequency against rating?


Ah, just what we wanted: a beautiful bell curve! Two is a little low for a perfect curve, but normal distributions are often imperfect in the real world. This suggests to me that our ratings are consistent with what you would expect from restaurants running in the free market.

That only shows data from restaurants that are still open. What about restaurants that have closed?


What we would expect to see here is a little less clear. Perhaps that 1-rating is the highest as poor restaurants should close the most. But given there are some many 3-rating restaurants, this might not be the case, and you may have to adjust it for frequency to see such a result. As it is we have another bell curve.

There is a clear asymmetry in the graph though. Far more 1-rating restaurants close than 5-rating restaurants, and far more 2-rating restaurants close than 4-rating restaurants, indicating that our ratings are broadly consistent with where the market chooses to spend, or not spend, it’s money.

What type of food is the best?

What cuisine produces the highest standards? Can you provide any correlation between the type of food and how good a restaurant is?


This graph shows each cuisine type and the average rating it receives. No category can maintain an average rating lower than 2 or higher than 4 because no range of restaurants can be that consistent.

I was not surprised to see Thai so high up. Steakhouses are also typically on the higher price range, so score well (though we do factor in price to an extent when awarding ratings). Chinese scoring to high is mostly a result of the less nice Chinese restaurants closing down.

The number in brackets after each cuisine indicates the number of restaurants in that category. So the ratings for Persian, German and seafood are pretty meaningless because it is based on a single restaurant.

What useful information we can draw from this is less clear. Just because the average restaurant scores well or poorly does not mean that all restaurants will. There are bad Thai restaurants for example (actually, there aren’t, but there used to be one) and good Indians (lots of them!). However, if you were to avoid eating at new hotels, casinos, fast food and pubs based on it being unlikely to be a good meal, few people would fault you for that.

Optimal Cupid

Thursday, November 5th, 2015 | Books

Optimal Cupid: Mastering the Hidden Logic of OkCupid is a book by Christopher McKinlay analysing the online dating site OkCupid.

He scraped the site to get data on thousands of profiles and then analysed the data so that he could build the ideal profile. He claims it worked for him, going on 88 dates in three months and is now engaged.

That is all very interesting, although it was not what I was hoping for when I read the book. I bought it thinking it would be an interesting insight into OkCupid, how they do stuff and what interesting information we can glean from a large dataset. That’s not the case at all, it is simply an analysis from a user’s perspective.

It is also a very short book. I polished the whole thing off one evening as a bit of light reading in bed. It will take you maybe an hour, maybe only half to finish it and I have no idea who the foreword is written by, but it feels like he just asked a friend to write a two page ramble.

Therefore I would not recommend the book to anyone, unless finding dates on OkCupid is your last salvation for happiness.

I did apply some of the ideas he suggested to my own OkCupid profile however, so it will be interesting to see if anything comes of it. Seems unlikely though given my profile is very clear that I am happy married and only interested in platonic friendship…


Flatland: A Romance of Many Dimensions

Friday, June 5th, 2015 | Books

What a novel! Written in 1884, Flatland explores the idea of a 2D and 1D universe and the maths surrounding that, in an engaging and humorous way. It follows the life of the protagonist, a square, as he describes his world and visits others.

How does a 2D world look for example? You can only see in one dimension so how do you tell the difference between different shapes when everything looks like a line? What challenges does that present for society? For building design? For interacting with other people?

The same issues occur when the square visits lineland, a one dimensional universe. As well as the difficulties of trying to explain another dimension to those who live in said worlds. Upwards, not northwards!


World Cup sticker book

Friday, June 20th, 2014 | Sport

How long would it take you to complete the World Cup sticker book?

The answer, as it turns out, is a long time. We did the maths in the office a few weeks ago and the value we came up with was £460. That is how much you need to spend on stickers, on average, to fill the entire book. This assumes a random distribution of each sticker with no rares.

James Offer has created an online tool which simulates the process. It opens up a random pack of stickers over and over again until you have filled the book. It reached 637 somewhere between £300-400 I think, then was still going for that last sticker at £600 when I turned it off after two hours.

Of course you can reduce this by having friends to swap with. However, as a 27 year old man, I do not know any of my friends that are collecting World Cup stickers (nor I am for the record).

Simon Singh at Leeds Skeptics

Thursday, November 7th, 2013 | Events, Foundation, Humanism

Last month, Simon Singh came to Leeds Skeptics to promote his new book, The Simpsons and their Hidden Mathematical Secrets.

Turn out was excellent, we had 85 people there, topping our previous record of 68. We had to move a lot of the tables out of the room, move extra chairs in and still had people queuing out of both doors.

Simon put on a very entertaining talk and it was a pleasure to host him.



Alan Turing: The Building of a Brain

Friday, April 12th, 2013 | Foundation, Humanism

For the March meeting of Leeds Skeptics, Professor Barry Cooper from the University of Leeds presented a talk entitled “Alan Turing: The Building of a Brain”.

IMG_0695 IMG_0696 IMG_0697

Making the sums add up

Tuesday, August 14th, 2012 | Friends

One of the most active members of Toastmasters is my friend John Fletcher who was working towards the end of his Competent Communicator manual when I joined and has since completed it and moved onto the advanced speeches.

His 10th and final speech of the Competent Communicator was about how he was not a big fan of his job and so had finally broken free and set up on his own. It was a speech I strongly identified with, having recently done a similar thing.

John now runs Leeds Maths Tuition, offering one to one tuition for anyone looking to improve their grades.

Fast math

Wednesday, January 25th, 2012 | Success & Productivity

What is nine times seven? Did you know it was sixty three before reading this far? You probably did, but don’t pat yourself on the back too hard yet, as it could well have been that your brain was already reading ahead and the buffered information hadn’t reached your consciousness yet (if that is a thing, I think it is but I’m not a psychologist). Although, being a reader of my blog, you probably could do the math that fast anyway.

But not everybody can. Not because maths might not be their strong point but because they don’t use the same technique we do.

I mean, working out nine times seven isn’t nine times seven really is it? It’s ten times seven, minus seven. Because that is way faster. Because you can almost instantly tell that ten times seven is seventy, then all you do is subtract seven and you have your answer.

This was always obvious to me. But then, maths was always a far stronger side for me than English was. Hence why I can easily do such maths, but why there will almost certainly be parts of this blog post which make no grammatical sense at all. But it was brought to my attention when someone told me they had been learning about little techniques like that, that for some people it isn’t obviously, but you can teach them it and their maths skills get a lot faster.

In fact, it’s almost always faster to do it that way. Take six times seven for example. If I didn’t know that off by heart I would do seven times ten, seventy, divided by two, because again that is easy maths, thirty five, plus seven, gives you forty two. That would be way faster than counting up seven, fourteen, twenty one, etc, etc, even though it’s actually three different multiplications.

It’s like the i++ of the human brain.

Poker Stats Library

Tuesday, August 16th, 2011 | Tech

A few weeks ago, I wrote some tools which would help me out in getting to grips with poker, which in general I fail at.

It annoyed me because it should be fairly simple for someone like myself to get my head around the poker maths (well, it is, pot odds are easy), so even despite the lack of social understanding the life of a computer scientist brings, I should at least be able to achieve a level of averageness in the game. I clearly have failed to do this, and so I decided a bit of work on my basic strategy was needed.

As a result, I built an interactive tool which would teach me what starting hands I should play, similar to the concept of Basic Strategy in blackjack. It presents you with two cards and you have to say what position you can play them from, if any. It will then tell you if you are correct or not, if not it will ask you to try again and if so, it will move on to the next hand.

I also wrote a tool which allows you to select the cards you have, and using the same formulas it will tell you what position that hand is worth playing from. I’ve thrown in a few other simple odds calculations in there as well.

Of course, these won’t make you a great poker play by themselves, but it should provide a good basis to learn from.

Given the tools would otherwise just disappear into the depths of my hard drive somewhere, I’ve decided to publish the code on Github. Should you have any interest, you can download the source from the Github repository. It’s all written in PHP and should run out of the box.

Btw, the images below are screenshots, but the way they have been scaled down looks rubbish. They make more sense when you open them…


Thursday, May 15th, 2008 | Distractions, Thoughts

I don’t mean to be picky but on Futurama Bender is made of…

  • 40% titanium
  • 40% zinc
  • 40% dolomite
  • 30% iron