Tag: Programming

How to Make Animated Math GIFs: LaTeX + TikZ
—
by
The first animated GIF that I ever made was made with the LaTeX package TikZ and the command line utility ImageMagick. In this post, I’ll give a quick example of how to make a simple GIF that works by layering images with transparent backgrounds on top of each other repeatedly. TikZ code In our first…

A πestimating Twitter bot: Part III
—
by
In the final part of this threepart series, I’ll give technical stepbystep instructions for how to wire up our Twitter bot, @BotfonsNeedles, to Docker and deploy it on the free tier of AWS Lambda, so that it can run until the end of time. I’ll also include some tips that I wish I knew when…

A πestimating Twitter bot: Part II
—
by
This is the second part of a three part series about making the Twitter bot @BotfonsNeedles. Click here for Part I. In this part, I’ll explain how to use the Twitter API to post the images to Twitter via the Python library Tweepy, and keep track of all of the Tweets to get an increasingly…

A πestimating Twitter bot: Part I
—
by
This is the first part of a three part series about making the Twitter bot @BotfonsNeedles. In this part, I will write a Python 3 program that uses a Monte Carlo method to approximate \(\pi\) with Buffon’s needle problem, and produces an image with the Python library Pillow In the second part, I’ll explain how…

Polytopes with Lattice Coordinates
—
by
Problems 21, 66, and 116 in my Open Problem Collection concern polytopes with lattice coordinates—that is, polygons, polyhedra, or higherdimensional analogs with vertices the square or triangular grids. (In higher dimensions, I’m most interested in the \(n\)dimensional integer lattice and the \(n\)simplex honeycomb). This was largely inspired by one of my favorite mathematical facts: given…

Parity Bitmaps from the OEIS
—
by
My friend Alec Jones and I wrote a Python script that takes a twodimensional sequence in the OnLine Encyclopedia of Integer Sequences and uses it to create a onebitperpixel (1BPP) “parity bitmaps“. The program is simple: it colors a given pixel is black or white depending on whether the corresponding value is even or odd.…