Manuscript Offprint
arXiv:2610.32251The Minimum Number of Samples in the Labeled Coupon Collector Problem
Andrew Tan Daniella Bar-Lev Ryan Gabrys Zohar Yakhini
Paul H. Siegel
October 26, 2026
The work of Z. Yakhini was funded by the European Union (DiDAX, 101115134). Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the granting authority can be held responsible for them. The work of D. Bar-Lev was supported in part by Schmidt Sciences. The work of D. Bar-Lev, R. Gabrys, A. Tan, and P. H. Siegel was supported in part by NSF Grant CCF-2212437. (Andrew Tan and Daniella Bar-Lev contributed equally to this work.)
Part of this work was presented and published at the IEEE Information Theory Workshop (ITW), Sydney, Australia, 2025 [19].
Abstract
The Labeled Coupon Collector Problem (LCCP) is an extension of the classical Coupon Collector Problem (CCP) in which one must deduce an unknown mapping between coupons and labels by collecting unordered subsets of k coupons and their associated labels, where deduction relies on analyzing the intersections and differences of the unordered subsets. In this work, we establish a fundamental connection between the LCCP and the combinatorial theory of separating systems. Using this framework, we completely characterize the minimum required number of samples to deduce all labels in two settings: Type-I, where the label set is known in advance, and Type-II, where it is unknown. We provide deterministic constructions of minimal separating and covering systems, yielding explicit bounds that are tighter than those found in existing literature. Furthermore, we extend our analysis to the partial recovery problem, characterizing the minimum number of samples required to identify a specified number of target coupons.
1 - Introduction
The Coupon Collector Problem (CCP) [10],[11] is a classical combinatorial problem dating back to De Moivre, Euler, and Laplace, which can be described as follows. Consider a promotional contest in which a prize is won by collecting at least one of each type of coupon distributed in packages of a certain product. Assuming the number of coupon types is a finite number and that each package contains exactly one coupon, opening a package can be viewed as sampling one coupon independently and uniformly at random with replacement from the set of possible coupon types. The CCP investigates the number of samples, , needed to collect all coupon types. Specific problems of interest include finding the minimum, expectation, and other properties of the distribution of . The minimum is trivially seen to be . The sample counts between collecting distinct coupon types are independent geometric random variables; thus, the expectation is found to be , where denotes the -th harmonic number [10]. Formulas for higher moments of can be computed [14], and limit theorems for the asymptotic distribution of have also been studied [9], [3].
A notable extension of the CCP is the group drawing scenario, corresponding to distinct coupons per package, or distinct coupons drawn per sample with replacement, for some fixed constant . Properties of the number of samples, , needed to collect all coupon types and related quantities have been studied in, e.g., [6, 12, 18, 1, 4]. The minimum number of samples needed to collect all coupon types is trivially .
Several other variants and generalizations of the CCP have been proposed, and applications are found in a wide range of mathematical, scientific, and engineering disciplines. An extensive list of references of a fundamental and applied nature can be found in [7].
In this paper, we introduce a new generalization of the CCP called the Labeled Coupon Collector Problem (LCCP) that combines aspects of both collection and inference. Again using a contest analogy, each of the n coupon types is uniquely associated with a distinct tag or label, and each package contains a subset of distinct coupons and their associated labels. More formally, we view each package as a sample containing two unordered sets: the k distinct coupons drawn uniformly at random with replacement, and their k associated labels. If , the association between coupon types and labels cannot be immediately deduced. To win the contest, one must correctly identify the label associated with each coupon type by combining the information gained from multiple packages. We are interested in the number of samples, , needed to establish the correspondence. In particular, the main objective of this paper is the investigation of the
- Introduction
3
minimum possible value of . Unlike the previously mentioned variants, analyzing the minimum in the current context is not trivial.
We consider two settings: Type-I, where the label set is known in advance, and Type-II, where it is unknown, with corresponding number of samples and . To illustrate how labels are deduced in both settings, consider the following example, which is depicted graphically in Figure 1.
Example 1. Suppose there are coupons with corresponding labels , and we draw coupons per sample. Suppose the first two samples are given by:
-
coupons and labels , and
-
coupons and labels .
Since coupon 2 appears in both samples, we deduce the correspondences . In the Type-I setting, we further deduce via elimination that . However, the correspondence cannot be deduced from these two samples in the Type-II setting because the label has not been drawn and the set of labels is not known in advance. A third sample is required, such as:
- coupons and labels .
As mentioned, in contrast to the CCP and the group drawing CCP, finding the minimum number of samples, and , needed to deduce the labels associated with the coupon types in the Type-I and Type-II settings of the LCCP, respectively, is not trivial for . This is the focus of this work. We demonstrate that this task is mathematically equivalent to finding minimal separating systems, a concept previously studied by Rényi [16, 17] and Katona [13]. Building upon their foundational work, we provide a full characterization of and , develop explicit combinatorial constructions for sequences of samples that achieve the minimum, and establish tight bounds that improve upon the corresponding classical results for separating systems [13, 21]. We also extend our framework to the partial recovery setting, where the labeling of only a subset of coupons needs to be identified.
In addition to the mathematical allure of these questions, they can also be relevant in practical applications. For example, consider the “traffic analysis problem”, in which the objective is to keep the identities of pairs of senders and recipients in a communication network confidential. First defined in [8], a Chaumian threshold mix is an anonymity protocol designed to unlink sender-recipient pairs by collecting messages and only forwarding them once a predetermined number (the threshold) has been received. It does so through a mix node, which collects incoming packets and flushes them in batches of size k to their receivers, intentionally stripping explicit routing headers [5, 20]. A passive adversary effectively has access only to the unordered sets of senders and recipients in the mix node. Such an adversary could theoretically reconstruct the sender-recipient pairs by analyzing multiple batch flushes over time in an intersection attack [15] similar to what is done in Example 1. The LCCP serves as an abstraction of this problem that could help to analyze the effectiveness of this protocol. It should be noted that real mixes face users who send at different rates, one-to-many communication patterns, and dummy/cover traffic. Hence, the LCCP model offers a fundamental-limits idealization
We do not consider the expectation here. In [19], we conjectured that and . These conjectures were confirmed in [2].

Figure 1: Deduction of labels as described by Example 1. For detailed explanation, see Example 1 text.
of the threshold-mix base case, rather than a direct model of any deployed system. Nevertheless, as also discussed in Section V, some of these scenarios can be addressed by generalizations of the LCCP model.
The remainder of this paper is organized as follows. Section II introduces the formal definition of the LCCP and rigorously establishes its connection to Katona's separating systems. Section III completely characterizes the minimum number of samples for full recovery and provides new bounds on the minimum that improve upon those obtained from previous bounds on separating systems. Section IV extends these deterministic constructions to the partial recovery problem. Section V summarizes the results and points to open directions.
2.1 • Problem Statement and Notations
Let be a set of coupons, be an alphabet of labels with , and be a bijective labeling function assigning each coupon a unique label
. For a fixed sample size , let be the -th sampled subset of coupons, with labels given by , where . The sampled subsets and their corresponding labels are given as unordered sets for all .
We define the random variable as the first sample in which f can be determined, i.e., each coupon's label can be deduced via set operations on the system of sampled pairs
We consider this problem in two settings: one where the label alphabet L is known at the start, and one where L is unknown; we refer to the corresponding LCCP problems as Type-I and Type-II respectively. Now, we can define the LCCP.
Problem . For a fixed positive integers such that , find the:
(1) Minimum of , namely, the smallest possible value that can take on. This is denoted
for Type-I and Type-II, respectively.
(2) Expectation of
(3) Variance of
(4) Distribution of
In this work, we address item (1), the (deterministic) minimum number of samples.
2.2 • Connection to Separating Systems
Now, we give exact conditions on when a coupon's label can be determined. We first define the concept of separability in a finite set.
Definition 2. Given and subsets , we say that:
-
separates two distinct coupons if exactly one of them is contained in .
-
j is separable given if for every , at least one separates and . Moreover, if every coupon is separable given , then is a separating system for .
-
is a covering system (or covers ) if every coupon is contained in at least one sample for some .
Note that the definition of a separating system is identical to the one in [13]. We also define the concept of an index set.
Definition 3. Given coupon and a system of subsets , we define:
• the index set of j as the set ,
-
the preorder and equivalence relation on such that if and if , and
-
the separation class of j as the set obtained by the following intersection of sets:
where is the set complement of in , and where we adopt the convention that the intersection over an empty index set yields the universal set .
It is clear that is a preorder (reflexive and transitive) and that is an equivalence relation since they inherit these properties from set inclusion and set equality, respectively. Note that becomes a partial order if and only if is a separating system, as antisymmetry is satisfied only when all index sets are distinct.
We have the following properties that establish an equivalent characterization of separability.
Lemma 4. Given and a system of subsets :
(a) separates and if and only if .
(b) is the smallest set containing j that can be generated by set operations on .
(c) if and only if . Consequently, separation classes are the equivalence classes with respect to .
(d) if and only if is separable. Consequently, this holds for all if and only if is a separating system.
Proof. We prove each part directly.
(a) separates and if and only if there is an that contains either or but not both. Equivalently, is contained in either or but not both, which holds if and only if , i.e., .
(b) By definition, if , then so . Observe that any set generated via set operations on can be written as a disjoint union of sets in . Because is a set containing , any set that contains must also contain . Hence, is the smallest set containing that can be generated via set operations.
(c) If , then and , which means that . Conversely, if , then from part (b), , which means that whenever , and so . Repeating this argument for will give us and .
(d) Since , then by part (c), if and only if for all , and by part (a), this holds if and only if separates and for all , or equivalently that is separable.
□
For coupon , its separation class can be viewed as the set of coupons that cannot be separated from given . Thus, Equation (1) establishes a canonical representation for each singleton if is a separating system, allowing us to establish Theorem 5.
Theorem 5. For any , , the label of every coupon can be determined given if and only if is a separating system (additionally a covering system in the Type-II setting).
Proof. In the Type-II setting, determining every coupon's label requires every label to be observed at least once. This implies , so by the bijectivity of , . Therefore, being a covering system is a necessary condition for determining every coupon's label in the Type-II setting.
Next, we show that if every coupon's label can be determined given , then is a separating system. As in the proof of Theorem 4, the smallest set of labels containing that can be obtained via set operations on is:
Therefore, if the label of every can be determined, we must have . Moreover, must be the smallest set of labels containing that can be obtained in this manner. By bijectivity and the definition of , we obtain and for all , which means is a separating system.
Conversely, if is a separating system (additionally a covering system in the Type-II setting), then by Theorem 4, the label of coupon is the sole element of .
Remark 1. Thus, the minimum number of samples required to deduce the label of all n coupons is mathematically equivalent to the minimum number of subsets required to form a separating system for [n] (additionally a covering system in the Type-II setting).
Finally, we define the draw matrix, which was also utilized by [13].
Definition 6. Given and subsets , the draw matrix corresponding to is a binary matrix such that when .
Remark 2. In the -LCCP, each row of M has Hamming weight k and represents a sampled subset, and each column corresponds to a coupon. Therefore, it is clear that being a separating system is equivalent to the following conditions:
• the index sets are distinct,
• the columns of M are distinct.
Similarly, being a covering system is equivalent to the following:
• the index sets are all nonempty,
• the columns of M are all nonzero (i.e., have nonzero weight).
2.3 · Deducing Labels from Separating Systems
Suppose we can construct a separating system and now want to use it to determine the label of each coupon. This can be done directly using Equation (2) by performing set intersections. However, this is inefficient, as we can exploit the fact that from Theorem 3 is a partial order on given a separating system. Namely, the coupons have distinct index sets and thus are never equivalent with respect to .
We focus our attention on maximal elements with respect to , i.e., coupons whose index sets are not proper subsets of any other index set. Clearly, given a separating system, coupons that appear most frequently in the samples will be maximal elements with respect to .
Lemma 7. Given where is a separating system, let such that . Then:
Proof. Suppose we have such that , which holds if and only if for all . This implies and , but since is defined to have maximum frequency, then we must have and . Moreover, since is a separating system, every index set is distinct, so this equality holds if and only if .
Remark 3. By applying Theorem 7, we can obtain the label of a maximal element . Because the index sets of the remaining coupons are static, their frequencies and relative ordering with respect to never change. Thus, we can simply determine , extract it from the pool of unknown labels by updating for all , and proceed to the next maximal coupon. By induction, this process determines the label of every coupon, as outlined in Algorithm 1. This significantly reduces the number of set operations compared to applying Equation (2) directly.
Remark 4. We briefly analyze the computational complexity of Algorithm 1. During preprocessing, computing the index sets and frequencies takes time and space. Since the maximum possible frequency is m, we can sort the coupons in time using bucket sort. Inside the loop, the total time spent computing intersections and removing labels across all iterations is bounded by the sum of the sizes of the label sets. Specifically, intersecting sets of size k for coupon j takes time. Summing this cost over all n coupons yields . Thus, the overall time complexity using bucket sort is with a space complexity of
Algorithm 1: Greedy Intersection–Peeling Algorithm
Input: Separating system of sampled subsets .
Output: All coupon-label correspondences extracted from intersections of the sets in .
Preprocessing:
Let be the set of coupons not yet extracted.
for do
Compute and store the index set .
Compute and store the frequency .
Sort the coupons in in decreasing order of .
while do
Pop the first element from the sorted (which has maximum frequency).
Compute the intersection .
Set and output .
Remove from for all .
. If m happens to be exceptionally large (e.g., ), one might opt for a standard comparison-based sort instead. This is a massive improvement over a naive application of Equation (2), which would require set operations taking exponential scaling in the worst case.
Example 8. Consider the Type-I (8, 4)-LCCP, where we receive samples
Observe that is a separating system and corresponds to the draw matrix:
By comparing the index sets, we can obtain the Hasse diagram of the coupons with respect to , given by Figure 2.
We identify coupon 1 as the maximal element with respect to , so from Theorem 7 we first determine by performing . After deleting 1 and from the samples, we can repeat this process for coupons 2, 3, and 4, which all appear twice in , and then we repeat the process for coupons 5, 6, and 7 which all appear only once. Finally, the label of coupon 8 is obtained immediately once every other label has been removed from .
So far, we have discussed equivalent conditions and methods for determining the labels of coupons in the LCCP using the concept of separating systems. We will use separating systems in the next section to analyze the absolute minimum number of samples to deduce every coupon's label.

Figure 2: Hasse diagram of the coupons partially ordered by for Example 2.
3 · Full Recovery Minimum
In this section, we find the minimum number of samples for the -LCCP in both Type-I and Type-II full recovery settings. In other words, we find minimal separating systems, i.e., separating systems of consisting of the smallest possible number of k-subsets.
The draw matrix formulation is useful; if there exists with weight-k rows and distinct columns, then . Additionally, if the columns are nonzero, then . Therefore, a minimal separating system is given by a binary matrix with columns containing the smallest possible number of weight-k rows such that all columns are distinct. Existence of such matrices will be proved via deterministic construction.
We divide the discussion into three parts: Subsection A discusses fundamental results and properties of the minimum. Subsection B develops the full characterization of the minimum. Finally, Subsection C examines bounds on the minimum, including improvements on the bounds from [13, 21].
3.1 • Fundamental Results
We begin by establishing a few logarithmic lower bounds.
Lemma 9. For all with :
(a) , .
(b) .
(c) When (resp. ) in the Type-I (resp. Type-II) setting, the lower bounds on (resp. ) in (a) and (b) are equal and met with equality. Furthermore, if is not a power of 2.
(d) If , then .
Proof. Suppose separates and corresponds to . The columns of form a subset of , so , yielding the bounds in (a) (for Type-II, exclude the all-zero vector). Moreover, across all vectors in , each coordinate contains exactly ones, so , yielding the bound in (b).
To prove (c), we construct for corresponding to a separating system for . Let the columns of consist of the all-ones vector, the all-zero vector, and distinct pairs of nonzero vectors that are complements of each other, which exist because . This yields a separating system for ; a separating and covering system for is obtained by deleting the all-zero column. Furthermore, if is not a power of 2, we obtain a separating and covering system for by selecting distinct pairs of nonzero vectors that are complements of each other, which exist because .
(d) holds since when .
Remark 5. When k is a power of 2, the draw matrix for the Type-II setting constructed in Lemma 9, part (c) is the parity check matrix of a Hamming code. Moreover, the respective draw matrix for the Type-I setting can be viewed as a binary splitting of the coupons where in each sample, the separation classes are split (approximately) in half. It will be seen later that the bounds in (a) become loose when n is much larger than k.
By computing the lower bound in Theorem 9 across all k for fixed n, we observe that
and
which gives the following result for when the subsets can be of any cardinality.
Corollary 10. Suppose we have coupons and can sample subsets of any size. Then, the minimum number of samples to deduce the label of each coupon is in the Type-I setting and in the Type-II setting.
Proof. Clearly, these are lower bounds since the bounds in Theorem 9(a) do not depend on the size of the sampled subsets. Moreover, these bounds are tight since we can simply pick any n distinct (resp. and nonzero) columns to construct a separating (resp. and covering) system.
From Theorem 5, it is clear that , though we can characterize the relationship further.
Lemma 11. For any :
Moreover, when . Consequently, and are 1-Lipschitz functions with respect to n for fixed k.
Proof. Suppose . Let and be a separating system corresponding to , so each row of has weight , and the columns are distinct. If covers , then we can conclude that . If not, assume, without loss of generality, that the last column of is the all-zero vector. By Theorem 9(b), , so there is a nonzero that is not a column of .
We proceed iteratively to transform the last column into v. For each row index i where , we transfer a 1 from one of the first columns to the last column. Since this transfer only occurs in rows where , it is impossible for any of the first columns to become v. So it suffices to ensure that for all i where , we can select at least one column whose 1 in row i can be transferred while keeping the first columns distinct.
Consider any such row i. The only way to create a duplicate column is to transfer a 1 from a column that, after the flip, becomes identical to another existing column. Excluding the last column, let be the number of columns with a 1 in row i and be the number of columns with a 0. Since the row weight is k and the last column is now 0, we have and . The difference is:
Since , we have , meaning . Thus, there are strictly more potential donors (columns with 1) than potential conflicts (columns with 0), ensuring there is always at least one valid choice of column for the transfer.
Next, suppose . It is clear that , since a separating and covering system for is a separating system for (by adding an all-zero column). To prove the converse, start with a separating system for corresponding to . If has an all-zero column, we can delete it to obtain the result. Otherwise, assume has no all-zero column. The strategy is to transfer every 1 from the last column to a column that currently has a 0, while keeping columns distinct, and then delete the resulting all-zero last column.
Consider any row where the last column has a 1. The only way to create a duplicate column is to transfer the 1 to a column that, after the flip, becomes identical to another existing column. Excluding the last column, let be the number of columns with a 1 and be the number of columns with a 0. Since the row weight is k and the last column is 1, we have and . The difference is:
Since , we have , meaning . Thus, there are strictly more potential receivers (columns with 0) than potential conflicts (columns with 1), ensuring there is always at least one valid choice of column to receive the 1.
Finally, suppose for . Let and be a separating system corresponding to draw matrix . By the hypothesis, does not cover , so there will be exactly one all-zero column in , denoted as column . Then, define by inserting in a weight- row with a 1 in the -th column. Now, all columns of are nonzero and distinct, so .
Example 12. Consider the case and , where and are at least 3 by Theorem 9. Let be the following draw matrix:
Note that M corresponds to a separating system but not a covering system. To remedy this, we must transfer ones to the fifth column to change it into a nonzero column vector that is not identical to an existing column of M. There are three options: , , and . Here, we pick , which means the transfer occurs in the first row of M. The donor candidates in row 1 are columns 1, 2, and 3, but note that column 1 matches with column 4 in both rows 2 and 3, so the only valid choices of columns to transfer from are columns 2 and 3. We transfer the 1 from column 2, so the new column 2 is and the new column 5 is . Then, the modified draw matrix is:
Observe that now is a valid minimal Type-II draw matrix obtained from M.
An immediate consequence of Theorem 11 is the following monotonicity property.
Corollary 13. When ,
We also have the following symmetry property for the Type-I minimum which was also proved in [13].
Lemma 14.
Proof. Take any matrix with weight-k rows and distinct columns; its component-wise complement will have weight- rows and distinct columns, so . Applying the same argument in the other direction yields the result.
Remark 6. It follows from Theorems 11 and 14 that the scope of computing and can be reduced to the regime , since if , then .
Next, we can upgrade Theorem 13 by showing a full ordering of and with respect to n and k for when one of the parameters is fixed. This is done in Theorems 15 and 16.
Lemma 15. For and :
(a) If , then .
(b) If (or ), then .
(c) If , then .
(d) If (or ), then .
Proof. We prove each part by starting with a minimal draw matrix M and modifying its rows. In each row, we must select a candidate column to modify without creating a duplicate. A conflict occurs only if modifying a candidate makes it identical to an existing column that differs only in that row. By comparing the number of available candidates ( ) and potential conflicts ( ), the Pigeonhole Principle guarantees a safe choice whenever . To additionally ensure we do not create the forbidden all-zero column, we require .
(a) This was given by Theorem 13.
(b) We flip a 0 to a 1 in each row of (which has weight ). Here, (number of 0's) and (number of 1's). Since , . This ensures a safe 0 to flip (and adding 1's cannot create an all-zero column). Thus, .
(c) We append a column of zeros to and transfer a 1 to it in rows where a new non-zero target vector (which exists since ) has a 1. Here, and . Since , . This guarantees a safe 1 to transfer while avoiding the all-zero column. Thus, .
(d) We flip a 1 to a 0 in each row of (which has weight ). Here, and . Since , . This guarantees a safe 1 to flip without creating an all-zero column. Thus, .
□
Lemma 16. The inequalities in Theorem 15 also hold for the Type-I minimum.
Proof. The results follow by utilizing the same modification strategies established in the proof of Theorem 15. Because the Type-I setting permits the all-zero column, distinctness is the only constraint, which requires . This condition is strictly satisfied across all four cases.
Corollary 17. For positive integers n, k with n > k:
Proof. Immediate from Theorems 9, 15 and 16.
Lemma 18. For such that :
(1) , and
(2) .
Proof. Let and correspond to a separating and covering system for for , and define as:
Then, observe that M will have weight-k rows and distinct nonzero columns (since neither nor contains all-zero columns), so subadditivity in (1) holds. Subhomogeneity in (2) is obtained via repeated applications of subadditivity.
Remark 7. From Theorem 18, one can immediately derive upper bounds on the minimum when k is fixed. In particular, this provides a simple method for constructing a separating system by combining multiple smaller separating systems, with the tradeoff being that the combined separating system is not necessarily minimal.
3.2 · Full Characterization
We begin with a lower bound that is useful when n is much larger than k.
Lemma 19. and .
Proof. Consider any separating system for some corresponding to draw matrix . For , let be the number of weight- columns, so and (since columns are distinct). Then, the total number of ones in is
implying .
The bound for Type-I follows from , and for Type-II from .
Remark 8. The bound in Lemma 19 is tight when (see Theorem 26), whereas the bound in Theorem 9 is loose in this regime, as illustrated by Theorem 20.
Example 20. Consider the Type-II (15, 5)-LCCP and subsets shown in Figure 3, where row corresponds to set and column corresponds to coupon . It can be seen that , and that separates and covers [15], achieving the lower bound .
The proof of Theorem 19 suggests that it may be useful to consider the dual problem: namely, given a fixed number of samples m and drawing size k, what is the maximum number of coupons whose labels can be determined in m samples? This can be achieved by using low column weights in the draw matrix, such as in Theorem 20 where each column has a weight of 1 or 2. The analysis of such matrices is facilitated by introducing the following definitions.
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 1 | |||||||||||
| 1 | 1 | 1 | 1 | 1 | |||||||||||
| 1 | 1 | 1 | 1 | 1 | |||||||||||
| 1 | 1 | 1 | 1 | 1 | |||||||||||
| 1 | 1 | 1 | 1 | 1 |
Figure 3: Visualization of a separating and covering system achieving the minimum of 5 samples for the Type-II (15, 5)-LCCP.
Definition 21. Denote the volume of a Hamming ball in with radius as . For such that , define its minimum Hamming radius as the smallest value of such that . In other words,
Definition 22. Given such that , we say that a binary matrix is -almost regular if every column has weight and every row has weight either or .
Remark 9. By dividing both sides of the inequality condition in Equation (6) by , we obtain the inequality , where . The left-hand side can be written as , where is binomially distributed with parameters and . Thus, is the inverse binomial cdf of with respect to parameters and .
A useful result is that for certain values of , we can guarantee the existence of an almost-regular matrix via construction.
Proposition 23. Given such that , then there exists a -almost regular matrix such that the columns of are distinct, and more than rows have weight .
Proof. See Appendix.
□
Lemma 24. For a fixed , let be any integer such that . Define:
Then the sequence is strictly increasing with . Furthermore, and .
Proof. We prove the result for . The result for will follow immediately from Theorem 11, since it will be shown that .
First, we present the following necessary condition for the existence of a separating and covering system. With sampling of subsets of size , we claim there exists corresponding to a separating and covering system for only if there exist integers such that
In other words, to prove , we must show that a valid draw matrix for coupons exists when the number of rows is , but no such matrix exists when the number of rows is . Thus, we evaluate the system of equations (9) specifically for . We will demonstrate this after establishing that a solution exists for with rows, and providing an explicit construction for a separating and covering system.
Set , and consider the following maximization problem:
Expressed in terms of the well-known knapsack problem, the goal here is to maximize the number of items carried, given a total weight limit of and a supply of items of weight , for . Note that the maximum of (10) is an upper bound to the maximum value of where a solution to (9) exists, though we later observe that these two quantities are equal. Observe that one maximizer for (10) is:
Indeed, since , then
The value is exactly the remainder of dividing the leftover capacity by , meaning . No more items can be added because the remaining capacity is , and the supply of all items with weight is already fully exhausted. Furthermore, no item can be replaced by two other items to increase the total count: removing our heaviest item and adding our maximum leftover budget yields a maximum available capacity of . Because the lightest available items have weight , acquiring two new items requires a capacity of at least .
Thus, a 1-for-2 swap is strictly impossible. Moreover, the total number of items is .
The values in (11) do not necessarily satisfy . However, if , this can be fixed by decreasing by 1, and increasing by 1. This is valid because our greedy assignment set , allowing us to safely increase it without violating the upper bound. Furthermore, corresponds either to a fully populated weight class (if ) or a populated one (if , where because the leftover capacity is a multiple of and cannot be exactly 1). This guarantees , ensuring we never decrease a variable below zero. Thus, this modification provides a solution to (9) when and the number of rows is .
Now, we construct with distinct, nonzero columns and weight-k rows. Note that if , then we would have and , and so the columns of will consist of all distinct nonzero vectors in . Thus, we assume that .
Let be the set of weight-w tuples for . The total number of 1's in each row in is , and . Inserting the tuples in as columns of tentatively gives it 1's in each row and columns. We then populate the rest of using weight- columns. Since , then by Theorem 23, there exists a -almost regular matrix with distinct columns and more than rows with weight . Inserting this as a submatrix of will give us the correct number of columns, but there may still be rows with weight .
Namely, there are such “deficient” rows with weight , where . If , then we resolve the deficiency by finding a column of weight with zeros in every deficient row. To see why such a column exists, note that when , contains the complete set of weight- vectors. Since , there exists at least one vector with ones exclusively outside the deficient rows. Alternatively, if , we need a weight- column with a zero in the single deficient row. Because , the number of columns in the almost-regular submatrix satisfies . Since the deficient row contains exactly ones within this submatrix, there is at least column with a zero in that row. We simply isolate this column and flip its zeros to ones, transforming it into a valid weight- column. Hence, this gives a separating and covering system for , so .
Additionally, for all , is the maximum of (10), and more importantly is the maximum for which can be separated and covered by samples. Since , can be separated and covered by samples (via Theorem 9 part (c)), so by maximality.
Finally, to show that , we show that no separating and covering system of exists for samples, namely, by showing that cannot be achieved in (10) with replaced by without violating the total weight constraint. Moreover, since is the maximum for which can be separated and covered by samples, this will also imply that , or in other words, is strictly increasing (note that if , then falls below the absolute minimum required samples established in Theorem 9, meaning no valid system can exist, so is strictly less than ).
We start with the earlier solution from (11), which now violates the supply constraint for each , and remove the “overfill” in each weight class. The total number of items removed is , and the total weight is decreased by . Since the total weight limit has been reduced by , then we must add items of weight at least so that their total weight is at most , where . However, since and , then , which means that the total weight limit cannot be satisfied with items. Therefore, .
Remark 10. Note that can be viewed as a threshold determining the maximum number of coupons whose labels can be deduced with m samples. Moreover, we note that although [13] proved the existence of a separating system if and only if a system of equations similar to (9) can be satisfied, our proof directly provides a method for constructing such a system using the proofs of Theorem 24 and Theorem 23. We provide the full construction in Algorithm 2 in the Appendix.
Moreover, when , observe that , so M will only have weight-1 or weight-2 columns (with a possible exception of one column), which will be useful for Theorem 26 below. Thus, Theorem 24 can be viewed as a generalization of Theorem 19 by more accurately counting the number of 1's in the draw matrix.
Finally, from this proof it is also apparent that if the setup of the LCCP were to be modified such that each subset has at most k coupons, then the minimum number of samples would still be the same. This can be seen by obtaining a minimal separating system before inserting 1's in the matrix to ensure every row has weight-k. This phenomenon was also observed in [13], and since we will use it to prove another result we state it here.
Lemma 25. For positive integers such that , is also equal to the minimum number of samples of subsets of size at most needed for a separating system.
Proof. Observation from Remark 10.
The following result is a consequence of Theorems 11, 15, 16, 19 and 24. It was first proved by other means in [13].
Lemma 26. Lemma 19 holds with equality if .
Proof. Consider the Type-II bound. Setting , observe that , so . By Theorem 24, , where , which can also be written as . Moreover, , so . By Theorem 15, .
Finally, by Theorem 19, . The respective expression for Type-I follows immediately from Theorem 11 since .
Corollary 27. for any .
Corollary 28. and .
Theorem 29 fully characterizes and .
Theorem 29. Given any , define the sequence for as in Theorem 24.
(a) If , then .
(b) If for some , then .
(c) If , then .
Proof. (a) follows from Theorem 26, and (c) follows from Theorems 11 and 14. If falls in (b), then by the proof of Theorem 24, , and by Theorem 15, , so .
Remark 11. Theorem 29 provides a procedure for finding the minimum values and .
(a) If , then the minimum is given by a simple formula.
(b) If , then an iterative search is performed to find m such that . (However, the calculation of from m in Lemma 24 is not readily inverted and therefore does not yield a closed-form expression for the minimum.)
(c) Otherwise, if , then symmetry (Lemma 14) can be invoked and one of the steps (a) or (b) will be applicable.
3.3 • Bounds on the Minimum
To address case (b) from Remark 11, we provide bounds on that will help limit the search. The first set of bounds were those proved by Katona [13]. The upper bound was later improved by Wegener [21].
Lemma 30. ([13] Theorem 5, 6) For any positive integers with , .
Lemma 31. ([21] Main Theorem) For with , , where .
Now, we present and prove new bounds.
Lemma 32. When , and .
Proof. First, let us find a separating system with subsets of size , where . Observe that if , then combining this with as well as Theorems 16 and 26 gives us . Note that is equivalent to . Letting be the smallest such that satisfies this property, then we have that .
Finally, since , then by Theorem 16, we have that . Moreover, .
Lemma 33. Suppose , and let . Then, .
Proof. We follow a similar constructive procedure as Wegener [21]: we begin with an empty matrix with columns, and in each step we add a block of rows. We assign a unique length- column pattern to each of the possible digits using the standard basis vectors and the all-zero vector. We index the columns from 0 to . In the -th step (block), the pattern assigned to a column is determined exactly by the -th digit of its index in base-. Because there are total columns, any specific base- digit appears at most times in any given position. Since , this guarantees that any specific pattern (and thus any 1 in the row block) is used at most times, strictly satisfying the LCCP capacity constraint.
Letting , , and , we split the construction into full steps and a final partial step. Each row has at most ones, so after full steps (i.e., rows), the columns are partitioned into possible groups, where the largest group of identical columns has size , which will be separated in the final partial step.
Viewing the number of rows m as a budget, we observe that we have a remaining budget of:
We must show that rows is enough to distinguish all columns in the remaining groups, where the largest group has identical columns. To separate a group of columns, we can add new rows as follows: for , in row we add a 1 at the -th column of the group and zeros elsewhere. Thus, what remains is to show that , i.e.,
Define real functions such that . Observe that for is convex, and is the line segment connecting and . By convexity, , so , and:
Finally, while this construction yields rows with weights strictly less than or equal to k (including the final partial rows which have weight exactly 1), Theorem 25 guarantees that this is mathematically equivalent to the existence of a valid minimal draw matrix with exactly weight-k rows. Thus, , concluding the proof.
Now, we compare the bounds that we derived with each other, as well as with the bounds from [13, 21]. Figure 4 shows plots of the Type-I minimum for (i.e., ) along with the bounds from Theorems 9, 19, 32 and 33, where the lower bounds are shown in Figure 4a and the upper bounds are shown in Figure 4b. Observe that the logarithmic bound from Theorem 9 is very loose when n is large, and the same can be said of the bounds by Katona [13] and Wegener [21]. Moreover, the bounds we derived are relatively tight, though finding an even tighter bound or approximation is an open problem.
Type-I LCCP minimum number of samples for k = 20

(a) Comparison of lower bounds.
Type-I LCCP minimum number of samples for k = 20
(b) Comparison of upper bounds.
Figure 4: Comparison of bounds on the smallest number of samples required for the -Type-I LCCP, where (a) shows lower bounds and (b) shows upper bounds. Our bounds are given as solid lines.
4 · Partial Recovery
In this section, we consider the partial recovery case where we need to determine only r of the coupons' labels for , whereas previously we considered the full recovery case with r = n.
Let denote the first sample in which the image of can be determined for coupons; i.e., there exists a subset of size such that can be determined for every . Accordingly, let and be the first such sample under the Type-I and II settings respectively, and let and denote their minimum possible values. Equivalently, (resp. ) is the minimum number of rows for a binary matrix with columns and weight- rows to have columns that appear exactly once in the matrix (resp. and are nonzero). Unlike with full recovery, the remaining columns can be anything, including zero or identical to each other.
We begin with the following observation.
Lemma 34. For all such that and , .
Proof. This is immediate from the observation that the property that a matrix needs to satisfy in the Type-II setting is stronger than that required for Type-I.
Since we only need to deduce the labels of r coupons, we expect that the number of samples required will be less than that required to deduce the labels of all coupons, espe-
- Partial Recovery
23
cially when r is much smaller than n. This can be seen through an analog of Theorem 9.
Lemma 35. For such that and ,
Proof. Since we require columns to appear exactly once, this means that any suitable draw matrix with rows has at least different columns, which means , implying . The same can be said about the Type-II setting, since we could have distinct nonzero columns and allow the rest to be zero.
Using this lemma as well as Theorems 15 and 16, we can find .
Theorem 36. Let be positive integers such that and , and let , i.e., the minimum number of samples to separate coupons for the full recovery case. Defining , we observe that the partial recovery minimum is determined by the ability to allocate ones into target columns. Namely, we have the three regimes:
(1) Starved Regime: If , then
(2) Flooded Regime: If , then
(3) Optimal Regime: If , then and achieve the absolute minimum , with the exception of two extreme cases requiring samples:
• .
• and .
Proof. For any draw matrix separating target coupons, we can represent it as a block matrix , where corresponds to the target coupons and to the remaining coupons. In every row, the ones must be distributed between and . Since the row weight of cannot exceed , the row weight of is constrained by . Let .
We prove the bounds by analyzing three regimes based on the capacity to allocate ones to M.
Case 1 ( ): Suppose a matrix corresponds to a separating and covering system for with weight . The block matrix separates and covers the first coupons, so . This holds for .
To prove the reverse inequality, let and consider a minimal partial recovery matrix . We extract the submatrix , which successfully separates and covers the target coupons. Since the row weight of is at most
, Theorem 25 gives . Moreover, since , Theorem 15 yields , establishing . If we are evaluating the Type-I minimum and contains an all-zero column, we can swap it with a nonzero column from to form a modified matrix. As we are only extracting an full recovery matrix to satisfy the lower bound for , we do not need to worry about creating duplicates in the remaining submatrix; we only need our extracted columns to be distinct and nonzero.
Case 2 (): Here, and . For the lower bound, let and consider any minimal matrix . The submatrix has a maximum row weight of , meaning has a minimum row weight of . We extract and consider its component-wise complement , which has distinct columns and a maximum row weight of . Since , we strictly have . Thus, the existence of and Theorem 25 implies . Applying Theorems 11 and 14, we obtain . Therefore, . The Type-I bound follows similarly.
To prove the reverse inequality, we construct where has weight and . Since , Theorems 11 and 14 yield . We construct by generating a matrix using the procedure from Theorem 24 for weight and taking its component-wise complement. For this to form a valid Type-II partial recovery matrix, must avoid both the all-zeros and all-ones vectors. natively avoids the all-zeros vector (ensuring avoids all-ones) since . Furthermore, avoids the all-ones vector (ensuring avoids all-zeros) because utilizing it would require full capacity, meaning and . This implies , yielding , which explicitly contradicts our regime condition .
Case 3 ( ): By Theorem 35, and are at least . We prove the upper bounds by allocating exactly ones to and the remaining ones to per row.
If is even (), we populate with complementary pairs of vectors in , strictly avoiding both the all-zeros and all-ones vectors. This ensures every row in has exactly ones. We then allocate exactly ones to in every row by assigning columns of to be all-ones vectors, and the remaining columns of to be all-zeros vectors. This validly achieves .
If r is odd, we evaluate three sub-cases:
- : We require the target columns to appear exactly once in the matrix. Because , must contain every non-zero vector in . Since , we have , meaning we must allocate at least one 1 to in every row. Thus, must contain at least one non-zero column. Since already exhausts all possible non-zero vectors of length , this column in will inevitably collide with a column in , violating the requirement that the target columns appear exactly once. Thus, rows are strictly insufficient.
To construct a valid matrix using rows, we populate the first rows of with all 2^m^* - 1 non-zero vectors, and assign exactly columns of to be all-ones vectors (with the remaining columns of being all-zeros). This creates a collision between the all-ones column in and the all-ones columns in . To resolve this, we append the -th row: we assign a 1 to the colliding columns in , a 0 to the all-zeros columns in , and distribute the remaining ones arbitrarily among the columns of , ensuring the column in that was previously all-ones receives a 0. This guarantees the all-ones column in
- Partial Recovery
25
becomes , strictly separating it from the columns which become . The all-zeros columns in become , which cannot collide with since every column in contains at least one 1 in the first rows.
-
: Here, . If , then , meaning must consist entirely of all-ones vectors. To avoid colliding with , cannot use the all-ones vector. Thus, must use every vector in except three (including 1). The three excluded vectors (e.g., 1, v, and ) naturally remove exactly two ones from every single row. Consequently, every row in is forced to have exactly ones. Adding the ones from yields a total row weight of , which strictly violates the weight constraint. This parity conflict occurs regardless of whether the all-zeros vector is permitted, meaning both Type-I and Type-II strictly require samples. Constructing a valid matrix requires inserting an additional row as done previously, yielding rows. If , the all-ones constraint on is relaxed, and rows suffice.
-
: We populate with vectors , , , followed by complementary pairs. This leaves nonzero vectors, which is sufficient to form the required pairs, achieving .
□
Remark 12. Thus, for the minimum number of samples, every case in the partial recovery scenario reduces to the full recovery scenario with different parameters. It can be seen that the Type-I minimum is almost identical to the Type-II minimum, where the only difference lies in the flooded regime where there is a “surplus” of ones that force many columns of the draw matrix to be all-ones. In this case, the allowance of an all-zero column could potentially give the Type-I setting an “advantage” over Type-II. Moreover, if the problem setting is changed so that each sampled subset can have a size of at most k, then the absolute minimum can be achieved in both the flood and optimal regimes.
We conclude the section with the following result for when each sample has at most k coupons rather than exactly k coupons.
Corollary 37. Let be the minimum number of samples of size at most k such that the label of at least r coupons can be deduced. Then:
Proof. The first case follows by Theorem 25. When , we construct a suitable draw matrix by simply choosing any nonzero columns from and then filling the rest of the columns with the all-zeros vector.
5 · Conclusion
We introduced the LCCP, an extension of the classical CCP where samples of n labeled coupons, taken uniformly with replacement, yield an unordered set of k coupons and an unordered set of their k associated distinct labels.
For the full recovery scenario, we provided a complete characterization of the minimum required number of samples, and , for the Type-I and Type-II settings, corresponding to a known and unknown label sets, respectively. By translating the subset drawings into a binary draw matrix formulation, we derived the exact threshold representing the maximum number of coupons whose labels can be deduced in m samples. Furthermore, we developed explicit block-matrix constructions that allowed us to establish upper and lower bounds that are significantly tighter than those previously established by Katona [13] and Wegener [21], particularly in regimes where n is much larger than k.
We also extended our deterministic framework to the partial recovery variation of the LCCP, where only a subset of target coupons must be identified. We categorized the partial recovery problem into three distinct regimes: Starved, Flooded, and Optimal. We demonstrated that in the optimal regime, the required number of samples natively achieves the unconstrained theoretical minimum , barring two highly dense edge cases that strictly require one additional sample due to parity and collision constraints.
Several interesting open directions remain for future work. One challenge is discovering an exact, closed-form expression for the minimum number of samples in the intermediate regime where , avoiding a computational search over . Additionally, while our constructed bounds significantly improve upon prior literature, finding even tighter bounds or analytical approximations remains an open problem. Finally, one can investigate practical applications of these results to Chaumian threshold mixes and other anonymity protocols by extension of the model. For example, by relaxing the definition of the mapping to be a general function (not necessarily a bijection), one can address the case of one-to-many communication patterns.
Bibliography
[1] I. ADLER AND S. M. ROSS, The coupon subset collection problem, J. Appl. Probab., 38 (2001), pp. 737–746.
[2] D. BARAK-PELLEG AND D. BEREND, On conjectures concerning the labeled coupon collector problem, preprint, arXiv:2510.23249, 2025.
[3] L. BAUM AND P. BILLINGSLEY, Asymptotic distributions for the coupon collector's problem, Ann. Math. Stat., 36 (1965), pp. 1835–1839.
[4] D. BEREND AND T. SHER, Asymptotic results for uniform group drawing in the coupon collector's problem, Stochastic Models, 42 (2026), pp. 455–468, doi:10.1080/15326349.2026.2669925.
[5] O. BERTHOLD, A. PFITZMANN, AND R. STANDTKE, The disadvantages of free mix routes and how to overcome them, in Proc. Design. Priv. Enhanc. Technol.: Workshop Design Issues Anon. Unobservability, Berkeley, CA, USA, 2000, pp. 30–45.
[6] C. BETKEN AND C. THÄLE, Approaching the coupon collector's problem with group drawings via Stein's method, J. Appl. Probab., 60 (2023), pp. 1352–1366.
[7] A. BONEH AND M. HOFRI, The coupon-collector problem revisited — a survey of engineering problems and computational methods, Commun. Stat. Stochastic Models, 13 (1997), pp. 39–66, doi:10.1080/15326349708807412.
[8] D. L. CHAUM, Untraceable electronic mail, return addresses, and digital pseudonyms, Commun. ACM, 24 (1981), pp. 84–90, doi:10.1145/358549.358563.
[9] P. ERDÖS AND A. RÉNYI, On a classical problem of probability theory, A Magyar Tudományos Akadémia Matematikai Kutató Intézetének Közleményei, 6 (1961), pp. 215–220.
[10] W. FELLER, An Introduction to Probability Theory and Its Applications, Vol. 1, Wiley, New York, NY, USA, 2nd ed., 1967.
[11] P. FLAJOLET, D. GARDY, AND L. THIMONIER, Birthday paradox, coupon collectors, caching algorithms and self-organizing search, Discrete Appl. Math., 39 (1992), pp. 207–229, doi:10.1016/0166-218X(92)90177-C.
[12] B. C. JOHNSON AND T. M. SELLKE, On the number of i.i.d. samples required to observe all of the balls in an urn, Meth. Comput. Appl. Probab., 12 (2010), pp. 139–154.
[13] G. KATONA, On separating systems of a finite set, J. Comb. Theor., 1 (1966), pp. 174–194.
[14] A. LEÓN-GARCÍA, A. PÉREZ, AND A. BOLÍVAR-CIMÉ, New easy to compute formulas for the moments of random variables appearing in the coupon collector problem, Probab. Math. Stat., 43 (2023), pp. 155–164, doi:10.37190/0208-4147.00130.
Bibliography
[15] N. MATHEWSON AND R. DINGLEDINE, Practical traffic analysis: Extending and resisting statistical disclosure, in Proc. Priv. Enhanc. Technol. Workshop, Toronto, Canada, 2004, pp. 17–34.
[16] A. RÉNYI, On random generating elements of a finite boolean algebra, Acta Sci. Math. (Szeged), 22 (1961), pp. 75–81.
[17] A. RÉNYI, Statistical laws of accumulation of information, Bull. Int. Statist. Inst., 39 (1962), pp. 311–316.
[18] W. STADJE, The collector's problem with group drawings, Adv. Appl. Probab., 22 (1990), pp. 866–882.
[19] A. TAN, O. LIMOR, D. BAR-LEV, R. GABRYS, Z. YAKHINI, AND P. H. SIEGEL, The labeled coupon collector problem, in Proc. IEEE Inf. Theory Workshop (ITW), Sydney, Australia, 2025, pp. 1–6, doi:10.1109/ITW62417.2025.11240383.
[20] J. VAN DEN HOOFF, D. LAZAR, M. ZAHARIA, AND N. ZELDOVICH, Vuvuzela: Scalable private messaging resistant to traffic analysis, in Proc. Symp. Oper. Syst. Princ., Monterey, CA, USA, 2015, pp. 137–152.
[21] I. WEGENER, On separating systems whose elements are sets of at most k elements, Discrete Math., 28 (1979), pp. 219–222.
Appendix
29
To prove Theorem 23, we start by considering simpler cases.
Proposition 38. Theorem 23 holds when , and and are coprime.
Proof. Let be the binary -tuple whose first entries are 1, and for , let be the tuple obtained via cyclic shifts of (e.g., ). Since and are coprime, the map is a bijection, and so contains all cyclically shifted versions of ; the claim is that can be constructed using as its columns.
Each row index can be viewed as a residue class modulo , and each can be viewed as a consecutive sequence of residue classes corresponding to the rows where has a 1. In particular, has 1's in positions ; more importantly, each is a "continuation" of the previous tuple, e.g., has ones in positions . This allows us to "chain" the 's together to form sequences of complete residue systems (i.e., ), where each complete residue system represents a 1 in every row. With , the number of complete residue systems formed by is , which is either or . Indeed, if , we have and , and so:
This tells us that there are complete residue systems and a remainder of consecutive residue classes. Therefore, will have rows of weight while the rest have weight as desired.
If m and w are not coprime, the proposition can be slightly generalized as follows:
Proposition 39. Theorem 23 holds when and , where .
Proof. Let and , which means that . With , then by Theorem 38 there exists whose columns are distinct and have weight , and more than rows have weight while the rest have weight . Then, by replacing each 1 in with an all-ones -tuple and each 0 with an all-zeros -tuple, we obtain with the desired properties.
We can finally prove the main proposition:
Proof. Denote the set of weight-w tuples as . First, observe that if , then , which means we can choose the entirety of as columns for , so let us assume that .
Consider the group action of cyclic shifts on , where can be partitioned into (possibly unequally-sized) orbits invariant under cyclic shifts with order dividing . Each orbit will have an equal number of ones per row (via symmetry), where the largest orbit will have ones per row. One such largest orbit is the orbit of , where the first entries of are 1.
Appendix
The sum of the number of ones per row across all orbits is , and since , then it is possible to obtain at least ones per row through insertion of orbits into . Moreover, since each orbit has at most ones per row, then it is possible to obtain at least but no more than ones per row through insertion of orbits except that of . We do exactly this; letting be the current number of columns and be the current number of 1's per row in , we have and .
The last step is to insert a subset of the orbit of with columns and ones per row so that will have columns and ones in more than of the rows (and ones in each of the rest).
Letting for be the tuple obtained via cyclic shifts of and , observe that the orbit of can be further partitioned into smaller "suborbits" of the form for (if , then nothing happens), where each has cardinality and exactly ones per row.
If is a multiple of we can simply insert a whole number of suborbits into , so suppose that for some , . Barring , we can use any suborbits and form the remaining part of with using Theorem 39. Indeed, will have a total of columns of weight , and will have rows where more than of them have weight , and the rest have weight .
Appendix
31
Algorithm 2: Construction of maximal LCCP draw matrix given number of samples m and row weight k
Input : Integers m (samples) and k (row weight). Output: Maximal integer n and binary matrix . // Step 1: The Knapsack Calculation (Determine max n) Initialize , Budget , ; Initialize array A where stores count of columns of weight w; while do MaxCols ; Cost ; if then ; ; ; ; else ; ; ; break; // Last full weight class ; // Partial weight class // Step 2: Construct Full Layers empty matrix with m rows; for to r do Generate all vectors of weight i; Append vectors to M as columns; // Step 3: Construct Partial Layer (Almost Regular) Generate base vector v of length m with 1s in first indices; Generate cyclic shifts ; Select first distinct vectors (prioritizing largest orbits if ); Append vectors to M; // Step 4: Deficiency Correction ; ; if then Find column c in M with weight having 0s in all rows in D; for do ; // Flip 0 to 1 end end
return n, M;