### Poisson

Interface poisson(m:real) : int where m>0.0. Returns a drawing from a Poisson distribution with intensity m. Raises Poisson exception, if m<=0.0. Characteristics Mean: m Variance: m Probability mass functions for Poisson distributions: Example poisson(100.0) A company has a network with a certain load. Each second an average of 100 packets is sent to the network. The number of packets arriving to the network per second […]

### Normal

Interface normal(n:real, v^2:real) : real Returns a drawing from a normal distribution with mean n and variance v. Raises Normal exception, if v<0.0. Characteristics Mean: n Variance: v Density functions for normal distributions: Example normal(505.0,4.0) A factory produces chocolate in packages of 500 grams. The amount of chocolate in each package has a normal distribution with mean n=505.0 grams and variance v=2.0 (as v^2=4.0) grams. […]

### Gamma

Note: Introduced in CPN Tools 3.2.2. Interface gamma(l:real, k:real) : real where l,k>=0.0. Returns a drawing from a gamma distribution with parameters l and k. Raises Gamma exception, if k<= 0.0 or l<=0.0. Related pages Random distribution functions

### Exponential

Function for generating values from exponential distributions Interface exponential(r:real) : real where r>0.0. Gives a drawing from a exponential distribution with intensity r. Raises Exponential exception, if r<=0.0. Characteristics Mean: 1/r Variance: 1/r^2 Density functions for exponential distributions: Example exponential(1.0/4.0) Customers arrive at a post office for service. The time between two arrivals has a mean of 4 minutes. The inter-arrival time has an exponential […]

### Erlang

Interface erlang(n:int, r:real) : real where n>=1 and r>0.0. Returns a drawing from an n-Erlang distribution with intensity r. A drawing from an n-Erlang distribution can be derived by addition of n drawings from a exponential distribution. Raises Erlang exception, if n<1 or r<=0.0. Characteristics Mean: n/r Variance: n/r^2 Density functions for n-Erlang distributions: Example erlang(100,50.0) A shop gives each 100th customer a present. The […]

### Discrete

Function for generating values from discrete uniform distributions Interface discrete (a:int, b:int) : int where a<=b. Returns a drawing from a discrete uniform distribution between a and b (a and b included). Raises Discrete exception, if a>b. Characteristics Mean: (a+b)/2 Variance: ((b-a+1)^2-1)/12 Probability mass functions for discrete uniform distributions: Example discrete(1,6) Throwing a die has a discrete uniform distribution with parameters a=1 and b=6. The […]

### Chi-square

Function for generating values from chi-square distributions. Interface chisq(n:int) : real where n>=1. It returns a drawing from a chi-square distribution with n degrees of freedom. The sum of the squares of n independent normally distributed random variables with mean 0.0 and standard deviation 1.0 is a chi-squared distribution with n degrees of freedom. It raises Chisq exception if n<1. Characteristics Mean: n Variance: 2n […]

### Binomial

Function for generating values from binomial distributions. Interface binomial(n:int, p:real) : int where n>=1 and 0.0<=p<=1.0. This function returns a drawing from a binomial distribution with n experiments and probability p for success. It raises Binomial exception if n<1 or p<0.0 or p>1.0. Characteristics Mean: np Variance: np(1-p) Probability mass functions for binomial distributions: Example binomial (100, 1.0/6.0) Throw a die 100 times and observe […]

### Beta

Note: Introduced in CPN Tools 3.2.2. Interface  beta(a:real, a:real) : real where a,b>=0.0. Returns a drawing from a beta distribution with parameters a and b. Raises Beta exception, ifa<=0.0 or b<=0.0. Related pages Random distribution functions

### Bernoulli

Function for generating values from Bernoulli distributions. Interface bernoulli(p:real) : int where 0.0<=p<=1.0. The value returned is either 0 or 1. The function returns a drawing from a Bernoulli distribution with probability p for success (i.e., success=1). It raises Bernoulli exception if p<0.0 or p>1.0. Characteristics Mean: p Variance: p(1-p) Example bernoulli(1.0/6.0) Throw a die and observe if a six was thrown. This experiment has […]