Problem 53004. Collect a set of candy wrappers

This past Halloween, the siblings Matilda and Labrun amused (and sometimes confused) their many neighbors with their costumes inspired by “mundane Halloween”, a Japanese tradition started in 2014. As they sifted through and sampled the candy they collected, they noticed something odd as they opened one type of candy, an Oh Leonhard! bar:
“This wrapper has a proof of the infinitude of primes!”, said Matilda.
“I got that one too,” said Labrun. “And here’s one with the Twin Prime Conjecture!”
“Here’s the Pythagorean Theorem. And this one has the Riemann hypothesis.”
The precocious pair determined that these wrappers were part of the Oh Leonhard! “Great Theorems and Unsolved Problems” promotion. In this promotion, wrappers with one of forty theorems, conjectures, or other famous math problems were distributed evenly among all of the Oh Leonhard! Bars produces. Anyone who collected all wrappers in the set would get a copy of the Handbook of Mathematical Functions by Abramowitz and Stegun.
Matilda and Labrun computed that, on average, they would have to open 172 wrappers to complete a set and win the prize. Their calculation accounted for the contest’s rule that all pieces of the wrapper had to be submitted—that is, no fractional wrappers were allowed.
Write a function that takes the number of wrappers in a set and compute the expected number of wrappers that would need to be opened to collect the set.

Solution Stats

83.33% Correct | 16.67% Incorrect
Last Solution submitted on Mar 14, 2022

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers3

Suggested Problems

More from this Author255

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!