Skip to content
Vamshi Jandhyala

Books · The Fiddler: Solutions

Chapter 27

Can You Take the Heat?

On the show Hot Ones you face 1010 hot sauces ranked 11 to 1010. Rather than buy all ten, you buy a few sauce numbers and combine sauces (adding their numbers, each used at most once) to hit any value you are missing. With the set {1,2,3,4}\{1,2,3,4\} you can already make every value from 11 to 1010. Counting that set, how many sets of four sauce numbers let you generate all of 11 through 1010?

The Fiddler, Zach Wissner-Gross, November 28, 2025(original post)

Solution

A set works when every target 1,,101,\dots,10 is a subset sum. To make 11 you need sauce 11; to make 22 you then need sauce 22 (nothing else is small enough). Sorting the four numbers 1<2<a<b1<2<a<b, the subset sums fill 1,2,1,2,\dots contiguously as long as each new number is at most one more than the running total, and the four must total at least 1010. So a1+(1+2)=4a\le 1+(1+2)=4, giving a{3,4}a\in\{3,4\}, and b1+(1+2+a)=4+ab\le 1+(1+2+a)=4+a with b10(3+a)b\ge 10-(3+a). Counting: a=3: b{4,5,6,7};a=4: b{5,6,7,8}.a=3:\ b\in\{4,5,6,7\};\qquad a=4:\ b\in\{5,6,7,8\}. That is 4+4=84+4 = \boxed{8} sets.

The computation

Test every four-sauce set directly: form all its subset sums and check that 11 through 1010 are all reachable. Eight sets pass.

import itertools as it
def covers(S, top):
    sums = {0}
    for x in S: sums |= {s + x for s in sums}
    return all(t in sums for t in range(1, top + 1))
print(sum(covers(S, 10) for S in it.combinations(range(1, 11), 4)))   # 8

Extra Credit

For “Hotter Ones,” the sauces run 11 to 100100. Let NN be the fewest sauces needed to generate every value from 11 to 100100. For how many sets of NN sauce numbers is it possible?

Solution

With NN sauces there are only 2N12^N-1 nonempty subset sums, so covering 100100 values needs 2N11002^N-1\ge100, forcing N7N\ge7; and {1,2,4,8,16,32,64}\{1,2,4,8,16,32,64\} shows N=7N=7 suffices. Counting all 77-element subsets of {1,,100}\{1,\dots,100\} whose subset sums cover 11 to 100100 (each must start at 11, grow contiguously until the running total reaches 100100, after which the remaining sauces are free) gives N=7,# sets=1014.N = 7,\qquad \#\text{ sets} = \boxed{1014}. (The source’s count is behind its paywall; this is my own enumeration.)

The computation

Count valid 77-sets by the contiguous-coverage rule: choose sauces in increasing order, each at most one past the running total (so subset sums stay gap-free), until coverage reaches 100100, after which any larger sauces complete the set.

from math import comb
from functools import lru_cache
N = 7
@lru_cache(None)
def cnt(k, last, reach):           # k chosen, last value used, coverage [0, reach]
    if k == N: return 1 if reach >= 100 else 0
    if reach >= 100: return comb(100 - last, N - k)     # remaining sauces are free
    return sum(cnt(k + 1, v, reach + v) for v in range(last + 1, min(100, reach + 1) + 1))
print(cnt(1, 1, 1))                # 1014   (every set must start with sauce 1)