This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a<- rbinom(1000,10000,0.3) | |
hist(a,breaks = seq(2500,3500,25),freq=FALSE) | |
curve(dnorm(x,mean= 3000,sd= sqrt(2100)),add=TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a<- rbinom(1000,1,0.3) #(繰り返し回数,各乱数のベルヌーイ分布の回数,成功率) | |
hist(a,freq=TRUE,breaks=seq(0,1,0.5)) | |
table(a) | |
a<- rbinom(1000,10,0.3) | |
hist(a,freq=TRUE,breaks=seq(0,10,1)) | |
table(a) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b<- numeric(1000) #1000個の推定値が入れるようにする | |
for(i in 1:1000){ | |
a<- ceiling(runif(n=1000,min=0,max=6)) #ceilingで切り上げ | |
b[i]<- mean(a) #初め[i]忘れてて失敗した | |
} | |
hist(b,breaks=seq(3,4,0.025),freq = FALSE) #freq=TRUEでdensityになる | |
curve(dnorm(x,mean=3.5,sd=sqrt(0.002916667)),add=TRUE) #sd=標準偏差!!!! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~pitch 10000 dices~ | |
b<- numeric(10000) | |
for( i in 1:10000){ | |
a<- ceiling(runif(n=10000,min=0,max=6)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~pitch 1000 dice~ | |
b<- numeric(10000) | |
for( i in 1:10000){ | |
a<- ceiling(runif(n=1000,min=0,max=6)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~pitch 100 dice~ | |
b<- numeric(10000) | |
for( i in 1:10000){ | |
a<- ceiling(runif(n=100,min=0,max=6)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~pitch 10 dice~ | |
b<- numeric(1000) | |
for( i in 1:1000){ | |
a<- ceiling(runif(n=10,min=0,max=6)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~pitch 1dice~ | |
b<- numeric(1000) #to enter 1000 estmimated values | |
for( i in 1:1000){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~pitch 1dice~ | |
b<- numeric(1000) #to enter 1000 estmimated values | |
for( i in 1:1000){ | |
a<- ceiling(runif(n=1,min=0,max=6)) #ceiling:round, assume dice | |
b[i]<- sum(a) #when i forgot [i], i could not success | |
hist(b,,breaks=seq(0,6,1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curve(dnorm(x,0,1),from=-4,to=4) #make normal distribution | |
curve(dnorm(x,0,2),add=TRUE) | |
curve(dnorm(x,2,1),add=TRUE) | |
text(x=0,y=0.4,"N(0,1)") #add text | |
text(x=2,y=0.4,"N(2,1)") | |
text(x=0,y=0.2,"N(0,2)") |