I need a random number generator using a geometric distribution
http://en.wikipedia.org/wiki/Geometric_Distribution.
I tried MathNet.Numerics.Distributions
:
public void GeometricTest()
{
var geometric = new Geometric(0.1);
int back = geometric.Sample();
Assert.Greater(back, -1);
}
But the test gives just negative numbers. Does somebody spot my mistake or give me advice for other ways of sampling a geometric distribution?