Home > Mobile >  A seemingly simple yet hard combinatorics problem
A seemingly simple yet hard combinatorics problem

Time:12-19

No matter how much I think about this, I cannot get the answer... The rules are fairly simple:

using only lowercase letters, from the English alphabet (no numbers or special characters allowed) tell me how many passwords of five characters can be created if there MUST be three or more vocals in the actual password.

I believe the right approach is to calculate the total amount of passwords you can create with five digits and then subtract from it those that do not fulfill the vocal requirements. Yet I have hit this mindblock and cannot seem to figure out how many passwords I need to discard. If you could lend me a hand it would be much appreciated!

CodePudding user response:

If I understood well your problem:

  • We count the total passwords: one letter for each position 26 * 26 * 26 * 26 * 26 = 265
  • Then, we calculate how many passwords we can create with three vowels: 5C3 * 53 * 212 (the vowels can be in 3 out of 5 positions, the rest will be 21 consonants to choose in the two remaining positions)
  • Now we calculate how many passwords we can create with four wovels: 5C4 * 54 * 21 (similar explanation as above)
  • We can as well have 5 vowels, don't we? So 5^5 (similar to the first point)

We then subtract all these to the total, so: 265 - 5C3 * 53 * 212 - 5C4 * 54 * 21 - 55

Edit right before going to bed: in this was we count the numbers of passwords which do not respect our standard of having at least three vowels. Since we want that, we just sum all the combinations without subtracting from the total.

  • Related