[過去ログ] 臨床統計もおもしろいですよ、その2 (1002レス)
1-

このスレッドは過去ログ倉庫に格納されています。
次スレ検索 歴削→次スレ 栞削→次スレ 過去ログメニュー
50: 2018/11/06(火)12:33 ID:jkx5i2bQ(1/5) AAS
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
省2
51
(1): 2018/11/06(火)15:40 ID:jkx5i2bQ(2/5) AAS
コインを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)
省16
52: 2018/11/06(火)17:00 ID:QApCAMmZ(1) AAS
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)
}
省2
53
(1): 2018/11/06(火)19:54 ID:jkx5i2bQ(3/5) AAS
>>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):
省14
54: 2018/11/06(火)20:01 ID:jkx5i2bQ(4/5) AAS
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)
}
省18
55: 2018/11/06(火)20:43 ID:jkx5i2bQ(5/5) AAS
>>53
泥タブだと普通にみえるが、Win10のPCだと コードのインデントがなくなって左揃えされてしまうなぁ。
56: 2018/11/07(水)00:33 ID:J7bMbWmD(1/3) AAS
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):
省3
57: 2018/11/07(水)03:24 ID:5r6Cuw34(1) AAS
愛の妖精ぷりんてぃん
58: 2018/11/07(水)20:28 ID:J7bMbWmD(2/3) AAS
# 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)
省7
59
(1): 2018/11/07(水)20:32 ID:J7bMbWmD(3/3) AAS
ド底辺シリツ医大の裏口入学調査委員会が
裏口入学は高々10%と報告したとする。

その結果の検証に100人を調査したら4人続けて裏口入学生であった、という。
この検証から裏口入学率が10%であるか否かを有意水準1%で検定せよ。
60
(1): 2018/11/07(水)21:22 ID:s+v4AjoX(1) AAS
グリーンねえさん
61: 2018/11/08(木)07:40 ID:PGJy3ILP(1/4) AAS
>>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)){
省18
62: 2018/11/08(木)15:06 ID:PGJy3ILP(2/4) AAS
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]
63: 2018/11/08(木)15:07 ID:PGJy3ILP(3/4) AAS
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)
64: 2018/11/08(木)16:45 ID:PGJy3ILP(4/4) AAS
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)))
}
}
省12
65: 2018/11/08(木)20:38 ID:cpzz/2HM(1) AAS
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.
66: 2018/11/08(木)21:27 ID:PVj0UwaU(1) AAS
Hutanari Ti〇po
67: 2018/11/08(木)22:34 ID:klK7Dgwj(1/2) AAS
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.
ド底辺特殊シリツ医大卒は裏口入学の負い目から裏口馬鹿を暴く人間を偽医者扱いしたがる。
68: 2018/11/08(木)22:35 ID:klK7Dgwj(2/2) AAS
第一法則の英文の意図的な文法誤謬を指摘してみ!
69: 2018/11/08(木)22:37 ID:JqNfxHqE(1) AAS
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.
1-
あと 933 レスあります
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル

ぬこの手 ぬこTOP 0.013s