This question was asked in Example 14

Plz explain how 1-p(b) come when 1-p(a') taken outside

Honey Jomy's image