Products & Services Solutions Academia Support User Community Company

Learn more about Statistics Toolbox   

geopdf - Geometric probability density function

Syntax

Y = geopdf(X,P)

Description

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

where .

Examples

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

See Also

pdf, geocdf, geoinv, geostat, geornd

Geometric Distribution

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS