Posts

Cathy Comb Home

Image
 I've just found this design I must have drawn when I was 16 I had a girlfriend at the time called Catherine with very long hair.  In fact it was so long she could sit on it.  Anyway, I was amazed at how much time she spent combing - about half an hour every day.  She'd start at the bottom and work her way up, combing all the way to the ends with each stroke. I thought that there had to be a better way, so I came up with this machine.  The two belts rotate in opposite directions and the angle between them gradually decreases so that it starts off just untangling the ends and ends up combing the whole length of the hair. Fortunately it never got built.

Thinking of repainting the kitchen

Image
... One day. But I don't want to lose this important historical information - my offspring's height vs time! So I've converted it into a nice graph Using some code #!/usr/bin/env python3 from datetime import datetime from matplotlib import pyplot as plt table = [ (132.4, '10/7/11' ), (134.8, '14/9/11' ), (136.9, '2/3/12' ), (138.4, '7/9/12' ), (141.5, '25/5/13' ), (142.6, '23/6/13' ), (145.8, '15/3/14' ), (148.7, '15/11/14' ), (150.0, '20/1/15' ), (153.1, '8/6/15' ), (157.7, '12/11/15' ), (159.0, '21/12/15' ), (160.1, '7/2/16' ), (164.1, '12/6/16' ), (167.6, '27/12/16' ), (169.9, '4/3/17' ), (171.7, '14/11/17' ), (172.1, '6/6/18' ), (172.9, '24/8/19' ), (173.6, '2/4/20' ), ] def labelToX(label: str): d,m,y = label.sp

How much would car tax be if we treated cars like cladding?

Image
Are we approaching the cladding crisis rationally? Cladding is in the news at the moment.  In response to the tragedy at Grenfell the UK government has introduced regulations requiring buildings with "unsafe" cladding to be patrolled.  This is obviously expensive and in most circumstances the cost is borne by the leaseholder.  The average paid per leaseholder is £137 per month (with a median of double that).  If we assume an average of two occupants per flat that comes to £822 per occupant per year. Obviously these actions may save lives.  But there are many other risks that we face day in and day out and it is worth considering whether we price these risks the same.  After all, that money has consequences - it has bankrupted people, particularly those who face the tail end of the cost distribution.  So let's try to work out how much car tax would be if we treated the risk of dying in a traffic accident in the same way, and loaded the cost per life onto drivers the way we

Many Worlds Quantum Tic Tac Toe

Image
MWQT$^3$ I've just discovered Quantum Tic Tac Toe .  This is a brilliant game designed to give players an intuition for Quantum Mechanics without requiring them to learn any complicated mathematics. Superposition Instead of playing in just one square each player gets to play in two squares at once.   Here player X has played in the 1st & 2nd squares on their first move, the 3rd & 6th squares on their 2nd move, and the 8th & 9th squares on their 3rd move.  Similarly player O has played on two squares each move, and the marks are subscripted to indicate when in the game play they were laid down. Entanglement Ultimately each pair of marks will be replaced with a single mark and the board will look like ordinary Tic Tac Toe - which is how we are able to determine a winner.  But the final location of, say, $O_2$ may need to depend on the final location of, say, $X_1$ if we are to avoid ending up with squares with multiple marks in them.  In this case the moves $X_1$ and $O_2

Finite State Machine Wizard

Image
    Here's my free to use, no attribute required FSM Wizard .  This one generates C++ code.  I'm not a fan of C++ but it happens to be the language I'm using at the moment.  However, it can easily be ported to other languages if desired. The FSM Wizard works like this 1. Write a CSV file with format initialState,Event,NewState,ActionFn,OptionalComment .  The code includes an example called MyFsm.csv RedGateLow,TrainPassed,RedGateLow,CheckLine, RedGateLow,LineClear,RedGateLow,RaiseGate, RedGateLow,GateRaised,Green,SetGreen, Green,TrainDetected,Yellow,StartTimerYellowRed Yellow,TimerExpired,RedGateHigh,StartTimerRedGate RedGateHigh,TimerExpired,RedGateHigh,LowerGate RedGateHigh,GateLowered,RedGateLow,  2. Run the wizard: ./fsmGen.py MyFsm.csv   3. View the output PNG file and optionally edit the autogenerated C++ files

Can population control solve the climate crisis?

Image
Yes and no. According to the IPCC, if we continue to emit as we do now, we have 10 years worth of carbon budget remaining before we reach a dangerous 1.5$^\circ$C of warming.  We can avoid exceeding this budget by  halving our emissions between now and 2030, and then bringing them to zero by 2040. Let's imagine an incredibly successful population control strategy, based on family planning, that results in zero births this decade.  By how much would the world's population fall?  According to Wikipedia the average life expectancy globally is about 72 , so let's assume that anyone over the age of 62 would shuffle off this mortal coil by 2030.  According to the UN there were 962 million people over the age of 60 in 2017 , so there's at most that many over the age of 62 now.  Oh dear that means that the population would only fall by $100\times\frac{0.962}{7.8}$ or 12%, but we'd need it to fall by 50% if it was our main strategy in reducing emissions. So, population contr

Christmas Cracker Magic Trick

Image
 When I was a kid I pulled a Christmas Cracker and 6 cards with numbers fell out: It's a mind reading magic trick.  Have a go against my virtual assistant, and see if you can work out how it's done:

Misunderstanding the Continuum Hypothesis

Image
(sometimes) A few days ago I read this article and realized I'd misunderstood the Continuum Hypothesis.  The Continuum Hypothesis is a statement in the language of set theory that says something like this: There's no set whose cardinality is between that of the real numbers $\mathbb{R}$ and the integers $\mathbb{Z}$. Set Theory Set theory is an axiomatic theory designed to give a rigorous foundation to our intuitive beliefs about sets.  The axioms of set theory take for granted just two things:  That there is a collection - also known as a class - of objects, which are known as sets That there is a binary relation between sets, represented by the symbol $\in$, and where $x \in A$ is read as "x is an element of A". Those two assumptions in themselves do not create any sort of parallel between the objects discussed and the naive concept of the "set".  That's the purpose of the axioms.  There's about 10 of these - known as the Zermelo-Fraenkel axioms

The arrow of time

Image
Why do we experience time the way we do?  The future seems a very different beast to the past, but as far as we can tell all of nature's fundamental laws are fully reversible.  Take a ball that's just been kicked into the air.  Newton tells us that the ball will lose speed as it rises to it's greatest height at which point it will start to fall and that it will trace out a parabola as it does.  However, if we play the video backwards, the ball will do exactly the same thing,   and this is   because the laws apply equally well when you start with "final" conditions instead of "initial" conditions and rewrite the equations in terms of "backwards time" $\tau = -t$ instead of time $t$. Despite this we do not experience the two directions the same.  In this post I will give an argument for why this is the case - one that borrows from thermodynamics, Hamiltonian classical mechanics, and Landauer's Limit. Phase Space and Entropy The 19th Century I

Why is Trump replacing NOAA director with a climate denier?

Image
Probably to stop them reporting things like this: Smoke from Californian wildfires is turning the sky pink in New York. The president does not want Americans to know.

Gormanian calendar shell utility

Image
CAL++(1)                    BSD General Commands Manual                   CAL++(1) NAME      cal++ — displays The Gormanian Calendar SYNOPSIS     cal++ -h     cal++ [-y] [[month] year] DESCRIPTION The cal++ utility displays a simple Gormanian calendar. The options are as follows: -h       help -y      [DEPRECATED] Make Gormanian year match Gregorian year. This is deprecated as it causes Dave Gorman's birthday to inconveniently have different representations in the two calendars. However, the option is included for compatibility with some online calculators. A single parameter specifies the year (1–9999) to be displayed; note the year must be fully specified: “cal++ 89” will not display a calendar for 1989. Two parameters denote the month and year; the month is either a number between 1 and 14 - where 14 represents the Intermission.  The current date is highlighed if it appears in the output. A year starts on March 1. SEE ALSO cal(1) HISTORY The Gormanian calendar

Guesstimating the radius of the Earth

Image
 Photo taken in the Outer Hebrides by my brother-in-law (The doctor one, not the Flat Earth one) This photo was taken a few days ago by my brother-in-law Alex from the Outer Hebrides where he's off galavanting at the moment. You can clearly see that half the ship is missing indicating either a) it's sinking b) the Earth is round Going with (b) for the time being we can actually come up with a pretty good guesstimate for the size of the Earth just from this picture. Let's guess that the ship is 10km away. (That's not likely to be accurate but it's certainly more than 1km - the width of Lake Windermere - and less than 100km - the distance from Portsmouth to Le Havre). So $l=10000$. Now let's assume that the bottom 10m of the ship is missing from view (again, not likely to be accurate but good enough for an order of magnitude calculation). So $h=10$. Now chuck it into this equation which is easily worked out with a bit of trig $$ r=\frac{l^2}{2h} $$ and, hey presto

Further reflections on the Rubik's Cube

Image
  Visual metaphor and pun Since my previous  post I've been thinking a bit more about Rubik's Cubes.  I have been wondering what is the simplest way to represent their state mathematically, and by extension programatically. Configurations of the cube clearly form a group, so I set myself the goal of creating objects in python which would represent individual configurations and which could be multiplied together to form new objects.  For example, $I$ would represent an unscrambled cube, $L$ a cube obtained from $I$ by moving the left face clockwise, $U$ a cube obtained from $I$ by moving the upper face clockwise and $L*U$ the cube obtained by rotating the left face first and then the upper face. The question is: what is the most elegant representation for each of these objects?  I was initially drawn by the idea of labelling the stickers (other than the centre face ones) 1 to 48 and representing each object as a different permutation.  This makes multiplication very easy but ha

Oil: Why shareholder activism doesn't work and divestment does

Image
Credit: Noah Scalin In the news This week the UK's biggest investment fund - the National Employment Savings Trust - has decided to divest from fossil fuels .  Their chief investment officer Mark Fawcett said "Just like coronavirus, climate change poses serious risks to both our savers and their investments, [...] It has the potential to cause catastrophic damage and completely disrupt our way of life. No one wants to save throughout their life to retire into a world devastated by climate change." This is in contrast to what the pensions minister Guy Opperman has said.  He thinks we should "nudge , cajole or vote" companies into becoming sustainable and that holding shares is the right thing to do. They can't both be right, and they're not.  Mark Fawcett is right and Guy Opperman is wrong.  Here's why: How are oil companies valued? It is fairly easy to show that the market valuation of an oil company is simply the price of the oil they have in res

How To Make ASCII Diagrams Beautifuller

Image
I've discovered an excellent tool in asciiflow.com .  The website makes it really easy to create ASCII box diagrams like this They put these things in fruit machines you know! This is ideal for source code banners, which I think should contain helpful documentation - but most programmers think it's a good place for the COPYRIGHT information and nothing else. But wait! we can make it beautifuller... and easier to read... by replacing some of the ASCII characters with ones available in UTF-8: There!  Isn't that better?  (Although some purists may object to non-ASCII characters in your code base.) SOURCE CODE: #!/usr/bin/python2 # coding: utf-8 # + gets converted in different ways depending on it's 4 neighbours # # . N . { nsew(N,S,E,W) has bit 3 set if N in "+|<>" # W + E { nsew(N,S,E,W) has bit 2 set if S in "+|<>" # . S . { nsew(N,S,E,W) has bit 1 set if W in "+-^v" # { nsew(N,S,E,W) has bit 0 set if E in

Debunked: The Carbon Cost of an email

Image
Earlier today I emailed an old acquaintance on a climate change related subject$^*$.  He almost certainly did not want to hear what I had to say, and tagged the following to the end of his reply: P.S.: Did you know: https://carbonliteracy.com/ the-carbon-cost-of-an-email/ I looked up that page and found the claim (without any supporting evidence) that a typical email generates 4g CO2e emissions while a spam email is typically around 0.3g CO2e. This struck me as nonsense.  I've worked in telecoms for most of the last 20 years and I know that most links require the same power whether they are transmitting user data or simply transmitting to maintain synchronization.  However, you don't need to know anything about Ethernet or ADSL to show that this is complete garbage.  Let's do some arithmetic: a spam email is around 1KB an hour of Netflix is around 1GB the network and servers don't really care what's in the data so we can safely assume if "carbonliteracy"

Delivering the demands

Image
Here's me and a few friends yesterday helping to deliver demands to the Cambridge colleges that are still investing in fossil fuels  (i.e. all except Clare Hall and Queen's). I'm the one in the T-Rex costume... These are the demands we delivered: And here's a T-Rex explaining to a Brontosaurus the concept of logarithms as we pass the Whipple Museum on the way to Darwin College.  The Whipple Museum has a lovely example of Napier's Bones, a calculating device invented by the discoverer of logarithms.

Trust in Telecomms Matrix

Image
Angela shows off her new phone which (fingers crossed) can't be tapped like the last one was There's been a lot of discussion in the media recently about Huawei.  Is it safe to buy equipment from a company with such close ties to the Chinese state?  Governments around the world have come under a lot of pressure from the Trump administration in the US to ban the company from involvement in their 5G rollout. But can we trust American or British equipment manufacturers any more than the Chinese?  Here's my Trust in Telecomms Matrix to help you decide:   USA/UK CHINA Are they spying for commercial gain? Yes, according to the EU, and they have been for a long time.  From https://www.theguardian.com/world/2001/may/30/eu.politics " [Echelon's] primary purpose, the report said, is to intercept private and commercial communications, not military intelligence " Yes, according to US State dept https://www.newsweek.com/china-involved-90-percent-ec

Proving the extra CO2 is all from fossil fuels

Image
    I've been doing  an online course on climate change at the University of Exeter for the last couple of weeks.  It's an excellent introduction if you're a bit hazy on the science and I thoroughly recommend it.  Plus it's free. As someone who has already done a lot of research on the climate crisis, some of the material was already familiar.  However, I've still discovered a lot of new stuff.  This week we covered ocean acidification - which was an area I knew very little about - and I've gained a lot of insight into the mechanisms behind it. What about the CO2? In the past I've had a go at calculating exactly how much one would expect the atmospheric concentration to have increased assuming we were responsible for all of it.  If this happened to match the actual increase in atmospheric CO2, then - I thought - it would be a very nice slam dunk the next time I get into an argument with someone claiming it wasn't down to us$^\dagger \ ^{\dagger_2}$. Unf