Let s be an integer equal to at least 5 and let n be a positive integer. Look at all tuples of s integers, each integer being between 0 and n-1 inclusive, and look at the sum of their squares mod n. About 1/n will fall into each possible value. …

Occasionally it’s useful to find the day of the year. For example, today is 272nd day of 2022. How hard would it be to calculate the day of the year in your head? Each month has about 30 days, so the dth day of the mth month is approximately day …

Sept. 29, 2022, 9:41 p.m.

A few days ago I wrote about Room squares, squares named after Thomas Room. This post will be about Room’s original square. You could think of a Room square as a tournament design in which the rows represent locations and the columns represent rounds (or vice versa). Every team plays …

Sept. 28, 2022, 1:55 p.m.

My local library had a book sale this weekend and I picked up a statistics textbook for geologists [1] for $1. When I thumbed through the book an image similar to the one below caught my eye. This image approximates Figure 15.2 in [1], The nodes represent six factors of …

Sept. 27, 2022, 1:34 p.m.

A Room square is a variation on a Latin square. Room squares are named after Thomas Room, though there is an application to rooms as in compartments of a building that we’ll discuss below. In a Latin square of size n you have to assign one of n symbols to …

Sept. 24, 2022, 3:43 p.m.

This post will give a detailed example of working in a field with nine elements. This is important because finite fields are not often treated concretely except for the case of prime order. In my first post on Costas arrays I mentioned in a footnote that Lempel’s algorithm works more …

Sept. 21, 2022, 9:44 a.m.

A couple days ago I wrote about Costas arrays. In a nutshell, a Costas array of size n is a solution to the n rooks problem, with the added constraint that if you added wires between the rooks, no two wires would have the same length and slope. See the …

Sept. 20, 2022, 4:57 p.m.

The famous n queens problem is to find a way to position n queens on a n×n chessboard so that no queen attacks any other. That is, no two queens can be in the same row, the same column, or on the same diagonal. Here’s an example solution: Costas arrays …

Sept. 18, 2022, 7:14 p.m.

Suppose you have an even number of teams that you’d like to schedule in a Round Robin tournament. This means each team plays every other team exactly once. Denote the number of teams as 2n. You’d like each team to play in each round, so you need n locations for …

Sept. 17, 2022, 2:16 p.m.

The two previous posts looked at adjacency networks. The first used examples of US states and Texas counties. The second post made suggestions for using these networks in a classroom. This post is a continuation of the previous post using examples from Japan. Japan is divided into 8 regions and …

Sept. 12, 2022, 3:29 p.m.

In the previous post I looked at graphs created from representing geographic regions with nodes and connecting nodes with edges if the corresponding regions share a border. It’s an interesting exercise to recover the geographic regions from the network. For example, take a look at the graph for the continental …

Sept. 12, 2022, 2:37 p.m.

Suppose you want to color a map with no two bordering regions having the same color. If this is a map on a plane, you can do this using only four colors, but maybe you’d like to use more. You can reduce the problem to coloring the nodes in a …

Sept. 12, 2022, 12:13 a.m.

This is the final post in a series of three posts about shortest tours, solutions to the so-called traveling salesmen problem. The first was a tour of Africa. Actually two tours, one for the continent and one for islands. See this post for the Mathematica code used to create the …

I recently wrote posts about spherical analogs of the Pythagorean theorem, the law of cosines, and the law of sines. The corresponding formulas for hyperbolic space mostly just replace circular functions with hyperbolic functions, i.e. replace sine with hyperbolic sine and cosine with hyperbolic cosine. Triangles on a sphere or …

Sept. 8, 2022, 10:30 a.m.

In an earlier post I looked in detail at a series for inverse cosine centered at 1. The function arccos(z) is multivalued in a neighborhood of 1, but the function arccos(z) / √(2 – 2z) is analytic in a neighborhood of 1. We cancel out the bad behavior of inverse …

As far as I know, all contemporary math libraries use the same branch cuts when extending elementary functions to the complex plane. It seems that the current conventions date back to Kahan’s paper [1]. I imagine to some extent he codified existing practice, but he also settled some issues, particularly …

I had some errors in a recent blog post that might have been eliminated if I had programmatically generated the content of the post rather than writing it by hand. I rewrote the example in this post in using org-mode. My org file looked like this: #+begin_src python :session :exports …

Sept. 6, 2022, 12:17 a.m.

Here’s a cute little poem: I wish I knew The root of two. Oh charmed was he To know root three. So we now strive To find root five. The beginning of each stanza is a mnemonic for the number mentioned in the following line. √ 2 = 1.414 √ …

Sept. 2, 2022, 12:33 a.m.