Author Archives: possiblywrong

Hilbert halftone art

Introduction This post was motivated by a recent attempt to transform a photograph into a large digital print, in what I hoped would be a mathematically interesting way. The idea was pretty simple: convert the (originally color) image into a … Continue reading

Posted in Uncategorized | 2 Comments

Probability of playable racks in Scrabble

Introduction Earlier this year, I spent some time calculating the probability of a Scrabble “bingo:” drawing a rack of 7 tiles and playing all of them in a single turn to spell a 7-letter word. The interesting part of the … Continue reading

Posted in Uncategorized | Leave a comment

Analysis of Bingo

Introduction Suppose that Alice and Bob play a game for a dollar: they roll a single six-sided die repeatedly, until either: Alice wins if they observe each of the six possible faces at least once, or Bob wins if they … Continue reading

Posted in Uncategorized | 2 Comments

Digits of pi and Python generators

Introduction This post was initially motivated by an interesting recent article by Chris Wellons discussing the Blowfish cipher. The Blowfish cipher’s subkeys are initialized with values containing the first 8336 hexadecimal digits of , the idea being that implementers may … Continue reading

Posted in Uncategorized | 2 Comments

Floating-point agreement between MATLAB and C++

Introduction A common development approach in MATLAB is to: Write MATLAB code until it’s unacceptably slow. Replace the slowest code with a C++ implementation called via MATLAB’s MEX interface. Goto step 1. Regression testing the faster MEX implementation against the … Continue reading

Posted in Uncategorized | 3 Comments

What is (-1&3)?

This is just nostalgic amusement.  I recently encountered the following while poking around in some code that I had written a disturbingly long time ago: What does this code do?  This is interesting because the switch expression is a constant … Continue reading

Posted in Uncategorized | 2 Comments

The following are equivalent

I have been reviewing Rosen’s Discrete Mathematics and Its Applications textbook for a course this fall, and I noticed an interesting potential pitfall for students in the first chapter on logic and proofs. Many theorems in mathematics are of the … Continue reading

Posted in Uncategorized | 4 Comments