[過去ログ]
高校数学の質問スレ Part434 (1002レス)
高校数学の質問スレ Part434 http://rio2016.5ch.net/test/read.cgi/math/1712376048/
上
下
前
次
1-
新
通常表示
512バイト分割
レス栞
このスレッドは過去ログ倉庫に格納されています。
次スレ検索
歴削→次スレ
栞削→次スレ
過去ログメニュー
976: 132人目の素数さん [sage] 2024/05/08(水) 21:20:47.36 ID:80mTSPJI >>975 min(p)-min(q) は max(p)-max(q)ではないでしょうか? http://rio2016.5ch.net/test/read.cgi/math/1712376048/976
977: 132人目の素数さん [sage] 2024/05/08(水) 21:26:58.86 ID:o+7mX6D2 ■haskellに移植 import Data.List import Data.List.Split m = 5 -- 縦マス(短軸) n = 6 -- 横マス(長軸) k = 5 -- 宝の数 q = [0..m*n-1] matQ = chunksOf n q matP = transpose matQ --行列を転置して p = concat matP -- 配列に変換 combinations :: Int -> [a] -> [[a]] combinations 0 _ = [ [] ] combinations n xs = [ y:ys | y:xs' <- tails xs, ys <- combinations (n-1) xs'] treasure = combinations k q -- 宝の組み合わせ ip y = minimum $ map(\x -> elemIndices x p!!0) y -- 宝の、配列pでのindex列を求めて最小値を返す iq y = minimum $ map(\x -> elemIndices x q!!0) y idxp = map ip treasure -- 宝の組み合せで実行して idxq = map iq treasure p_q = zipWith (-) idxp idxq -- 差をとって大小判別 p1st = length $ filter (<0) p_q -- 短軸方向探索pが先に宝をみつける q1st = length $ filter (>0) p_q draw = length $ filter (==0) p_q main = do putStrLn $ "p1st = " ++ show p1st ++ ", q1st = " ++ show q1st ++ ", draw = " ++ show draw >matrix.exe p1st = 55469, q1st = 54036, draw = 33001 http://rio2016.5ch.net/test/read.cgi/math/1712376048/977
978: 132人目の素数さん [sage] 2024/05/08(水) 21:32:32.19 ID:80mTSPJI 宝の数と配置をランダムに決めるとして 15×2のマスでもこの程度の差(単軸有利)に終わった。 > summary(re) Min. 1st Qu. Median Mean 3rd Qu. Max. -14.000 0.000 0.000 -0.212 0.000 13.000 Rのスクリプトが投稿されている。 他の人のプログラムを読むのは勉強になっていいなぁ。 http://rio2016.5ch.net/test/read.cgi/math/1712376048/978
979: 132人目の素数さん [sage] 2024/05/08(水) 23:13:57.87 ID:80mTSPJI 短軸 sマス 長軸 l マス 宝 t 個 のときの総当たり計算 f=\( s=5, # skort axis l=6, # long axis t=7){# tresure sl=s*l long=1:sl mat=matrix(long,ncol=l,nrow=s,byrow=TRUE) short=as.vector(mat) os=order(short) dif=combn(sl,t,\(x) max(os[x])-max(x)) list( 探索数差=mean(dif), 短軸有利=mean(dif<0), 同等=mean(dif==0), 長軸有利=mean(dif>0)) } f() http://rio2016.5ch.net/test/read.cgi/math/1712376048/979
980: 132人目の素数さん [sage] 2024/05/08(水) 23:16:00.17 ID:80mTSPJI 最初の宝をみつけるかmin、お宝全部みつけるかmaxのどちらで計算するかだな。 http://rio2016.5ch.net/test/read.cgi/math/1712376048/980
981: 132人目の素数さん [sage] 2024/05/08(水) 23:51:55.52 ID:o+7mX6D2 P君が縦にnマス, Q君が横にn+1マス移動時、 残ったマス数とk-1のコンビネーション 繰り返すだけ http://rio2016.5ch.net/test/read.cgi/math/1712376048/981
982: 132人目の素数さん [] 2024/05/09(木) 00:06:38.71 ID:vS28WcMc >>944 迂回(まわり道)解法 P: (x, y) = (r・cosθ, r・sinθ) とおけば y/x = tanθ, 軸を45°回して y=x をu軸、y=-x をv軸とすると (sinθ−cosθ)/(sinθ+cosθ) = v/u = tan(θ−45°), u軸上に Q: (x, y) = (3, 3) (u, v) = (3√2, 0) をとる。 ∠POQ = θ−45° となる点Pをとろう。 tan(∠POQ) = tan(θ−45°) = v/u = 1/3, (←題意) P: (u, v) = (3√2, √2) (x, y) = (2, 4) ∴ tanθ = y/x = 2, http://rio2016.5ch.net/test/read.cgi/math/1712376048/982
983: 132人目の素数さん [sage] 2024/05/09(木) 05:49:40.01 ID:RdQdgp2K ID:o+7mX6D2=ID:80mTSPJI http://rio2016.5ch.net/test/read.cgi/math/1712376048/983
984: 132人目の素数さん [sage] 2024/05/09(木) 07:41:10.03 ID:SqUSooPh >>981 それを多言語で自分の手足のように使って実装できるのがすばらしい。 http://rio2016.5ch.net/test/read.cgi/math/1712376048/984
985: 132人目の素数さん [sage] 2024/05/09(木) 07:49:21.97 ID:SqUSooPh 最初の宝をみつけるまでの探索数が少ない方が有利と判定することにして >979をWolframに移植 長短の差を大きめにして実行してみる。 (* s:短軸枡数 l:長軸枡数 t:宝の数 *) s=2; l=15; t=3; long=Range[s*l]; (mat=Partition[long,l])//MatrixForm; short=Flatten[Transpose[mat]]; tre=Subsets[long,{t}]; long; short; os=Ordering[short]; subsets=Subsets[long,{t}]; (* combn(long,t) *) nshort=Min[os[[#]]]& /@ subsets; nlong=Min[#]& /@ subsets; {"short search"->Mean[nshort],"long search"->Mean[nlong]} % //N dif=nshort-nlong; (* 探索枡差*) Histogram[dif,AxesLabel->{探索枡差(短軸-長軸),""}] sif=Sign[dif]; mshort=Mean@Boole[#==-1& /@ sif]; (* 短軸有利割合*) meven=Mean@Boole[#== 0& /@ sif]; (* 互角割合*) mlong=Mean@Boole[#== 1& /@ sif]; (* 長軸有利割合*) {"short beats"-> mshort,"even" ->meven,"long beats" ->mlong} % // N 実行結果 https://i.imgur.com/tc3ovoG.png http://rio2016.5ch.net/test/read.cgi/math/1712376048/985
986: 132人目の素数さん [sage] 2024/05/09(木) 08:13:38.84 ID:l48JEfyA > sapply(1:20,function(k) treasure0(4,5,k)) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] 短軸有利 9 84 463 1776 5076 11249 19797 28057 32243 30095 22749 長軸有利 9 83 453 1753 5075 11353 20057 28400 32528 30250 22803 同等 2 23 224 1316 5353 16158 37666 69513 103189 124411 122408 [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] 短軸有利 13820 6656 2486 695 137 17 1 0 0 長軸有利 13831 6657 2486 695 137 17 1 0 0 同等 98319 64207 33788 14114 4571 1106 188 20 1 4×5の場合 宝:1個 同等 宝:2~5個 短軸有利 宝:6~13個 長軸有利 宝:14~20個 同等 □■■■■ □□■■■ □□□■■ □□□□■ 短軸有利☆ Table[sum[C(2n-1+C(0,(21mod n)-1),k-1),{n,1,9}],{k,1,20}] 長軸有利☆ Table[sum[C(2n-1+C(0,6mod n)-C(0,C(3,n-2)-1),k-1),{n,1,9}],{k,1,20}] 同等☆ Table[C(19,k-1)+C(17,k-2)+C(15,k-2)+C(13,k-2)+C(8,k-2)+C(1,k),{k,1,20}] http://rio2016.5ch.net/test/read.cgi/math/1712376048/986
987: 132人目の素数さん [sage] 2024/05/09(木) 08:41:06.04 ID:RdQdgp2K 尿瓶朝っぱらからもうID変えたのかよめんどくせぇ http://rio2016.5ch.net/test/read.cgi/math/1712376048/987
988: 132人目の素数さん [sage] 2024/05/09(木) 09:15:41.06 ID:yYb3W7tm p,qを相異なる素数、nを自然数とする。 (p+qi)^nは実数でないことを示せ。 http://rio2016.5ch.net/test/read.cgi/math/1712376048/988
989: 132人目の素数さん [sage] 2024/05/09(木) 12:33:07.87 ID:SqUSooPh >>986 Wolfram言語の練習にその結果を検算 https://i.imgur.com/XHl6EHD.png 最終行 0:互角 −1:短軸有利 1:長軸有利 結果は合致したので Wolframで正しくコードできたと実感できた。 http://rio2016.5ch.net/test/read.cgi/math/1712376048/989
990: 132人目の素数さん [sage] 2024/05/09(木) 19:45:32.67 ID:sBNvJAPA >>989 いつになったら日本語理解できんだよ? http://rio2016.5ch.net/test/read.cgi/math/1712376048/990
991: 132人目の素数さん [sage] 2024/05/09(木) 22:30:04.32 ID:VA/8d2rk >>964 コードのサラダって何だよアホか 言葉のサラダ(統合失調症に特徴的な症状)だろアンタは http://rio2016.5ch.net/test/read.cgi/math/1712376048/991
992: 132人目の素数さん [sage] 2024/05/10(金) 05:02:28.89 ID:esg1TcXl 凸四角形ABCDの頂点の座標から A,Bを通り、CーDを結ぶ直線と接する円を描画するプログラムを作成せよ。 http://rio2016.5ch.net/test/read.cgi/math/1712376048/992
993: 132人目の素数さん [sage] 2024/05/10(金) 05:03:33.15 ID:esg1TcXl R言語やWolfram言語が使える人はちゃんとしたレスをしているなぁ。 助言より罵倒を喜びとするPhioseくんらの集団が東大合格者だと思う人はその旨をレスしてください。 http://rio2016.5ch.net/test/read.cgi/math/1712376048/993
994: 132人目の素数さん [sage] 2024/05/10(金) 06:11:20.21 ID:tIlXy57I >>993 どうせアンタの自演だろ 他はもうスレチに飽き飽きしてるから http://rio2016.5ch.net/test/read.cgi/math/1712376048/994
995: 132人目の素数さん [sage] 2024/05/10(金) 06:28:02.54 ID:tIlXy57I >>993 大体アンタのどこが助言なん?w 誰にも求められてないしただスレチなことをブツブツほざいてるだけの日本語通じない統失チンパン ご丁寧にスレ誘導までしてくれてるのにその助言を一切無視してここのスレに粘着して発狂してるのがアンタ この日本語も理解できないのか?アンタの知能レベルだと http://rio2016.5ch.net/test/read.cgi/math/1712376048/995
メモ帳
(0/65535文字)
上
下
前
次
1-
新
書
関
写
板
覧
索
設
栞
歴
あと 7 レスあります
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.022s