I’ve been struggling with this question for a while and was hoping you could help because I think I’ve gone wrong somewhere with my calculations, Firstly I calculated the total number of passwords (including those that didn’t satisfy the criteria) by doing $(26+26+10)^8 = 62^8$ Then I calculated the number of passwords with at least one number: $(10\cdot 62^7)$ (I was thinking the other $7$ characters could be any). I also did the same for at least one uppercase letter: $(26\cdot 62^7)$ and for at least one lowercase letter: $(26\cdot 62^7)$ I then tried to calculate the number of passwords with at least one number and at least one uppercase letter: $(10\cdot 26\cdot 62^6)$, with at least one number and one lowercase letter: $(10\cdot 26\cdot 62^6)$, with at least one uppercase letter and one lowercase letter: $(26\cdot 26\cdot 62^6)$ My logic was to use the inclusion-exclusion rule and find the number of passwords that satisfy all of them: $$62^8 - (10\cdot 62^7) - 2(26\cdot 62^7) + 2(10\cdot 26\cdot 62^6) + (26^2\cdot 62^6) = 6.793308176 \cdot 10^{13}$$ My problem is by the same logic I’ve used, I could simply do $26\cdot 26\cdot 10\cdot 62^5 = 6.193057944 \cdot 10^{12}$ I don’t understand why these two answers are different, have I gone wrong somewhere?
Thank you very much for your help!
As already mentioned in the comments this is an object lesson for applying the inclusion-exclusion principle.
You problem have started already with the wrong calculation of passwords with at least one digit. In fact it is clearly the number of unrestricted passwords minus the number of passwords containing no digits: $$ 62^8-(62-10)^8=62^8-52^8. $$
Similarly the number of passwords containing no uppercase letters is: $$ 62^8-(62-26)^8=62^8-36^8. $$
One could naively assume that we are done if all three false possibilities are subtracted. This however would be wrong. Any set containing only uppercase letters or only lowercase letters or only digits will be subtracted twice. Therefore we should add them back. If there were some additional symbols we should have now subtract all passwords containing only these symbols. As, however, no such symbols are left, the final result is:
$$62^8-52^8-36^8-36^8+26^8+26^8+10^8-0^8=159655911367680.$$