---
title: Problem set 11
heading: "Problem set 11: information, Markov chains and queues"
eyebrow: A11 · Problem set 11
type: problems
---

::: hook
These problems use lessons 49 to 51: entropy and channel capacity, Markov chains and their steady states, and queues with Little's law. Each topic has one central formula; most of the work is deciding which quantity it gives you.
:::

::: pool
pick: 12

::: check
kind: parts
given: n = 8 | 16 | 52

## A source picks one of {n} equally likely symbols.

::: part
answer: log(n)/log(2)
unit: bits
tolerance: 0.5%

### What is its entropy?

::: misses
- [log(n)] Use base 2.
- [any] $\log_2n$.
:::
:::
:::

::: check
kind: parts
given: p = 0.05 | 0.2 | 0.4

## A coin lands heads with probability {p}.

::: part
answer: -p*log(p)/log(2) - (1 - p)*log(1 - p)/log(2)
unit: bits
tolerance: 0.5%

### What is its entropy?

::: misses
- [any] $H(p)$.
:::
:::
:::

::: check
kind: parts
given: p = 0.001 | 0.01 | 0.02 | 0.05 | 0.1 | 0.2 | 0.3

## A binary channel flips bits with probability {p}.

::: part
answer: 1 + p*log(p)/log(2) + (1 - p)*log(1 - p)/log(2)
unit: bits
tolerance: 0.5%

### What is its capacity per use?

::: misses
- [1 - p] Unknown errors cost more than their fraction.
- [any] $1 - H(p)$.
:::
:::
:::

::: check
kind: parts
given: B = 1 | 10; s = 15 | 20 | 30

## A channel of {B} MHz has an SNR of {s} dB.

::: part
answer: B*log(1 + 10^(s/10))/log(2)
unit: Mb/s
tolerance: 0.5%

### What is its Shannon capacity?

::: misses
- [B*log(1 + s)/log(2)] Convert the SNR from dB first.
- [any] $B\log_2(1 + \text{SNR})$.
:::
:::
:::

::: check
kind: parts
given: a = 0.5 | 0.4; b = 0.25 | 0.3

## A source has three symbols with probabilities {a}, {b} and the rest.

::: part
answer: -(a*log(a) + b*log(b) + (1 - a - b)*log(1 - a - b))/log(2)
unit: bits
tolerance: 0.5%

### What is its entropy?

::: misses
- [log(3)/log(2)] That's the maximum, for equally likely symbols.
- [any] $-\sum p\log_2p$.
:::
:::
:::

::: check
kind: parts
given: a = 0.01 | 0.05; b = 0.1 | 0.3

## A two-state channel goes bad with probability {a} per step and recovers with probability {b}.

::: part
answer: a/(a + b)
tolerance: 0.5%

### What fraction of the time is it bad?

::: misses
- [b/(a + b)] That's the good fraction.
- [any] $\frac{a}{a + b}$.
:::
:::

::: part
answer: 1/a
tolerance: 0.5%

### How many steps does a good spell last on average?

::: misses
- [1/b] That's a bad spell.
- [any] Geometric with exit probability {a}.
:::
:::
:::

::: check
kind: parts
given: a = 0.1 | 0.2; b = 0.3 | 0.5; n = 1 | 2

## The same kind of chain starts good, with $a$ = {a} and $b$ = {b}.

::: part
answer: a/(a + b)*(1 - (1 - a - b)^n)
tolerance: 0.5%

### What is the chance it's bad after {n} steps?

::: misses
- [a/(a + b)] It hasn't reached the steady state yet.
- [any] $\pi_b\left(1 - (1 - a - b)^n\right)$.
:::
:::
:::

::: check
kind: parts
given: l = 400 | 800; m = 1000 | 2000

## Packets arrive at {l} per second at a server handling {m} per second.

::: part
answer: l/m/(1 - l/m)
tolerance: 0.5%

### How many are in the system on average?

::: misses
- [l/m] That's the utilization.
- [any] $\frac{\rho}{1 - \rho}$.
:::
:::

::: part
answer: 1000/(m - l)
unit: ms
tolerance: 0.5%

### How long does each spend in the system?

::: misses
- [any] $\frac{1}{\mu - \lambda}$.
:::
:::
:::

::: check
kind: parts
given: L = 5 | 20; W = 2 | 10

## A system holds {L} jobs on average, each staying {W} ms.

::: part
answer: L/W*1000
tolerance: 0.5%

### What is the throughput, per second?

::: misses
- [L*W] Little's law: $\lambda = L/W$.
- [any] $L = \lambda W$.
:::
:::
:::

::: check
kind: parts
given: rho = 0.6 | 0.8 | 0.9; N = 10 | 20

## An M/M/1 queue at load {rho} has a buffer that overflows above {N}.

::: part
answer: rho^(N + 1)
tolerance: 0.5%

### About what fraction of the time is it over {N}?

::: misses
- [rho^N] More than $N$ means at least $N + 1$.
- [any] $\rho^{N+1}$.
:::
:::
:::

::: check
kind: parts
given: m = 1000 | 5000; r = 0.5 | 0.9

## A server handles {m} per second at load {r}.

::: part
answer: r/(m*(1 - r))*1000
unit: ms
tolerance: 0.5%

### What is the mean wait before service starts?

::: misses
- [1000/(m*(1 - r))] That's the total time in the system.
- [any] $W_q = \frac{\rho}{\mu - \lambda}$.
:::
:::
:::

::: check
kind: parts
given: k = 2..8 int

## A Huffman code for symbols with probabilities $\frac12, \frac14, \ldots, \frac{1}{2^{\given{k}}}, \frac{1}{2^{\given{k}}}$.

::: part
answer: 2 - 2^(1 - k)
unit: bits
tolerance: 0.5%

### What is its average length, which equals the entropy?

::: misses
- [any] Lengths 1, 2, …, {k}, {k}; weight each by its probability.
:::
:::
:::

::: check
kind: parts
given: p = 0.05 | 0.1 | 0.2 | 0.25 | 0.3 | 0.4

## A binary source emits 1 with probability {p}, and its output is coded in blocks for compression.

::: part
answer: -p*log(p)/log(2) - (1 - p)*log(1 - p)/log(2)
unit: bits
tolerance: 0.5%

### What is the best possible average rate per symbol?

::: misses
- [1] That's the uncoded rate; compression can approach $H(p)$.
- [any] The entropy.
:::
:::
:::

::: check
kind: parts
given: l1 = 300 | 500; l2 = 200 | 300; m = 1000 | 1500

## Two independent Poisson streams of {l1} and {l2} per second merge into a server handling {m} per second.

::: part
answer: (l1 + l2)/m
tolerance: 0.5%

### What is the utilization?

::: misses
- [any] Merged Poisson streams add their rates.
:::
:::

::: part
answer: 1000/(m - l1 - l2)
unit: ms
tolerance: 0.5%

### What is the mean time in the system?

::: misses
- [any] $\frac{1}{\mu - \lambda}$ with $\lambda = \lambda_1 + \lambda_2$.
:::
:::
:::

::: check
kind: parts
given: q = 0.9 | 0.95; r = 0.6 | 0.7

## A Markov chain has $P(\text{stay good}) = $ {q} and $P(\text{stay bad}) = $ {r}.

::: part
answer: (1 - q)/(2 - q - r)
tolerance: 0.5%

### What is the steady-state probability of bad?

::: misses
- [(1 - r)/(2 - q - r)] That's good's share.
- [any] $\frac{1 - q}{(1 - q) + (1 - r)}$.
:::
:::
:::
:::
