Posts

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

Rubik's Cube

Image
About 18 years ago a friend patiently explained to me how to solve a Rubik's Cube.  I memorized the instructions, but realized sooner or later I'd forget them.  So maybe a week later I wrote up my notes using dia , and printed them out .  Since then I've carried this same slip of paper around in my wallet, for those occasional opportunities when you're 'round someone's house and you spot a cube exhibiting a frustratingly high degree of entropy. It's still just about legible Each face of the cube is given a letter U - up D - down F - front B - back L - left R - right A single letter on it's own represents rotating the face 90$^\circ$ clockwise (looking at the face), and a letter followed by an apostrophe means rotate anti-clockwise.  Thus LL' is the same as doing nothing.  An exponent of 2 simply means do the preceeding action twice.  Below, I've split the sequences into subblocks with dashes to make them easier to memorize$^\dagger$. HOW TO SOLV

My Family Tree

Image
The extended family I've been sharing digs with... See alt-text for code

How much CO2 could be removed by planting trees?

Image
Credit: NASA This article in the guardian points to some recent research.  The article begins: Planting billions of trees across the world is one of the biggest and cheapest ways of taking CO2 out of the atmosphere to tackle the climate crisis, according to scientists, who have made the first calculation of how many more trees could be planted without encroaching on crop land or urban areas. As trees grow, they absorb and store the carbon dioxide emissions that are driving global heating. New research estimates that a worldwide planting programme could remove two-thirds of all the emissions from human activities that remain in the atmosphere today, a figure the scientists describe as “mind-blowing”. and goes on to quote the lead scientist from ETH Zürich saying "This new quantitative evaluation shows [forest] restoration isn’t just one of our climate change solutions, it is overwhelmingly the top one" Let's test this claim with two tools everyone has at their disp

Why 2050 is too late

Image
In 2018 the Intergovernmental Panel on Climate Change produced a report on 1.5 C of warming .  This is considered a level of warming that is 50% likely to trigger a tipping point beyond which further warming will be beyond human control. According to the report: "Global warming is likely to reach 1.5°C between 2030 and 2052 if it continues to increase at the current rate" Unfortunately, that's been taken by our politicians to mean we've got until 2050 to zero our emissions. Let's see if this is true: According to section C.1.3 "C.1.3. Limiting global warming requires limiting the total cumulative global anthropogenic emissions of CO2 since the pre-industrial period, that is, staying within a total carbon budget (high confidence). By the end of 2017, anthropogenic CO2 emissions since the pre-industrial period are estimated to have reduced the total carbon budget for 1.5°C by approximately 2200 ± 320 GtCO2 (medium confidence). The associated remaining budget i

Why $\sqrt{2} \ne \frac{7}{5}$ (or similar sort of thing)

Image
Why does $\sqrt{2} \ne \frac{7}{5}$?  Well, if it did, we could draw a square of side 5 and diagonal 7 Not in proportion! Then, by removing 5 from the diagonal we could create a second square of side 2 and diagonal 3, which would mean $\sqrt{2} = \frac{3}{2}$, which is a  different fraction to $\frac{7}{5}$. Actually, we can easily generalize this argument to show that if $$ \sqrt{2} = \frac{a}{b} $$ for some whole numbers $a$ and $b$, then $$ \sqrt{2} = \frac{c}{d} $$ for some smaller whole numbers $c \lt a$ and $d \lt b$.  Repeating this argument over and over leads us to the conclusion that $\sqrt{2}$ is a whole number itself!  This is clearly incorrect and leads us to the conclusion that we can't in fact write $\sqrt{2}$ as a fraction. This is not a particularly modern way to prove the existence of irrational (non-fraction) numbers, but it is - supposedly - how the ancient Greeks originally did it!  Unfortunately the person who discovered this fact, Hippasus of Metapontum , fo

Jet Stream

Image
Here's a cartoon I made on my phone.  It's an explanation of what the Polar Jet Stream is and how it might be changing! The winter of 2019/2020 was the 5th wettest on record in the UK, and the spring of 2020 looks like it will turn out to be the driest.  This has been attributed to the polar jet stream being more wavy and slower to change shape than in the past.  This meant that we got stuck in a U bend all  winter and an $\Omega$ bend all spring! This may be due to climate change, specifically the higher rate of heating that is occurring in the arctic region as newly exposed sea water causes less sunlight to be reflected.  However, most climate models appear to suggest the opposite: that the Jet Stream will speed up and become less wavy. Some types of prediction in climate science are easy and others are hard.  That the Earth will warm up significantly this century is certain; exactly what that will do to the polar jet stream and local weather patterns is very uncertain.  All

Natural History of East Anglia

Image
Hobbit hole, Chalkney Woods (Homunculum cuniculum) Stinkhorn, Sandringham (Phallus Impudicus) Wild dog with pliosauroid fossil, Sandringham (Canis Poodiculous)

Holograms

Image
I'm old enough to remember when holograms first appeared commercially.  I remember being amazed and trying to look behind to see if it wasn't just a 3-dimensional object masquerading as a 2-dimensional object (masquerading as a 3-dimensional object).  It must have looked like when you show a chimp a mirror and it tries to reach behind it to touch its reflection.  (I guess the same would happen to a human if it saw a mirror for the first time as an adult.) I did one year of physics at university before switching to maths.  In general I didn't like the practical sessions because they were always at the end of the day, and very long and tiring.  However, on one occasion we got to make our own holograms, and that really did impress me.  IIRC mine was of a 2 pence piece. What I found really interesting, was finding out how they worked.  I don't think we were taught this as such - it was up to us whether we wanted to go off and find out for ourselves.  Anyway,

A Patent Protection Racket

Image
From: Learn To Speak Mafia About 15 years ago I was working for a small firm making telecoms equipment , and developing from scratch a Voice over IP box.  It was a very simple device to convert SIP internet calls to local analogue POTS lines (Plain Old Telephony Service) and there were just two of us working on the project: Mike the hardware engineer, and me, for the software. The box had a microprocessor running Linux (including a massively hacked version of Linphone for the SIP stack), and it had a DSP to support the codecs (short for Codify/Decodify).  It was quite a fun project (*) . A word about codecs and SIP:  SIP stands for Session Initiation Protocol (**) and is an internet standard allowing two internet peers to start a phone call.  One of the main tasks SIP has to perform is to co-ordinate on which codec to use.  One peer may support GSM, G.729, and G.711, and another may support G.726, GSM, and Speex - in which case the two peers would have to agree to use their on