International Lockdown Effectiveness - Part 2

I last wrote about lockdown effectiveness (or lack thereof) back in April 2020. In the same way, I'm once again thinking about virus stats instead of studying... ?

So after all this time, how do country's cases and deaths compare? Let's have a look shall we? I've picked out six countries that have been in the UK news a lot recently.

Here's the number of cases in each country as a percentage of the population. As before, populations are approximate. In order of severity:

CountryPopulation (millions)Cases% of population
South Africa59.31,192,5702.01%

Here is the percentage of each population dead due to covid-19:

CountryPopulation (millions)Deaths% of population
South Africa59.332,4250.05%

Why is there such a high chance of death in the UK compared to anywhere else? Again, why is this not being reported on? ?โ€โ™‚๏ธ


Complex Analysis Assignment 1

My first complex analysis assignment has been marked and returned. I don't think I've ever felt the urge quite so much to learn from my mistakes.

Consequently there has been quite a lot of post-assignment learning... :/

This assignment featured a very brief introduction to complex numbers as a refresher, then broadly covered complex functions, the concept of continuity and complex differentiation.

So in no particular order, below are some notes on mistakes I made and how I could've avoided them! There's a lot to reflect on here...

Read questions carefully. One of the first very simple questions read "express z in polar form and determine all fourth roots". I did the second bit, but not the first.

I feel this is a bit "Complex Numbers 101", but the square root sign is defined as the principal square root (of a complex number), i.e. there's no need to calculate the second root.

If you're using the triangle inequality, state it specifically.

Again, this is fairly "Complex Numbers 101", but the polar form of a complex number isn't just a cosine function as the real part, and a sine function as the imaginary part. The arguments to both functions must be identical to qualify as "polar form". ie, you should be able to write the complex number as an exponential form.

Top tip: Be mindful about using identities. In complex analysis there are loads of them and they help a great deal.

When working out the inverse of a complex function, it's important to use your common sense. Part of one inverse I'd calculated had a square root in it. Just by looking at that, you know it could never produce a unique answer (it isn't a one-to-one function).

For another, I had to find the inverse of \text{Log}(3z) and the domain of that inverse. I got this spectacularly wrong. I'd written: given w=\text{Log}(3z), hence z=e^{3w}.

Trick here was to exponentiate each side, leading to e^{w}=3z. But the domain of the inverse isn't affected by the "3" above, the image set of the original function is still \{z: -\pi <\text{Im}z \leq \pi\}.

Some complex functions are very very different to their real equivalents. Case in point: \text{cosh}(x)\neq 0 , \forall x \in \mathbb{R}, but \exists\: z \in \mathbb{C}\: \text{s.t.}\: \text{cosh}(z)=0. Which leads to the next note:

If \text{cosh}(z) is the divisor in a complex quotient, you need to show that it's only 0 for values outside of the given range of the equation (eg |z|<1).

For one question, I had to prove that f(z)=z^{i},\:\: (\text{Re}\:z>0) was continuous. I thought this was easy.

z^{\alpha},\: \alpha \in \mathbb{C} is a basic continuous function on \mathbb{C}-\{x\in\mathbb{R} : x \leq 0\}. So if you let \alpha=i, then f(z) is continuous, right?

Not quite. I had entirely forgotten to state that the given set (\text{Re}\:z>0) is a subset of the set I gave: \mathbb{C}-\{x\in\mathbb{R} : x \leq 0\}.

The answer can appear obvious sometimes, but you have to keep your answer rigorous, otherwise you risk losing half marks or whole marks here and there.

z^{\alpha} = e^{\alpha Log(z)}
z^{\alpha} \neq e^{z Log(\alpha)}

For one question I had to prove whether a set was a region or not. For reference, a region is a non-empty, connected, open subset of \mathbb{C}. In the usual manner, if you can prove that any of those three properties don't hold then you've managed to prove that your set isn't a region. Easy.

I realised I could prove a set was closed, and hence not a region. Turns out this was incorrect. A set being "closed" and a set being "not open" hold two completely different definitions, and are seen as different things. I was meant to show it was "not open" as opposed to showing it was "closed".

In other words, mathematically:

Closed is not the same as not-open.
Closed is not the opposite of open.
Not-open is the opposite of open.

Again, here I needed to provide a proof based on the properties of various objects. Given a set that was compact (closed and bounded), I needed to prove that a function f was bounded on that set.

The Boundedness Theorem states that if a function is continuous on a compact set, then that function is bounded on that set.

The function was: f(z) = \frac{1}{7z^{7}-1}

I proved that the given function was continuous on it's domain, but I'd failed to prove it was continuous on the set. Here, I needed to show where the function was undefined, THEN show that those points at which it was undefined all lay outside of the set. So there was quite a lot of work I missed out from this answer.

My simultaneous requirement for the Cauchy-Riemann theorem, AND the Cauchy-Riemann Converse theorem within a proof ended up not flowing very well logically. Once again, I'd jumped ahead with my logic. As soon as I had seen something obvious, I felt the urge to state it immediately.

The Cauchy-Riemann theorem proves that a function is not differentiable at certain points. The Converse theorem then proves that a function IS differentiable on certain points. After using the Cauchy-Riemann theorem, it was extremely obvious where the function was differentiable, so I stated it. Then, as a matter of course, plodded through the Converse theorem to prove it. Complete lack of discipline! ๐Ÿ™‚

Complex Functions: Domains, Image Sets and Inverses

I can imagine having to refer to these notes regularly, so I'm putting them here!

Image Sets

  1. State the domain A of f(z)=w.
  2. Rearrange so w is a function of z (to discover the condition under which w remains valid.

e.g., for f(z)=\frac{1}{z-1}:

    \begin{align*} f(A) =&\: \left\{ \frac{1}{z-1}\::\:z\in\mathbb{C}-\{1\}\right\} \\ f(A) =&\: \left\{w=\frac{1}{z-1}\::\:z\neq 1\right\} \\ f(A) =&\: \left\{w\::\: z=\frac{1}{w}+1\::\:z\neq 1\right\} \\ f(A) =&\: \{w\::\: w\neq 0\} \\ f(A) =&\: \mathbb{C}-\{0\} \\ \end{align*}

Domain of Combined Functions

Domain of combined functions are the intersection (A\cap B) of the domains of all component functions and that of the combined function. e.g:

f(z)=\frac{z-1}{z}\:,\:\: z\in\mathbb{Z}-\{0\}

g(z)=\frac{z}{z-1}\:,\:\: z\in\mathbb{Z}-\{1\}

\frac{f\left(z\right)}{g\left(z\right)} = \frac{z^{2}-2z+1}{z^{2}} \:,\:\: z\in\mathbb{Z}-\{0,\:1\}

Domain of Composite Functions

For f and g with domains A and B respectively, the domain of g\circ f is:

A-\{z\::\: f(z)\: \notin\: B\}

e.g., for:

f(z)=\frac{z-1}{z}\:,\:\: z\in\mathbb{C}-\{0\}

g(z)=\frac{z}{z-1}\:,\:\: z\in\mathbb{C}-\{1\}

\text{domain of }f\circ g = \text{domain of }g - \{z\::\:\frac{z}{z-1} \:\notin\: \mathbb{C}-\{0\}\}

\text{domain of }f\circ g = (\mathbb{C}-\{1\} ) - \{z\::\:\frac{z}{z-1} =0\}

\text{domain of }f\circ g = (\mathbb{C}-\{1\} ) - \{0\}

\text{domain of }f\circ g = (\mathbb{C}-\{0,\:1\} )


  1. Determine image set of f(z)=w.
  2. Invert f(z) to find a unique z in the domain of f.

For f(z)=\frac{1}{z-1}

f(A) = \{\frac{1}{z-1}\::\:z\in\mathbb{C}-\{1\}\}

f(A) = \{w=\frac{1}{z-1}\::\:z\:\neq\: 1\}

f(A) = \{w\::\: z=\frac{1}{w}+1\:\neq\: 1\}

f(A) = \{w\::\: w\:\neq\: 0\}

f(A) = \mathbb{C}-\{0\}

(all same as above for finding an image set)

z=\frac{1}{w}+1 gives a unique soluition in \mathbb{C}-\{0\}, hence f has a unique inverse rule:


A New Year of Study Begins!

September has come around already!

My virology work placement came and went so quickly. Great experience. I was certainly not expecting it to be such a creative process. Or should I say "necessarily creative process". It seems with research like this, you really do need to be mindful of other results popping out of your work. If the tangent appears to be more important/meaningful than the original work, then it's best to follow it!

Of course this creative approach gives rise to a bit of a problem. The project has the potential to meander. I suppose this would be fine on a longer time scale, but for my all-too-brief 8 weeks it meant I wasn't able to neatly draw a line under it by the end of the placement.

Though having said that, the work that I was looking at wasn't time-dependant so I still have however long I want to complete the project in my spare time. After this next year of study I'd love to return to it.

Speaking which... my next year of study has started! I won't be informed of my assigned tutor for about another month, but I have my learning materials. So learning has begun! This year it's complex analysis. Very excited to be looking at this subject, and to be writing up the areas I have difficulty with on here.

(Side note: Wow, I've been writing on this blog for 5 years?!)

A Brief Change

Normally I'd take a well-earned break from mathematics during the Summer. Recharge for my next module that starts up in September.

Not this year!

This year, I've managed to take a short career break from my normal job to work as a work placement student in mathematics research!

So for eight weeks I'll be getting a taste of real life mathematics research! I've been lucky enough to be accepted into the mathematical biology research group at the University of York. Specifically, I'll be looking at mathematical virology, but the relevance to the current times is purely by chance: I first started arranging this placement about a year ago.

In my placement I'll be using group theory and linear algebra to produce predictions of virus structure.

It seems that all viruses appear to have the same symmetry as an icosahedron. But it turns out that you can find more icosahedral symmetry by translating an icosahedron along its axes of symmetry to create a larger non-crystallographic structure. When you do this according to strict rules, it turns out that you can start to predict overall virus structure. You can predict not just what it looks like on the outside, but what it may look like inside too.

I'm very early on in the position, but it's already fascinating. I'll be updating here when I can about how I get on with the experience.

Depth of Field

I'm glad I finally managed to get this working. I have almost no experience in real-time graphics like these, so this was a bit of a battle. Really interesting effect though. It's not perfect, as it's some kind of 2D blur process, but I think it's effective for what it is!

Your browser does not support the canvas tag. This is a static example of what would be seen.

GL Lines

Thought I'd play a bit more with WebGL through three.js. I wanted to play with lines a bit more, as wireframe just looks cool.

Your browser does not support the canvas tag. This is a static example of what would be seen.


I had my statistics exam at the beginning of the week.

This exam was weirder than most. Because of the pandemic, the OU had decided to turn the usual three-hour sit down exam into an "end-of-module" assignment that could be done at home within a period of 24 hours.

As soon as I heard this news, I had mostly negative feelings. The exam at the end of a 9-month module is a chance to really show off what you've learned. In three hours you have to recall, at speed, a very large assortment of problem solving skills and take full advantage of nurtured intuition. Some people can just stroll into an exam and do well, but I need to work very hard to walk into that exam hall with any confidence.ย  Preparing for these exams for me is like training for a marathon, or a mountain climb. It's exhausting.

I start attempting past papers under exam conditions on Saturdays and Sundays four to five weeks before exam day. Then the week before the exam I take a whole week off work to spend practically ten days straight doing past papers, marking them harshly, then reviewing them and revising further.

By the time I arrive at the exam in the exam hall in June, those three hours feel exactly like I'm running that marathon or climbing that mountain I've been training for.

Walking out of an exam realising like you were prepared and knowing it's all over is an enormous feeling. The final punctuation of nine months hard work.

Hearing that that wasn't happening this year was a let down. I'd be denied completing my marathon.

Though despite the fact that the "exam" was to be completed at home, I trained just the same. To the point where I felt I couldn't have been more prepared. I was comfortable and determined to complete the at-home exam in three hours regardless of how long I was given.


On the day, I downloaded the exam pdf. I scrolled through it. And I realised that they had changed the distribution of the questions in the sections just enough that I was not prepared for it in the way that I was hoping. For the past seven years of past papers, you could guarantee certain topics would appear.

Not here.

For the past seven years, you should guarantee that within each topic, you'd be given a certain set of sub-topics.

Not here.

Immediately I was glad that I was not running my marathon. If I had been, I would have had to be stretchered away from the starting line by medics.

That day was a battle. Over the entire course of the exam (which took way way longer than three hours) I thought "how was I not prepared for this?". It shook me, and it was the only thing I could think about.

Here, in the third and final stage of this degree, I may have found that there is something fundamentally wrong with the way I learn.

Being kind to myself, this was generally a hard exam. It was statistics, which by its nature is non-intuitive (a lot of people find it so anyway). I did think that this module was aimed at students studying an actual degree in (just) statistics, and that I probably didn't have the background knowledge that other stats students did. And as my mathematician friend has pointed out, it's unlikely it was hard for just me. If an exam is hard, it's generally hard for everyone.

So where do I go from here? It's difficult isn't it. Amongst those 500 or so pages I learn from, should I pay attention and make notes on 'the fleeting comments on page 274 that I never got tested on once and seemed insignificant'? ......Regardless, it seems my revision technique as it stands isn't sufficient.

Assuming I will be in an actual physical exam hall for three hours in June 2021 for my complex analysis exam, I need a better revision strategy.

Statistics Assignment 3

So I've finally completed all my assignments! I've just had the very last one returned to me and again, although I did well, there are very obviously some areas for improvement:


Models for Populations

Very small thing here, but when asked to describe the shape of the age-specific death rate, it's important to describe it in terms of the rate (of change).



Wow. My weakest area by a long way here... It'd be wise for me to avoid any exam questions on genetics... But for the moment, let's examine what I did wrong to try and understand the assignment questions better at least. (It's mainly an issue with conditional probabilities).


When calculating the probabilities of genotype combinations of parents, if you're given the genotype of one parent you don't need to use it in the calculation! eg: Despite the proportion of a genotype in a population being 0.2, if you're given the genotype of one parent, then the chance of them being that genotype is 1.0, not 0.2! Making a mistake like this obviously has a knock-on effect on working out probabilities for the children's genetics, insofar as the probabilities of the children will be incorrect too.

But I compounded my issue with the children. It took me a while to review the next bit to work out where I went wrong, but here we go...

When working out the parent-child genetics, you start by working out two sets of probabilities:

  1. The probability of the parents being certain combinations of genotype (easy in this specific case, as the probability of one parent is 1.0). The probability of the parent of unknown genotype follows from the Hardy-Weinberg law. We'll call the probability of all the mating types P(E_{i}).
  2. The offspring probabilities, which follow from Mendel's first law. Though we'll talk about them in terms of phenotype, so P(\text{Hilary} M) means the probability of Hilary being of phenotype M.

So the next question asked just that: What is the probability of Hilary being phenotype M (which was just one genotype "MM").

This question I managed to get correct based on my initial incorrect probabilities of the parents, but it's important to explain it for the next question. So it turns out that:

P(\text{Hilary M}) = \sum^{\text{3}}_{i=1} P(\text{Hilary M}| E_{i})P(E_{i})

So you multiply each offspring probability, (the probability of Hilary being phenotype M given the mating type) with the associated mating type probability. And you sum them across all mating types. Easy.

But the next question was:

Calculate the probability that sisters Hilary and Jane both have phenotype M. This was the bit that I got completely wrong that took me a while to review. I ended up squaring the result I got from the last question. Very not correct. ๐Ÿ™ From the above, we know we start with:

P(\text{Hilary M and Jane M})

= \sum^{\text{3}}_{i=1} P(\text{Hilary M and Jane M}| E_{i})P(E_{i})

and it turns out:

= \sum^{\text{3}}_{i=1} P(\text{Hilary M}| E_{i})P(\text{Jane M}| E_{i})P(E_{i})

Which suddenly makes it all very very clear. I suppose this goes to show that when you come across something convoluted, it's worth taking extra time out to run through it in depth and make detailed notes on it. Doing so here would've paid off. I think the problem I have with genetics questions is that there are quite a number of ways in which these questions can be phrased.


Writing Conditional Probabilities

Well this went really wrong. This is probably my weakest area, and is related to the above slip-ups in the questions with Hilary and Jane.

"Show the that proportion of male offspring for the second mating that you should expect to have plain wings (gene contains dominant allele A) is \frac{3}{4}."

Here, I wrote the definition incorrectly, but calculated the correct result. Kind of double-bad. ๐Ÿ™ Here, I wrote:

P(male A)
(which is the joint probability of a male having the allele A)

When I should have written:
P(A | male)
(the conditional probability of offspring having the allele A given that they're male.)


The Hardy-Weinberg Law

A lengthier title to this subsection would be: "When to calculate the proportions of subsequent generations of a certain type using Hardy-Weinberg, and when to use your own table of probabilities".

As above, the table of probabilities includes the probabilities of the parents of certain types mating, and the probabilities of the associated offspring genotypes.

The question:

"One male and one female are chosen at random from all the offspring of the mating, and are themselves mated. What is the proportion of female offspring of the second mating to have a dominant allele?"

In this case, there were two genotypes which had a dominant allele, AA and Aa. But how do I parse this question? This question is asking about grandchildren of the initial parents! It's also asking about "proportion" which hints that I should be using Hardy-Weinberg proportions. Turns out not. It seems that you can only use the Hardy-Weinberg law when you're given the proportion of three genotypes of a starting generation.

So what are we left with?

P(AA | female) AND P(Aa | female)

Which in this case is equivalent to:

\sum^{\text{4}}_{i=1} P(\text{female AA}| E_{i})P(E_{i}) + \sum^{\text{4}}_{i=1} P(\text{female Aa}| E_{i})P(E_{i})

Notice how this differs from the sum in the last section (the Hilary and Jane example), because there's no assumption made about them both having the same father.

Last related one here that tripped me up was:

"What is the proportion of dominant-alleled females in this second mating would you expect to be AA?"

Again, I used the Hardy-Weinberg law to calculate this, when I should've been using conditional probability.

So it seems I needed to go through the process of parsing the question, and translating it into stats language: "What's the probability of offspring being genotype AA given that they're a female with a dominant allele?". The probability we require here is:

P(AA | dominant allele female)

Using the standard, straight-forward rule for conditional probability I learned in my first section back in September, this is equivalent to:

\frac{P(AA \cap \text{dominant allele female})}{P(\text{dominant allele female})}

What's the numerator here? The probability of being AA and a dominant-allele female? Well yeah, AA is dominant, we know that. So this is just the probability of being AA and female:

\sum^{\text{4}}_{i=1} P(\text{female AA}| E_{i})P(E_{i})

It's just one part of the previous question.

Then what's the denominator? The probability of being (proportion of) a dominant-allele female generally? So AA female and Aa female?ย ย Well that was the actual answer to the last question!

So that's it. There's a lot of parsing that needs to be done generally:

Have I been given proportions? Use Hardy-Weinberg.
No proportions? Use a table of parents and offspring probabilites.
What am I given, what don't I have to calculate?
What are they asking me, is the probability conditional?
If it's conditional, I can separate it out but then I need to parse what each of these new probabilities mean.

Armed with this little checklist, I may have done a bit better in my genetics questions!

General Stuff


If your answer is an equation in terms of x, always state the range of possible values of x:

Q(x) =1-\frac{x^{2}}{100},\:\:\:\: 0\leq x < 10


Annoying oversight here. When stating the variance of the lifetime of something was 42.92 months, I should've said it was 42.92 \text{months}^{2}. Not often you think of months-squared, but here, it's relevant. Variance!

Log and Ln

Concentrate when typing one or the other into your calculator. There's a big difference, people... Thankfully I only slipped up once here.


And that's it! Now it's just revision time until my exam on the 8th of June. Of course, due to our new friend covid-19, I'll be taking my exam at home which will be a bit weird. Plenty to revise though, so I'll get started...