Exercise 6.16 (you can do it faster using the concept of independence)