# Lecture 21 - Binomial Distributions, Poisson Processes (pdf)

## Other Distributions

The exponential distribution pretty well takes care of arrival events in open systems. What about

• arrival events in closed systems, aka think time?
• service times?
• others?

These are normally modelled based on distributions that are abstractions of behaviour observed in logs or traces. Here are a few that turn up from time to time.

### Bernoulli & BinomialDistributions

Systems that are easily categorized into two distinct homogeneous classes.

#### Examples

Think times

• Easy versus hard problems
• Need to access manual versus no need to access manual

Service times

• Slow CPU versus fast CPU
• Local versus remote

#### Bernoulli

Coin-flipping is the natural analogue, but it covers any binary choice made at (biased!) random.

• P(tails) = 1-p

How do you sample a Bernoulli distribution in practice

• Get a random number, u, uniformly distributed on [0,L)
• If u < Lp then heads, else tails.

#### Binomial

Make N binary choices at random, all identical.

• P(k heads in N tosses) = (N choose k) p^k (1 - p)^(N-k)

How do you sample a binomial distribution in practice

1. Small N: sample a Bernoulli N times,
• linear in N for each sample
2. Medium N: divide the range [0,L) into N+1 parts proportional to (N choose k) and do binary search with u
• linear in N to set up
• logarithmic in N for each sample
3. Large N: converge to another distribution
• Poisson if Np is constant as N -> infinity
• Gaussian if p is constant as N -> infinity