Find how many strings of n lowercase letters from the English alphabet contain
a) the letter a?
- is the answer $26^n - 25^n$? I got this answer because the total number of letters in the alphabet is $26^n$ and the remaining number is $25$ because "a" is subtracted from the total number of letters.
b) the letters a and b?
- is the answer $26^n - 24^n$?
c) the letters a and b in consecutive positions with a preceding b, with all the letters distinct?
- don't know how to do
d) the letters a and b, where a is somewhere to the left of b in the string, with all the letters distinct?
- don't know how to do
For a you are right.
But for b you must use Inclusion–Exclusion Principle (as you mentioned in the comment with a little mistake): $$26^n-2\times25^n+24^n$$
Option c: The number of string of length $n-2$ with distinct letters without a,b is $P_{n-2}^{24}$ then you have $(n-1)$ position to place ba, so there is $(n-1)P_{n-2}^{24} = C_{n-2}^{24}(n-1)!$ strings. The right side of equality can achieve directly if we do as @Certainly not a dog said. Obviously for $n \geqslant 25$ there is no string!
Option d: The number of string of length $(n-2)$ with distinct letters without a,b is $P_{n-2}^{24}$ then you have $(n-1)$ places for the first of a,b, and then produce $(n)$ places for the later one. Symmetrically half of them is desired, so there is $n(n-1)/2P_{n-2}^{24}=C_2^nP_{n-2}^{24}=\frac{C_{n-2}^{24}n!}{2}$ strings. If you first choose positions of a,b that is $C_2^n$, and after that place others, the middle equation produces directly. If you first choose $(n-2)$ other letters, then sort them with a,b, and then consider exactly in half of them is desired, the right equation is achieved directly. Obviously for $n \geqslant 25$ there is no string!