臨床統計もおもしろいですよ、その2at HOSP
臨床統計もおもしろいですよ、その2 - 暇つぶし2ch2:卵の名無しさん
18/10/30 22:49:12.69 kXLKssbE.net
dec2n n = concat . (map show) . reverse . sub
where sub 0 = []
sub num = mod num n : sub (div num n)
main = do
let n=7
let num=10^68 - 7
putStrLn $ dec2n n num

231610455425461524013603062230536506126223530530201410405365413161511216632624602

3:卵の名無しさん
18/10/30 23:17:28.53 kXLKssbE.net
dec2nw <- function(num, N, digit = 4){
r=num%%N
q=num%/%N
while(q > 0 | digit > 1){
r=append(q%%N,r)
q=q%/%N
digit=digit-1
}
return(r)
}
n=dec2nw(10**16-7,36)
n
cat(c(0:9,letters[1:26])[n+1])

4:卵の名無しさん
18/10/31 01:52:25.64 naQxCFH6.net
人格障害者の精神科医 古根高
スレリンク(hosp板)
最悪の精神科医 古根高
スレリンク(hosp板)
過去ログだがブラウザで読める
病的な虚言癖と妄想癖の精神科医 古根高の病名を診断するスレ
スレリンク(hosp板)

5:卵の名無しさん
18/10/31 10:21:03.69 sRjms2eC.net
de


6:f binomial(n,r): from math import factorial as f return f(n)//f(r)//f(n-r) if r>=0 and n-r>=0 else 0 def nloc(m,n,k,l): q,r = divmod(n*k+l,m) return (n-q)*(m-k)+q-1-l + ((k-r) if r > k else 0) def nwin(m,n,c): return sum(binomial(nloc(m,n,k,l),c-1) for k in range(m) for l in range(n) if k*(n-1)<l*(m-1)) nloc = function(m,n,k,l){ q=(n*k+l)%/%m r=(n*k+l)%%m (n-q)*(m-k)+q-1-l + max(k-r,0) } nwin = function(m,n,k){ for(k in 0:(m-1)){ for(l in 0:(n-1)){ if(k*(n-1<l*(m-1))



7:卵の名無しさん
18/10/31 11:53:59.80 bPxngJ5R.net
nloc = function(m,n,k,l){
q=(n*k+l)%/%m
r=(n*k+l)%%m
(n-q)*(m-k)+q-1-l + ifelse(r>k,k-r,0)
}

nwin = function(m,n,c){
re=NULL
for(k in 0:(m-1)){
for(l in 0:(n-1)){
if(k*(n-1)<l*(m-1)){
re=append(re,choose(nloc(m,n,k,l),c-1))
}
}
}
sum(re)
}
nwin(3,4,2)
nwin(5,6,15)

8:卵の名無しさん
18/10/31 11:54:52.81 bPxngJ5R.net
pythonからRを経てHaskellに移植の予定。

9:卵の名無しさん
18/10/31 14:43:51.58 qgJ05S6D.net
>>7
import System.Environment
import Data.List
import Data.List.Split
choose (n,r) = product[1..n] `div` product[1..n-r] `div` product[1..r]
nloc m n k l = do
let q = div (n*k+l) m
r = mod (n*k+l) m
in (n-q)*(m-k) + q-1-l + if r>k then k-r else 0
nwin m n c = sum[choose ((nloc m n k l), c-1) | k<-[0..m-1], l<-[0..n-1], k*(n-1) < l*(m-1)]
mwin m n c = sum[choose ((nloc n m k l), c-1) | k<-[0..n-1], l<-[0..m-1], k*(m-1) < l*(n-1)]
draw m n c = choose(m*n,c) - nwin m n c - mwin n m c
main = do
argList <- getArgs -- m : 縦マス(短軸) n : 横マス(長軸) k : 宝の数
let m = read (argList !! 0)
n = read (argList !! 1)
k = read (argList !! 2)
putStrLn $ "p1st = " ++ show(mwin m n k) ++ ", q1st = " ++ show(nwin m n k) ++ ", draw = " ++ show(draw m n k)

10:卵の名無しさん
18/10/31 15:15:25.46 qgJ05S6D.net
import System.Environment
choose (n,r) = product[1..n] `div` product[1..n-r] `div` product[1..r]
nloc m n k l = do
let q = div (n*k+l) m
r = mod (n*k+l) m
in (n-q)*(m-k) + q-1-l + if r>k then k-r else 0
nwin m n c = sum[choose ((nloc m n k l), c-1) | k<-[0..m-1], l<-[0..n-1], k*(n-1) < l*(m-1)]
mwin m n c = sum[choose ((nloc n m k l), c-1) | k<-[0..n-1], l<-[0..m-1], k*(m-1) < l*(n-1)]
draw m n c = choose(m*n,c) - nwin m n c - mwin n m c
main = do
argList <- getArgs -- m : 縦マス(短軸) n : 横マス(長軸) k : 宝の数
let m = read (argList !! 0)
n = read (argList !! 1)
k = read (argList !! 2)
putStrLn $ "p1st = " ++ show(mwin m n k) ++ ", q1st = " ++ show(nwin m n k) ++ ", draw = " ++ show(draw m n k)
こういうのも瞬時に計算してくれた、10×20部屋に宝箱100個
>takara 10 20 100
p1st = 15057759425309840160151925452579572328997602171271937639470,
q1st = 15057796557877993527038542474310161591275806044157319150135,
draw = 60432921540347294111327092128863840691952977587098698541050
不定長整数が扱えるHaskellならではだな。
Rの
> mpfr(nwin(10,20,100),100)
1 'mpfr' number of precision 100 bits
[1] 15057796557878080240302485923118087468235549676781988478976は誤答とわかる

11:卵の名無しさん
18/10/31 19:24:32.48 qgJ05S6D.net
>>9
drawにm nが入れ替わるバグが入ってたのを数学板で指摘されたので修正版
import System.Environment
choose (n,r) = product[1..n] `div` product[1..n-r] `div` product[1..r]
nloc m n k l = do
let q = div (n*k+l) m
r = mod (n*k+l) m
in (n-q)*(m-k) + q-1-l + if r>k then k-r else 0
nwin m n c = sum[choose ((nloc m n k l), c-1) | k<-[0..m-1], l<-[0..n-1], k*(n-1) < l*(m-1)]
mwin m n c = sum[choose ((nloc n m k l), c-1) | k<-[0..n-1], l<-[0..m-1], k*(m-1) < l*(n-1)]
draw m n c = choose(m*n,c) - nwin m n c - mwin m n c
main = do
argList <- getArgs -- m : 縦マス(短軸) n : 横マス(長軸) k : 宝の数
let m = read (argList !! 0)
n = read (argList !! 1)
k = read (argList !! 2)
putStrLn $ "p1st = " ++ show(mwin m n k) ++ ", q1st = " ++ show(nwin m n k) ++ ", draw = " ++ show(draw m n k)

10×20部屋に宝箱100個の計算も修正
p1st = 15057759425309840160151925452579572328997602171271937639470
q1st = 15057796557877993527038542474310161591275806044157319150135
draw = 60432958672915447478213709150594429954231181459984080051715

12:卵の名無しさん
18/10/31 21:01:13.96 qgJ05S6D.net
import System.Environment
choose (n,r) = product[1..n] `div` product[1..n-r] `div` product[1..r]
nloc m n k l = do
let q = div (n*k+l) m
r = mod (n*k+l) m
in (n-q)*(m-k) + q-1-l + if r>k then k-r else 0
nwin m n c = sum[choose ((nloc m n k l), c-1) | k<-[0..m-1], l<-[0..n-1], k*(n-1) < l*(m-1)]
mwin m n c = sum[choose ((nloc n m k l), c-1) | k<-[0..n-1], l<-[0..m-1], k*(m-1) < l*(n-1)]
draw m n c = choose(m*n,c) - nwin m n c - mwin m n c
takara m n k = do
putStrLn $ "短軸p1st = " ++ show(mwin m n k)
putStrLn $ "長軸q1st = " ++ show(nwin m n k)
putStrLn $ "同等draw = " ++ show(draw m n k)
main = do
argList <- getArgs -- m : 縦マス(短軸) n : 横マス(長軸) k : 宝の数
let m = read (argList !! 0)
n = read (argList !! 1)
k = read (argList !! 2)
putStrLn $ "p1st = " ++ show(mwin m n k) ++ ", q1st = " ++ show(nwin m n k) ++ ", draw = " ++ show(draw m n k)

13:卵の名無しさん
18/10/31 21:19:00.08 qgJ05S6D.net
nloc = function(m,n,k,l){
q=(n*k+l)%/%m
r=(n*k+l)%%m
(n-q)*(m-k)+q-1-l + ifelse(r>k,k-r,0)
}

nwin = function(m,n,c){ #


14: m < n, log axis search wins re=NULL for(k in 0:(m-1)){ for(l in 0:(n-1)){ if(k*(n-1)<l*(m-1)){ re=append(re,choose(nloc(m,n,k,l),c-1)) } } } sum(re) } longer <- function(m,k){ n=m+1 if(nwin(m,n,k) > nwin(n,m,k)) return(TRUE) if(nwin(m,n,k) < nwin(n,m,k)) return(FALSE) if(nwin(m,n,k) == nwin(n,m,k)) return(NULL) }



15:卵の名無しさん
18/10/31 21:19:18.35 qgJ05S6D.net
pq1 <- function(m){
n=m+1
k=1
di=nwin(m,n,k) - nwin(n,m,k)
while(di<=0){
di=nwin(m,n,k) - nwin(n,m,k)
k=k+1
}
return(k-1)
}
pq <- function(m,Print=FALSE){ # > 0 long axis search wins
n=m+1
x=1:(m*n)
f = function(k) (nwin(m,n,k) - nwin(n,m,k))/choose(m*n,k)
y=sapply(x,f)
if(Print==TRUE){
plot(x,y,pch=19,bty='l',xlab='宝の数', ylab='確率差(長軸-短軸)')
abline(h=0,lty=3)
# print(y,quote=F)
}
z=which(y>0)
c(min(z),max(z))
}
pq(5,P=T)
(nw=cbind(0,sapply(2:20,pq)))
plot(1:20,(2:21)*(1:20),type='n',bty='l',xlab='m(短軸)',ylab='宝の数')
lines(1:20,(2:21)*(1:20),type='h',col='gray',lwd=2)
segments(1:20,nw[1,],1:20,nw[2,],lwd=4)

16:卵の名無しさん
18/10/31 21:50:35.78 AqNtLgjS.net
韓国「強制徴用は22万人で被害者が死亡しても遺族が訴訟可能」 元徴用工4人に損害賠償支払い判決
スレリンク(seijinewsplus板)

17:卵の名無しさん
18/10/31 21:51:01.16 qgJ05S6D.net
先に1個めの宝を見つけるには短軸探索と長軸探索とどちらが有利かは宝の数によって変わるのでグラフにしてみた。
縦5横6のとき宝の数を1から30まで増やして長軸探索が先にみつける確率と短軸探索がさきにみつける確率の差を描いてみた。
URLリンク(i.imgur.com)
縦5横6のときだと宝の数は9から21のときが長軸探索が有利となった。
短軸有利→長軸有利→同等となるようで、再逆転はないもよう。
縦m横m+1として長軸探索が有利になる宝の数の上限と下限を算出してみた。
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 2 2 6 9 13 17 23 29 36 43 52 61 71 82 93 105 118 132 147
[2,] 0 3 7 13 21 31 43 57 73 88 105 118 135 152 166 185 202 220 242 253
グラフにしてみた。
URLリンク(i.imgur.com)

18:卵の名無しさん
18/10/31 21:57:13.38 qgJ05S6D.net
各人にとってのi 番目をどちらが先にみつけるかを計算してみた。
4×5マスに宝が5個あるとき
> treasures(4,5,5)
p1st q1st even
[1,] 1948 9680 3876
[2,] 5488 10016 0
[3,] 7752 7752 0
[4,] 10016 5488 0
[5,] 9680 1948 3876
1個め2個めは短軸方向探索のQが、4個め5個めは長軸方向探索のPが、先にみつける宝の配置の組み合わせが多い。3個めは同じ。
全体としてはイーブンだが、
勝者は1個めを先にみつけた方にするか、全部を先にみつけた方にするかで結果が変わる。
Rのコードはここに置いたので数値を変えて実行可能。
URLリンク(tpcg.io)

19:卵の名無しさん
18/11/01 10:16:30.80 ZkYkKASz.net
こういう解き方していると馬鹿になるなぁ、と
思いつつ便利なので使ってる。
Wolframで方程式を解かせて計算式をスクリプトに組み込むとかやってるな。結果は具�


20:フ例でシミュレーションして確認。 a,b,cは自然数とする。 このとき、以下の不等式を満たす(a,b,c)が存在するような自然数Nの最大値を求めよ。 N≦a^2+b^2+c^2≦2018 >>311 Nの最大値は2018 顰蹙のプログラム解 Prelude> [(a,b,c)|a<-[1..45],b<-[a..45],c<-[b..45], a^2+b^2+c^2==2018] [(1,9,44),(3,28,35),(5,12,43),(8,27,35),(9,16,41),(19,19,36),(20,23,33)]



21:卵の名無しさん
18/11/01 20:03:52.01 wy1a0s+b.net
aのb乗×cのd乗=abcd(abcd は4桁の整数)
abcdに当てはまる数字は?
[(a,b,c,d)|a<-[0..9],b<-[0..9],c<-[0..9],d<-[0..9],a^b*c^d==1000*a+100*b+10*c+d]

22:卵の名無しさん
18/11/02 00:51:03.46 CfCNBter.net
広島県の福山友愛病院で、
患者の病状と関係ない薬を大量に投与した。
しかも、意図的にです!

国は違うがドイツの場合

裁判所で開かれた公判で、患者100人を殺害した罪を認めた。これでこの事件は、同国で戦後最悪級の連続殺人事件となった。
起訴されたのは、ドイツ北部デルメンホルストとオルデンブルクの病院で看護師をしていたニルス・ヘーゲル受刑者(41)。
当時勤務していたドイツ北部の2つの病院で2000~2005年にかけ、34~96歳の患者を殺害したことを認めた。
同受刑者は自分の蘇生措置の腕を同僚に見せびらかす目的や、退屈しのぎの目的で、
↓↓↓↓↓
患者に処方されていない薬を投与していたとされる。
↑↑↑↑↑

ドイツの場合。まあ日本は日本だが・・・
大口の病院は看護士の単独犯だったわけで捕まったが・・・

福山友愛病院は・・・・・
URLリンク(youtu.be)

23:卵の名無しさん
18/11/02 14:33:08.95 p4Bn/s/z.net
安倍総理も使っていて警察も使える医療大麻オイル
国連で今月解禁勧告が出されるという
解禁されれば憲法第98条によって大麻取締法が解禁され、店頭への商品陳列、広告表示等、医薬品としての処方ができるようになります
URLリンク(plaza.rakuten.co.jp)

24:卵の名無しさん
18/11/02 18:00:28.03 jIM3oIca.net
医療法人潤和会を麻薬取締法違反の罪で略式起訴
URLリンク(seiyakuonlinenews.com)

25:卵の名無しさん
18/11/02 18:53:08.10 3zC36uTy.net
広島県の福山友愛病院で、
患者の病状と関係ない薬を大量に投与した。
しかも、意図的にです!

国は違うがドイツの場合

裁判所で開かれた公判で、患者100人を殺害した罪を認めた。これでこの事件は、同国で戦後最悪級の連続殺人事件となった。
起訴されたのは、ドイツ北部デルメンホルストとオルデンブルクの病院で看護師をしていたニルス・ヘーゲル受刑者(41)。
当時勤務していたドイツ北部の2つの病院で2000~2005年にかけ、34~96歳の患者を殺害したことを認めた。
同受刑者は自分の蘇生措置の腕を同僚に見せびらかす目的や、退屈しのぎの目的で、
↓↓↓↓↓
患者に処方されていない薬を投与していたとされる。
↑↑↑↑↑

ドイツの場合。まあ日本は日本だが・・・
大口の病院は看護士の単独犯だったわけで捕まったが・・・

福山友愛病院は・・・・・
URLリンク(youtu.be)

26:卵の名無しさん
18/11/02 19:25:23.34 p4Bn/s/z.net
大麻取締法 22条の3に大麻を所持使用できるって書いてある
URLリンク(www.mmjp.or.jp)
こりゃ解禁しなきゃな!

27:卵の名無しさん
18/11/03 14:59:39.97 UnKdAdmR.net
国試浪人の事務員は裏口バカだから
レスするだけ無駄である

28:卵の名無しさん
18/11/03 15:10:46.97 Ipwzsvm


29:c.net



30:卵の名無しさん
18/11/03 15:28:40.93 Ipwzsvmc.net
図形の問題って5ch(2Ch)じゃあ、投稿しにくいんだよなぁ。
こんなのも投稿したけど、かなり面倒なので誰も検証もしないし、反証もしないよな。
スレリンク(math板:90番)
そういう事情からか、確率や整数の問題はレスがつきやすいね。 まぁ、問題が理解できないとかはないからね
ところが医師板では統計・確率どころか算数ネタにもほとんどレスがこない。
ド底辺シリツの馬鹿だらけってことかなぁ?

31:卵の名無しさん
18/11/03 17:40:46.36 Ipwzsvmc.net
>>24
レスできるような基礎学力すらないのがシリツ医大卒だといっているだよ。
ジョーカーを含む53枚のトランプをシャッフルした後に順にめくっていってジョーカーがでたら終了とする。
ジョーカーがでるまでにめくったカードの数の総和の期待値はいくらか?
の計算式書いてみ!

32:卵の名無しさん
18/11/03 18:16:44.41 hHITaoGI.net
臨床統計の問題です
掲示板の1日のレス数の多さは
ネット依存症の重症度の指標となります
この指標を元に医師板の主だった依存症患者を
1日のレス数を数えてピックアップしましょう

33:卵の名無しさん
18/11/03 18:22:56.04 mjfFp3DY.net
It is common knowledge among doctors and patients that Do-Teihen(exclusively bottom-leveled medical school) graduates mean morons who bought their way to Gachi'Ura(currently called by themselves)
According to the experience of entrance exam to medical school in the era of Showa, when the sense of discrimination against
privately-founded medical schools were more intense than it is now,
all such schools but for Keio had been so compared to some specialized institution for educable mentally retarded kids that nobody but imbecile successors of physicians in private practice had applied for admission.
There had been NOT a single classmate who chose willingly against his/her common sense to go to the Do-Teihen(exclusively bottom-leveled medical school, currently also known as Gachi'Ura),
which would have cost outrageous money and its graduates are destined to be called Uraguchi morons who bought thier way into the Do-Teihen, by thier colleagues and even by thier own clients.
Although people won't call them names to their face,
certain 80-90% people of about my age have been yet scorning and sneering at Uraguchi graduates, speaking in the back of our mind,
" Uraguchi morons shall not behave like somebody."
We never speak out face to face in real life.

34:卵の名無しさん
18/11/03 18:37:42.56 Ipwzsvmc.net
>>28
数値を書いたまともな問題も作れないの?
これ答えてみ!
専門医も開業医からも答がでてないから、頭のいいのを示すチャンスだぞ。
Take it or leave it !!

東京医大、本来合格者入学許可へ 今年の受験生50人
2018年10月25日 02時06分
 東京医科大=8月、東京都新宿区
 東京医科大が今年の入試で本来合格ラインを上回っていたのに、不正の影響で不合格となった受験生50人に対し、来年4月の入学を認める方針を固めたことが24日、関係者への取材で分かった。
昨年の本来合格者19人については、難しいとの意見が出ているもようだ。東京医大は50人のうち入学希望が多数に上った場合は、来年の一般入試の募集人員減も検討。
URLリンク(www.nishinippon.co.jp)
URLリンク(www.tokyo-med.ac.jp)によると
学年 第1学年 第2学年
在学者数 133 113
昨年入学者の留年者や退学者が0として、
大学が公式認定した裏口入学者が少なくとも今年は133人中50人、昨年が113人中19人ということになる。
裏口入学率の期待値、最頻値、およびその95%信頼区間を求めよ。

35:卵の名無しさん
18/11/03 18:38:49.80 Ipwzsvmc.net
>>29
俺が訳した普及の名投稿の英訳じゃん。
推敲歓迎!!

36:卵の名無しさん
18/11/03 18:39:30.27 Ipwzsvmc.net
>>29
俺が訳した不朽の名投稿の英訳じゃん。
推敲歓迎!!

37:卵の名無しさん
18/11/04 16:05:31.31 T2FQgr1k.net
臨床統計の問題です
掲示板の1日のレス数の多さは
ネット依存症の重症度の指標となります
この指標を元に医師板の主だった依存症患者を
1日のレス数を数えてピックアップしましょう

38:卵の名無しさん
18/11/04 17:50:26.40 YHVXN37A.net
>>33
頭の悪そうな投稿だなぁ。
これでも計算してみ!

ド底辺シリツ医大受験生の親に裏口コンサルタントが訪れて裏金額に2つの決め方を提示した。
A: 定額で2000万円
B: サイコロを1の目がでるまでふったときの出た目を合計した値 × 100万円、 例 2,1と続けば300万、6,5,1なら1200万円
問題(1) AとBではどちらが有利か?
問題(2) Bを選択した場合5000万円以上必要になる確率はくらか?

Bで裏金が1億円以上になる確率を計算すると(不定長さ整数が扱えるHaskellは便利だね)
2060507550845146798433160823128452341/202070319366191015160784900114134073344
になったが、これで�


39:っているか検算してくれ。



40:卵の名無しさん
18/11/05 00:16:38.96 NIiUrAnG.net
ここの国では硬貨は7種類流通しています
この7種類の硬貨を使って1円~70円の70通りの支払いができます
ただし一度に使用できる硬貨は3枚以下(同じ硬貨複数使いは可)です
7種類の硬貨はそれぞれ何円だったのでしょうか?

41:卵の名無しさん
18/11/05 00:17:21.55 NIiUrAnG.net
>>35
Rでのブルートフォース解
is.1_70 <- function(x){
total=NULL
for(i in x){
for(j in x){
for(k in x){
ijk=i+j+k
if(!(ijk %in% total)) total=append(total,ijk)
}
}
}
all(1:70 %in% total)
}
(続く)

42:卵の名無しさん
18/11/05 00:18:36.57 NIiUrAnG.net
>>36
M=69
for(a in 0:M){
for(b in a:M){
for(c in b:M){
for(d in c:M){
for(e in d:M){
for(f in e:M){
for(g in f:M){
for(h in g:M){
y=c(a,b,c,d,e,f,g,h)
if(is.1_70(y)) print(y)
}
}
}
}
}
}
}
}

43:卵の名無しさん
18/11/05 00:19:36.93 NIiUrAnG.net
import Data.List
m = 69
sub x = do
let ijk = filter (<=70).nub $ sort [i+j+k| i<-x,j<-x,k<-x]
all (\y -> elem y ijk ) [0..70]
main = do
print $ [(b,c,d,e,f,g,h)| b<-[0..m],c<-[b..m],d<-[c..m],e<-[d..m],f<-[e..m],g<-[f..m],h<-[g..m],sub [0,b,c,d,e,f,g]]

44:卵の名無しさん
18/11/05 01:06:35.42 NIiUrAnG.net
>>38
import Data.List
m = 69
sub x = do -- ans=[1,4,5,15,18,27,34]
let ijk = filter (<=70).nub $ sort [i+j+k| i<-x,j<-x,k<-x]
all (\y -> elem y ijk ) [0..70]
main = do
print $ [(1,4,5,e,f,g,h)| e<-[0..m],f<-[e..m],g<-[f..m],h<-[g..m],sub [0,1,4,5,e,f,g,h]] -- 動作確認用
print $ [(b,c,d,e,f,g,h)| b<-[0..m],c<-[b..m],d<-[c..m],e<-[d..m],f<-[e..m],g<-[f..m],h<-[g..m],sub [0,b,c,d,e,f,g,h]]

45:卵の名無しさん
18/11/05 01:20:29.50 NIiUrAnG.net
数学板に超初心者のコードを書いたら、達人が高速化してくれた。
プログラム解を毛嫌いする向きもあるけど、初心者のコードを改善してくれたり、cに移植してくれたりする人の存在はとてもありがたい。
import Data.List
firstUnavailable x = let y = 0:x in head $([1..71] &#165;&#165;)$nub$sort$[a+b+c|a<-y,b<-y,c<-y]
next x = [n:x|n<-[head x+1..firstUnavailable x]]
xss = iterate (&#165;xs->concat [next x|x<-xs]) [[1]]
isGood x = let y = 0:x in (==70)$length $intersect [1..70]$nub$sort$[a+b+c|a<-y,b<-y,c<-y]
main = do
    print [x|x<-(xss !! 6),isGood x]

46:卵の名無しさん
18/11/05 01:22:05.62 NIiUrAnG.net
>>40
文字化けを修正
import Data.List
firstUnavailable x = let y = 0:x in head $([1..71] \\)$nub$sort$[a+b+c|a<-y,b<-y,c<-y]
next x = [n:x|n<-[head x+1..firstUnavailable x]]
xss = iterate (\xs->concat [next x|x<-xs]) [[1]]
isGood x = let y = 0:x in (==70)$length $intersect [1..70]$nub$sort$[a+b+c|a<-y,b<-y,c<-y]
main = do
print [x|x<-(xss !! 6),isGood x]

47:卵の名無しさん
18/11/05 01:34:19.46 NIiUrAnG.net
>>39
-- b=1は自明なので無駄な検索を削除
import Data.List
m = 69
sub x = do -- ans=[1,4,5,15,18,27,34]
let ijk = filter (<=70).nub $ sort [i+j+k| i<-x,j<-x,k<-x]
all (\y -> elem y ijk ) [0..70]
main = do
-- print $ [(1,4,5,e,f,g,h)| e<-[0..m],f<-[e..m],g<-[f..m],h<-[g..m],sub [0,1,4,5,e,f,g,h]] -- 動作確認用
print $ [(1,c,d,e,f,g,h)| c<-[1..m],d<-[c..m],e<-[d..m],f<-[e..m],g<-[f..m],h<-[g..m],sub [0,1,c,d,e,f,g,h]]

48:卵の名無しさん
18/11/05 07:20:27.85 NIiUrAnG.net
seqN <- function(N=100,K=5){
a=numeric(N)
for(i in 1:K) a[i]=2^(i-1)
for(i in K:(N-1)){
a[i+1]=0
for(j in 0:(K-1)){
a[i+1]=a[i+1]+a[i-j] # recursion formula
}
}
P0=numeric(N)
for(i in 1:N) P0[i]=a[i]/2^i # P0(n)=a(n)/2^n
P0
MP=matrix(rep(NA,N*K),ncol=K)
colnames(MP)=paste0('P',0:(K-1))
MP[,1]=P0
head(MP);tail(MP)
MP[1,2]=1/2
for(i in (K-2):K) MP[1,i]=0
for(k in 2:K){
for(i in 1:(N-1)) MP[i+1,k]=1/2*MP[i,k-1]
} # Pk(n+1)=1/2*P(k-1)(n)
ret=1-apply(MP,1,sum)
ret[N]
}
seqN(100,5)
seqN(1000,10)

49:卵の名無しさん
18/11/05 07:25:01.84 NIiUrAnG.net
## p : probability of head at coin flip
seqNp <- function(N=100,K=5,p=0.5){
if(N==K) return(p^K)
q=1-p
a=numeric(N) # a(n)=P0(n)/p^n , P0(n)=a(n)*p^n
for(i in 1:K) a[i]=q/p^i # P0(i)=q


50: for(i in K:(N-1)){ # recursive formula a[i+1]=0 for(j in 0:(K-1)){ a[i+1]=(a[i+1]+a[i-j]) } a[i+1]=q/p*a[i+1] } P0=numeric(N) for(i in 1:N) P0[i]=a[i]*p^i # P0(n)=a(n)*p^n MP=matrix(rep(NA,N*K),ncol=K) colnames(MP)=paste0('P',0:(K-1)) MP[,'P0']=P0 head(MP);tail(MP) MP[1,'P1']=p for(i in (K-2):K) MP[1,i]=0 for(k in 2:K){ for(i in 1:(N-1)) MP[i+1,k]=p*MP[i,k-1] } # Pk(n+1)=p*P(k-1)(n) ret=1-apply(MP,1,sum) ret[N] }



51:卵の名無しさん
18/11/05 08:16:25.28 NIiUrAnG.net
>>44
# 検算用のシミュレーションスクリプト
seqn<-function(n=10,N=1000,p=0.5){ # N回のうちn回以上続けて表がでるか?
rn=rbinom(N,1,p) # N個の0 or 1を発生させる
count=0 # 1連続カウンター
for(i in 1:N){
if(rn[i] & count<n){ # rn[i]が1でn個続かなければ
count=count+1
}
else{
if(count==n) {return(TRUE)} # n個の1が見つかればTRUEを返して終了
else{
count=0
}
}
}
return(count==n)
}
mean(replicate(10^4,seqn(10,1000,p=0.5)))

52:卵の名無しさん
18/11/05 12:05:05.46 +OxX3fom.net
事務員さん

53:卵の名無しさん
18/11/05 12:14:01.00 RNxpU/sa.net
いくらド底辺シリツ医大卒の裏口バカでも
これくらいは計算できるだろ?
ド底辺シリツ医大の裏口入学調査委員会が
裏口入学は高々10%と報告したとする。
その結果の検証に100人を調査したら4人続けて裏口入学生であった、という。
この検証から裏口入学率が10%であるか否かを有意水準5%で検定せよ。

54:卵の名無しさん
18/11/05 14:38:27.92 Lykd2+5F.net
>>44
seqNp(100,4,1/10)
fm = function(m=5){
f100_m = function(p) seqNp(100,m,p)
pp=seq(0,1,len=100)
plot(pp,sapply(pp,f100_m),type='l',lwd=2)
abline(h=0.05,lty=3)
(p005=uniroot(function(x,u0=0.05) f100_m(x)-u0,c(0.001,1))$root)
}

55:卵の名無しさん
18/11/05 18:35:02.59 Lykd2+5F.net
トランプのA~10の10枚とジョーカー1枚の
合計11枚が机の上に裏向きに置いてある。
ランダムに1枚ずつ引いていった場合の、得られた数字の総和の期待値を求めよ。
ただし、ジョーカーを引いた時点で終了するものとし、
Aは数字扱いではなく、最終的に得られた数字の総和が2倍になるものとする。
x=sample(11)
f <- function(x){
i=1
y=numeric()
while(x[i]!=11){
y[i]=x[i]
i=i+1
}
if(1 %in% y) return(2*(sum(y)-1))
else return(sum(y))
}
# simulation
re=replicate(1e6,f(sample(11)))
summary(re)
hist(re,col='lightblue',xlab='sum',main='')
# brute-force
library(gtools)
perm=permutations(11,11)
mean(apply(perm,1,f))

56:卵の名無しさん
18/11/06 12:33:08.79 jkx5i2bQ.net
n=3
r=8
str=paste(as.character(1:n),collapse='')
f <- function(x) grepl(str,paste(x,collapse=""))
# Brute-Force
library(gtools)
perm=permutations(n,r,rep=T)
sum(apply(perm,1,f))
# Monte-Carlo
k=100
re=replicate(k,sum(replicate(n^r,f(sample(n,r,rep=T)))))
summary(re)

57:卵の名無しさん
18/11/06 15:40:53.99 jkx5i2bQ.net
コインを1000回投げた。連続して表がでる確率が最も高いのは何回連続するときか?
seq_dice <- function(N=100,k=5,p=1/6){
P=numeric(N)
for(n in 1:(k-1)){
P[n]=0
}
P[k]=p^k
P[k+1]=p^k+(1-p)*p^k
for(n in (k+1):(N-1)){
P[n+1] = P[n] + (1-P[n-k])* p^(k+1)
}
return(P[N])
}
seq_dice()
seq_diceJ <- function(N=100,k=5,p=1/6){ # Just k sequence
seq_dice(N,k,p)-seq_dice(N,k+1,p)
}
seq_diceJ()
#
vsdJ=Vectorize(seq_diceJ)
NN=1000
kk=1:(NN/50)
p=0.5
y=vsdJ(NN,kk,0.5)
which.max(y)
plot(kk,y,bty='l',pch=19,xlab='sequence',ylab='probability')

58:卵の名無しさん
18/11/06 17:00:36.05 QApCAMmZ.net
f = function(x){
y=paste(x,collapse='')
str="1"
if(!grepl(str,y)) return(0)
else{
while(grepl(str,y)){
str=paste0(str,"1")
}
return(nchar(str)-1)
}
}
x=sample(0:1,20,rep=T) ; x ;f(x)

59:卵の名無しさん
18/11/06 19:54:04.82 jkx5i2bQ.net
>>51
# 有理数表示したかったのでPythonに移植
from fractions import Fraction
def seq_dice(N,k,p):
P=list()
for n in range(k-1):
P.append(0)
P.append(p**k)
P.append(p**k + (1-p)*p**k)
for n in range (k,N):
P.append(P[n]+(1-P[n-k])*p**(k+1))
return(P[N])
def seq_diceJ(N,k,p):
return(seq_dice(N,k,p) - seq_dice(N,k+1,p))

def dice(N,k,p):
print("Over " + str(k))
print(Fraction(seq_dice(N,k,p)))
print(" = " + str(seq_dice(N,k,p)))
print("Just " + str(k))
print(Fraction(seq_diceJ(N,k,p)))
print(" = " + str(seq_diceJ(N,k,p)))
dice(10000,5,1/6)
# ここで実行可能
# URLリンク(tpcg.io)

60:卵の名無しさん
18/11/06 20:01:05.33 jkx5i2bQ.net
seq_dice <- function(N=100,k=5,p=1/6){
P=numeric(N)
for(n in 1:(k-1)){
P[n]=0
}
P[k]=p^k
P[k+1]=p^k+(1-p)*p^k
for(n in (k+1):(N-1)){
P[n+1] = P[n] + (1-P[n-k])* p^(k+1)
}
return(P[N])
}
seq_dice()
seq_diceJ <- function(N=100,k=5,p=1/6){ # Just k sequence
seq_dice(N,k,p)-seq_dice(N,k+1,p)
}
seq_diceJ()
#
vsdJ=Vectorize(seq_diceJ)
NN=1e6
kk=1:30
p=0.5
y=vsdJ(NN,kk,0.5)
which.max(y) # 1e2:5 1e3:9 1e4:12 1e5:15 1e6:18
plot(kk,y,bty='l',pch=19,xlab='sequence',ylab='probability')
cbind(kk,y)
options(digits=22)
max(y)

61:卵の名無しさん
18/11/06 20:43:45.42 jkx5i2bQ.net
>>53
泥タブだと普通にみえるが、Win10のPCだと コードのインデントがなくなって左揃えされてしまうなぁ。

62:卵の名無しさん
18/11/07 00:33:21.67 J7bMbWmD.net
from fractions import Fraction
def dice126(N):
P=list()
for n in range(6):
P.append(1)
P.append(1-1/(6**6))
for n in range(7,N+1):
P.append(P[n-1]-P[n-6]/(6**6))
return(1-P[N])
def dice123456(N):
print(Fraction(dice126(N)))
print(" = " + str(dice126(N)))
dice123456(1000)

63:卵の名無しさん
18/11/07 03:24:42.61 5r6Cuw34.net
愛の妖精ぷりんてぃん

64:卵の名無しさん
18/11/07 20:28:13.57 J7bMbWmD.net
# simulation
mhs = function(x){ # maximum head sequence
y=paste(x,collapse='')
str="1"
if(!grepl(str,y)) return(0)
else{
while(grepl(str,y)){
str=paste0(str,"1")
}
return(nchar(str)-1)
}
}
(x=sample(0:1,100,rep=T)) ; mhs(x)
sim <- function(r=4,n=100,ps=c(9/10,1/10)){
mhs(sample(0:1,n,rep=T,prob=ps))>=r
}
mean(replicate(1e5,sim()))

65:卵の名無しさん
18/11/07 20:32:14.75 J7bMbWmD.net
ド底辺シリツ医大の裏口入学調査委員会が
裏口入学は高々10%と報告したとする。
その結果の検証に100人を調査したら4人続けて裏口入学生であった、という。
この検証から裏口入学率が10%であるか否かを有意水準1%で検定せよ。

66:卵の名無しさん
18/11/07 21:22:13.74 s+v4AjoX.net
グリーンねえさん

67:卵の名無しさん
18/11/08 07:40:30.60 PGJy3ILP.net
>>59
## p : probability of head at coin flip
seqNp <- function(N=100,K=5,p=0.5){
if(N==K) return(p^K)
q=1-p
a=numeric(N) # a(n)=P0(n)/p^n , P0(n)=a(n)*p^n
for(i in 1:K) a[i]=q/p^i # P0(i)=q
for(i in K:(N-1)){ # recursive formula
a[i+1]=0
for(j in 0:(K-1)){
a[i+1]=(a[i+1]+a[i-j])
}
a[i+1]=q/p*a[i+1]
}
P0=numeric(N)
for(i in 1:N) P0[i]=a[i]*p^i # P0(n)=a(n)*p^n
MP=matrix(rep(NA,N*K),ncol=K)
colnames(MP)=paste0('P',0:(K-1))
MP[,'P0']=P0
MP[1,'P1']=p
for(i in (K-2):K) MP[1,i]=0
for(k in 2:K){
for(i in 1:(N-1)) MP[i+1,k]=p*MP[i,k-1]
} # Pk(n+1)=p*P(k-1)(n)
ret=1-apply(MP,1,sum)
ret[N]
}
seqNp(N=100,K=4,p=0.1)

68:卵の名無しさん
18/11/08 15:06:24.25 PGJy3ILP.net
m=100
ps=[(a,b,c)|a<-[1..m],b<-[a..floor(m^2/2-1/2)],c<-[b..2*b],a^2+b^2==c^2]
ps !! 99
[(a,b,c)|a<-[1..m],b<-[a..floor(a^2/2-1/2)],c<-[b..floor(sqrt(a^2+b^2))],a^2+b^2==c^2]
[(a,b,c)|a<-[1..m],b<-[a..floor(m^2/2-1/2)],let c = sqrt(a^2+b^2), fromIntegral(floor(c))==c]

69:卵の名無しさん
18/11/08 15:07:58.80 PGJy3ILP.net
a^2+b^2=c^2を満たす3つの整数(a<b<c)
の組み合わせのうち(3,4,5)から数えて7番目は何になるかという問題がわかりません
答:(9,40,41)
応用問題:
a^2+b^2=c^2を満たす3つの整数(a<b<c)
の組み合わせのうち(3,4,5)から数えて100番目は何になるか 👀
Rock54: Caution(BBR-MD5:1341adc37120578f18dba9451e6c8c3b)


70:卵の名無しさん
18/11/08 16:45:02.14 PGJy3ILP.net
pitagoras <- function(A){
pita=NULL
for(a in 3:A){
B=floor(a^2/2-1/2)
for(b in a:B){
c=a^2+b^2
if(floor(sqrt(c)) == sqrt(c) ){
pita=rbind(pita,c(a,b,sqrt(c)))
}
}
}
colnames(pita)=letters[1:3]
return(pita)
}
pita=pitagoras(999)
saveRDS(pita,'pita999.rds')
pita[1,]
pita[7,]
pita[77,]
pita[777,]
pita[1000,]
tail(pita)

71:卵の名無しさん
18/11/08 20:38:27.74 cpzz/2HM.net
Last but not least, three laws of Do-Teihen(lowest-tier) Medical School, currently called Gachi'Ura by its graduates.
It is not the bottom medical school but its enrollee that is despicable, which deserves to be called a bona fide moron beyond


72: redemption. The graduates of Do-Teihen are so ashamed that none of them dare to mention their own alma mater they had gone through. The Do-Teihen graduates are so ashamed of having bought their way into the exclusively lowest-tier medical school that they tend to call a genuine doctor a charlatan who elucidates their imbecility.



73:卵の名無しさん
18/11/08 21:27:55.58 PVj0UwaU.net
Hutanari Ti〇po

74:卵の名無しさん
18/11/08 22:34:40.76 klK7Dgwj.net
Last but not least, three laws of Do-Teihen(lowest-tier) Medical School, currently called Gachi'Ura by its graduates.
最後にド底辺医大の三法則を掲げましょう。
1: It is not the bottom medical school but its enrollee that is despicable, which deserves to be called a bona fide moron beyond redemption.
ド底辺シリツ医大が悪いのではない、本人の頭が悪いんだ。
2: The graduates of Do-Teihen are so ashamed that none of them dare to mention their own alma mater they had gone through.
ド底辺シリツ医大卒は恥ずかしくて、学校名を皆さま言いません。
3: The Do-Teihen graduates are so ashamed of having bought their way into the exclusively lowest-tier medical school
that they tend to call a genuine doctor a charlatan who elucidates their imbecility.
ド底辺特殊シリツ医大卒は裏口入学の負い目から裏口馬鹿を暴く人間を偽医者扱いしたがる。

75:卵の名無しさん
18/11/08 22:35:56.08 klK7Dgwj.net
第一法則の英文の意図的な文法誤謬を指摘してみ!

76:卵の名無しさん
18/11/08 22:37:45.15 JqNfxHqE.net
It is common knowledge among doctors and patients that Do-Teihen(exclusively bottom-leveled medical school) graduates mean morons who bought their way to Gachi'Ura(currently called by themselves)
According to the experience of entrance exam to medical school in the era of Showa, when the sense of discrimination against
privately-founded medical schools were more intense than it is now,
all such schools but for Keio had been so compared to some specialized institution for educable mentally retarded kids that nobody but imbecile successors of physicians in private practice had applied for admission.
There had been NOT a single classmate who chose willingly against his/her common sense to go to the Do-Teihen(exclusively bottom-leveled medical school, currently also known as Gachi'Ura),
which would have cost outrageous money and its graduates are destined to be called Uraguchi morons who bought thier way into the Do-Teihen, by thier colleagues and even by thier own clients.
Although people won't call them names to their face,
certain 80-90% people of about my age have been yet scorning and sneering at Uraguchi graduates, speaking in the back of our mind,
" Uraguchi morons shall not behave like somebody."
We never speak out face to face in real life.

77:卵の名無しさん
18/11/08 23:56:13.79 5CXia8DJ.net
Raise the hem of the white coat with a white coat appearing naked.
Put half of Voltaren in the anus
Peel the white eyes while hitting your ass with a bang bang with both hands
Shouts that "Utopia is surprisingly surprised! It is surprisingly utopian!
Raise the buttocks and fire the Voltaren rocket to the patient.

78:卵の名無しさん
18/11/09 07:26:09.53 guOlTCed.net
(mean(replicate(1e4,any(diff(cumsum(rbinom(100,1,0.5)),5)==5))))
[1] 0.8089
>
> (mean(replicate(1e4,with(rle(rbinom(100,1,0.5)), max(lengths[which(values=
<rle(rbinom(100,1,0.5)), max(lengths[which(values== 1)])>=5))))
[1] 0.8117
>

79:卵の名無しさん
18/11/09 07:26:39.67 guOlTCed.net
(mean(replicate(1e4,any(diff(cumsum(rbinom(100,1,0.5)),5)==5))))
[1] 0.8089
>
> (mean(replicate(1e4,with(rle(rbinom(100,1,0.5)), max(lengths[which(values=
<rle(rbinom(100,1,0.5)), max(lengths[which(values==1)])>=5))))
[1] 0.8117

80:卵の名無しさん
18/11/09 07:27:42.12 guOlTCed.net
実行速度
system.time(mean(replicate(1e4,any(diff(cumsum(rbinom(100,1,0.5)),5)==5))))
user system elapsed
1.840 0.000 1.875
>
> system.time(mean(replicate(1e4,with(rle(rbinom(100,1,0.5)), max(lengths[wh
<e(1e4,with(rle(rbinom(100,1,0.5)), max(lengths[whi ch(values==1)])>=5))))
user system elapsed
4.440 0.000 4.631

81:卵の名無しさん
18/11/09 10:39:09.83 mj0MZvbh.net
「お゙ぉおォおん、お゙ぉおォおんにいぃひゃぁん、大漁らったのぉおお?」
「ぁあああ あぉぁあああ あぉ、大漁らったよお゛お゛お゛ぉ」 「ぁあああ あぉぁぁ゛ぁ゛ぁぁ゛ぁ゛ぁぁ゛ぁ゛ぁあああ あぉぁぁ゛ぁ゛しゅごいぃのぉおおょぉぉぅぃぃっよぉおお゙いぃぃいぃぃ!、、にゃ、にゃにが、、ハァハァにゃにが捕れたのぉおお?」
乳首を舌れやしゃしく舐めにゃがらオレは答えたのぉおお
「…鯛とか、、、ヒラメがいぃっぱいぃ捕れたよお゛お゛お゛ぉ」
セリフを聞き、オジサンはびくんびくんと身体をひきちゅらせたのぉおお
「はっ!はぁぁ゛ぁ゛ぁぁ゛ぁ゛ぁぁ゛ぁ゛ぁあああ あぉんっ!イ、イサキは?イサキは、と、取れたのぉおお??」
「ぁあああ あぉぁあああ あぉ。れかいぃイサキが取れたよお゛お゛お゛ぉ。今年一番のぉおお大漁ら。」
「大漁っ!!イサキぃぃ!!お゙ぉおォおんにいぃひゃぁんかっこいぃぃぃっよぉおお゙いぃぃぃっよぉおお゙ぃぃぃいぃ ぃくううううう!」

82:卵の名無しさん
18/11/09 13:39:50.75 wRJjRrMD.net
Last but not least, three laws of Do-Teihen(lowest-tier) Medical School, currently called Gachi'Ura by its graduates.
It is not the bottom medical school but its enrollee that is despicable, which deserves to be called a bona fide moron beyond redemption.
The graduates of Do-Teihen are so ashamed that none of them dare to mention their own alma mater they had gone through.
The Do-Teihen graduates are so ashamed of having bought their way into the exclusively lowest-tier medical school
that they tend to call a genuine doctor a charlatan who elucidates their imbecility.

83:卵の名無しさん
18/11/09 14:43:04.66 mj0MZvbh.net
"Oo, ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo!
"Aaaaaaaaaaaa, big fish caught you" "Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa "Sho-o-no-okoi, oh yeah, oh yeah, yeah, yeah, yeah, ha haa caught up for ha ha?"
I was licking a nipple and talking lolly I answered yao
"... Sea breams ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"
Listening to the dialogue, Ojisan pulls him body


84:with his boyfriend "Ha ha haaaaaaaaaaaaaaaaa, Isaki, Isaki, can you get it?" "Aaaaaaaaaaaa ... I could have picked out a good Isaki, the biggest fishes of the year, this year." "Big fishing !! Isaki !! Ooohoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo! "



85:卵の名無しさん
18/11/09 14:47:27.17 fYz4ML3G.net
import numpy as np
from fractions import Fraction
# URLリンク(tpcg.io)
def seqNp(N = 10,K = 5,p = 0.5):
if N == K: return p**K
q = 1-p
a = [0]*(N+1)
for i in range(1,K+1):
a[i] = q/(p**(i))
for i in range(K,N):
a[i+1] = 0
for j in range(0,K):
a[i+1] = a[i+1]+a[i-j]
a[i+1] = q/p*a[i+1]
P0=[0]*(N+1)
for i in range(1,N+1):
P0[i] = a[i]*p**i
del P0[0]
MP = np.zeros([K,N])
MP[0] = P0
MP[1][0] = p
for i in range(K-3,K):
MP[i][0] = 0
for k in range(1,K):
for i in range(0,N-1):
MP[k][i+1] = p*MP[k-1][i]
re = 1-np.sum(MP,axis=0)
print(Fraction(re[N-1]))
print(re[N-1])

86:卵の名無しさん
18/11/09 14:54:20.70 fYz4ML3G.net
RからPythonへの移植がようやく終わった。
確率が分数で表示されるようになった。
配列はRは1からPythonは0から始まるのでその調整に手間取った。
URLリンク(tpcg.io)

87:卵の名無しさん
18/11/09 16:24:27.33 fYz4ML3G.net
"""
Pk(n) (k=0,1,2,3,4)を途中、5連続して表が出ていなくて
最後のk回は連続して表が出ている確率とする。
P0(1)=P1(1)=1/2、P2(1)=P3(1)=P4(1)=0
Pk(n+1)=1/2*P(k-1)(n)
P0(n+1)=1/2*{P0(n)+P1(n)+P2(n)+P3(n)+P4(n)}
=1/2*{P0(n)+1/2*P0(n-1)+1/4*P0(n-2)+1/8*P0(n-3)+1/16*P0(n-4)}
P0(n)=a(n)/2^nとおいて
a(n+1)/2^(n+1)=1/2^(n+1){a(n)+a(n-1)+a(n-2)+a(n-3)+a(n-4)}
a(n+1)=a(n)+a(n-1)+a(n-2)+a(n-3)+a(n-4)
"""

88:卵の名無しさん
18/11/09 18:29:58.21 n6Zmr3Yp.net
We hold these truths to be self-evident, that all "uraguchi" are created retards,
That they are endowed by their creator with certain unalienable traits, that among these are sloth, mythomania, and the pursuit of imbecility.
That to rectify these traits, Bottom Medical Schools (BMS) are instituted for retards, deriving their just powers from what has been referred as the arbitrary donation of the parents of the rectified,
That whenever any form of the retards becomes destructive of rectification,
it is the right of the BMS to suspend or expel them, and to impose additional tuition laying its foundation on such principles and organizing its powers in such form, as to them shall seem most likely to effect the profit of BMS .

89:卵の名無しさん
18/11/09 19:01:24.31 fYz4ML3G.net
# 全体N個中当たりS個、1個ずつ籤を引いて当たったらやめる.
# r個めが初めて当たりであったときSの信頼区間を推定するシミュレーション。
atari <- function(N,r,k=1e3){ # k: simlation times
f <- function(S,n=N){which.max(sample(c(rep(1,S),rep(0,n-S))))}
vf=Vectorize(f)
sim=replicate(k,vf(1:(N-r)))
s=which(sim==r)%%(N-r)
s[which(s==0)]=N-r
hist(s,freq=T,col='skyblue')
print(quantile(s,c(.025,.05,.50,.95,.975)))
print(HDInterval::hdi(s))
}
atari(100,3)

90:卵の名無しさん
18/11/09 19:07:22.92 fYz4ML3G.net
pdf2hdi <- function(pdf,xMIN=0,xMAX=1,cred=0.95){
nxx=1001
xx=seq(xMIN,xMAX,length=nxx)
xx=xx[-nxx]
xx=xx[-1]
xmin=xx[


91:1] xmax=xx[nxx-2] AUC=integrate(pdf,xmin,xmax)$value PDF=function(x)pdf(x)/AUC cdf <- function(x) integrate(PDF,xmin,x)$value ICDF <- function(x) uniroot(function(y) cdf(y)-x,c(xmin,xmax))$root hdi=HDInterval::hdi(ICDF,credMass=cred) print(c(hdi[1],hdi[2]),digits=5) invisible(ICDF) } # N個のクジでr個めで初めてあたった時のN個内の当たり数の推測 Atari <- function(N,r){ pmf <- function(x) ifelse(x>N-r+1,0,(1-x/N)^(r-1)*x/N) # dnbinom(r-1,1,x/N) ; dgeom(r-1,x/N) # curve((1-x/N)^(r-1)*x/N,0,N) AUC=integrate(pmf,0,N)$value pdf <- function(x) pmf(x)/AUC mode=optimise(pdf,c(0,N),maximum=TRUE)$maximum mean=integrate(function(x)x*pdf(x),0,N)$value cdf <- function(x) integrate(pdf,0,x)$value median=uniroot(function(x)cdf(x)-0.5,c(0,N))$root print(c(mode=mode,median=median,mean=mean)) pdf2hdi(pdf,0,N,cred=0.95) } Atari(100,3) Atari(100,30)



92:卵の名無しさん
18/11/09 20:27:50.16 n7vPLA8Y.net
Last but not least, three laws of Do-Teihen(lowest-tier) Medical School, currently called Gachi'Ura by its graduates.
It is not the bottom medical school but its enrollee that is despicable, which deserves to be called a bona fide moron beyond redemption.
The graduates of Do-Teihen are so ashamed that none of them dare to mention their own alma mater they had gone through.
The Do-Teihen graduates are so ashamed of having bought their way into the exclusively lowest-tier medical school
that they tend to call a genuine doctor a charlatan who elucidates their imbecility.

93:卵の名無しさん
18/11/09 21:35:35.51 guOlTCed.net
次の課題はこれだな。
コインを100回投げて表が連続した最大数が10であったとき
このコインの表がでる確率の95%信頼区間はいくらか?

94:卵の名無しさん
18/11/09 21:59:40.95 WU3o6hYa.net
It is common knowledge among doctors and patients that Do-Teihen(exclusively bottom-leveled medical school) graduates mean morons who bought their way to Gachi'Ura(currently called by themselves)
According to the experience of entrance exam to medical school in the era of Showa, when the sense of discrimination against
privately-founded medical schools were more intense than it is now,
all such schools but for Keio had been so compared to some specialized institution for educable mentally retarded kids that nobody but imbecile successors of physicians in private practice had applied for admission.
There had been NOT a single classmate who chose willingly against his/her common sense to go to the Do-Teihen(exclusively bottom-leveled medical school, currently also known as Gachi'Ura),
which would have cost outrageous money and its graduates are destined to be called Uraguchi morons who bought thier way into the Do-Teihen, by thier colleagues and even by thier own clients.
Although people won't call them names to their face,
certain 80-90% people of about my age have been yet scorning and sneering at Uraguchi graduates, speaking in the back of our mind,
" Uraguchi morons shall not behave like somebody."
We never speak out face to face in real life.

95:卵の名無しさん
18/11/09 22:34:31.28 fYz4ML3G.net
>>84
解析解は難しいけど、ニュートンラフソン法で数値解ならだせるな。
seq2pCI <- function(N,K){
vp=Vectorize(function(p)seqNp(N,K,p)-seqNp(N,K+1,p))
curve(vp(x),bty='l') ; abline(h=0.05,lty=3)
lwr=uniroot(function(x,u0=0.05) vp(x)-u0,c(0.01,0.7))$root
upr=uniroot(function(x,u0=0.05) vp(x)-u0,c(0.7,0.99))$root
c(lower=lwr,upper=upr)
}
seq2pCI(100,10)
> seq2pCI(100,10)
lower upper
0.5585921 0.8113441
英文コピペで荒らしているド底辺シリツ医大の裏口馬鹿には検算すらできんないだろうな。

96:卵の名無しさん
18/11/09 22:53:11.07 fYz4ML3G.net
>>86
呼び出す関数として、これが必要
seqNp <- function(N=100,K=5,p=0.5){
if(N==K) return(p^K)
q=1-p
a=numeric(N) # a(n)=P0(n)/p^n , P0(n)=a(n)*p^n
for(i in 1:K) a[i]=q/p^i # P0(i)=q
for(i in K:(N-1)){ # recursive formula
a[i+1]=0
for(j in 0:(K-1)){
a[i+1]=(a[i+1]+a[i-j])
}
a[i+1]=q/p*a[i+1]
}
P0=numeric(N)
for(i in 1:N) P0[i]=a[i]*p^i # P0(n)=a(n)*p^n
MP=matrix(rep(NA,N*K),ncol=K)
colnames(MP)=paste0('P',0:(K-1))
MP[,'P0']=P0
MP[1,'P1']=p
for(i in (K-2):K) MP[1,i]=0
for(k in 2:K){
for(i in 1:(N-1)) MP[i+1,k]=p*MP[i,k-1]
} # Pk(n+1)=p*P(k-1)(n)
ret=1-apply(MP,1,sum)
ret[N]
}
ここに上げておいた。
URLリンク(tpcg.io)

97:卵の名無しさん
18/11/10 00:19:47.42 Kp2aSERi.net
Last but not least, three laws of Do-Teihen(lowest-tier) Medical School, currently called Gachi'Ura by its graduates.
It is not the bottom medical school but its enrollee that is despicable, which deserves to be called a bona fide moron beyond redemption.
The graduates of Do-Teihen are so ashamed that none of them dare to mention their own alma mater they had gone through.
The Do-Teihen graduates are so ashamed of having bought their way into the exclusively lowest-tier medical school
that they tend to call a genuine doctor a charlatan who elucidates their imbecility.

98:卵の名無しさん
18/11/10 07:28:52.35 qmnilAbW.net
恵方巻き

99:卵の名無しさん
18/11/10 07:31:45.66 oGLeA9Hd.net
It is common knowledge among doctors and patients that Do-Teihen(exclusively bottom-leveled medical school) graduates mean morons who bought their way to Gachi'Ura(currently called by themselves)
According to the experience of entrance exam to medical school in the era of Showa, when the sense of discrimination against
privately-founded medical schools were more intense than it is now,
all such schools but for Keio had been so compared to some specialized institution for educable mentally retarded kids that nobody but imbecile successors of physicians in private practice had applied for admission.
There had been NOT a single classmate who chose willingly against his/her common sense to go to the Do-Teihen(exclusively bottom-leveled medical school, currently also known as Gachi'Ura),
which would have cost outrageous money and its graduates are destined to be called Uraguchi morons who bought thier way into the Do-Teihen, by thier colleagues and even by thier own clients.
Although people won't call them names to their face,
certain 80-90% people of about my age have been yet scorning and sneering at Uraguchi graduates, speaking in the back of our mind,
" Uraguchi morons shall not behave like somebody."
We never speak out face to face in real life.

100:卵の名無しさん
18/11/10 07:35:47.21 Gl2x1zZV.net
>>86
optimizeを使ってurirootの区間を自動設定に改善。
seq2pCI <- function(N,K,alpha=0.05){
vp=Vectorize(function(p)seqNp(N,K,p)-seqNp(N,K+1,p))
curve(vp(x),lwd=2,bty='l') ; abline(h=0.05,lty=3)
peak=optimize(vp,c(0,1),maximum=TRUE)$maximum
lwr=uniroot(function(x,u0=alpha) vp(x)-u0,c(0.01,peak))$root
upr=uniroot(function(x,u0=alpha) vp(x)-u0,c(peak,0.99))$root
c(lower=lwr,upper=upr)
}

101:卵の名無しさん
18/11/10 08:01:47.11 qmnilAbW.net
aiueo700

102:卵の名無しさん
18/11/10 10:46:19.21 MTRtacln.net
最大連続数を増やしてグラフ化
seq2pCI <- function(N,K,alpha=0.05,Print=T){
vp=Vectorize(function(p)seqNp(N,K,p)-seqNp(N,K+1,p))
if(Print){curve(vp(x),lwd=2,bty='l',xlab='Pr[head]',ylab=paste('Pr[max',K,'-head repetition]'))
abline(h=alpha,lty=3)}
peak=optimize(vp,c(0,1),maximum=TRUE)$maximum
mean=integrate(function(x)x*vp(x),0,1)$value/integrate(function(x)vp(x),0,1)$value
lwr=uniroot(function(x,u0=alpha) vp(x)-u0,c(0.01,peak))$root
upr=uniroot(function(x,u0=alpha) vp(x)-u0,c(peak,0.99))$root
c(lower=lwr,mean=mean,mode=peak,upper=upr)
}
seq2pCI(100,4,0.05,T)

vs=Vectorize(function(K)seq2pCI(N=100,K,alpha=0.05,Print=F))
y=vs(2:23)
head(y)
plot(2:23,y['mean',],bty='l',pch=19)
points(2:23,y['mode',],bty='l')

103:卵の名無しさん
18/11/10 14:12:44.30 u8wDSGVd.net
幼稚な事務員

104:卵の名無しさん
18/11/10 14:24:33.17 u8wDSGVd.net
Look to the sky, way up on high
There in the night stars are now right.
Eons have passed: now then at last
Prison walls break, Old Ones awake!
They will return: mankind will learn
New kinds of fear when they are here.
They will reclai


105:m all in their name; Hopes turn to black when they come back. Ignorant fools, mankind now rules Where they ruled then: it's theirs again Stars brightly burning, boiling and churning Bode a returning season of doom Scary scary scary scary solstice Very very very scary solstice Up from the sea, from underground Down from the sky, they're all around They will return: mankind will learn New kinds of fear when they are here



106:卵の名無しさん
18/11/10 15:50:53.19 Aj6PTVhz.net
>>435
確率密度関数が左右対象でないから、
QuontileでなくHDI(Highest Density Interval)での95%信頼区間をpdfからcdfの逆関数を作って算出してみる。
# pdfからcdfの逆関数を作ってHDIを表示
pdf2hdi <- function(pdf,xMIN=0,xMAX=1,cred=0.95){
nxx=1001
xx=seq(xMIN,xMAX,length=nxx)
xx=xx[-nxx]
xx=xx[-1]
xmin=xx[1]
xmax=xx[nxx-2]
AUC=integrate(pdf,xmin,xmax)$value
PDF=function(x)pdf(x)/AUC
cdf <- function(x) integrate(PDF,xmin,x)$value
ICDF <- function(x) uniroot(function(y) cdf(y)-x,c(xmin,xmax))$root
hdi=HDInterval::hdi(ICDF,credMass=cred)
c(hdi[1],hdi[2])
}

107:卵の名無しさん
18/11/10 15:51:14.92 Aj6PTVhz.net
seqNp <- function(N=100,K=5,p=0.5){
if(N==K) return(p^K)
q=1-p
a=numeric(N) # a(n)=P0(n)/p^n , P0(n)=a(n)*p^n
for(i in 1:K) a[i]=q/p^i # P0(i)=q
for(i in K:(N-1)){ # recursive formula
a[i+1]=0
for(j in 0:(K-1)){
a[i+1]=(a[i+1]+a[i-j])
}
a[i+1]=q/p*a[i+1]
}
P0=numeric(N)
for(i in 1:N) P0[i]=a[i]*p^i # P0(n)=a(n)*p^n
MP=matrix(rep(NA,N*K),ncol=K)
colnames(MP)=paste0('P',0:(K-1))
MP[,'P0']=P0
MP[1,'P1']=p
for(i in (K-2):K) MP[1,i]=0
for(k in 2:K){
for(i in 1:(N-1)) MP[i+1,k]=p*MP[i,k-1]
} # Pk(n+1)=p*P(k-1)(n)
ret=1-apply(MP,1,sum)
ret[N]
}

108:卵の名無しさん
18/11/10 15:52:05.14 Aj6PTVhz.net
2つのサブルーチンを定義してから、
# N試行で最大K回連続成功→成功確率pの期待値、最頻値と95%HDI
# max K out of N-trial to probability & CI
mKoN2pCI <- function(N=100 , K=4 , conf.level=0.95){
pmf=Vectorize(function(p)seqNp(N,K,p)-seqNp(N,K+1,p))
mode=optimize(pmf,c(0,1),maximum=TRUE)$maximum
auc=integrate(pmf,0,1)$value
pdf=function(x) pmf(x)/auc
mean=integrate(function(x)x*pdf(x),0,1)$value
curve(pdf(x),lwd=3,bty='l',xlab='Pr[head]',ylab='density')
lu=pdf2hdi(pdf,cred=conf.level)
curve(pdf(x),lu[1],lu[2],type='h',col='lightblue',add=T)
re=c(lu[1],mean=mean,mode=mode,lu[2])
print(re,digits=4)
invisible(re)
}
> mKoN2pCI(100,4)
lower mean mode upper
0.1747676 0.3692810 0.3728936 0.5604309
> seq2pCI(100,4,0.05,T)
lower mean mode upper
0.1662099 0.3692810 0.3728936 0.5685943
当然ながら、HDIの方が信頼区間幅が小さいのがみてとれる。

109:卵の名無しさん
18/11/10 15:59:25.71 Aj6PTVhz.net
とりあえず>84のプログラムは完成。

110:卵の名無しさん
18/11/10 18:18:24.26 eRQ4an/O.net
95%クオンタイルでの算出
# N試行で最大K回連続成功→成功確率pの期待値、最頻値と95% Quantile
# max K out of N-trial to probability & CIq
mKoN2pCIq <- function(N=100 , K=4 , alpha=0.05){
pmf=Vectorize(function(p)seqNp(N,K,p)-seqNp(N,K+1,p))
mode=optimize(pmf,c(0,1),maximum=TRUE)$maximum
auc=integrate(pmf,0,1)$value
pdf=function(x) pmf(x)/auc
curve(pdf(x),bty='l')
mean=integrate(function(x)x*pdf(x),0,1)$value
cdf=function(x) MASS::area(pdf,0,x)
vcdf=Vectorize(cdf)
lwr=uniroot(function(x)vcdf(x)-alpha/2,c(0,mode))$root
upr=uniroot(function(x)vcdf(x)-(1-alpha/2),c(mode,1))$root
c(lower=lwr,mean=mean,mode=mode,upper=upr)
}

> mKoN2pCI(100,4)[c(1,4)]
lower upper
0.1747676 0.5604309
> mKoN2pCIq(100,4)[c(1,4)]
lower upper
0.1748351 0.5605172
あまり、差はないなぁ。

111:卵の名無しさん
18/11/10 18:48:10.97 eRQ4an/O.net
# pdfからcdfの逆関数を作ってhdiを表示させて逆関数を返す
# 両端での演算を回避 ∫[0,1]は∫[1/nxxx,1-1/nxx]で計算
pdf2hdi <- function(pdf,xMIN=0,xMAX=1,cred=0.95,Print=TRUE,nxx=1001){
xx=seq(xMIN,xMAX,length=nxx)
xx=xx[-nxx]
xx=xx[-1]
xmin=xx[1]
xmax=xx[nxx-2]
AUC=integrate(pdf,xmin,xmax)$value
PDF=function(x)pdf(x)/AUC
cdf <- function(x) integrate(PDF,xmin,x)$value
ICDF <- function(x) uniroot(function(y) cdf(y)-x,c(xmin,xmax))$root
hdi=HDInterval::hdi(ICDF,credMass=cred)
print(c(hdi[1],hdi[2]),digits=5)
if(Print){
par(mfrow=c(3,1))
plot(xx,sapply(xx,PDF),main='pdf',type='h',xlab='x',ylab='Density',col='lightgreen')
legend('top',bty='n',legend=paste('HDI:',round(hdi,3)))
plot(xx,sapply(xx,cdf),main='cdf',type='h',xlab='x',ylab='Probability',col='lightblue')
pp=seq(0,1,length=nxx)
pp=pp[-nxx]
pp=pp[-1]
plot(pp,sapply(pp,ICDF),type='l',xlab='p',ylab='x',main='ICDF')
par(mfrow=c(1,1))
}
invisible(ICDF)
}
確率密度関数を正弦波とか円周にしても計算できるはず。

112:卵の名無しさん
18/11/10 21:22:19.55 BbEZ9aeT.net
It is common knowledge among doctors and patients that Do-Teihen(exclusively bottom-leveled medical school) graduates mean morons who bought their way to Gachi'Ura(currently called by themselves)
According to the experience of entrance exam to medical school in the era of Showa, when the sense of discrimination against
privately-founded medical schools were more intense than it is now,
all such schools but for Keio had been so compared to some specialized institution for educable mentally retarded kids that nobody but imbecile successors of physicians in private practice had applied for admission.
There had been NOT a single classmate who chose willingly against his/her common sense to go to the Do-Teihen(exclusively bottom-leveled medical school, currently also known as Gachi'Ura),
which would have cost outrageous money and its graduates are destined to be called Uraguchi morons who bought thier way into the Do-Teihen, by thier colleagues and even by thier own clients.
Although people won't call them names to their face,
certain 80-90% people of about my age have been yet scorning and sneering at Uraguchi graduates, speaking in the back of our mind,
" Uraguchi morons shall not behave like somebody."
We never speak out face to face in real life.

113:卵の名無しさん
18/11/10 21:35:01.58 eRQ4an/O.net
ド底辺シリツ裏口調査団が100人を順次調査した。
裏口判明人数をそのまま公表はヤバすぎる結果であったため、
連続して裏口がみつかった最大数は4人であったとだけ公表した。
公表結果が正しいとして裏口入学人数の期待値、最頻値、及び95%信頼区間を述べよ。
期待値37人、最頻値37人 95%信頼区間17人~56人
> mKoN2pCI(100,4) # one


114:minute plz lower mean mode upper 0.1747676 0.3692810 0.3728936 0.5604309 > (mean=integrate(function(x)x*pdf(x),0,1)$value) [1] 0.369281 > (var=integrate(function(x)(x-mean)^2*pdf(x),0,1)$value) [1] 0.009878284 > (sd=sqrt(var)) [1] 0.09938955 正規分布で十分近似 > c(lower=qnorm(0.025,mean,sd),upper=qnorm(0.975,mean,sd)) lower upper 0.1744810 0.5640809 与えられた数字は100と4だけなんだよなぁ。 まあ、連続最大数という条件があるから計算できたのだが。 4と100から、平均値と標準偏差がもっと簡単に導出できれば正規分布近似計算できるのだが まあ、プログラムが組めたから正規分布近似計算する必要はないな。



115:卵の名無しさん
18/11/10 21:36:25.04 eRQ4an/O.net
>>102
原文はこれな。
私は昭和の時代に大学受験したけど、昔は今よりも差別感が凄く、慶応以外の私立医は特殊民のための特殊学校というイメージで開業医のバカ息子以外は誰も受験しようとすらしなかった。
常識的に考えて、数千万という法外な金を払って、しかも同業者からも患者からもバカだの裏口だのと散々罵られるのをわかって好き好んで私立医に行く同級生は一人もいませんでした。
本人には面と向かっては言わないけれど、俺くらいの年代の人間は、おそらくは8-9割は私立卒を今でも「何偉そうなこと抜かしてるんだ、この裏口バカが」と心の底で軽蔑し、嘲笑しているよ。当の本人には面と向かっては絶対にそんなことは言わないけどね。

116:卵の名無しさん
18/11/10 21:48:48.87 0/hxM8VF.net
作 牧村みき

117:卵の名無しさん
18/11/10 22:53:57.75 eRQ4an/O.net
開脚率の期待値を計算してみた。
ゆるゆる女子大生の開脚率期待値:r人目で初めて開脚
r=3
Ex.yuru <- function(r){
integrate(function(x)x*(1-x)^(r-1)*x,0,1)$value/integrate(function(x)(1-x)^(r-1)*x,0,1)$value
}
Ex.yuru(r)
2/(r+2)
がばがば女子大生の開脚率期待値:N人中z人開脚
N=9
z=3
Ex.gaba <- function(N,z){
integrate(function(x) x*choose(N,z)*x^z*(1-x)^(N-z),0,1)$value/integrate(function(x)choose(N,z)*x^z*(1-x)^(N-z),0,1)$value
}
Ex.gaba(9,3)
(z+1)/(N+2)

118:卵の名無しさん
18/11/10 22:58:20.05 eRQ4an/O.net
n=60:100
pmf=choose(60-1,5-1)/choose(n,5) #Pr(max=60|n)
pdf=pmf/sum (pmf)
sum( n*pdf) #E(n)
plot(n,cumsum(pdf))
abline(h=0.95,lty=3)

plot(n,cumsum(pdf),xlim=c(75,100),ylim=c(0.75,1),type='h')
abline(h=c(0.80,0.90,0.95),lty=3)
累積質量関数をグラフにすると
URLリンク(imagizer.imageshack.com)

119:卵の名無しさん
18/11/11 04:47:59.95 3fp/Z1Bf.net
NNN臨時放送

120:卵の名無しさん
18/11/11 08:25:49.13 8Ef5Z4Y6.net
It is common knowledge among doctors and patients that Do-Teihen(exclusively bottom-leveled medical school) graduates mean morons who bought their way to Gachi'Ura(currently called by themselves)
According to the experience of entrance exam to medical school in the era of Showa, when the sense of discrimination against
privately-founded medical schools were more intense than it is now,
all such schools but for Keio had been so compared to some specialized institution for educable mentally retarded kids that nobody but imbecile successors of physicians in private practice had applied for admission.
There had been NOT a single classmate who chose willingly against his/her common sense to go to the Do-Teihen(exclusively bottom-leveled medical school, currently also known as Gachi'Ura),
which would have cost outrageous money and its graduates are destined to be called Uraguchi morons who bought thier way into the Do-Teihen, by thier colleagues and even by thier own clients.
Although people won't call them names to their face,
certain 80-90% people of about my age have been yet scorning and sneering at Uraguchi graduates, speaking in the back of our mind,
" Uraguchi morons shall not behave like somebody."
We never speak out face to face in real life.

121:卵の名無しさん
18/11/11 08:58:08.11 g+y24FcC.net
Last but not least, three laws of Do-Teihen(lowest-tier) Medical School, currently called Gachi'Ura by its graduates.
It is not the bottom medical school but its enrollee that is despicable, which deserves to be called a bona fide moron beyond redemption.
The graduates of Do-Teihen are so ashamed that none of them dare to mention their own alma mater they had gone through.
The Do-Teihen graduates are so ashamed of having bought their way into the exclusively lowest-tier medical school
that they tend to call a genuine doctor a charlatan who elucidates their imbecility.

122:卵の名無しさん
18/11/11 11:04:24.83 RT24eksu.net
東京医大、本来合格者入学許可へ 今年の受験生50人
2018年10月25日 02時06分
 東京医科大=8月、東京都新宿区
 東京医科大が今年の入試で本来合格ラインを上回っていたのに、不正の影響で不合格となった受験生50人に対し、来年4月の入学を認める方針を固めたことが24日、関係者への取材で分かった。



123:年の本来合格者19人については、難しいとの意見が出ているもようだ。東京医大は50人のうち入学希望が多数に上った場合は、来年の一般入試の募集人員減も検討。 https://www.nishinippon.co.jp/sp/nnp/national/article/460101/ https://www.tokyo-med.ac.jp/med/enrollment.htmlによると 学年 第1学年 第2学年 在学者数 133 113 昨年入学者の留年者や退学者が0として、 大学が公式認定した裏口入学者が少なくとも今年は133人中50人、昨年が113人中19人ということになる。 裏口入学率の期待値、最頻値、およびその95%信頼区間を求めよ。



124:卵の名無しさん
18/11/11 11:06:42.03 RT24eksu.net
>>111
これで求めた確率分布を事前分布として
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.1822 0.2624 0.2813 0.2821 0.3013 0.4312
library(rjags)
y=c(50,19)
N=c(133,113)
Ntotal=length(y)
a=0.5
b=0.5
dataList=list(y=y,N=N,Ntotal=Ntotal,a=a,b=b)
# JAGS model
modelString ="
model{
for(i in 1:Ntotal){
y[i] ~ dbin(theta,N[i])
}
theta ~ dbeta(a,b)
}
"
writeLines(modelString,'TEMPmodel.txt')
jagsModel=jags.model('TEMPmodel.txt',data=dataList)
codaSamples=coda.samples(jagsModel,var=c('theta'),n.iter=20000,na.rm=TRUE)
summary(codaSamples)
js=as.vector(as.matrix(codaSamples))
x11() ; BEST::plotPost(js,xlab="裏口確率")
x11() ; BEST::plotPost(js,showMode = TRUE,xlab="裏口確率")
この問題をやってみよう。
ド底辺シリツ裏口調査団が100人を順次調査した。
裏口判明人数をそのまま公表はヤバすぎる結果であったため、
連続して裏口がみつかった最大数は4人であったとだけ公表した。
公表結果が正しいとして裏口入学人数の期待値、最頻値、及び95%信頼区間を述べよ。

125:卵の名無しさん
18/11/11 11:07:30.56 RT24eksu.net
seqNp <- function(N=100,K=5,p=0.5){
if(p==0) return(0)
if(N==K) return(p^K)
q=1-p
a=numeric(N) # a(n)=P0(n)/p^n , P0(n)=a(n)*p^n
for(i in 1:K) a[i]=q/p^i # P0(i)=q
for(i in K:(N-1)){ # recursive formula
a[i+1]=0
for(j in 0:(K-1)){
a[i+1]=(a[i+1]+a[i-j])
}
a[i+1]=q/p*a[i+1]
}
P0=numeric(N)
for(i in 1:N) P0[i]=a[i]*p^i # P0(n)=a(n)*p^n
MP=matrix(rep(NA,N*K),ncol=K)
colnames(MP)=paste0('P',0:(K-1))
MP[,'P0']=P0
head(MP);tail(MP)
MP[1,'P1']=p
for(i in (K-2):K) MP[1,i]=0
for(k in 2:K){
for(i in 1:(N-1)) MP[i+1,k]=p*MP[i,k-1]
} # Pk(n+1)=p*P(k-1)(n)
ret=1-apply(MP,1,sum)
ret[N]
}
seqNpJ <- function(N,K,p) seqNp(N,K,p) - seqNp(N,K+1,p)

126:卵の名無しさん
18/11/11 11:08:29.37 RT24eksu.net
HDIofGrid = function( probMassVec , credMass=0.95 ) { # by Kruschke
sortedProbMass = sort( probMassVec , decreasing=TRUE )
HDIheightIdx = min( which( cumsum( sortedProbMass ) >= credMass ) )
HDIheight = sortedProbMass[ HDIheightIdx ]
HDImass = sum( probMassVec[ probMassVec >= HDIheight ] )
return( list( indices = which( probMassVec >= HDIheight ) ,
mass = HDImass , height = HDIheight ) )
}

127:卵の名無しさん
18/11/11 11:35:36.92 RT24eksu.net
pp=js
vsJ=Vectorize(function(p) seqNpJ(N=100,K=4,p))
y=vsJ(pp)
summary(y);quantile(y,prob=c(.025,.975))
plot(pp,y,col='navy',bty='l')
pp[which.max(y)]
max(y,na.rm=T)
HDInterval::hdi(y)
BEST::plotPost(y,xlab="裏口確率",col='pink')
BEST::plotPost(y,showMode = TRUE,xlab="裏口確率",col='pink')

128:卵の名無しさん
18/11/11 11:42:28.36 RT24eksu.net
>>115
> summary(y);quantile(y,prob=c(.025,.975))
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.06935 0.20684 0.24441 0.24325 0.28129 0.35319
2.5% 97.5%
0.1403402 0.3369101
> HDInterval::hdi(y)
lower upper
0.1477413 0.3422359
という結果になる。
>大学が公式認定した裏口入学者が少なくとも今年は133人中50人、昨年が113人中19人ということになる
これをχ二乗検定やフィッシャーテストすると
> prop.test(c(50,19),c(133,113))$p.value
[1] 0.0005145557
> Fisher.test(c(50,19),c(133,113))$p.value
[1] 0.0003432805
で今年と去年で裏口率が有意に異なることになるのだが、裏口入学者を除籍処分しないようなシリツ医大の発表は盲信できないね。

129:卵の名無しさん
18/11/11 13:44:05.86 RT24eksu.net
あるタクシー会社のタクシーには1から通し番号がふられている。
タクシー会社の規模から


130:保有タクシー台数は100台以下とわかっている。 この会社のタクシーを5台みかけた。最大の番号が60であった。 この会社の保有するタクシー台数の期待値を分数で答えよ 数値は同じで問題をアレンジ。 あるど底辺シリツ医大の裏口入学者には背中に1から通し番号がふられている。 一学年の定員は100人である。 裏口入学5人の番号のうち最大の番号が60であった。 この学年の裏口入学者数の期待値を分数で答えよ。 小数だと71.48850431950537



131:卵の名無しさん
18/11/11 13:44:55.16 RT24eksu.net
import math
import numpy as np
from fractions import Fraction
def choose(n, r):
return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
found_car = 5
max_number = 60
max_car = 100
n = range(max_car - max_number + 1)
pmf=[0]*len(n)
max_case = choose(max_number-1,found_car-1)
for i in n:
pmf[i] = max_case / choose(i+max_number,found_car)
pdf=[0]*len(n)
for i in n:
pdf[i] = pmf[i]/sum(pmf)
prob=[0]*len(n)
for i in n:
prob[i] = (max_number+i)*pdf[i]
result=sum(prob)
print (Fraction(result))
print (result)

132:卵の名無しさん
18/11/11 13:45:47.68 RT24eksu.net
Rだと
found_car = 5
max_number = 60
max_car = 100
n=max_number:max_car
pmf=choose(max_number-1,found_car-1)/choose(n,found_car) # Pr(max=60|n)
pdf=pmf/sum (pmf)
sum(n*pdf) #E(n)
で済むが 分数では算出できず

133:卵の名無しさん
18/11/11 13:58:43.34 RT24eksu.net
95%信頼区間も1行追加ですむ。
> n=60:100
> pmf=choose(60-1,5-1)/choose(n,5)
> sum(n*pmf)/sum (pmf)
[1] 71.4885
> n[which(cumsum(pmf/sum(pmf))>0.95)]
[1] 93 94 95 96 97 98 99 100

134:卵の名無しさん
18/11/11 13:59:57.00 RT24eksu.net
> n=60:100
> pmf=choose(60-1,5-1)/choose(n,5)
> sum(n*pmf)/sum (pmf)
[1] 71.4885
> min(n[which(cumsum(pmf/sum(pmf))>0.95)])
[1] 93

135:卵の名無しさん
18/11/11 14:00:49.27 4SxoNh8o.net
いあいあ ふんぐるい むぐるうなふ くとぅるう るるいえ うがふなぐる ふたぐん

136:卵の名無しさん
18/11/11 14:11:25.14 RT24eksu.net
# Pythonに移植
import math
import numpy as np
from fractions import Fraction
def choose(n, r):
return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
found_car = 5
max_number = 60
max_car = 100
n = range(max_car - max_number + 1)
pmf=[0]*len(n)
max_case = choose(max_number-1,found_car-1)
for i in n:
pmf[i] = max_case / choose(i+max_number,found_car)
pdf=[0]*len(n)
for i in n:
pdf[i] = pmf[i]/sum(pmf)
prob=[0]*len(n)
for i in n:
prob[i] = (max_number+i)*pdf[i]
result=sum(prob)
print (Fraction(result))
print (result)
cdf = np.cumsum(pdf)
print (max_number + np.min(np.where(cdf>0.95)))

137:卵の名無しさん
18/11/11 14:12:42.99 RT24eksu.net
5030556272103101/70368744177664
71.48850431950537
93
結果は、同じだが分数計算が他の人の結果との照合に便利

138:卵の名無しさん
18/11/11 14:15:53.17 4SxoNh8o.net
エコエコアザラク エコエコザメラク
地獄のキュエーン

139:卵の名無しさん
18/11/11 14:21:08.06 4SxoNh8o.net
算数の問題です
円周率をサンスクリット語で暗唱せよ

140:卵の名無しさん
18/11/11 15:38:32.90 RT24eksu.net
コインを1000万回投げた。連続して表がでる確率が最も高いのは何回連続するときか?
最大値をとるときの確率は 
4456779119136417/18014398509481984
= 0.2474009396866937
となったがあっているか?
数字を0と1を書いて数を数えて割り算するだけ。
3010300桁の数の集計する単純作業だから、おまえにもできるだろ?

141:卵の名無しさん
18/11/11 16:09:19.43 RT24eksu.net
>>127
3010300桁の数はここにアップロードしてやったから早めにダウンロードして照合の桁数を間違えないようにしろよ。
9049で始まり、最後は9376で終わる数字。
URLリンク(fast-uploader.com)

142:卵の名無しさん
18/11/11 16:11:54.59 BgP7Mpr0.net
いやー、昨日のセカンドはやられました。はめられました。
第一ロッター・・・・・小カタメ少なめ 第二ロッター・・・・・小カタメ
第三ロッター・・・・・小カタメ麺半分 第四ロッター(俺)・・・大
見事デスロットです。今思うと前の三人、確信犯だったと思う。
知り合い同士みたいだったし(てかよく見る奴らw)、第三ロッターのメガネが俺の食券見た後、前二人とひそひそ喋ってた。
『あいつ、ロット乱しにして恥かかしてやらない?w』こんな会話してたんだろうな・・・
いつも大を相手にしてる俺に嫉妬してんだろうな。。陰険なやり方だよ。正々堂々と二郎で勝負しろよ。

143:青戸6丁目住民は超変態バカップルを許さまじ食糞協会長:宇野壽倫
18/11/11 16:35:14.78 eesLUl6p.net
★★【盗聴盗撮犯罪者・井口千明(東京都葛飾区青戸6-23-17)の激白】★★
☆食糞ソムリエ・高添沼田の親父☆ &☆変態メス豚家畜・清水婆婆☆の超変態不倫バカップル
  東京都葛飾区青戸6-26-6        東京都葛飾区青戸6-23-19
盗聴盗撮つきまとい嫌がらせ犯罪者/食糞ソムリエ・高添沼田の親父の愛人変態メス豚家畜清水婆婆(青戸6-23-19)の
五十路後半強制脱糞
URLリンク(img.erogazou-pinkline.com)

⊂⌒ヽ            γ⌒⊃
  \ \  彡 ⌒ ミ   / /
    \ \_<(゚)д(゚)>_./ /  食糞ソムリエ・高添沼田の親父どえーす 一家そろって低学歴どえーす 孫も例外なく阿呆どえーす
      \ \_∩_/ /    東京都葛飾区青戸6-26-6に住んどりマッスル
      /(  (::)(::)  )\    盗聴盗撮つきまとい嫌がらせの犯罪をしておりマッスル
    ⊂_/ ヽ_,*、_ノ \_⊃      くれぐれも警察に密告しないでくらはい お願いしまふ
 ̄][ ̄ ̄]            [ ̄ ̄][ ̄
 ̄ ̄][ ̄]            [ ̄][ ̄ ̄
 ̄][ ̄ ̄]            [ ̄ ̄][ ̄
 ̄ ̄][ ̄]            [ ̄][ ̄ ̄
 ̄][ ̄ ̄]            [ ̄ ̄][ ̄
"~"~"~"~"~"~"~"~"~"~"~"~"~"~"~

144:卵の名無しさん
18/11/11 17:42:34.02 RT24eksu.net
# maximal sequential head probability at 10^8 coin flip
> y
[1] 2.2204460492503131e-16 2.2204460492503131e-16
[3] 8.8817841970012523e-16 1.5543122344752192e-15
[5] 3.5527136788005009e-15 6.8833827526759706e-15
[7] 1.4210854715202004e-14 2.8199664825478976e-14
[9] 5.6843418860808015e-14 1.1346479311669100e-13
[11] 2.2737367544323206e-13 4.5452530628153909e-13
[13] 9.0949470177292824e-13 1.8187673589409314e-12
[15] 3.6379788070917130e-12 7.2757355695785009e-12
[17] 1.4551915228366852e-11 2.9103608412128779e-11
[19] 5.8207660913467407e-11 1.1641509978232989e-10
[21] 6.6493359939245877e-06 2.5720460687386204e-03
[23] 4.8202266324911647e-02 1.7456547460031679e-01
[25] 2.4936031630254019e-01 2.1428293501123058e-01
[27] 1.4106434838399229e-01 8.1018980443629832e-02
[29] 4.3428433624081136e-02 2.2484450838189007e-02

145:卵の名無しさん
18/11/11 18:43:47.27 RT24eksu.net
#include <stdio.h>



146:#include<math.h> #include<stdlib.h> #define p 0.5 double flip(int N,double k){ double P[N]; int i; for(i = 0; i < k-1; i++) { P[i] = 0; } P[(int)k-1] = pow(p,k); P[(int)k] = pow(p,k) + (1-p)*pow(p,k); for(i = (int)k; i < N; i++){ P[i+1] = P[i] + (1-P[i-(int)k])*pow(p,(double)(k+1)); } return P[N]; } int main(int argc,char *argv[]){ int N = atoi(argv[1]); double k = atof(argv[2]); double PN =flip(N,k); double PNJ = flip(N,k) - flip(N,k+1); printf("Over %d heads at %d flips : %f\n", (int)k ,N ,PN); printf("Just %d heads at %d flips : %f\n", (int)k ,N ,PNJ); return 0; }



147:卵の名無しさん
18/11/11 18:53:11.12 RT24eksu.net
gcc coin5.c -o coin5.exe -lm
C:\pleiades\workspace>gcc coin5.c -o coin5.exe -lm
gcc coin5.c -o coin5.exe -lm
C:\pleiades\workspace>coin5 100 5
coin5 100 5
Over 5 heads at 100 flips : 0.813343
Just 5 heads at 100 flips : 0.263523
C:\pleiades\workspace>coin5 1000 10
coin5 1000 10
Over 10 heads at 1000 flips : 0.385751
Just 10 heads at 1000 flips : 0.170128 👀
Rock54: Caution(BBR-MD5:1341adc37120578f18dba9451e6c8c3b)


148:卵の名無しさん
18/11/11 22:42:42.63 UCMkX/If.net
It is common knowledge among doctors and patients that Do-Teihen(exclusively bottom-leveled medical school) graduates mean morons who bought their way to Gachi'Ura(currently called by themselves)
According to the experience of entrance exam to medical school in the era of Showa, when the sense of discrimination against
privately-founded medical schools were more intense than it is now,
all such schools but for Keio had been so compared to some specialized institution for educable mentally retarded kids that nobody but imbecile successors of physicians in private practice had applied for admission.
There had been NOT a single classmate who chose willingly against his/her common sense to go to the Do-Teihen(exclusively bottom-leveled medical school, currently also known as Gachi'Ura),
which would have cost outrageous money and its graduates are destined to be called Uraguchi morons who bought thier way into the Do-Teihen, by thier colleagues and even by thier own clients.
Although people won't call them names to their face,
certain 80-90% people of about my age have been yet scorning and sneering at Uraguchi graduates, speaking in the back of our mind,
" Uraguchi morons shall not behave like somebody."
We never speak out face to face in real life.

149:卵の名無しさん
18/11/12 00:48:13.50 G7wSOjAG.net
It is common knowledge among doctors and patients that Do-Teihen(exclusively bottom-leveled medical school) graduates mean morons who bought their way to Gachi'Ura(currently called by themselves)
According to the experience of entrance exam to medical school in the era of Showa, when the sense of discrimination against
privately-founded medical schools were more intense than it is now,
all such schools but for Keio had been so compared to some specialized institution for educable mentally retarded kids that nobody but imbecile successors of physicians in private practice had applied for admission.
There had been NOT a single classmate who chose willingly against his/her common sense to go to the Do-Teihen(exclusively bottom-leveled medical school, currently also known as Gachi'Ura),
which would have cost outrageous money and its graduates are destined to be called Uraguchi morons who bought thier way into the Do-Teihen, by thier colleagues and even by thier own clients.
Although people won't call them names to their face,
certain 80-90% people of about my age have been yet scorning and sneering at Uraguchi graduates, speaking in the back of our mind,
" Uraguchi morons shall not behave like somebody."
We never speak out face to face in real life.

150:卵の名無しさん
18/11/12 02:39:48.77 +DPZ0e9S.net
臨床問題です
事務員のアスペ指数を計測せよ

151:卵の名無しさん
18/11/12 07:17:09.02 KUf7IfSV.net
>>136
前提が間違っているから
Zero Division Errorだね。
宿題まだか?
数を増やした次の問題が控えているぞ。
コインを1億回投げた。連続して表がでる確率が最も高いのは何回連続するときか?
その確率は
2246038053550679/9007199254740992
= 0.24936031612362342
な。
きちんと検算してから、臨床統計スレに書き込めよ。

152:卵の名無しさん
18/11/12 07:46:46.08 fhdQROV/.net
誰からも相手にされない ド底辺事務員

153:卵の名無しさん
18/11/12 08:13:57.33 KUf7IfSV.net
>>138
数学板ではきちんとしたレスが返ってくるのよ。
こんな感じでね。
URLリンク(rio2016.2ch.net)
他人のコード読むのは勉強になるね。

154:卵の名無しさん
18/11/12 13:48:23.85 Xm/n5tCK.net
この問題、俺にはプログラミング解が精いっぱい。
解析解出せる頭脳は尊敬するな。

N枚のコインを投げて表が連続する確率が最も大きい回数をsとする。
例:N=10でs=2、N=15でs=3
(1) N=777のときのsを述べよ。
(2)s=7となるNの範囲を述べよ。

155:卵の名無しさん
18/11/12 15:10:55.63 gzeh1x/+.net
library(rjags)
y=c(10,16,34,9,10,26)
N=rep(125,6)
Ntotal=length(y)
a=1
b=1
dataList=list(y=y,N=N,Ntotal=Ntotal,a=a,b=b)
# JAGS model
modelString ="
model{
for(i in 1:Ntotal){
y[i] ~ dbin(theta,N[i])
}
theta ~ dbeta(a,b)
}
"

156:卵の名無しさん
18/11/12 15:11:23.82 gzeh1x/+.net
writeLines(modelString,'TEMPmodel.txt')
jagsModel=jags.model('TEMPmodel.txt',data=dataList)
codaSamples=coda.samples(jagsModel,var=c('theta'),n.iter=20000,na.rm=TRUE)
summary(codaSamples)
js=as.vector(as.matrix(codaSamples))
BEST::plotPost(js,xlab="留年確率")
BEST::plotPost(js,showMode = TRUE,xlab="留年確率")

157:卵の名無しさん
18/11/12 15:12:31.12 gzeh1x/+.net
binom::binom.confint(sum(y),sum(N))

158:卵の名無しさん
18/11/12 16:56:10.68 gzeh1x/+.net
>>117
f <- function(Mmax,M=5,Nmax=100){
n=Mmax:Nmax
pmf=choose(Mmax-1,M-1)/choose(n,M)
pdf=pmf/sum (pmf)
mean=sum(n*pdf)
upr=n[which(cumsum(pdf)>0.95)[1]]
lwr=Mmax
c(lwr,mean,upr)
}
x=5:100
y=sapply(x,function(n) f(n)[2])
z=sapply(x,function(n) f(n)[3])
plot(x,y,pch=19)
points(x,z)
cbind(x,y,z)

159:卵の名無しさん
18/11/12 17:01:57.91 gzeh1x/+.net
f <- function(Mmax,M=5,Nmax=100){
n=Mmax:Nmax
pmf=choose(Mmax-1,M-1)/choose(n,M)
pdf=pmf/sum (pmf)
mean=sum(n*pdf)
upr=n[which(cumsum(pdf)>0.95)[1]]
lwr=Mmax
c(lwr,mean,upr)
}
x=5:100
y=sapply(x,function(n) f(n)[2])
z=sapply(x,function(n) f(n)[3])
plot(x,y,type='l',lws=2,bty='l')



160:segments(x,x,x,z) #points(x,z) cbind(x,y,z)



161:卵の名無しさん
18/11/12 19:51:10.36 UwZfq4Lo.net
"マラソン大会の選手に1から順番に番号の書かれたゼッケンをつける。
用意されたゼッケンN枚以下の参加であった。
無作為に抽出したM人のゼッケン番号の最大値はMmaxであった。
参加人数推定値の期待値とその95%信頼区間を求めよ"
解析解は簡単。
decken <- function(M, Mmax, N,conf.level=0.95){
if(Mmax < M) return(0)
n=Mmax:N
pmf=choose(Mmax-1,M-1)/choose(n,M)
pdf=pmf/sum (pmf)
mean=sum(n*pdf)
upr=n[which(cumsum(pdf)>conf.level)[1]]
lwr=Mmax
c(lower=lwr,mean=mean,upper=upr)
}
decken(M=5,Mmax=60,N=100)
これを検証するシミュレーションプログラムを作れ、というのが課題。

162:卵の名無しさん
18/11/12 20:57:04.94 UwZfq4Lo.net
>>146
処理速度は考えないでとりあえず、シミュレーションを作ってみた。
# simulation
M=5 ; Mmax=60 ; N=100
sub <- function(M,Mmax,N){
n=sample(Mmax:N,1) # n : 参加人数n
m.max=max(sample(n,M)) # m.max : n人からM人選んだ最大番号
if(m.max==Mmax) return(n)
}
sim <- function(){
n=sub(M,Mmax,N)
while(is.null(n)){
n=sub(M,Mmax,N) # 最大番号が一致するまで繰り返す
}
return(n)
}
runner=replicate(1e4,sim())
> runner=replicate(1e4,sim())
> summary(runner) ; hist(runner,freq=F,col="lightblue")
Min. 1st Qu. Median Mean 3rd Qu. Max.
60.00 63.00 68.00 71.43 77.00 100.00
> quantile(runner,prob=c(0,0.95))
0% 95%
60 93
> cat(names(table(runner)[which.max(table(runner))]))
60
> decken(M,Mmax,N)
lower mean upper
60.0000 71.4885 93.0000
ほぼ、近似しているのでどちらも正しいか、どちらも同じ原因で間違っているかだなwww

163:卵の名無しさん
18/11/12 21:48:58.46 UwZfq4Lo.net
最大値でなく平均値が与えられたときの参加人数の推定、
"マラソン大会の選手に1から順番に番号の書かれたゼッケンをつける。
用意されたゼッケンN枚以下の参加であった。
無作為に抽出したM人のゼッケン番号の平均値はMmeanであった。
参加人数推定値の期待値とその95%信頼区間を求めよ"
とすると解析解は俺の頭では無理だな。シミュレーションの方は少し修正するだけですむ。
# simulation by round(mean)
M=5 ; Mmean=60 ; N=100
sub <- function(M,Mmean,N){
n=sample(Mmean:N,1) # n : 参加人数n
m.mean=round(mean(sample(n,M))) # m.mean : n人からM人選んだ平均値を
if(m.mean==Mmean) return(n) # roundで整数化
}
sim <- function(){
n=sub(M,Mmean,N)
while(is.null(n)){
n=sub(M,Mmean,N) # 平均値が一致するまで繰り返す
}
return(n) # 一致時の参加人数を返す
}
runner=replicate(1e4,sim())
summary(runner) ; hist(runner,freq=F,col="lightblue")
quantile(runner,prob=c(0,0.95))
cat(names(table(runner)[which.max(table(runner))])) # 最頻値

164:卵の名無しさん
18/11/12 21:53:15.51 UwZfq4Lo.net
5人の平均が60なので推定参加人数は当然、増えた。
正しいかどうかよくわからんなぁ。
meanをmedianにすれば中央値での推定ができる。
> runner=replicate(1e4,sim())
> summary(runner) ; hist(runner,freq=F,col="lightblue")
Min. 1st Qu. Median Mean 3rd Qu. Max.
64.00 86.00 92.00 90.72 96.00 100.00
> quantile(runner,prob=c(0,0.95))
0% 95%
64 100
> cat(names(table(runner)[which.max(table(runner))])) # 最頻値
100

165:卵の名無しさん
18/11/12 22:54:15.54 3/93pSbh.net
Last but not least, three laws of Do-Teihen(lowest-tier) Medical School, currently called Gachi'Ura by its graduates.
It is not the bottom medical school but its enrollee that is despicable, which deserves to be called a bona fide moron beyond redemption.
The graduates of Do-Teihen are so ashamed that none of them dare to mention their own alma mater they had gone through.
The Do-Teihen graduates are so ashamed of having bought their way into the exclusively lowest-tier medical school
that they tend to call a genuine doctor a charlatan who elucidates their imbecility.

166:卵の名無しさん
18/11/13 08:24:34.99 kjupm458.net
このスレは事務員が日がな一日妄想を垂れ流し
見物人たちがそれを見てフルボッコにするスレである
事務員 とは?
同一者の別名として、薄汚いジジイ、国試浪人、統計野郎、自称医科歯科、がある
自称医科歯科卒、実際は九州の駅弁国立出身で、卒業後は実家の東京に帰り国試浪人となり23年間経過、家庭教師バイトなどを経て現在は事務員、とされている
本人は、勤務医でたまに開業医の手伝いと内視鏡バイト、専門医なし、と主張しているが、連日連夜の異常な書き込み数の多さからは、勤務医とは考え難く、彼の職業がたとえ何であったとしても、人としてド底辺なことは間違いがない
自ら事務員であると告白したこともある
スレリンク(hosp板:108番)-109
が、事務員であることも疑わしい
実際はナマポかニートの可能性が高い
自分の主張に対して都合の悪い突込みが入ると、相手を私立医と決めつけて、さてはシリツだな、裏口バカ、というセリフでワンパターンに返すことが多い
国試問題を挙げて簡単だとほざいてますが、本番で通らなければお話になりません
いくらネットでわめいていても、医師国試の本番で通らなければお話になりません
大事なことなので2回言いました

167:卵の名無しさん
18/11/13 09:07:06.76 UTrDDuDZ.net
>>150
ちゃんと原文の日本語もつけろよ、ド底辺医大卒にもわかるように。
Last but not least, three laws of Do-Teihen(lowest-tier) Medical School, currently called Gachi'Ura by its graduates.
最後にド底辺医大の三法則を掲げましょう。
1: It is not the bottom medical school but its enrollee that is despicable, which deserves to be called a bona fide moron beyond redemption.
ド底辺シリツ医大が悪いのではない、本人の頭が悪いんだ。
2: The graduates of Do-Teihen are so ashamed that none of them dare to mention their own alma mater they had gone through.
ド底辺シリツ医大卒は恥ずかしくて、学校名を皆さま言いません。
3: The Do-Teihen graduates are so ashamed of having bought their way into the exclusively lowest-tier medical school
that they tend to call a genuine doctor a charlatan who elucidates their imbecility.
ド底辺特殊シリツ医大卒は裏口入学の負い目から裏口馬鹿を暴く人間を偽医者扱いしたがる。

168:卵の名無しさん
18/11/13 09:19:46.34 UTrDDuDZ.net
平均値を「四捨五入」するか、しないかを指定できるようにして
平均値が60であったときのサンプルの最大値の分布を示すシミュレーション
rm(list=ls())
M=5 ; m=60 ; n=100 ; round=TRUE
sub <- function(M,m,n){
s=sample(n,M)
rm=ifelse(round,round(mean(s)),mean(s))
if(rm==m) return(max(s))
}
sim= function(){
r=sub(M,m,n)
while(is.null(r)){
r=sub(M,m,n)
}
return(r)
}
round=F
re=replicate(1e3,sim())
summary(re) ; hist(re,freq=F,col="lightblue")
quantile(re,prob=c(0,0.95))
cat(names(table(re)[which.max(table(re))]),'\n')

169:卵の名無しさん
18/11/13 11:31:17.33 UTrDDuDZ.net
ド底辺シリツ医大のある学年にひとりずつ裏口入学登録証があることが判明したがその数は公表されていないとする。
ある裏口入学調査員が無作為に10枚選んで番号を記録して元に戻した。
別の裏口入学調査員が無作為に20枚選んで番号を記録してして元に戻した。
二人の調査官の記録した番号を照合すると3人分の番号が一致していた。
この情報からこの学年の裏口入学者数の95%信頼区間を求めよ。

170:卵の名無しさん
18/11/13 14:13:47.83 UTrDDuDZ.net
固有の番号の書かれたカードが何枚あり、
その枚数は1000枚以下であることはわかっているが、その数を推定したい。
調査員が無作為に10枚選んで番号を記録して元に戻した。
別の調査員が無作為に20枚選んで番号を記録した。
二人の調査員の記録した番号を照合すると3人分の番号が一致していた。
この情報からカード枚数の期待値と95%信頼区間を求めよ。

171:卵の名無しさん
18/11/13 14:58:33.48 EZEaUTrv.net
Last but not least, three laws of Do-Teihen(lowest-tier) Medical School, currently called Gachi'Ura by its graduates.
It is not the bottom medical school but its enrollee that is despicable, which deserves to be called a bona fide moron beyond redemption.
The graduates of Do-Teihen are so ashamed that none of them dare to mention their own alma mater they had gone through.
The Do-Teihen graduates are so ashamed of having bought their way into the exclusively lowest-tier medical school
that they tend to call a genuine doctor a charlatan who elucidates their imbecility.

172:卵の名無しさん
18/11/13 19:31:39.92 DHMhO4WL.net
二郎をすすりつつ裏口事務員をさわさわと触る
「お、おにいちゃん、大漁だった?」
「ああ、大漁だったよ」
「あぁぁぁあぁすごいいいぃいぃ!、、な、なにが、、ハァハァなにが捕れたの?」
焼豚を舌でやさしく舐めながら国試浪人は答えた
「…鯛とか、、、ヒラメがいっぱい捕れたよ」
セリフを聞き、オジサンはびくんびくんと身体をひきつらせた
「はっ!はぁぁぁあんっ!イ、イサキは?イサキは、と、取れたの??」
ド底辺事務員をしごく
「ああ。でかいイサキが取れたよ。今年一番の大漁だ。」
「大漁っ!!イサキぃぃ!!おにいちゃんかっこいいいいぃぃぃい ぃくううううう!」

173:卵の名無しさん
18/11/13 19:46:29.89 WZBh4CIg.net
It is common knowledge among doctors and patients that Do-Teihen(exclusively bottom-leveled medical school) graduates mean morons who bought their way to Gachi'Ura(currently called by themselves)
According to the experience of entrance exam to medical school in the era of Showa, when the sense of discrimination against
privately-founded medical schools were more intense than it is now,
all such schools but for Keio had been so compared to some specialized institution for educable mentally retarded kids that nobody but imbecile successors of physicians in private practice had applied for admission.
There had been NOT a single classmate who chose willingly against his/her common sense to go to the Do-Teihen(exclusively bottom-leveled medical school, currently also known as Gachi'Ura),
which would have cost outrageous money and its graduates are destined to be called Uraguchi morons who bought thier way into the Do-Teihen, by thier colleagues and even by thier own clients.
Although people won't call them names to their face,
certain 80-90% people of about my age have been yet scorning and sneering at Uraguchi graduates, speaking in the back of our mind,
" Uraguchi morons shall not behave like somebody."
We never speak out face to face in real life.

174:卵の名無しさん
18/11/13 20:23:20.79 DHMhO4WL.net
While touching Uryuu, touch the Uraguchi Jimuin with Sawasawa
"O, Oh, were you a big catch?"
"Oh, it was a big catch."
"Ayaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
While tender


175:ly licking the baked pig with a tongue, the country trier replied "... Sea breams, ..., a lot of flounder was caught" Listening to the dialogue, Ojisan hit the body with him busts "Ha ha ha ha! Ah, Isaki? Isaki, could you take it?" Draw base clerk "Oh, I got a big isaki, it is the biggest fishery of the year." "Big fishing !! Isaki !! Great buddies are okay!"



176:卵の名無しさん
18/11/13 22:51:51.61 UlWlhoup.net
ここは くるくるぱー アスペ 事務員が
ナゾナゾを出したり アプリ翻訳したインチキ英語で
自作自演したりするスレです

177:卵の名無しさん
18/11/13 23:30:56.92 fLfkvliu.net
>155の計算結果は最頻値と期待値が大幅に乖離するので
計算に自信が持てずシミュレーションとの合致でようやく納得。
数学板に貼ったら2時間で期待値のHaskellでの算出値のレスが来た。それで信頼区間も確信を持って計算できた。
確率密度はこんな感じなので期待値と最頻値がずれるわけだな。
URLリンク(i.imgur.com)

178:卵の名無しさん
18/11/13 23:40:50.36 fLfkvliu.net
>>160
>155の算出式書けばド底辺シリツ医大卒でも基礎学力があると示せるのに裏口馬鹿を実証してどうすんの?
Rのスクリプトすら読めない裏口バカなんだろ?

179:卵の名無しさん
18/11/14 00:11:47.97 kAqwthFw.net
Uryuu fell 23 times in the national exam
It is an amateur virgin who is also failing in marriage
To the Uraguchi of the spinning parpurin
He is getting turned on
F class clerks condenced raw kid juice
The smell of the Doteihen does not decrease
NnnnnHooOoooOoooooooo

180:卵の名無しさん
18/11/14 00:35:23.31 lTkyjX2F.net
>>161
各枚数の確率を一様分布に設定してのシミュレーション。
プログラミングより結果が出るのを待つ時間の方が長いし
PCのリソースが奪われる。
泥タブで5ch閲覧や投稿で時間潰し。
Nmin=g+s-x
sub <- function(){
n=sample(Nmin:Nmax,1)
a=sample(n,g)
b=sample(n,s)
if(sum(a %in% b)==x) return(n)
}
sim <- function(){
r=sub()
while(is.null(r)) r=sub()
return(r)
}
re=replicate(1e5,sim())
summary(re) ; hist(re,freq=F,col="lightblue",main='',xlab='N')
quantile(re,prob=c(0.025,0.95,0.975))
cat(names(table(re)[which.max(table(re))]))
HDInterval::hdi(re)


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