With replacement and repetition is allowed, if we can choose from the 26 letters of the alphabets, how many length 10 strings/ words can we make that either start with the substring "try" or end with "try". I know this is about the inclusion exclusion principle, so it would be words that start with TRY + words that end with TRY - the duplicates between them. This is how I started it:
Words that start with try: 26^7 (because first 3 letters are not changeable).
Words that end with try: 26^7 (last 3 letters are not changeable)
But how do I calculate the numbers that both begin and end with try (the duplicates) ? Thanks.
There are $N=26^4$ string which both start and end with TRY. The next action depends on the fact if such words are allowed (this is not quite clear from the question).
If they are allowed you should subtract $N$ once, and if not allowed - twice.