exercise 2.20 same-parity