This is an automated email from the ASF dual-hosted git repository. aherbert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-rng.git
commit bacb5d654343e548837203ef3b19b75f423ed191 Author: aherbert <aherb...@apache.org> AuthorDate: Thu Feb 14 15:23:31 2019 +0000 Changed equations to use MathJax notation. --- .../rng/sampling/distribution/GeometricSampler.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/GeometricSampler.java b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/GeometricSampler.java index 757367d..92b8df2 100644 --- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/GeometricSampler.java +++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/GeometricSampler.java @@ -25,17 +25,17 @@ import org.apache.commons.rng.UniformRandomProvider; * <p>This distribution samples the number of failures before the first success taking values in the * set {@code [0, 1, 2, ...]}. * - * <p>The sample is computed using a related an exponential distribution. If {@code X} is an - * exponentially distributed random variable with parameter λ, then {@code Y = floor(X)} is a - * geometrically distributed random variable with parameter p = 1 − e<sup>−λ</sup>, with {@code p} - * the probability of success. + * <p>The sample is computed using a related exponential distribution. If \( X \) is an + * exponentially distributed random variable with parameter \( \lambda \), then + * \( Y = \left \lfloor X \right \rfloor \) is a geometrically distributed random variable with + * parameter \( p = 1 − e^\lambda \), with \( p \) the probability of success. * * <p>This sampler outperforms using the {@link InverseTransformDiscreteSampler} with an appropriate * Geometric inverse cumulative probability function. * - * <p>Usage note: As the probability of success ({@code p}) tends towards zero the mean of the - * distribution ({@code (1-p)/p}) tends towards infinity and due to the use of {@code int} for the - * sample this can result in truncation of the distribution. + * <p>Usage note: As the probability of success (\( p \)) tends towards zero the mean of the + * distribution (\( \frac{1-p}{p} \)) tends towards infinity and due to the use of {@code int} + * for the sample this can result in truncation of the distribution. * * @see <a * href="https://en.wikipedia.org/wiki/Geometric_distribution#Related_distributions">Geometric