sawyl: (A self portrait)
Got into a discussion about pizzas and value for money with someone who was, I suspect, deliberately pretending to be innumerate to wind me up. The conversation went somewhat as follows:

Them: We always get two 12" pizzas and end up talking half home. I can't understand why people buy their 16" ones. They cost twice as much, but you're only getting 16 inches of pizza instead of 24...
Me: [ boggling ] I'm not sure it works like that...
Them: [ blithely ] ...people are always really impressed when I tell them that... It's much better value for money
Me: But the area varies with according to the square of the radius... [ estimating frantically ] So if we say that a 16" pizza is around 200 square inches and a 12" is around 100, then it's going to be a pretty close run thing. Two 12 inchers are probably better value, but not by very much — certainly not double.
Them: Really? I'll have to remember not to tell people who are good at mental arithmetic...

Having had time to run the numbers, I've realised that my rough numbers were right and my interlocutor was correct, but only just: if the costs of the larger pizza are exactly double (which, it turns out, they're not) you get 12.5 per cent more by buying two smalls; which in other terms, means that you ought to be getting a 16.9" pizza for your money (or 16.5" if the larger prices are only 1.9 times the price of a 12 incher).

As the days pass, my life feels like it's asymptotically approaching XKCD...

sawyl: (Default)
Struggling to keep track of the count of the endless Sundays after Trinity, I became curious about the method used to calculate the date of Easter. This in turn led to to a Metonic cycles, a whole load of clever Medieval attempts to nail down the correct date, and eventually to a handful of lines of python:
from datetime import datetime

def easter(year):

    year = int(year)

    a = year % 19
    b, c = divmod(year, 100)
    d, e = divmod(b, 4)
    
    f, r = divmod(b + 8, 25)
    g, r = divmod((b - f) + 1, 3)
    h = ((19 * a) + (b - d - g) + 15) % 30

    i, k = divmod(c, 4)

    L = (32 + (2 * e) + ((2 * i) - h - k)) % 7
    m, r = divmod(a + (11 * h) + (22 * L), 451)

    month, day = divmod((h + L) - (7 * m) + 114, 31)
    day += 1
    
    return datetime(year, month, day)

Because once you know the date of Easter, the remaining moveable feasts are almost easy to work out...

sawyl: (Default)
Dubious about some of the latest Top 500 results, I spent a few idle minutes knocking up a quick bit of code to parse the XML data and compare the distribution of results against those predicted by Benford's law. Sadly the span of the data in the latest list was insufficient to draw any conclusions, but when I added in the results from previous years, the curves fitted pretty well. So, who knows, maybe the results are trustworthy after all...
sawyl: (Default)
After a lazy day spent reading and catching, I got down to cooking supper while pater helped my niece cram for her imminent GCSE maths exam. Even though she was doing the easier paper, I was surprised by how easy it was: I don't think it covered anything that I hadn't learnt by the end of my second year of senior school.

Still, the girl seemed to find it tough going. She's hoping to get a C in November, with the possibility of a re-sit in the summer if she doesn't get the grade she needs for sixth form; pater, on the other hand, is clearly if unrealistically hoping that she'll somehow find a way to study hard enough to be able to take the more difficult paper in June. Sometimes I think we — both children and grandchildren — have let him down by not being better at mathematics...

ETA: I completely forgot to mention my niece's unexpected — to me, at least — interest in philosophy. For some reason, she mentioned that some of her friends had visited Auschwitz as part of their philosophy and ethics course. I transformed this into a few comments about Kant's argument that it is always wrong to lie — something I hazily remembered Kant justifying in terms of the Categorical Imperative — and after she mentioned that she was interested in studing P&E in the Sixth Form, we went on to talk about William Paley's watchmaker argument and where it falls down.

I'm very excited by the idea of another philosopher in the family!

Profile

sawyl: (Default)
sawyl

August 2018

S M T W T F S
   123 4
5 6 7 8910 11
12131415161718
192021222324 25
262728293031 

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 6th, 2026 12:05 am
Powered by Dreamwidth Studios