Worked problems
Try each one first, then open the solution.
1. Entropy of two random variables (from your notes)
$X\in\{0,1,2,3\}$, $Y\in\{0,1\}$ with $p(0,0)=p(1,0)=p(2,1)=p(3,1)=\tfrac14$. Find $H(X)$, $H(Y)$, $H(X,Y)$, $H(X|Y)$, $H(Y|X)$, $I(X;Y)$.
Solution.
$X$ is uniform on 4 values: $H(X)=2$ bits. $p(Y=0)=p(Y=1)=\tfrac12$: $H(Y)=1$. The joint has four equal outcomes: $H(X,Y)=2$. Then $H(X|Y)=H(X,Y)-H(Y)=1$, $H(Y|X)=H(X,Y)-H(X)=0$ ($X$ determines $Y$), and $I(X;Y)=H(X)+H(Y)-H(X,Y)=1$ bit.
2. Toy RSA
$p=3$, $q=11$, $e=3$. Find $d$, encrypt $m=4$, decrypt.
Solution.
$n=33$, $\varphi=20$, $3d\equiv1\pmod{20}\Rightarrow d=7$. $c=4^3\bmod33=31$. $31^7\bmod33$: $31\equiv-2$, $(-2)^7=-128\equiv-128+132=4$. ✓
3. Discrete logarithm
Modulo 17, with generator $g=3$, find $x$ with $3^x\equiv13$.
Solution.
Powers: $3,9,27\equiv10,30\equiv13$. So $x=4$ ($3^4=81=4\cdot17+13$).
4. Miller–Rabin on 341
Test $n=341$, base $a=2$.
Solution.
$340=2^2\cdot85$, so $d=85$, $s=2$. $2^{10}=1024\equiv1\pmod{341}$, so $2^{85}=2^{5}=32$. Not $\pm1$. Square: $32^2=1024\equiv1$, reached from $32\ne\pm1$, so a non-trivial square root of 1 exists: 341 is composite ($=11\cdot31$), although it passes the plain Fermat test.
5. BB84 with a partial eavesdropper
Eve intercepts and resends a fraction $p$ of the photons. What is the sifted-key QBER? What $p$ reaches the 11% threshold?
Solution.
Intercepted sifted bits have error 1/4, others 0, so $\text{QBER}=p/4$. $p/4=0.11\Rightarrow p=0.44$. At $p=1$, QBER = 25%.
6. Key length
$n=10^6$ sifted bits, $Q=2\%$, $f=1.1$. Estimate the asymptotic secret fraction and key length.
Solution.
$h(0.02)=-0.02\log_2 0.02-0.98\log_2 0.98\approx0.1414$. $R=1-h-f\,h=1-0.1414-0.1555\approx0.703$. Length $\approx7.0\times10^5$ bits (before finite-key losses).
7. Weak-pulse statistics
Mean photon number $\mu=0.5$. Probability of a multi-photon pulse, and its share among non-empty pulses?
Solution.
$P(0)=e^{-0.5}=0.6065$, $P(1)=0.3033$, so $P(n\ge2)=1-0.6065-0.3033\approx0.090$. $P(n\ge1)=0.3935$; multi-photon share $=0.090/0.3935\approx23\%$. This is why decoy states are essential.
8. Hong–Ou–Mandel
Show that $|1,1\rangle$ never produces a coincidence at a 50:50 beam splitter.
Solution.
$a^\dagger\to(a^\dagger+b^\dagger)/\sqrt2$, $b^\dagger\to(a^\dagger-b^\dagger)/\sqrt2$. Then $a^\dagger b^\dagger|0\rangle\to\tfrac12(a^{\dagger2}-b^{\dagger2})|0\rangle$ because the cross terms cancel: $=\tfrac1{\sqrt2}(|2,0\rangle-|0,2\rangle)$. No $|1,1\rangle$ term, hence no coincidences.
9. CHSH value
For $|\Phi^+\rangle$ with $E(\theta_A,\theta_B)=\cos2(\theta_A-\theta_B)$ and angles $a=0$, $a'=\pi/4$ (Alice), $b=\pi/8$, $b'=-\pi/8$ (Bob), compute $S=E(a,b)+E(a,b')+E(a',b)-E(a',b')$.
Solution.
$E(a,b)=\cos(\pi/4)=\tfrac{\sqrt2}2$; $E(a,b')=\cos(\pi/4)=\tfrac{\sqrt2}2$; $E(a',b)=\cos(\pi/4)=\tfrac{\sqrt2}2$; $E(a',b')=\cos(3\pi/4)=-\tfrac{\sqrt2}2$. Hence $S=\tfrac{\sqrt2}2(1+1+1+1)=2\sqrt2\approx2.83$, the Tsirelson maximum, exceeding the classical bound 2.
10. Loss budget and PLOB
Fibre loss 0.2 dB/km. Find $\eta$ and the PLOB limit at 300 km.
Solution.
300 km = 60 dB, $\eta=10^{-6}$. $K\le-\log_2(1-\eta)\approx1.44\times10^{-6}$ bit per channel use. At a 1 GHz clock that is at most about 1.4 kbit/s; realistic systems achieve far less.
11. Teleportation corrections
In teleportation, Alice’s Bell measurement returns $|\Psi^-\rangle$. What does Bob do?
Solution.
From $|\psi\rangle_C|\Phi^+\rangle_{AB}=\tfrac12\sum_k|\Phi_k\rangle_{CA}\,\sigma_k|\psi\rangle_B$, outcomes map to corrections $\Phi^+\to I$, $\Phi^-\to Z$, $\Psi^+\to X$, $\Psi^-\to XZ$ (equivalently $ZX$; they differ only by a global phase). Alice sends the two classical bits identifying the outcome, and Bob applies that Pauli. Without them Bob’s state is the maximally mixed $I/2$.