负二项分布(Negative Binomial Probability Distribution)
何谓负二项实验?
一个实验必须满足下列各条件,才能称为负二项实验。
1)某一个实验独立、重复地试行y次
2)每一试行均产生两结果:成功(Success)或失败(Failure)
3)每一试行成功的机率均为p,失败的机率为(1-p)或q
4)我们对出现第r次成功所经历的试行次数y有兴趣
负二项机率分布
The probability distribution for a negative binomial random variable Y is given by
其中
p=Probability of success on a single Binomial trail
q=1-p
y=Number of trails until the success is observed
负二项随机变数的平均数与变异数
-平均数
-变异数Example 1:To attach the housing on a motor,a production line assembler must use an electrical hand tool to set and tighten four bolts.Suppose that the probability of setting and tightening a bolt in any 1-second time interval is p=0.8.If the assembler fails in the first second, the probability of success during the second 1-second interval is 0.8 and so on.
a)Find the probability distribution of Y, the length of time until a complete housing is attached.
b)Find p(6).
c)Find the mean and variance of Y.Example 2:In an NBA championship series,the team which wins four games out of seven will be winner.Suppose that team A has probability of 0.55 of winning over the team B and both teams A and B face each other in the championship games.
a)What is the probability that team A will win the series in six games?
b)What is the probability that team A will win the series?
最近发现简书上有个人也在听唐老师的课,而且笔记写得非常好,从此转战不写笔记啦。偷个懒。
打卡吧
接下来是第5章 连续型随机变数
另外想起一个在看data.frame的时候,view(data)首字母要大写V
View(data)
为了画这个机率分布函数的图,费了我好大劲了,一顿百度,终于搞成。
1 首先百度了咋计算二项分布的概率
2 然后用ggplot作图发现histogram还有什么统计变换,总是提示'stat_bin'
绘图基本概念
3 这么看颜值的我最后一定要挑一个美丽的颜色!原谅绿色!色板
size <- 5
p <- 0.5
n1 <- c(0,1,2,3,4,5)
n2 <- dbinom(0:size,size,p)
data <- data.frame(n1,n2)
View(data)
library(ggplot2)
ggplot(data,aes(x=n1,y=n2))+geom_histogram(fill='#669900',stat='identity')

听课笔记
