Test your knowledge of passwords

Thread Starter

studiot

Joined Nov 9, 2007
4,998
Here's a nice problem someone is working on elsewhere for his maths exam tomorrow.

Problem: Create a password that contains 6 characters. The first four characters must be a letter the alphabet, however the first and forth character must be a vowel. The last 2 characters must be a number (1 through 9). How many possible passwords are there. No repetition of characters is allowed and the password is not case sensitive.
answer tomorrow.
 

joeyd999

Joined Jun 6, 2011
6,307
Sorry, joeyd, but No.
There are 5 ways to pick the 1st vowel.
There are 4 ways to pick the 4th vowel.
There are 24 ways to pick the 2nd letter.
There are 23 ways to pick the 3rd letter.
There are 9 ways to pick the 5th digit.
There are 8 ways to pick the 6th digit.

5*4*24*23*9*8 = 794,880

My answer is correct, or you mis-described the problem.
 

paulktreg

Joined Jun 2, 2008
851
There's nothing that says the 2nd or 3rd character can't be a vowel?

There are then:
5 ways to pick the 1st
25 ways to pick the 2nd
24 ways to pick the 3rd
2-4 ways to pick the 4th (depends on what you use for character 2 and 3) Gets complicated here!
9 ways to pick the 5th
8 ways to pick the 6th

Maximum possible number is then 5 x 25 x 24 x 4 x 9 x 8=864,000????
 

joeyd999

Joined Jun 6, 2011
6,307
There's nothing that says the 2nd or 3rd character can't be a vowel?

There are then:
5 ways to pick the 1st
25 ways to pick the 2nd
24 ways to pick the 3rd
2-4 ways to pick the 4th (depends on what you use for character 2 and 3)
9 ways to pick the 5th
8 ways to pick the 6th

Maximum possible number is then 5 x 25 x 24 x 4 x 9 x 8=864,000?
If you process the forth character before the 2nd and 3rd, you don't have to worry about whether or not the 2nd and/or 3rd characters were vowels.
 

WBahn

Joined Mar 31, 2012
32,877
Assumption #1: "Letter" means one of the 26 characters of the case-insensitive English alphabet.
Assumption #2: "Vowel" means one of the 5 characters from the set {a,e,i,o,u}.
Assumption #3: "no repetition of characters is allows" means that any given character can be used at most once within the entire password (as opposed to just meaning that the same character can't be used twice in succession).

I get the same answer as joeyd999 and for the same reasons.

If this is not the correct answer, then which of my assumptions is/are incorrect?
 

WBahn

Joined Mar 31, 2012
32,877
If you process the forth character before the 2nd and 3rd, you don't have to worry about whether or not the 2nd and/or 3rd characters were vowels.
And if you do process them in order, then you need to use a tree to track the choices, but the answer still comes out to 794880:

Branch #1: VCCVNN - 5*21*20*4*9*8 = 604800
Branch #2: VCVVNN - 5*21*4*3*9*8 = 90720
Branch #3: VVCVNN - 5*4*21*3*9*8 = 90720
Branch #4: VVVVNN - 5*4*3*2*9*8 = 8640
 

joeyd999

Joined Jun 6, 2011
6,307
Joey and WBahn, you have an error in the fourth place.
Reading literally, the text says "the first and forth character must be a vowel." This may mean they are the same vowel, but that would contradict the non-repetition clause.
 
Last edited:

djsfantasi

Joined Apr 11, 2010
9,237
Here's my shot...

Ok, I have assumptions beyond the explicitly stated requirements, which are that the second and third positions can also be a vowel as long as there is no repetition of characters. This is important, as it affects the options/combinations for the second and third characters. Someone not operating on this assumption may think there are only 21 or less choices for the second and third characters.

Secondly, the characters are picked in order of their position within the password. I.e., the fourth character will not be picked before the second and third characters are picked.

Now on to the problem.

It's easy to agree that we have 5 options for the first password character. (Assuming that we are not considering 'y' to be a vowel).

For the second, we have 25 options (26 less the first character chosen). Some people reduce this further, since we need another vowel for the fourth position, but there are 4 vowels left and we can pick any vowel for the second (and third) position and still satisfy the requirements.

The same logic applies to the third character, except we have one less option, given that we picked a character for the second position. Hence, we have 24 options.

The fourth character is a little tricky. Depending on the second and third charaxters, we have anywhere from 2 to 4 options. So lets calculate the combinations based on what we know so far and the various scenarios for the fourth character.

If 2&3 are not vowels, the combinations are:
5 x 25 x 24 x 4 = 12,500

If 2&3 has one vowel amongst them, the combinations are:
5 x 25 x 24 x 3 = 9,375

If 2&3 are both vowels, the combinations are:
5 x 25 x 24 x 2 = 6,250

Summing the combinations in each of the three scenarios, we get 28,125 combinations.

The combinations of the last two digits is 72 (9x8). Multiplying 28,125 x 72, we get a total number of combinations equal to 2,025,000
 

joeyd999

Joined Jun 6, 2011
6,307
Ok, I have assumptions beyond the explicitly stated requirements, which are that the second and third positions can also be a vowel as long as there is no repetition of characters.
My solution, and both of WBahn's, make the same assumption.

Secondly, the characters are picked in order of their position within the password. I.e., the fourth character will not be picked before the second and third characters are picked.
Why should order matter? These types of problems are generally (@WBahn: Always?) commutative. Besides, WBahn solved the same problem, both in order and out of order, each computation resulting in the same answer.

...

If 2&3 are not vowels, the combinations are:
5 x 25 x 24 x 4 = 12,500

If 2&3 has one vowel amongst them, the combinations are:
5 x 25 x 24 x 3 = 9,375

If 2&3 are both vowels, the combinations are:
5 x 25 x 24 x 2 = 6,250
Are you suggesting that there are 25 non-vowels in a 26 character alphabet?
 

Thread Starter

studiot

Joined Nov 9, 2007
4,998
djsfantasi, you started so well, I had high hopes, but you faded before the line. Sorry.

Joey

The password must be

1 Any vowel
2 Any remaining letter after 1 is picked (vowel or consonant)
3 Any remaining letter after 2 is picked (vowel or consonant)
4 Any remaining vowel after 3 is picked
5 Any digit from 1 to 9 inclusive
6 Any remaining digit after 5 is picked

So (1) and (4) cannot be the same vowel.

And yes order does matter

VLLVNN is not the same as VVLLNN since the options are different depending upon which order is used.
 

joeyd999

Joined Jun 6, 2011
6,307
I am, BTW, of the suspicion that this is a trick question. I refuse to slap my forehead when Studiot reveals the real answer.
 
Top