# Package ikr.simlib.distributions.discrete

Discrete Distributions

See: Description

• Class Summary
Class Description
BernoulliDistribution
Bernoulli Distribution
Meaning: Single random experiment with the success probability $$q (0 \le q \le 1)$$ Parameters: Success probability = mean value $$q$$ Distribution: $$P(X=i) = p_i = \begin{cases} 1-q &\mbox{for } i=0 \\ q &\mbox{for } i=1 \\ 0 & \mbox{else } \end{cases}$$ Expected value: $$E[X]=q$$ Variance: $$VAR[X]=q(1-q)$$ Coefficient of variation: $$c_T=\sqrt{ \frac{ 1-q }{q} }$$ Generating func.: $$G(z)=1-q+qz$$ Parser example:  [...].Distribution = Bernoulli [...].Distribution.mean = 0.6
BinomialDistribution
Binomial Distribution
Meaning: Probability for $$i$$ successes in $$n$$ Bernoulli trials with the parameter $$q(0 \le q \le 1)$$ Parameters: success probability $$q(0 < q \le 1$$ number of trials $$n > 0$$ Alternative: mean $$E[X] \ge 0$$ and variance $$VAR[X] (0 \le VAR[X] \le E[X]$$ parameters: $$q = 1- \frac{VAR[X]}{E[X]}$$ $$n = \frac{(E[X])^2}{E[X] - VAR[X]}$$ Distribution: $$P(X=i) = \binom{n}{i} \cdot q^i \cdot (1-q)^{n-i}$$ Expected value: $$E[X]= nq$$ Variance: $$VAR[X]= nq(1-q)$$ Coefficient of variation: $$c_T= \sqrt{ \frac{ 1-q }{nq} }$$ Generating func.: $$G(z)= (1-q+qz)^n$$ Parser example:  [...].Distribution = Binomial [...].Distribution.Mean = 15.0 [...].Distribution.Variance = 10.5 
DiscreteConstantDistribution
Discrete Deterministic Value
Meaning: A constant integer value $$d$$ is returned Parameters: constant integer (mean) value $$d$$ Distribution: $$P(X=i) = \begin{cases} 1 &\mbox{for } i=d \\ 0 & \mbox{else } \end{cases}$$ Expected value: $$E[X]=d$$ Variance: $$VAR[X]=0$$ Coefficient of variation: $$c_X=0$$ Generating func.: $$G(z)=z^d$$ Parser example:  [...].Distribution = DiscreteConstant [...].Distribution.Data = 5
DiscreteDistribution
DiscreteDistributions are distributions that return integer values.
DiscreteGeneralDistribution
General Discrete Distribution
Meaning: The first $$n$$ values $$p_i (i = 0, ... DiscreteUniformDistribution Discrete Uniform Distribution Meaning: All integer values \(i$$ in the interval $$b_l \le i < b_u$$ ($$b_l$$ and $$b_u$$ being also integer values) have the same probability $$\frac{1}{b_u-b_l}$$ Parameters: lower limit $$b_l$$ upper limit $$b_u > b_l$$ Distribution: $$P(X=i) = \begin{cases} \frac{1}{b_u-b_l} &\mbox{for } b_l \le i < b_u \\ 0 & \mbox{else } \end{cases}$$ Expected value: $$E[X]=\frac{b_l+b_u-1}{2}$$ Variance: $$VAR[X]=\frac{(b_u-b_l-1) \cdot (b_u-b_l+1)}{12}$$ Coefficient of variation: $$c_X=\frac{ \sqrt{ (b_u-b_l-1) \cdot (b_u-b_l+1) } }{ \sqrt{3} \cdot (b_l+b_u-1)}$$ Generating func.: $$G(z)=z^{b_l}+...+z^{b_u-1}$$ Parser example:  [...].Distribution = DiscreteUniform [...].Distribution.LowerBound = 3 [...].Distribution.UpperBound = 7 
GeometricDistribution
Geometric Distribution
Meaning: Probability for $$i$$ failures prior to the first success in independent Bernoulli experiments with the parameter $$q(0 \le q \le 1)$$ Parameters: success probability $$q(0 < q \le 1)$$

With mean parameter $$m : q = \frac{1}{1+m}$$ Distribution: $$P(X=i) = (1-q)^i \cdot q = (\frac{m}{m+1})^i \cdot \frac{1}{m+1} \mbox{for } i = 0,1,2,... NegBinDistribution Negative Binomial Distribution Meaning: Probability, that \(i$$ failed Bernoulli trials with the parameter $$q$$ will precede $$k$$ successes Parameters: success probability $$q(0 \le q \le 1)$$ number of successful trial $$k \ge 0$$ With mean value and variance parameters: $$q= \frac{VAR[X]}{E[X]}$$ $$k= \frac{E[X]}{VAR[X] - E[X]}$$ Distribution: $$P(X=i) = \binom{i+k-1}{k-1} \cdot q^k \cdot (1-q)^i = \binom{i+ \frac{m^2}{v-m} -1}{ \frac{m^2}{v-m} -1} \cdot (\frac{m}{v})^{\frac{m^2}{v-m}} \cdot (1- \frac{m}{v})^i$$ Expected value: $$E[X]= \frac{1-q}{q} \cdot k = m$$ Variance: $$VAR[X]= \frac{1-q}{q^2} \cdot k = \frac{m}{q} = v$$ Coefficient of variation: $$c_T= \frac{1}{ \sqrt{(1-q) \cdot k}}$$ Generating func.: $$G(z)= \frac{q^k}{(1-(1-q) \cdot z)^k}$$ Parser example:  [...].Distribution = NegBin [...].Distribution.Mean = 5 [...].Distribution.Variance = 10 
PoissonDistribution
Poisson Distribution
Meaning: Probability of the number of arrivals in a time interval with the duration $$t$$ for a Markovian arrival process (limit distribution of a binomial distribution for $$n \to \infty , q \to 0, nq \to \lambda t$$) Parameters: mean value $$m = \lambda t > 0$$ Distribution: $$P(X=i) = \frac{(\lambda t)^i}{i!} \cdot exp(-\lambda t) = \frac{m^i}{i!} \cdot exp(-m)$$ Expected value: $$E[X]= \lambda t = m$$ Variance: $$VAR[X]= \lambda t = m$$ Coefficient of variation: $$c_T=\frac{1}{ \sqrt{ \lambda t }} = \frac{1}{ \sqrt{m}}$$ Generating func.: $$G(z)= exp(-\lambda t \cdot (1-z)) = exp(-m \cdot (1-z))$$ Parser example:  [...].Distribution = Poisson [...].Distribution.Mean = 2.5
ShiftedGeometricDistribution
Shifted Geometric Distribution
Meaning: Probability for $$i-1$$ failures prior to the first success in independent Bernoulli experiments with the parameter $$q(0 \le q \le 1)$$ Parameters: Success probability $$q$$

With mean value parameter $$m : q = \frac{1}{m}$$ Distribution: \(P(X=i) = (1-q)^{i-1} \cdot q = (\frac{m-1}{m})^i \cdot \frac{1}{m-1} \mbox{for } i = 1,2,...
ZipfDistribution
Zipf Distribution ("Discrete Pareto Distribution")
ZipfMandelbrotDistribution
Zipf-Mandelbrot Distribution

# Discrete Distributions

Classes, that have been derived from DiscreteDistribution, override the abstract method next(), which returns an integer value.