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,… ,

Answers (2)

John D'Errico
John D'Errico on 10 Jun 2016
Edited: John D'Errico on 10 Jun 2016
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.)
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.

Categories

Find more on Mathematics in Help Center and File Exchange

Asked:

on 10 Jun 2016

Answered:

on 10 Jun 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!