siteIcon

Tech Novice Tools

PHP Apps

burgerIcon

Crummy Buttonscereal

Every box a winner!

Instructions

'The Good Ole Days'

It doesn't happen as much any more, but long ago, we bought our cereal because there were prizes in the box! ~ good prizes!

Most of the time, there were 'collections' and you were encouraged to 'collect all 8' which meant you (or mom) purchased 50 boxes of cereal looking for the ellusive 8th prize! (You rarely ate all the cereal!)

This is a simulation where you specify the number of prizes, (each with a unique 'prize code') and see how many purchases of the fictitous cereal Crummy Buttons it takes to collect a complete set.

We assume each prize is equally-likely to be won!

When generating codes: we are filtering out spaces and ensuring that each new code did not already exist! Additionally, we are filtering out duplicate characters, so each character has an equally-likely chance of being selected. However, we do allow the unique characters to be selected with replacement (i.e. characters can be repeated within a given code).

Learn more about the classic Cereal Box Problem.

Read about the theoretical number of boxes you would expect to buy to get all the available prizes.

Last update: 11/14/19


Design your prize code(s):