With type_a as one bit and val as two bits, the legal pairs are (0,0), (0,1), (0,2), (0,3), and (1,3). In the uniform legal-pair model, type_a is 1 for one of five pairs, so its probability is 1/5.
Reason it through
- The implication leaves all four val values legal when type_a is 0 but only one value legal when type_a is 1.
- Adding solve type_a before val changes the marginal choice of type_a to roughly one half before selecting a compatible val.
- A finite simulation fluctuates around the expected rate. Measure the distribution instead of expecting an exact count in every short run.
