>> From: Helmut Kahovec
Nicolas Ratier wrote:
>| I'm looking for help to use the Combinatorials Structures
>| packages.
>|
>| My problem is to generate the list of list :
>|
>| 000 i.e. [[0,0,0],[0,0,1],...,[1,1,1]]
>| 001
>| 010
>| ...
>| 111
>|
>| I known how to do it with "dirty" code, with binary conversion
>| and stuff like that ... I feel that the Combinatorials Structures
>| is perfect for that ... but how to code it ?
Hello Nicolas,
Well, I'd do the following:
> restart;
> with(combstruct):
> allstructs(Permutation([0,0,0,1,1,1]),size=3);
[[0, 0, 0], [0, 0, 1], [0, 1, 0], [0, 1, 1], [1, 0, 0], [1, 0, 1],
[1, 1, 0], [1, 1, 1]]
With kind regards
Helmut
|