Example. Counting bit strings [00GB]
How many strings of 8 bits either start with a 1 or end with 00?
There are 2^7 strings of 8 bits that start with a 1: the first bit is fixed, and we can independently choose each remaining bit to be 0 or 1.
Similarly, there are 2^6 strings of 8 bits that end with 00.
We cannot simply add these numbers, because of overlap: there are some strings of bits that both start with 1 and end with 00. In fact there are 2^5 such strings, since three bits are fixed and we can freely choose the other 5. Thus, the total number of bit strings that start with 1 or end with 00 is 2^7 + 2^6 - 2^5 = 160.