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 …

Hello, moon!

On 20 July 1969, the Apollo 11 mission put a man on the moon for the very first time. It was one of the most inspiring technological achievements in human history. However, the moon landing happened relatively early in the timeline of computing, and the systems on board were incredibly underpowered by today’s standards. To celebrate the fiftieth anniversary of the moon landing, this article will cover some historical and technical details of the Apollo Guidance Computer before diving into the meaty details of the machine to allow us to write our own small program.

More …

Generating stack-machine bytecode

During the last four months, I’ve been working on a software project called OPythn. It’s an interpreter for a subset of Python, written in OCaml. Now that the project is complete, I wanted to write about one of the most interesting parts of OPythn’s development: translating control structures into stack-machine bytecode. The procedures described in this article are my own work, but a great deal of credit must be given to my supervisor Adam Dingle, who guided me over the course of many meetings. The OPythn stack machine is designed to be very similar to the one inside a conventional Python installation. I’d like to stress, however, that my program might not resemble how real Python’s bytecode is compiled at all; indeed, Python’s methods are likely more sophisticated and optimised. This article is intended to be rather technical and quite long. Feel free to treat it as a reference and skim to find the bits that interest you.

More …