Category Archives: Uncategorized

Tracking heap memory use in Windows

Introduction I recently encountered a problem with a C++ program that was allocating more memory than it should. It wasn’t leaking memory– that is, the program was well-behaved in the sense of eventually releasing every byte of memory that it … Continue reading

Posted in Uncategorized | 1 Comment

Follow-up: I found two identical packs of Skittles, among 468 packs with a total of 27,740 Skittles

Introduction This is a follow-up to a post from earlier this year discussing the likelihood of encountering two identical packs of Skittles, that is, two packs having exactly the same number of candies of each flavor. Under some reasonable assumptions, … Continue reading

Posted in Uncategorized | 49 Comments

Printing a single-elimination tournament bracket

How should the teams be arranged in a “seeded” single-elimination tournament bracket? This question is motivated by the NCAA men’s basketball tournament, the first two rounds of which are now in the books. There are 64 teams in the tournament, … Continue reading

Posted in Uncategorized | Leave a comment

The answer is always “None of the above (or below)”

Consider this multiple-choice problem: Which of the following answers is the correct answer to this question? None of the below All of the below All of the above One of the above None of the above None of the above … Continue reading

Posted in Uncategorized | Leave a comment

Identical packs of Skittles

Introduction “No two rainbows are the same. Neither are two packs of Skittles. Enjoy an odd mix.” – Skittles label Analyzing packs of Skittles (or sometimes M&Ms) seems to be a very common exercise in introductory statistics. How many candies … Continue reading

Posted in Uncategorized | 9 Comments

Random drug testing in the NFL

Introduction “This is supposed to be a random system. It doesn’t feel very random.” – Eric Reid, as quoted on Twitter Last week, Eric Reid was selected to take his fifth random drug test in eight weeks with the Carolina … Continue reading

Posted in Uncategorized | 3 Comments

Generating Mini-Crosswords

Introduction The New York Times publishes “mini-crosswords,” which are crossword puzzles on a relatively small grid (usually 5×5), without any black squares, so that every row and column of the grid must spell a word. The figure below shows an … Continue reading

Posted in Uncategorized | 3 Comments