The derivation in Section 2 is geometric and explicitly uses the
inclusion-exclusion principle.
They cover initial encounters with combinatorial reasoning; selections, arrangements, and distributions; binomial series and generating functions; alternating sums, the
inclusion-exclusion principle, rook polynomials, and Fibonacci Nim; recurrence relations; special numbers; linear spaces and recurrence sequences; and counting with symmetries.
They explain such topics as combinatorics is, permutations and combinations, the
inclusion-exclusion principle, generating functions and recurrence relations, trees, group actions, and Dirichlet's pigeonhole principle.
The application of the inclusion-exclusion principle to word counting due to Goulden and Jackson (1979, 1983) is used to derive the result.
We describe and prove our results in Section 3 using the inclusion-exclusion principle. Algorithmic aspects are also considered in this section.
This multiple counting is eliminated by use of the inclusion-exclusion principle (see among others [GJ83], [Szp01], and [FS07, 111.6.4] for details).