高校数学の質問スレ(医者・東大卒専用) Part438 (979レス)
高校数学の質問スレ(医者・東大卒専用) Part438 http://rio2016.5ch.net/test/read.cgi/math/1723152147/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
レス栞
リロード規制
です。10分ほどで解除するので、
他のブラウザ
へ避難してください。
113: 132人目の素数さん [sage] 2024/08/21(水) 11:44:00.03 ID:trPnwZW4 シミュレーションによる検証 Wolfram Language 14.0.0 Engine for Microsoft Windows (64-bit) Copyright 1988-2023 Wolfram Research, Inc. In[1]:= j[n_] :=( (* n人でジャンケンして勝者が決まるまでの回数と勝者の数*) count=0; Until[Length@Union@a==2,a=RandomChoice[Range[3],n];count++]; b=Sort@Union@a; If[b=={1,2}, winners=Count[a,2]]; If[b=={2,3}, winners=Count[a,3]]; If[b=={1,3}, winners=Count[a,1]] ; {winners,count} ) In[2]:= In[2]:= sim[n_] :=((* 勝者が一人になるまでの回数 *) For[{winner,counts}=j[n],winner>1,k=j[winner];winner=k[[1]];counts=counts+k[[2]]]; counts ) In[3]:= res11=Table[sim[11],10^6]; In[4]:= Histogram[res11,"Scott","PDF"] Out[4]= -Graphics- In[5]:= Mean[res11] // N Out[5]= 34.9504 In[6]:= Median[res11] Out[6]= 27 In[7]:= N@Mean@Boole[#<=10&/@res11] Out[7]= 0.154785 In[8]:= 449687340186660888579056289638229806808082/2909321189362570808630465826492242446680483 449687340186660888579056289638229806808082 Out[8]= ------------------------------------------- 2909321189362570808630465826492242446680483 In[9]:= % // N Out[9]= 0.154568 http://rio2016.5ch.net/test/read.cgi/math/1723152147/113
116: 132人目の素数さん [sage] 2024/08/21(水) 17:53:09.19 ID:EiqnP9Ex >>113 >>69にはいつになったら答えられるんだよゴミ http://rio2016.5ch.net/test/read.cgi/math/1723152147/116
メモ帳
(0/65535文字)
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.028s