(0,1)-Matrix

Author

Eric W. Weisstein
October 24, 2003

This notebook downloaded from http://mathworld.wolfram.com/notebooks/LinearAlgebra/01-Matrix.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/01-Matrix.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Enumeration

MatrixForm/@Matrices[2]

Length/@Matrices/@Range[5]//Timing

Table[2^(n^2),{n,5}]

Maximum Determinant

Complex matrix bound

Floor[Table[n^(n/2),{n,10}]]

Real matrix bound

Floor[Table[(n+1)^((n+1)/2)/2^n,{n,10}]]

Floor[Table[Sqrt[(2n-1)(n-1)^(n-1)],{n,10}]]

β={1,1,2,3,5,9,32,56,144,320,1458,3645,9477}

Max[Det/@Matrices[#]]&/@Range[4]//Timing

Table[Count[Det/@Matrices[i],β[[i]]],{i,4}]//Timing

Table[MatrixForm/@Select[Matrices[i],Det[#]==β[[i]]&],{i,4}]//TableForm

PCT

ByteCount[Matrix[5,1]]/1024.^2 10^6

ByteCount[Matrix[6,1]]/1024.^2 10^6

5 gives 3600

Matrices without adjacent 1s

OnesQ[l_List,n_Integer]:=First[l]==1&&Length[l]≥n

AdjacentOnesQ[l_List,n_Integer:2]:=MemberQ[Flatten[Split/@l,1],_?(OnesQ[#,n]&)]||MemberQ[Flatten[Split/@Transpose[l],1],_?(OnesQ[#,n]&)]

MatrixForm/@Matrices[2]

MatrixForm/@Select[Matrices[2],Not[Adjacent1sQ[#]]&]

MatrixForm/@Select[Matrices[3],Not[Adjacent1sQ[#]]&]

Table[Count[Matrices[i],_?(Not[AdjacentOnesQ[#,1]]&)],{i,4}]

Table[Count[Matrices[i],_?(Not[AdjacentOnesQ[#]]&)],{i,4}]

Table[Count[Matrices[i],_?(Not[AdjacentOnesQ[#,3]]&)],{i,4}]

MemberQ[Flatten[Split/@#,1],{1,1}]||MemberQ[Flatten[Split/@Transpose[#],1],{1,1}]&/@Matrices[2]

MatrixForm/Matrices[2]

Table[Count[MemberQ[Flatten[Split/@#,1],{1,1}]||MemberQ[Flatten[Split/@Transpose[#],1],{1,1}]&/@Matrices[i],False],{i,4}]