The nine-point circle theorem

The nine-point circle theorem says that for any triangle, there is a circle passing through the following nine points:

  • The midpoints of each side.
  • The foot of the altitude to each side.
  • The midpoint between each vertex and the orthocenter.

The orthocenter is the place where the three altitudes intersect.

Illustration of Feuerbach's nine-point circle theorem

In the image above, the midpoints are red circles, the altitudes are blue lines, the feet are blue stars, and the midpoints between the vertices and the orthocenter are green squares.

 

The Möbius Inverse Monoid

I’ve written about Möbius transformations many times because they’re simple functions that nevertheless have interesting properties.

A Möbius transformation is a function f : ℂ → ℂ of the form

f(z) = (az + b)/(cz + d)

where adbc ≠ 0. One of the basic properties of Möbius transformations is that they form a group. Except that’s not quite right if you want to be completely rigorous.

The problem is that a Möbius transformation isn’t a map from (all of) ℂ to ℂ unless c = 0 (which implies d cannot be 0). The usual way to fix this is to add a point at infinity, which makes things much simpler. Now we can say that the Möbius transformations form a group of automorphisms on the Riemann sphere S².

But if you insist on working in the finite complex plane, i.e. the complex plane ℂ with no point at infinity added, each Möbius transformations is actually a partial function on ℂ because a point may be missing from the domain. As detailed in [1], you technically do not have a group but rather an inverse monoid. (See the previous post on using inverse semigroups to think about floating point partial functions.)

You can make Möbius transformations into a group by defining the product of the Möbius transformation f above with

g(z) = (Az + B) / (Cz + D)

to be

(aAz + bCz + aB + bD) / (Acz + Cdz + Bc + dD),

which is what you’d get if you computed the composition fg as functions, ignoring any difficulties with domains.

The Möbius inverse monoid is surprisingly complex. Things are simpler if you compactify the complex plane by adding a point at infinity, or if you gloss over the fine points of function domains.

Related posts

[1] Mark V. Lawson. The Möbius Inverse Monoid. Journal of Algebra. 200, 428–438 (1998).

Locally invertible floating point functions

Is the function xx + 2 invertible? Sure, its inverse is the function xx − 2.

Is the Python function

    def f(x): return x + 2

invertible? Not always.

You might reasonably think the function

    def g(x): return x - 2

is the inverse of f, and it is for many values of x. But try this:

    >>> x = 2**53 - 1.0
    >>>  g(f(x)) - x
    -1.0

The composition of f and g does not give us x back because of the limited length of a floating point significand. See Anatomy of a floating point number.

The function f as a function between floating point numbers is locally invertible. That is, it is invertible on a subset of its domain.

Now let’s look at the function

    def f(x): return x*x

Is this function invertible? There is a function, namely sqrt that serves as an inverse to f for many values of x, but not all x. The function sqrt is a partial function because although it is ostensibly a function on floating point numbers, it crashes for negative inputs. The function’s actual domain is smaller than its nominal domain.

Locally invertible functions are an inevitable part of programming, and are awkward to reason about. But there are tools that help. For example, inverse semigroups.

According to nLab

An inverse semigroup is a semigroup S such that for every element sS, there exists a unique “inverse” s* ∈ S such that s s* s = s and s* s s*= s*.

The canonical example of an inverse semigroup, and in some sense the only example, is the following, also from nLab.

For any set X, let I(X) be the set of all partial bijections on X, i.e. bijections between subsets of X. The composite of partial bijections is their composite as relations (or as partial functions).

This is the only example in the sense that the Wagner-Preston theorem says every inverse semigroup is isomorphic to a group of this form.

In our case, the set X is the set of representable floating point numbers, and locally invertible functions are functions which are invertible, but only when restricted to a subset of X.

Solving Laplace’s equation in the upper half plane

In the previous post, I said that solving Laplace’s equation on the unit disk was important because the unit disk is a sort of “hub” of conformal maps: there are references and algorithms for mapping regions to and from a disk conformally.

The upper half plane is a sort of secondary hub. You may want to map two regions to and from each other via a half plane. And as with the disk, there’s an explicit solution to Laplace’s equation on a half plane.

Another reason to be interested in Laplace’s equation on a half plane is the connection to the Hilbert transform and harmonic conjugates.

Given a continuous real-valued function u on the real line, u can be extended to a harmonic function on the upper half plane by taking the convolution of u with the Poisson kernel, a variation on the Poisson kernel from the previous post. That is, for y > 0,

u(x + iy) = \frac{1}{\pi} \int_{-\infty}^\infty \frac{y}{(x-t)^2 + y^2}\, u(t)\, dt

This gives a solution to Laplace’s equation on the upper half plane with boundary values given by u on the real line. The function u is smooth on the upper half plane, and its limiting values as y → 0 is continuous.

Furthermore, u is the real part of an analytic function f = u + iv. The function v is the harmonic conjugate of u, and also equals the Hilbert transform of u.

Solving Laplace’s equation on a disk

Why care about solving Laplace’s equation

\Delta u = 0

on a disk?

Laplace’s equation is important in its own right—for example, it’s important in electrostatics—and understanding Laplace’s equation is a stepping stone to understanding many other PDEs.

Why care specifically about a disk? An obvious reason is that you might need to solve Laplace’s equation on a disk! But there are two less obvious reasons.

First, a disk can be mapped conformally to any simply connected proper open subset of the complex plane. And because conformal equivalence is transitive, two regions conformally equivalent to the disk are conformally equivalent to each other. For example, as I wrote about here, you can map a Mickey Mouse silhouette

Mickey Mouse

to and from the Batman logo

Batman logo

using conformal maps. In practice, you’d probably map Mickey Mouse to a disk, and compose that map with a map from the disk to Batman. The disk is a standard region, and so there are catalogs of conformal maps between the disk and other regions. And there are algorithms for computing maps between a standard region, such as the disk or half plane, and more general regions. You might be able to lookup a mapping from the disk to Mickey, but probably not to Batman.

In short, the disk is sort of the hub in a hub-and-spoke network of cataloged maps and algorithms.

Secondly, Laplace’s equation has an analytical solution on the disk. You can just write down the solution, and we will shortly. If it were easy to write down the solution on a triangle, that might be the hub, but instead its a disk.

Suppose u is a real-valued continuous function on the boundary of the unit disk. Then u can be extended to a harmonic function, i.e. a solution to Laplace’s equation on the interior of the disk, via the Poisson integral formula:

u(z) = \frac{1}{2\pi} \int_0^{2\pi} u(e^{\i\theta})\, \text{Re}\left( \frac{e^{i\theta} + z}{e^{i\theta} - z}\right)\, d\theta

Or in terms of polar coordinates:

u(re^{i\varphi}) = \frac{1}{2\pi} \int_0^{2\pi} \frac{u(e^{\i\theta}) (1 - r^2)}{1 - 2r\cos(\theta-\varphi) + r^2}\, d\theta

Related posts

Posts on ellipses and elliptic integrals

I wrote a lot of posts on ellipses and related topics over the last couple months. Here’s a recap of the posts, organized into categories.

Basic geometry

More advanced geometry

Analysis

Design of experiments and design theory

Design of experiments is a branch of statistics, and design theory is a branch of combinatorics, and yet they overlap quite a bit.

It’s hard to say precisely what design theory is, but it’s consider with whether objects can be arranged in certain ways, and if so how many ways this can be done. Design theory is pure mathematics, but it is of interest to people working in ares of applied mathematics such as coding theory and statistics.

Here’s a recap of posts I’ve written recently related to design of experiments and design theory.

Design of Experiments

A few weeks ago I wrote about fractional factorial design. Then later I wrote about response surface models. Then a diagram from central composite design, a popular design in response surface methodology, was one the diagrams in a post I wrote about visually similar diagrams from separate areas of application.

I wrote two posts about pitfalls with A/B testing. One shows how play-the-winner sequential testing has the same problems as Condorcet’s voter paradox, with the order of the tests potentially determining the final winner. More seriously, A/B testing cannot detect interaction effects which may be critical.

ANSI and Military Standards

There are several civilian and military standards related to design of experiments. The first of these was MIL-STD-105. The US military has retired this standard in favor of the civilian standard ASQ/ANSI Z1.4 which is virtually identical.

Similarly, the US military standard MIL-STD-414 was replaced by the very similar civilian standard ASQ/ANSI Z1.9. This post looks at the mean-range method for estimating variation which these two standards reference.

Design Theory

I wrote a couple posts on Room squares, one on Room squares in general and one on Thomas Room’s original design now known as a Room square. Room squares are used in tournament designs.

I wrote a couple posts about Costas arrays, an introduction and a post on creating Costas arrays in Mathematica.

Latin Squares

Latin squares and Greco-Latin squares a part of design theory and a part of design of experiments. Here are several posts on Latin and Greco-Latin squares.

Repunits: primes and passwords

A repunit is a number whose base 10 representation consists entirely of 1s. The number consisting of n 1s is denoted Rn.

Repunit primes

A repunit prime is, unsurprisingly, a repunit number which is prime. The most obvious example is R2 = 11. Until recently the repunit numbers confirmed to be prime were Rn for n = 2, 19, 23, 317, 1031. Now the case for n = 49081 has been confirmed.

R_{49081} = \frac{10^{49081} - 1}{9} = \underbrace{\mbox{111 \ldots 1}}_{\mbox{{\normalsize 49,081 ones}} }

Here is the announcement. The date posted at the top of the page is from March this year, but I believe the announcement is new. Maybe the author edited an old page and didn’t update the shown date.

Repunit passwords

Incidentally, I noticed a lot of repunits when I wrote about bad passwords a few days ago. That post explored a list of commonly used but broken passwords. This is the list of passwords that password cracking software will try first. The numbers Rn are part of the list for the following values of n:

1–45, 47–49, 51, 53–54, 57–60, 62, 67, 70, 72, 77, 82, 84, 147

So 46 is the smallest value of n such that Rn is not on the list. I would not recommend using R46 as a password, but surprisingly there are a lot of worse choices.

The bad password file is sorted in terms of popularity, and you might expect repunits to appear in the file in order, i.e. shorter sequences first. That is sorta true overall. But you can see streaks in the plot below showing multiple runs where longer passwords are more common than shorter passwords.

Recent posts on solving equations

I’ve written several blog posts about equation solving recently. This post will summarize how in hindsight they fit together.

Trig equations

How to solve trig equations in general, and specifically how to solve equations involving quadratic polynomials in sine and cosine.

Polynomial equations

This weekend I wrote about a change of variables to “depress” a cubic equation, eliminating the quadratic term. This is a key step in solving a cubic equation. The idea can be extended to higher degree polynomials, and applied to differential equations.

Before that I wrote about how to tell whether a cubic or quartic equation has a double root. That post is also an introduction to resultants.

Numerically solving equations

First of all, there was a post on solving Kepler’s equation with Newton’s method, and especially with John Machin’s clever starting point.

Another post, also solving Kepler’s equation, showing how Newton’s method can be good, bad, or ugly.

And out there by itself, Weierstrass’ method for simultaneously searching for all roots of a polynomial.

Expert witness experiences

The world of expert testimony seems mysterious from the outside, so I thought some readers would find it interesting to have a glimpse inside.

Kinds of experts

There are two kinds of experts, consulting experts and testifying experts. These names mean what they say: consulting experts consult with their clients, and testifying experts testify. Usually a lawyer will retain an expert with the intention of having this person testify, but the expert starts out as a de facto consulting expert.

Working with lawyers

Working with lawyers is quite pleasant. The division of labor is crystal clear: you are hired to be an expert on some topic, they are the experts in matters of law, and the streams don’t cross. You’re treated with deference and respect. Even if a lawyer knows something about your field of expertise, it’s not their role to opine on it.

I’ve never had a lawyer try to twist my arm. It’s not in their interests to do so. I’ve told lawyers things they were disappointed to hear, but I’ve never had a lawyer argue with me.

Turning down projects

I’ve turned down engagements when it was immediately apparent that the client didn’t have a statistical case. (They may have a legal case, but that’s not my bailiwick.) Sometimes lawyers are grasping at straws, and they may try a statistical argument as a last resort.

One person approached me to do a statistical analysis of one data point. Not to be outdone, someone once asked me to do a statistical analysis based on absolutely no data. I told both that I’d need a little more data to go on.

Nature of the work

John Tukey said that the best part of being a statistician is that you get to play in everyone else’s back yard. I’d expand that to applied math more generally. You can’t be expected to be an expert in everything, but you are expected to come up to speed quickly on the basics of problem domain.

Work on legal cases is confidential, but so is almost everything else I do. However, an intellectual property case I worked on took this to a higher level. I was only allowed to work at opposing counsel’s office, on their laptop, without an internet connection, and without a phone. That was an interesting exercise.

There’s a lot of hurry-up and wait with legal work. A project can be dormant and presumably dead, then suddenly pop back up. This isn’t unique to legal work, but it seems more frequent or more extreme with legal work.

Billing

Law firms do everything by the hour. I mostly work by the project, but I’ll work by the hour for lawyers. There are occasional exceptions, but hourly billing is firmly ingrained in legal culture. And reasonably so: it’s hard to say in advance how much work something will take. Sometimes when you can reasonably anticipate the scope of a task you can do it fixed bid.

Law firms typically pass through all expenses. So even if a firm hires you, their client is responsible for paying you. You don’t get paid until the law firm gets paid, which can sometimes take a while.

Travel

A few years ago I had to fly around a fair amount. That was fun for a while but it got old. I haven’t had to travel for work since the pandemic and I’m OK with that.