Suppose that a procedure can be broken down into a sequence of two tasks. If there are ways to do the first task and for each of these ways of doing the first task, there are ways to do the second task, then there are ways to do the procedure.
If a task can be done either in one of ways or in one of ways, where none of the set of ways is the same as any of the set of ways, then there are ways to do the task.
The Subtraction Rule / Principle of inclusion–exclusion §
If a task can be done in either ways or ways, then the number of ways to do the task is + minus the number of ways to do the task that are common to the two different ways.
There are ways to do a task if it can be done using a procedure that can be carried out in ways, and for every way , exactly of the ways correspond to way .