# Portfolio optimization

**December 5, 2022.** *A quick, first-principles derivation of
optimal portfolios with risk.*

QML researcher

Welcome to my blog!
Posts are in chronological order. You can also browse by category.
# Portfolio optimization

Read More
# Approximating large powers

Read More
# Anthrometry

Read More
# Self-reflexive instance-naming

Read More
# A kernel trick for integrals

Read More
# Indescribably boring numbers

Read More
# Taking half a derivative

Read More
# The statistical basis of Fermi estimates

Read More
# Reductionism, order and patterns

Read More
# Binomial party tricks

Read More
# A simplicial generalisation of the Bloch ball

Read More
# Turning a thermometer into a sundial

Read More
# A simple proof of the bus paradox

Read More
# Cashing a blank check

Read More
# Integrals from pyramids

Read More
# Dicing with chaos

Read More
# Eternal recurrence and brainjam

Read More
# Generalising Spot It!

Read More
# Central limits for unlike variables

Read More
# Why is the sky blue?

Read More
# Pairing random socks

Read More
# The shower curtain effect

Read More
# From noodles to woodles

Read More
# Hairy shadows

Read More
# The continually interesting exponential

Read More
# Asymmetric dice are unfair

Read More
# A HyperLaunch oompoc

Read More
# The battle of the bulge

Read More
# Hacking Kepler's problem

Read More
# Parallel axes and wise crowds

Read More
# Why is quantum gravity hard?

Read More
# The Bloch sphere and Hopf fibrations

Read More
# An equinoctial experiment

Read More
# Language, cognition and alien math (Part I)

Read More
# Solipsism and emergent time

Read More
# From straight lines to random fractals

Read More
# A hacker's guide to the Chandrasekhar limit

Read More
# Hacking physics from the back of a napkin

Read More
# The scrubland manifesto

Read More
# Zeta regularisation voodoo

Read More
# The endless present

Read More
# Partition identities in Haskell

Read More
# The geometry of coin flips

Read More
# Inverted pendulums

Read More
# Incompleteness and provability logic

Read More
# Replicators and Fisher's Fundamental Theorem

Read More
# Cigarettes, hard labour and a box full of money

Read More
# Partitions, pentagons and products

Read More
# Black hole thermodynamics

Read More
# Sums of squares and normed algebras

Read More
# Cumulants from Möbius inversion

Read More
# The functional equation for Riemann's zeta

Read More
# Pedagogy, polylogarithms and particles

Read More
# Summing the natural numbers

Read More
# Shifted Gaussians and Hermite functions

Read More

**December 5, 2022.** *A quick, first-principles derivation of
optimal portfolios with risk.*

**December 3, 2022.** *A short guide to estimating large powers.*

**December 2, 2022.** *Humans are the measure of all things, though
not in the sense Protagoras meant. I show how to estimate distance
using only your hands and feet.*

**December 1, 2022.** *A whimsical post on naming things named after an instance after an instance.*

**November 10, 2022.** *I present a simple trick for doing integrals by swapping
the argument of a kernel.*

**March 23, 2021.** *I turn the old joke about interesting numbers into a
proof that most real numbers are indescribably boring. In turn, this implies
that there is no explicit well-ordering of the reals. The axiom of
choice, however, implies all are relatively interesting.*

**March 13, 2021.** *Can you take half a derivative? Or π derivatives?
Or even √–1 derivatives? It turns out the answer is yes, and there are
two simple but apparently different ways to do it. I
show that one implies the other!*

**February 12, 2021.** *Why are Fermi approximations so effective? One
important factor is log normality, which occurs for large random
products. Another element is
variance-reduction through judicious subestimates. I discuss both
and give a simple heuristic for the latter.*

**February 8, 2021.** *Some philosophical reflections on the nature of
scientific explanation, structure, emergence, and the unreasonable
effectiveness of mathematics.*

**February 6, 2021.** *Sketchy hacker notes on the binomial
approximation. The flashy payoff: party trick arithmetic for estimating
roots in your head.*

**February 5, 2021.** *I explore unitary orbits of density matrices
for finite-dimensional quantum systems. The upshot is a neat scheme
for representing orbits using simplices.*

**January 28, 2021.** *I attempt to turn a thermometer
(or more specifically, data about the maximum daily temperature)
into a sundial. Though it fails on earth, it works on Mercury!*

**January 26, 2021.** *The bus paradox states that, if buses arrive
randomly but on average every ten minutes, the expected waiting time is
ten minutes rather than five. I give a simple proof involving no
integrals or formal probability theory.*

**January 26, 2021.** *Suppose you find a blank check on the ground,
and unscrupulously decide to cash it in. If overdrawing gets you
nothing, how much should you cash it in for? Assuming wealth follows
the 80-20 rule, the answer is: almost nothing!*

**January 22, 2021.** *I present an elementary, first-principles
trick for integrating polynomials: splitting a hypercube into congruent pyramids.*

**January 20, 2021.** *Why are dice and coins good sources of
randomness? The word “symmetry” is bandied about, but symmetry is
not enough to explain why starting with very similar initial
conditions and evolving deterministically leads to random outcomes. I explore
the relevant factors—chaos and jitter—and use them to build deterministic dice.*

**January 15, 2021.** *In a
previous post,
I advanced a four-dimensionalist version of eternal recurrence
which I call “brainjam”. In
this post, I discuss the moral dimensions of eternal recurrence, its
relation to fatalism and free will, and end by discussing some
subtle but important differences from brainjam.*

**January 10, 2021.** *I discuss the mathematics of Spot It! (aka
Dobble in the UK) and its various generalisations, including
projective planes, combinatorial designs, and an entertaining
polytopal turducken.*

**January 3, 2021.** *In the real world, properties like height come
from a sum of independent but not identically distributed
variables. To explain why height lies on a Bell curve, we need a
slightly more sophisticated version of the central limit theorem
(CLT). I give a simple heuristic proof using characteristic functions.*

**December 31, 2020.** *Why is the sky blue? The conventional answer
invokes Rayleigh scattering, but isn’t quite right! Here, we give a fuller answer,
which involves a surprising combination of dimensional analysis,
thermodynamics and physiology.*

**December 27, 2020.** *If you have a jumbled pile of socks,
how many do you need to draw on average before getting a pair? The
answer turns out to be surprisingly tricky!*

**December 27, 2020.** *Another bathroom-themed post, this time
on the mysterious billowing of shower curtains. This is related to
the fact that planes can fly upside down!*

**December 23, 2020.** *Buffon asked how likely it is that a needle
thrown onto ruled paper will cross one of the lines. The 1860
solution of Barbier is well-known. Equally simple but less
well-known are the extensions to noodles and shapes of constant
width, which I discuss informally, as well as a fanciful application
to polymers.*

**December 13, 2020.** *A short, equation-free post on the fun physics
of hairy shadows.*

**November 28, 2020.** *I discuss some of the key properties of the
exponential function without (explicitly) invoking calculus.
Starting with its relation to compound interest, we
learn about its series expansion, Stirling’s approximation, Euler’s
formula, the Basel problem, and the sum of all positive numbers,
among other fun facts.*

**November 3, 2020.** *Symmetric dice are fair since you cannot
tell faces apart. This obviates the need to consider the mechanics
of rolling. Here, I analyse the mechanics of asymmetric,
two-dimensional dice and show they can always be
“dynamically loaded”, i.e. loaded by rolling at different speeds. So
fairness implies symmetry!*

**October 25, 2020.** *In which I pretend to be Elon Musk, and launch
rockets into space using empty cylinders. We’ll learn a
little about atmospheric physics, rockets, and building giant
cylinders, in order to sketch an order of magnitude proof-of-concept
(oompoc).*

**October 21, 2020.** *The earth spins and the equator bulges, turning
from a sphere into a flattened ellipsoid. To estimate just how
flattened, we assume that the potential energy is the same at the
equator and the poles, and find an equatorial bulge only a few
hundred metres off the correct result!*

**October 16, 2020.** *Night thoughts on Kepler’s
first law. Main takeaway: an elliptical orbit is just simple harmonic motion with
respect to inverse radius! I review Kepler’s laws and derive the
second and third for good measure as well.*

**October 7, 2020.** *A quick post showing that the parallel axis
theorem from first-year mechanics is mathematically equivalent to
the wisdom of the crowd, aka diversity of prediction.*

**October 2, 2020.** *People often say that quantum gravity is hard
because quantum mechanics and gravity are incompatible. I’ll give a
brief, non-technical explanation of the real problem:
powerful microscopes make black holes. In an appendix, we’ll also
see why there is no problem combining gravity and quantum mechanics
as long as we stick to sufficiently weak microscopes.*

**August 9, 2020.** *The Bloch sphere encodes the geometry
of single qubit states. Remarkably, it is equivalent
to the Hopf fibration of the 3-sphere! I prove this result and
briefly touch on the generalisation to two and three qubits.*

**August 6, 2020.** *Eratosthenes measured the size of the earth
using three data points: two shadows and the distance between
them. During the vernal equinox in March, I performed a less elegant
version of the same experiment and found the latitude of Vancouver. Lacking one
data point, I invoke an imaginary friend in Whistler to help me.*

**July 13, 2020.** *Linguistic relativism is the notion that language
determines reality. Here, I introduce a variant called cognitive
relativism, and consider whether humans could simulate bats. This
will prepare us (hopefully) to explore whether aliens can do our
math homework!*

**July 8, 2020.** *Why can we remember the past but not the future?
And why do objects persist? I discuss how folk metaphysics draws attention to genuine puzzles
about the nature of time, and outline some desiderata for a physical explanation.*

**July 6, 2020.** *A derivative is a local linear
approximation. Linear approximations are natural candidates for the
function at “infinite zoom” since they are self-similar, i.e. fixed
points of scaling. Here, I make the natural generalization to local
approximation by an arbitrary self-similar curve. I also introduce
random fractal approximations, and use these to motivate Brownian
motion and more general Itô processes from an elementary perspective.*

**April 6, 2020.** *If you throw too many electrons into a box, it
collapses under its own weight to form a black hole. But how many is
too many? We will hack our way towards an order-of-magnitude
estimate, and comment on the implications for astrophysics.*

**February 24, 2020.** *The computational power of a humble napkin is
awesome. I discuss three napkin algorithms — dimensional
analysis, Fermi estimates, and random walks — and use them to
figure out why rain falls, the length of the E. coli genome, and the
mass of a proton, among other things. These examples suggest a
napkin-based approach to teaching physics.*

**September 04, 2019.** *In the 21st century, mathematical
skills are more important than ever before, but high school maths
classes are dull, alienating and disempower students. How do we improve them, and plug some
of the holes in the pipeline? I propose we make maths interesting! I illustrate the approach for teaching derivatives.*

**August 13, 2019.** *A technical post on path integrals, zeta function
regularisation of determinants, and an application to hot oscillators.*

**July 29, 2019.** *Modern physics suggests a view of time called
four-dimensionalism: just as all places exist simultaneously, all
times should exist simultaneously. I examine some consequences for
the psychology of time, and contrast with the (more intuitive but
ultimately incoherent) philosophy of time called presentism.*

**September 30, 2018.** *With a little experimental mathematics, you
too can arrive at the insights of Ramanujan! A simple program in
Haskell for discovering partition identities.*

**September 8, 2018.** *Getting a handle on higher-dimensional objects
is hard. In very high dimensions, however, we can view simple shapes
as random processes, and convert statistical properties into
geometric ones. I’ll explore this approach for hypercubes, loosely
speaking the geometry of coin flips.*

**August 17, 2018.** *I discuss the physics of an inverted pendulum,
and prove (using a judicious combination of hand-waving and the Hill
determinant) that if you wobble the pivot fast enough, the pendulum will settle into equilbrium
upside-down.*

**December 14, 2017.** *Studying Gödel’s theorems in their original arithmetic context involves a lot of detail and hard work if all you are interested in is the logical content (e.g. Gödel’s Incompleteness Theorems). I talk about an alternative called provability logic, which cleanly extracts all the interesting logical behaviour. In this context, Gödel’s results reduce to a single logical axiom called Löb’s Theorem and the existence of certain propositional fixed points.*

**November 30, 2017.** *One of the basic tenets of evolution is that different organisms (or genes) have different rates of reproduction. Simple models treating these organisms as replicators, competing for population dominance, are surprisingly rich. I give a simple proof in this context of Fisher’s “fundamental theorem” that average fitness increase equals genetic variance.*

**August 11, 2017**. *Three paradoxes of rational action — the Prisoner’s Dilemma (rational behaviour for you may not be collectively rational), Newcombe’s paradox (correlation is not causation), and the Smoker’s Dilemma (common cause is correlation) — coincide in certain contexts. I explain in more detail what these paradoxes are and how they can be viewed as equivalent.*

**September 30, 2015.** *Partitions are the additive equivalent of
primes, telling us how many ways we can add (rather than multiply)
smaller numbers to get a given natural number. Euler proved a lovely
result about the number of partitions which, surprisingly, involves
pentagons. I’ll show one way to obtain this result from Jacobi’s
triple product formula.*

**August 31, 2015.** *An introduction to black hole thermodynamics,
based on a talk given to undergraduates at the University of Melbourne.*

**August 23, 2015.** *There are nice connections between representations of numbers as sums of squares, and the multiplicative structure of weird number systems. I explain some of these connections, and show why 3 × 21 = 63 tells us that a certain normed division algebra cannot exist!*

**May 31, 2015.** *Cumulants are like the moments of a probability distribution, but
better. I discuss a nice technique for calculating them in terms of
Möbius functions on partition lattices, and use it to prove a famous
result about Gaussian moments attributed to Wick/Isserlis. These are more or
less just my notes on a
paper by Terry Speed.*

**May 17, 2015.** *A self-contained proof of the functional equation
for Riemann’s zeta function, mainly written for my own edification.*

**April 30, 2015.** *The polylogarithm series often appears as the butt of convergence tests;
here, we go further, evaluating it and discussing the application to
quantum statistics.*

**April 1, 2015.** *According to a
now infamous Numberphile video,
the sum of all natural numbers is -1/12. I explain two methods for
getting this result, one rigorous and one non-rigorous, both due to Ramanujan.*

**April 15, 2014.** *I give a simple method for calculating moments of a
shifted Gaussian using the generating function for Hermite polynomials.*