美しい整数の世界 (780レス)
美しい整数の世界 http://rio2016.5ch.net/test/read.cgi/math/1686749616/
上
下
前
次
1-
新
通常表示
512バイト分割
レス栞
577: 132人目の素数さん [sage] 2024/05/08(水) 21:09:58.68 ID:o+7mX6D2 ■R # 宝の数を変化させる treasure0 <- function(m=3,n=4,k=2){ y=1:(m*n) (z=matrix(y,ncol=n,byrow=T)) (P=as.vector(z)) (Q=as.vector(t(z))) PQ <- function(x){ p=q=numeric(k) for(i in 1:k){ p[i]=which(P==x[i]) q[i]=which(Q==x[i]) } min(p)-min(q) } tre=combn(m*n,k) re=apply(tre,2,PQ) return(c(短軸有利=sum(re<0),長軸有利=sum(re>0),同等=sum(re==0))) } sapply(1:12,function(k) treasure0(3,4,k)) > sapply(1:12,function(k) treasure0(3,4,k)) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] 短軸有利 5 26 73 133 167 148 91 37 9 1 0 0 長軸有利 5 27 76 140 176 153 92 37 9 1 0 0 同等 2 13 71 222 449 623 609 421 202 64 12 1 http://rio2016.5ch.net/test/read.cgi/math/1686749616/577
メモ帳
(0/65535文字)
上
下
前
次
1-
新
書
関
写
板
覧
索
設
栞
歴
あと 203 レスあります
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.006s