分からない問題はここに書いてね460at MATH
分からない問題はここに書いてね460 - 暇つぶし2ch870:132人目の素数さん
20/07/03 21:16:16.50 90y63y3Z.net
>>810
プログラムを組んで数えさせた。
library(gtools)
pm=unique(permutations(8,8,v=rep(1:4,2),set=FALSE))
x2mat <- function(x) matrix(x,ncol=4,byrow=T) # vector-> matrix
x2mat(c(2,1,3,4,1,3,4,2)) # demo
fn <- function(x){
y=x2mat(x)
all(
all(1:4 %in% y[1,]), # 1st row includes all of 1:4
all(1:4 %in% y[2,]), # 2nd row includes all of 1:4
all(apply(y,2,diff)!=0) # difference in each column is not zero
)
}
idx=which(apply(pm,1,fn))
length(idx)
x2mat(pm[idx[100],]) # demo
"
identical after rotation : 'symmetric'
1234 1234
4321 4321
different after rotatio : 'asymmeric'
2134 2431
1342 4312
"
pm1=pm[idx,]
x2mat(pm1[216,]) # demo
fn1 <- function(x){
(y=x2mat(x))
(



次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch