Geometric probability density function
Y = geopdf(X,P)
Y = geopdf(X,P) computes the geometric pdf at each of the values in X using the corresponding probabilities in P. X and P can be vectors, matrices, or multidimensional arrays that all have the same size. A scalar input is expanded to a constant array with the same dimensions as the other input. The parameters in P must lie on the interval [0 1].
The geometric pdf is
Suppose you toss a fair coin repeatedly. If the coin lands face up (heads), that is a success. What is the probability of observing exactly three tails before getting a heads?
p = geopdf(3,0.5) p = 0.0625