Probability of a password having no uppercase letters and at least one digit.

A password consists of 7 characters, where each character has is either an uppercase letter, lowercase letter or a (decimal) digit. I'm trying to find the probability of a password having no uppercase letters and at least one digit.

I know that my sample space has cardinality $$62^7$$. Let $$A = \text{set of that a passwords that have no uppercase letters }$$, and $$B = \text{set of that a password that have at least one decimal digit }$$. I tried to first find $$|A \cap B|$$ by using the property that $$|A \cap B| = |S| - |\bar A \cup \bar B|$$, where $$S$$ is our sample space and a bar represents the complement of a set with respect to the sample space. Now, $$\bar A \cup \bar B = \text{set of that a password that have only letters } = \bar B$$, from which we have $$|\bar A \cup \bar B| = 52^7$$. This thus gives $$|A \cap B| = |S| - |\bar A \cup \bar B| = 62^7-52^7$$. Thus we have that the probability of a password having no uppercase letters and at least one digit is: $$\frac{62^7-52^7}{62^7}$$ Now, I'm not entirely sure if my solution is correct as this probability coincides with the probability that I obtain a password with at least one decimal digit which would imply that the number of passwords which have at least one decimal digit and no lowercase letters is equal to the number of password with at least one decimal digit, which is obviously false. However, I'm not exactly sure where I've went wrong.

1 Answer

There are a total of $$62^7$$ passwords, of which $$36^7$$ have no uppercase letters. The latter can be split into two types - 1. at least one digit, 2. zero digits. So let's find the number of passwords with no uppercase letters and no digits (category 2). This would be $$26^7$$. Thus, the number of passwords with no uppercase letters and at least one digit is $$36^7-26^7$$. Finally, the desired probability is:

$$\frac{36^7-26^7}{62^7}$$