1
$\begingroup$

Exercise:

Calculate the possibilities for a password according to the following conditions:

  • All passwords start with "pw";
  • This is followed by either 2 or 3 digits (0-9);
  • After which come 8 characters from the set {"p","x","f"}

For the digits I think that the solution is: 10^2 * 10^3. I think that for the last condition 3^8 is the correct calculation, but I'm not sure on how to combine all of the conditions to one calculation.

Would be nice if someone could help me!

$\endgroup$
  • $\begingroup$ Just like third condition, calculate for the second condition. Calculate for $2$ digits and then for $3$ digits. $\endgroup$ – Math Lover Jan 13 at 20:13
  • 1
    $\begingroup$ Hint: the passwords which have $2$ digits and the passwords which have $3$ digits are disjoint. That is, a password either has $2$ digits or $3$ digits. $\endgroup$ – Charles Hudgins Jan 13 at 20:13
  • $\begingroup$ and there is only one way for the first condition. $\endgroup$ – Math Lover Jan 13 at 20:14
  • $\begingroup$ @MathLover Is this correct: 1 * 10^2 * 10^3 * 3^8 ? $\endgroup$ – Mart Postma Jan 13 at 20:16
  • $\begingroup$ No, for $2$ digits, it is $1 \times 10^2 \times 3^8$. $\endgroup$ – Math Lover Jan 13 at 20:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.