Is there an error in the function geopdf?
显示 更早的评论
The function is described: y=f(x<|p)=p(1−p)^x ; x=0,1,2,… , I think, this i not correct, because x = 0 is not possible.
Correct is in my opinion: y=f(x<|p)=p(1−p)^(x-1) ; x=1,2,… ,
回答(2 个)
John D'Errico
2016-6-10
编辑:John D'Errico
2016-6-10
0 个投票
Why is x==0 not possible? Of course it is! 0 is just a number. You can attach any meaning to a number that you wish. It seems quite logical to start at 0. In fact, you can start at any point you wish, as long as the PDF is normalized to have unit "area" over the support. Since this is a discrete PDF, just compute a sum over the PDF.
So, is it true that the sum to infinity is 1? (Yes, it is.)
Steven Lord
2016-6-10
0 个投票
What is the probability of flipping a fair coin (probability of landing on heads = 0.5) 0 times before flipping a heads? Well, the first flip is either heads or tails and each occurs with probability 0.5 so geopdf(0, 0.5) (which is the probability of my first flip being heads -- no tails before heads) should be (and is) 0.5.
类别
在 帮助中心 和 File Exchange 中查找有关 Mathematics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!