The previous lesson built a fair coin: apply H to ∣0⟩, measure, and each outcome appears
with probability 21. But what if you want a coin that lands heads 75% of the time?
Adjusting the bias requires a different tool — a rotation gate.
From 50/50 to any split
Every single-qubit state can be parameterised as
∣ψ⟩=cos2θ∣0⟩+sin2θ∣1⟩,
where θ∈[0,π] controls the balance between the two amplitudes (up to an overall phase
we can ignore here). The Ry(θ) gate rotates the Bloch vector by angle θ around the
y-axis, starting from ∣0⟩ at the north pole:
Ry(θ)∣0⟩=cos2θ∣0⟩+sin2θ∣1⟩.
By the Born rule, the probability of measuring 1 after this rotation is
P(1)=sin2θ2=sin22θ.
Setting θ=2π recovers the Hadamard result: sin24π=21.
Choosing the angle for a 75/25 coin
We want P(1)=41. Working backwards:
sin22θ=41⟹sin2θ=21⟹2θ=6π⟹θ=3π.
After Ry(3π) the state is
Ry(3π)∣0⟩=23∣0⟩+21∣1⟩,
giving P(0)=(23)2=43 and P(1)=(21)2=41.
Try it
Build a circuit that produces a biased coin landing on 1 with probability 41 (and on
0 with probability 43). Apply the correctly tuned Ry rotation to qubit 0 and then
measure. The grader compares the probability distribution, so the angle must be right.
Run your code to see the quantum state.
After running, open the Probabilities panel. The bar for 0 should be at 0.75 and the bar for
1 at 0.25 — a 3:1 coin controlled by a single rotation angle.
Sign in on the full site to ask questions and join the discussion.