Click or drag to resize
StdRandomGeometric Method
Returns a random integer from a geometric distribution with success probability P.

Namespace: Algs4Net
Assembly: Algs4Net (in Algs4Net.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public static int Geometric(
	double p
)

Parameters

p
Type: SystemDouble
p the parameter of the geometric distribution

Return Value

Type: Int32
a random integer from a geometric distribution with success probability p; or int.MaxValue if p is (nearly) equal to 1.0.
Exceptions
ExceptionCondition
ArgumentExceptionunless p >= 0.0 and p <= 1.0
See Also