Skip to content
Tutorials Center
My learning

Topics

Lesson 34 of 36 ยท Projects and Practice

Practice Set: Poisson Processes, CTMCs and Random Walks

Eight worked practice problems on Poisson processes, continuous-time chains, random walks and Brownian motion, each solved with runnable code you can check.

You have now met four big ideas in this part of the course: Poisson processes, continuous-time Markov chains, random walks and Brownian motion. This practice set checks them with eight problems. Try each one on paper first, using the formulas from earlier lessons. Then open the code: it computes the answer from a formula and often confirms it by simulation, so you can see whether your own number is right.

Useful reminders:

  • Poisson count: P(N = k) = e^(-ฮผ) ฮผ^k / k! with ฮผ = ฮปt (definition).
  • Merging streams adds rates; thinning multiplies the rate by p (lesson).
  • CTMC: P(t) = exp(Qt), stationary distribution ฯ€Q = 0 (generator).
  • M/M/1: L = ฯ/(1 โˆ’ ฯ), W = 1/(ฮผ โˆ’ ฮป) (queue lesson).
  • Symmetric walk: Var Sโ‚™ = n; reflection gives P(Mโ‚™ โ‰ฅ a) = 2P(Sโ‚™ > a) + P(Sโ‚™ = a) (reflection).

Problems 1 to 4: Poisson and continuous-time chains

Problem 1. Calls reach a help line as a Poisson process at 6 per hour. What is the probability of at least 2 calls in 20 minutes? And what is the mean and standard deviation of the number of calls in 3 hours?

Problem 2. Customers arrive at a shop as a Poisson process with rate 30 per hour. Each independently spends money with probability 0.2. What is the probability that no paying customer arrives in 10 minutes? What is the mean time until the first paying customer?

Problem 3. A server alternates between Up and Down. Up goes to Down at rate 0.1 per hour, and Down goes back to Up at rate 0.9 per hour. Find the stationary probability of Up, and the probability that the server is Up at time 2 hours given it is Up now.

Problem 4. An M/M/1 queue has arrival rate 3 per minute and service rate 4 per minute. Find ฯ, the mean number in the system L, the mean time in the system W, and the probability the system holds at least 3 customers.

Python Solutions to problems 1 to 4

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

In Problem 3 the sum of the two rates (0.1 + 0.9 = 1) is the speed at which the chain forgets its start, which is why the correction term is e^(-t). In Problem 4, P(N โ‰ฅ 3) = ฯยณ because the geometric tail is P(N โ‰ฅ k) = ฯแต.

Problems 5 to 8: walks and Brownian motion

Problem 5. A symmetric simple random walk makes 50 steps. What is the probability it is exactly at 0? How does this compare with 1/โˆš(ฯ€n) for n = 25?

Problem 6. A gambler with 10 coins plays a game with win probability 0.48 per round and stops at 0 or 20 coins. What is the probability of reaching 20? What is the expected number of rounds?

Problem 7. For a symmetric walk of 30 steps, find P(Mโ‚ƒโ‚€ โ‰ฅ 5) where M is the running maximum.

Problem 8. For a standard Brownian motion find P(W(4) > 3), Cov(W(1), W(4)), and the probability that the maximum over [0, 4] exceeds 3.

Python Solutions to problems 5 to 8

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Problem 6 shows the effect of a small edge: a 2% disadvantage per round drops the success chance well below the fair value of 0.5. Problem 8 uses the continuous reflection result: the maximum of Brownian motion exceeds a level with exactly twice the probability that the endpoint does.

How to review your mistakes

  • If a Poisson answer is off by a factor, check that ฮป and t use the same time unit (hours versus minutes).
  • If a CTMC answer is wrong, check the row sums of Q (each must be 0).
  • If a walk answer is off, check whether you used Sโ‚™ > a where the formula needs Sโ‚™ โ‰ฅ a.
  • If a Brownian answer is wrong, remember the variance is t, so the standard deviation is โˆšt, not t.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. A Poisson process has rate 12 per hour. What is the probability of no events in 10 minutes?

    The mean in 10 minutes (1/6 hour) is 2, so P(N = 0) = e^(-2).
  2. 2. A two-state chain goes Up to Down at rate a and Down to Up at rate b. What is the stationary probability of Up?

    Balance: ฯ€_up a = ฯ€_down b, so ฯ€_up = b/(a + b).
  3. 3. For standard Brownian motion, P(max over [0, t] โ‰ฅ a) equals...

    The reflection principle doubles the endpoint tail probability.
  4. 4. In a gambler's ruin game with p = q = 1/2, i = 5, N = 20, how many rounds are expected?

    d_i = i (N - i) = 5 ร— 15 = 75.

Summary

  • Convert units first, then identify the model: Poisson count, exponential gap, thinning, CTMC, queue or walk.
  • Write the balance equations or formulas before computing.
  • Confirm formula answers with a quick simulation whenever possible.
  • Most errors come from units, signs on diagonals of Q, and strict versus non-strict inequalities.

Next: Project: A Bank Queue Simulator