Plain TeX references with AWK and sed

Using Plain TeX in the 21st century isn’t as big a pain as it might seem. The main difference between using TeX and LaTeX is that when you need a new feature in LaTeX, there is almost certainly a package out there that does it, while with TeX, you have to be prepared to write your own solution. I’ve written my own macros for most of the things I need to do on a daily basis, and the TeXbook contains approaches to most problems, but something that I never figured out how to do was format reference lists automatically. Recently, Prof. Luc Devroye showed me how he formats his references: entirely using UNIX scripts! I expanded his script to handle automatic numbering of references, and I thought I’d write a little post explaining how it works.

More …

Binary trees in the wild

Binary trees are one of the most common data structures in computer science. They can be used to represent hierarchy and also arise in many different computer algorithms related to sorting and searching. Today, we’re going to investigate a cool algorithm for drawing organic-looking trees and then look at different “species” of binary trees.

More …

Bit sequences and Hamiltonian cycles

With the coronavirus pandemic currently sweeping the globe, most of us here in Montréal are shut at home. But social distancing hasn’t kept my friends and I from discussing cool math (some school-related, some not) over videochat. The subject of today’s article is a little exercise that Prof. Luc Devroye gave some of us in his virtual office hours yesterday. After thinking on it overnight and working it out on paper this morning, I found a solution that I thought was pretty nice.

More …

Putnam 2019

This past weekend, I participated in the William Lowell Putnam Mathematical Competition with a couple of my friends. It was my first time competing in any sort of math competition and I hadn’t prepared much beforehand (I did have a peek at some problems from previous years the day before, but I didn’t manage to solve any). On the day itself, I ended up submitting three out of the twelve questions, though I wouldn’t be surprised if I still got a score of 0/120, given how tough the grading is supposed to be. I thought it’d be a good idea to record my incomplete solutions (and what they were missing) so that when the marks come out in a couple months I’ll be able to refer to what I actually did.

More …

Consonant voicing and Mandarin pop music

It’s back-to-school season here in Montréal and I just returned from a six-week holiday to Singapore as well as some surrounding countries. During this time I was exposed to quite a bit more Chinese than I’m used to (mostly Mandarin, Hokkien, and Cantonese) and it really struck me just how odd Mandarin pop music sounds, compared to normal spoken Mandarin. As a disclaimer, I’m not a strong speaker of Mandarin, but I do understand it fairly well and I often noticed growing up that Mandarin is a little different when sung. For one, Mandarin is a tonal language, so when the tones are masked by the notes of a pop song, the words don’t always seem as clear. But this summer, I finally managed to put my finger on what really seemed off to me: The consonants are all messed up!

More …