# 周辺度数条件の行列を作る

• n次元分割表でn軸の個のカテゴリ別に識別する、長さのベクトルを並べた行列をつくる
> A
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12]
[1,]    1    0    1    0    1    0    1    0    1     0     1     0
[2,]    0    1    0    1    0    1    0    1    0     1     0     1
[3,]    1    1    0    0    0    0    1    1    0     0     0     0
[4,]    0    0    1    1    0    0    0    0    1     1     0     0
[5,]    0    0    0    0    1    1    0    0    0     0     1     1
[6,]    1    1    1    1    1    1    0    0    0     0     0     0
[7,]    0    0    0    0    0    0    1    1    1     1     1     1
[8,]    1    1    1    1    1    1    1    1    1     1     1     1
[9,]    0    0    0    0    0    0    0    0    0     0     0     0
[,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22]
[1,]     1     0     1     0     1     0     1     0     1     0
[2,]     0     1     0     1     0     1     0     1     0     1
[3,]     1     1     0     0     0     0     1     1     0     0
[4,]     0     0     1     1     0     0     0     0     1     1
[5,]     0     0     0     0     1     1     0     0     0     0
[6,]     1     1     1     1     1     1     0     0     0     0
[7,]     0     0     0     0     0     0     1     1     1     1
[8,]     0     0     0     0     0     0     0     0     0     0
[9,]     1     1     1     1     1     1     1     1     1     1
[,23] [,24]
[1,]     1     0
[2,]     0     1
[3,]     0     0
[4,]     0     0
[5,]     1     1
[6,]     0     0
[7,]     1     1
[8,]     0     0
[9,]     1     1

n<-4
rs<-sample(2:4,n,replace=TRUE)
R<-prod(rs)
Arr<-array(0,rs)