Solution:
Concept: In n(A)+n(B) the common elements are counted twice, once in A and once in B. So n(A∪B)=n(A)+n(B)−n(A∩B); also n(A−B)=n(A)−n(A∩B); and n(B−A)=n(B)−n(A∩B), because a difference leaves out exactly the common elements.
Given: n(A)=31, n(B)=20, n(A∩B)=6.
Step 1 — (i) A − B.
From A we take away the 6 common elements.
n(A−B)=31−6=25
Step 2 — (ii) B − A.
From B we take away the 6 common elements.
n(B−A)=20−6=14
Step 3 — (iii) Union.
The union is made of three separate parts: only A, only B, and both.
n(A∪B)=25+14+6=45
The rule n(A∪B)=n(A)+n(B)−n(A∩B) gives the same number.
n(A∪B)=31+20−6=45
Watch out: The common elements belong to both A and B, but in the union they are counted only once.
Therefore, n(A−B)=25, n(B−A)=14 and n(A∪B)=45.