# Rule of Sum and the Inclusion-Exclusion Principle

Rule of Sum and the Inclusion-Exclusion Principle

If there are ways of getting a result and ways to get a result , then the number of ways of getting or is , as long as the results and do not overlap.

n(A)

A

n(B)

B

A

B

n(A)+n(B)

A

B

To get the right number when there is overlap, think of the possible results and as sets. Then the number of ways to get an element from or is . This is called the principle of inclusion-exclusion.

A

B

A

B

n(A⋃B)=n(A)+n(B)-n(A⋂B)