Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nashutoing/88330026f2ff7a13e0eaddeb2f347e09 to your computer and use it in GitHub Desktop.
Save nashutoing/88330026f2ff7a13e0eaddeb2f347e09 to your computer and use it in GitHub Desktop.
binomial distribution per different amount of trial
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)
a<- rbinom(1000,100,0.3)
hist(a,freq=TRUE,breaks=seq(10,50,2))
table(a)
a<- rbinom(1000,1000,0.3)
hist(a,freq = TRUE,breaks =seq(200,400,8))
table(a)
a<- rbinom(1000,10000,0.3)
hist(a,freq = TRUE,breaks = seq(2500,3500,25))
table(a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment