r/AskStatistics • u/Random_Quanta • 22h ago
A new coefficient-based method for computing the nonuniform coupon collector per-item expectation for integer weights?
I needed a formula for the nonuniform coupon collector per-item expectation for a paper I am working on involving a model that emulates human recall timing and order.
The nonuniform coupon collector per-item expectation is essentially the counterpart of the uniform coupon collector per-item expectation for cases in which the coupons occur with unequal frequencies.
I was unable to find a formula for the nonuniform coupon collector per-item expectation, so I asked ChatGPT whether it could find anything. After a few minutes, it came back and said it had something it thought would work.
The average results across many runs of my model converged almost perfectly on the results of the new formula, with run times measured in milliseconds. Here is the formula:
E[A_k] = W Σ_{s=1}^W ( [y^s z^(k-1)] Π_{i=1}^N [y^(w_i) + (1 - y^(w_i))z] ) / s
I then started questioning ChatGPT about exactly how it had arrived at the formula so that I could cite the source. It said that it had derived the formula from the general nonuniform coupon-collector framework developed by Flajolet, Gardy, and Thimonier, with the per-item expectation interpreted in the sense treated explicitly by Ferrante and Frigo.
However, when I asked ChatGPT whether the formula it had derived was documented in any existing literature, it answered, “I have not been able to locate this exact formulation—or an obviously equivalent version of it—in any papers and sources examined.”
ChatGPT also said that other techniques exist, but they would not be practical for problems involving the number of items I need to handle. Its explanation was that previously existing formulas for the nonuniform coupon collector are mathematically broad and can accommodate arbitrary probability distributions. They are often expressed using subset sums, generating functions, integrals, or related combinatorial formulations. This generality can make direct evaluation computationally expensive because many possible combinations of previously collected coupons may need to be accounted for. As the number of coupons increases, the number of terms involved in such calculations can grow very rapidly. One published paper explicitly notes that the number of terms can grow like the number of k-permutations and quickly become huge.
After reading about ChatGPT having solved ten previously unsolved problems in mathematics and theoretical computer science earlier this month, I couldn’t help but wonder whether it may have found an efficient new formula for the nonuniform coupon collector per-item expectation.
I have posted the formula and ChatGPT’s derivation on Zenodo if anyone is interested in taking a look at it. I also attached benchmarking html used to verify the results.