tl/dr: I need help with the "generate()" method described below... a nudge in the correct direction or perhaps, a good reference/tutorial/something that helps me understand dynamic programming better.
This example, from Keith Soper at Merck, illustrates the exact permutation Cochran-Armitage test carried out on permutation resamples. In the following data set, the 0s represent failures and the 1s ...
Combinatorial enumeration and pattern avoidance represent a vibrant area of modern discrete mathematics, where the objective is to count and characterise structures subject to specific constraints.