On Fri, Oct 14, 2011 at 2:25 PM, David Vaughan <[email protected]> wrote: > On a similar note, how might one approach the problem of trying to > essentially create all boolean lists of a particular size where there are at > least n 1's in a row? So for example, if n is 3, 1 1 1 0 1 1 1 0 0 1 1 1 is > accepted. I have a filter for checking whether any list is accepted, but not > for generating all of them, specifically any lists where there are more than > 2 groups of consecutive 1's. How could I either get this list 'directly' or > generate every possible list (and then use my filter)?
The simplest way of generating all boolean lists of a given size is: #:i.2^size -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
