Research
How Many Houses Until You Have Every Kind of Halloween Candy?
If every house hands out one random piece from the same bag, how many houses until a trick-or-treater has every kind? With the pretend 20-piece bag on Wheel Cue's Halloween wheel, 8 kinds take 34.6 houses on average, and a full set within 30 houses comes only about half the time. We worked out the exact odds, checked them against 89.6 million simulated spins through the site's real random code, and turned them into a class activity that needs no real candy.
The short answer
The example is the Candy bag (math) list on the Halloween wheel, a pretend bag of 20 pieces in 8 kinds: Chocolate bar (5 pieces), Lollipop (4), Gummy bears (3), Caramel, Sour chews and Toffee (2 each), plus Mints and Candy corn (1 each). Each house hands out one piece at random, and the bowl never runs out.
- One child needs 34.6 houses on average to collect all 8 kinds. About half of nights finish within 30 houses (52.5%), 9 in 10 within 60, and 16.3% need more than 50.
- The rare kinds decide the wait. Collecting just mints and candy corn, the two one-piece kinds, takes 30.0 houses on average, most of the 34.6. Collecting just the other 6 kinds takes 19.9; the two waits overlap rather than add up.
- One piece changes a lot. Turn one chocolate bar into a second piece of candy corn and the average drops to 29.6 houses.
- Teaming up helps. Two children who pool and trade have a full set each after 29.7 houses on average: sooner than one child alone (34.6), and far sooner than both going alone (44.5).
These figures are exact and checked against a simulation (details at the end); the calculator below takes your own bag.
One child: why eight kinds take so many houses
A house is one spin of the Candy bag (math) list, with Remove the winner after each spin left off. Each of the 20 slices has the same chance, so a kind's chance is its pieces out of 20: 5 in 20 (25%) for a chocolate bar, 1 in 20 (5%) for a piece of candy corn.
Real streets are messier: one house may hand out a single kind, another two pieces, and bowls do run out. The numbers here are for the pretend bag, where every house draws from the same mix.
Collecting every kind is the coupon collector's problem. Our study How Many Spins Until Every Student Gets a Turn? covers the case where every entry has the same chance. Here the chances are unequal, and that is what stretches the night. Once only candy corn is missing, each house has a 1 in 20 chance of ending it, so that last step alone takes 20.0 houses on average.
The spread is wide. The fastest possible night is 8 houses, all different, a 1 in 1,323 chance; only 23.5% of nights finish within 20 houses, and 9.54% take more than 60. Those long nights pull the average (34.6) above the middle night, 30 houses.
- The candy bag (20 pieces, 8 kinds)
- One Chocolate bar changed to Candy corn
- An even bag (8 kinds, equal chances)
Show the numbers
| Houses | Candy bag | One Chocolate bar changed | Even bag |
|---|---|---|---|
| 10 | 0.90% | 1.43% | 2.82% |
| 15 | 9.13% | 13.7% | 24.8% |
| 20 | 23.5% | 32.8% | 53.1% |
| 25 | 38.9% | 50.6% | 73.7% |
| 30 | 52.5% | 64.5% | 85.9% |
| 40 | 72.1% | 81.8% | 96.20% |
| 50 | 83.7% | 90.34% | 98.99% |
| 60 | 90.46% | 94.69% | 99.73% |
| 75 | 95.66% | 97.72% | 99.96% |
| 100 | 98.81% | 99.40% | >99.99% |
With 8 equally common kinds, one line each, the average would be 21.7 houses: about half of nights within 20 (53.1%) and 9 in 10 within 33. The candy bag has the same 8 kinds and only adds pieces of the common ones, yet on average it takes almost 13 houses longer (12.81 exactly).
The rare kinds set the pace
Mints and candy corn have one slice each, so every house has a 1 in 20 chance of each.
- The first piece of candy corn takes 20.0 houses on average. About half of nights it shows up within 14 houses, but 1 night in 10 it takes more than 45 (9.94%).
- The last kind found is mints or candy corn on 62.9% of nights. A chocolate bar is last on 0.98%.
Moving one piece
Change one Chocolate bar line to Candy corn. The bag still has 20 pieces and 8 kinds, but the average falls from 34.6 to 29.6 houses. About half of nights finish within 25 (50.6%), 9 in 10 within 50, and the chance of a full set within 30 houses rises from 52.5% to 64.5%.
One piece moved from the most common kind to one of the two rarest saves almost 5 houses on average (4.91 exactly). To shorten the wait, make the rare kinds less rare.
Teaming up: trading gets everyone a set sooner
Now several children walk together, and every child gets one piece at every house. There are three ways to count when they are done:
- One set between them: the pooled haul holds every kind at least once. That's one set for the whole group, not one each.
- A full set each, trading: the pooled haul holds every kind at least as many times as there are children, so they can trade until everyone has a complete set.
- Each alone, until all have a set: no trading.
| Exact values (one child alone: 34.6 houses, 52.5% within 30) | 2 children | 3 children | 4 children |
|---|---|---|---|
| One set between them (average houses) | 17.5 | 11.9 | 9.0 |
| A full set each, trading (average houses) | 29.7 | 27.7 | 26.5 |
| Each alone, until all have a set (average houses) | 44.5 | 50.9 | 55.7 |
| A set each within 30 houses, trading | 62.0% | 68.2% | 72.6% |
| A set each within 30 houses, alone | 27.5% | 14.5% | 7.58% |
With two children, one set between them takes 17.5 houses on average, about half of one child's 34.6, because the pair collects two pieces per house. A full set each after trading takes 29.7: the duplicates one child does not need fill the other's gaps. Without trading, both have a set only after 44.5.
The gap grows with the group. With 4 children, trading gives everyone a set after 26.5 houses on average, against 55.7 going alone. Within 30 houses, a set each comes 72.6% of the time with trading and 7.58% without.
Pooling can never take longer than going alone, night by night: if every child already has a set, the pooled haul has a set each.
Leftovers to trade, and the wait for a favorite kind
Every house gives one piece and 8 of them make the set, so when the set is complete a child holds 26.6 duplicates on average, all kinds together. Most are common kinds: 7.6 extra chocolate bars (8.6 in all), against 0.7 extra pieces of candy corn. That surplus is the trading stock.
The wait for one favorite kind depends on how common it is:
- Chocolate bar, 5 in 20 (25%): the first one takes 4.0 houses on average, and 9 nights in 10 it arrives within 9. Three of them take 12.0 houses on average, 9 in 10 within 20.
- Candy corn, 1 in 20 (5%): the first piece takes 20.0 houses on average, within 30 houses 78.5% of the time. Three pieces take 60.0 on average, and only 18.8% of nights get there within 30 houses.
A kind 5 times rarer takes 5 times longer on average, for one piece or for three.
A no-candy math lesson on the Halloween wheel
The Halloween wheel's trick-or-treat math section gives the four steps; this section adds the numbers. The tally works for any grade that can count marks; comparing the class's results with the exact chances suits a middle-school probability unit.
Nothing is eaten, so the lesson fits classrooms with food allergies or no-food rules (the Halloween wheel's treats that are not candy work the same way). If some families in your class do not mark Halloween, rename the kinds to stickers or animal cards: only the counts matter.
Setting up
- Open the Candy bag (math) list; that link selects it. Under Wheel options, leave Remove the winner after each spin off, as it is by default. The line under the wheel shows 20 entries and "each has a 1 in 20 chance (5%)".
- For pace, set Spin length to Quick — 3 seconds. The spinning alone for an average night then takes about 100 seconds; with the tally, allow several times that, and more for a long night.
- Press Clear in the Results panel (not the Clear under the list, which empties the wheel) before each night, so the spin numbers (#1, #2…) are house numbers.
- After each result, press Spin again. Do not use Remove & spin: it takes that one piece out of the bag, so the chances change and the numbers on this page no longer apply. If it gets pressed, Reset under the list puts the slice back.
The result window says "Probability 5%" for every pick, chocolate bars included, because it gives the chance of one slice. Ask the class why a chocolate bar still comes up 5 times as often as a piece of candy corn.
The Results panel lists only the latest 40 spins, and 27.9% of nights need more than 40 houses, so keep the tally on the board. Copy copies every spin since the last Clear as a table.
What to expect
Most guesses will be far too low: a night of 8 houses, one per kind, happens about once in 1,323 nights. One group's night proves little, since about half finish within 30 houses and 16.3% run past 50. If a night passes 50 houses, stop and record it as "more than 50": that is a result too. Averaging groups narrows this less than you might think: the average of six groups still has a standard deviation of about 8 houses (one night's is 19.6). Expect mints or candy corn to be the last kind found on about 6 nights in 10.
Extensions
- Pairs pooling. On one device, each partner spins once per house, so a house is two spins, and the pair keeps one tally on paper: the spin numbers now count pieces, and the Results list keeps only the latest 20 houses. Stop when every kind has two marks: the pair could then trade to a full set each. That takes 29.7 houses on average, about 59 spins. Stopping at one mark per kind (one set between them) takes 17.5 houses. A pair sharing one spin per house is just one child again.
- Changing the bag. Edit the list, one line per piece: change one Chocolate bar line to Candy corn and test the 29.6-house average. Or turn on Weighted choices and write one line per kind, such as
Chocolate bar *5(how weights work). The odds line then shows the total weight, and the result window shows 25% for a chocolate bar. Without Weighted choices those lines become 8 equal slices: the even bag, 21.7 houses. To get the original bag back, click the Candy bag (math) chip again; Reset goes back to the page's first list.
Candy bag calculator
Enter a bag, how many children walk together and how many houses are on the route. The page works out the exact averages, then simulates nights in this tab with the same random code as the wheel, one pick per piece of candy.
Press Simulate the nights to run them.
Each kind's chance at every house
A line such as Chocolate bar 5 means 5 pieces; *5, or a space then x5, also work, and repeated names are added up (capitals aside), so the wheel's list can be pasted as it is. On the wheel itself, Chocolate bar 5 is just a slice with that name. The calculation runs in this page: the bag you type is not sent to Wheel Cue. Simulated results change a little on every run; the exact values do not.
How to check these numbers
The script and its raw results are linked at the top of the page. Save the script and random.js in one folder and run node how-many-houses-for-every-halloween-candy.mjs random.js results.json with Node.js 18 or later (about 120 seconds on our PC with Node 24). The exact values will match this page; the simulated ones will differ in the last decimals.
- Exact values. One child's wait comes from inclusion–exclusion over the 256 subsets of kinds in whole-number arithmetic. A full set each after trading comes from counting, house by house and in whole numbers, every sequence of spins that holds each kind at least once per child. The count stops once fewer than one night in ten billion is still unfinished, far below the last decimal shown. A favorite kind follows the negative binomial distribution, and the leftovers follow from the average wait (each kind's share of the pieces is its chance). All 27 cross-checks between two exact methods agree, including an independent integral formula for the averages.
- Simulation. The script loads the real random.js, reads the bag from the Halloween wheel's list, and makes each piece one
CueRandom.pickWeighted()call over the 20 lines, as the wheel does: 89.6 million simulated spins over 400,000 nights of one child, plus the even bag, the moved piece and groups of 2 to 4. - Checks. A simulated value passes when it is within four standard errors of the exact one: all 37 agreed, and the largest deviation was 2.13 standard errors. With this many checks, a rerun may very rarely fail one by chance.
The random code itself is tested at scale in the fairness report.
How this research was made
The results on this page come from a simulation that runs real draws through random.js — the same file that picks every winner on Wheel Cue — and from the exact formula wherever one exists, and the two are checked against each other. Simulated results are labelled as simulations: they are not usage figures for this site.
The script and its raw output are published with the page, so anyone can re-run the study. The raw results (the JSON file) are free to reuse under the CC BY 4.0 license, with credit to Wheel Cue; the article text is not covered by that license. If you find a mistake, tell us: corrections are dated in the changelog. How the research is made →
Frequently asked questions
How many houses does it take to get every kind of candy?
With the pretend bag on the Halloween wheel (20 pieces, 8 kinds), one child needs 34.6 houses on average, and about half of nights finish within 30. A real night depends on what the houses hand out; the calculator takes your own mix.
Why does it take so long when there are only 8 kinds?
Because the last kinds are rare. Mints and candy corn are 1 piece each in 20, and collecting both takes 30.0 houses on average, most of the 34.6; the other 6 kinds alone take 19.9, and the two waits overlap. With 8 equally common kinds the average would be 21.7.
Do siblings get a full set sooner if they share?
Yes, if they pool and trade: two children have a full set each after 29.7 houses on average, against 44.5 going alone; three take 27.7 against 50.9.
Why does the wheel say 5% when it picks a Chocolate bar?
The result window gives the chance of the one slice that won, and every slice of the Candy bag (math) list has a 1 in 20 chance (5%). A Chocolate bar has 5 slices, so its chance at each house is 5 in 20 (25%). With Weighted choices on and one line per kind, such as Chocolate bar *5, the window shows 25% instead.
Does the lesson work if some students do not celebrate Halloween?
Yes. Rename the eight kinds on the Candy bag (math) list to any items, keep 5, 4, 3, 2, 2, 2, 1 and 1 lines, and every number here stays the same. No real candy is needed either way.
Keep reading
Run the candy bag lesson
Open the Halloween wheel's candy bag list, spin once per house, and tally until every kind has a mark.