So I'm trying to learn inclusion/exclusion but am having a hard time understanding this example.
How many strings of length 6 over the alphabet ${A, B, C}$ start with a $C$ or end with a $C$?
So I understand there are $3^5$ strings of length $6$ that start with C, and also $3^5$ strings of length $6$ that end with C. However I'm not understanding the intersection part. What does it mean to get the intersection of those $2$ values? The example shows $C * * * * C$, so I'm assuming this means we can pick 4 more letters out of ${A, B, C}$, so $3^4$?
And the answer to the problem is $3^5 + 3^5 - 3^4 = 405$?
I tried looking at other problems posted but it just adds to my confusion.
You are correct, there are $3^5$ strings that start with a $C$ and there are $3^5$ that end on a $C$. However, adding all those up, we counted some strings twice, namely all strings that start and end in a $C$. We need to subtract these doubly counted strings. There $3^4$ strings that start with and end in a $C$ so the answer is indeed $3^5 +3^5 -3^4$. If we do not subtract the $3^4$ strings, we would have double counted for instance $CAAAAC$.