サイズKの0-1行列の可能なすべての組み合わせをNで生成するにはどうすればよいですか?Pythonで0-1のすべての可能な組み合わせを生成する方法は?
たとえば、K = 2、N = 2とすると、次の組み合わせが得られます。
combination 1
[0, 0;
0, 0];
combination 2
[1, 0;
0, 0];
combination 3
[0, 1;
0, 0];
combination 4
[0, 0;
1, 0];
combination 5
[0, 0;
0, 1];
combination 6
[1, 1;
0, 0];
combination 7
[1, 0;
1, 0];
combination 8
[1, 0;
0, 1];
combination 9
[0, 1;
1, 0];
combination 10
[0, 1;
0, 1];
combination 11
[0, 0;
1, 1];
combination 12
[1, 1;
1, 0];
combination 13
[0, 1;
1, 1];
combination 14
[1, 0;
1, 1];
combination 15
[1, 1;
0, 1];
combination 16
[1, 1;
1, 1];
さらにアルゴリズムの質問に似ています - > http://programmers.stackexchange.com/ – tomasyany