I can find the answers to similar questions online, but what I'm trying to do is develop my own intuition so I can find the answers. I am quite sure I am wrong, so could you look over my reasoning?
If $X = (1,2,3,4,5,6,7,8)$,
- How many strings over X of length 5?
Reasoning: Each character of the string is a choice of a selection from the string, so $8^5$.
- How many strings over X with length 5 don't contain $1$?
Reasoning: This is equivalent to strings of length 5 of an alphabet not containing $1$, so $7^5$.
- How many strings over X with length 5 contain $1$?
Reasoning: First get the strings for length 4 ($8^4$). Then select a position to insert a 1 ($5$). Compounded: $5\times 8^4$.
At this point I saw $8^5 \ne 7^4 + 5 \times 8^4$ and lost motivation. I am more sure 1 and 2 are correct than 3 so perhaps the simplest solution would be just $8^5-7^5$, but my logic for 3 "feels" sound. I am frustrated because I have never had these kinds of difficulties before. I look at solutions and though they too "feel" correct, I'd not have come up with them.
I apologize for the irregular question form, and understand if this isn't the site for this.