# Probability of EXACTLY $3$ p's in $5$ letter word

There are $26^5$ possible words

How would one go about doing this ?

I'm not sure, but why can't it be $26^2$/$26^5$?

-
How would YOU go about it? – Did Feb 5 '13 at 19:08
Exactly 3 Ps should mean that there aren't 26 choices for other 2 letters as the words containing 4 or 5 Ps shouldn't be counted. – JB King Feb 5 '13 at 19:29

There are 25 letters of the alphabet without p and 2 of those needed so that gives us 25*25=625 permutations of the 2 letters to be placed into the word aside from the 3 P's.

How many ways could one put the Ps into a 5 letter word is the next part. "5 choose 3" which is 10 gives us the number of possible combinations of picking where the Ps are within the word. The idea here is to consider how many combinations of the 5 places in the word could one put the Ps. Alternatively, one could just as easily do a 5 choose 2 to consider where the non-Ps would go which is the same number as for n choose k the value is n!/((n-k)!k!). The reason for using combinations here is that the order doesn't matter. The Ps are the same regardless of which order you pick. So, if you take the 1st, 3rd and 5th letters to be P, this is the same as if you took the 5th, 3rd and 1st or any other permutation of those choices of which there are 6. This would be different if those letters were different but that would also change other parts of the question as well. For example, if someone asked the probably of exactly ABC being in a 5 letter word, then the number gets a bit higher as one could shuffle around the letters to get a different word. By changing the same letter, this doesn't impact what the word itself is.

Multiplying these together gives 6250 words that contain exactly 3 Ps.

Thus the answer is 6250/$26^5$.

In the case where instead of it being all the same letter, we wanted exactly one A, one B, and one C in the word, there is a similar split.

The other letters of the alphabet are now only 23 and so there are $23^2$ = 529 of those.

Then it becomes Permutations of 5 choose 3 which is 60 as we are selecting where each letter goes.

Thus, in this case it is 529*60 = 31740 possible words that contain exactly one A, one B, and one C.

-
Would you explain how it's 5 choose 3? Isn't 5 choose 3 a set of 3 and not 5? – John Feb 5 '13 at 19:39
Why wouldn't one use perm instead of nchoosek? – John Feb 5 '13 at 20:04
Would it suffice to say that it would be 625 * perm(5,3) in the ABC case? – John Feb 5 '13 at 20:34

Hints:

1) How many possibilities are there for a 5-letter word to have the first, second and third letters equal to p's? -- please do note that the other two letters must be non p... --

2) Now, in how many ways can you arrange the exactly three letters p in a 5-letter word?

-
1) 26^2, but is 2 a permutation? – John Feb 5 '13 at 19:30
1) would be $25^2$ because you want the remaining letters to be non $p$'s. – Jean-Sébastien Feb 5 '13 at 19:34

Here is a five letter word: $$_ _ _ _ _ .$$ If I want it to have exactly $3$ $p$'s, all that remains is to place those $p'$s and then choose the remaining letters.

1) In how many ways can you place $3$ $p'$ s in a five letters word?

2) In how many ways can you choose the remaining $2$ letters?

-
is 1 a permutation? – John Feb 5 '13 at 19:31
Does the order in which you place the $p$ matter? Or think of it this way, you have to "choose" $3$ places for your $p'$s. – Jean-Sébastien Feb 5 '13 at 19:34

Assumption

100% random distribution of letters (does not occur naturally in any language, but for this problem I'm assuming a random character generator for each letters).

Variables

X = Chance of getting 1 P = 1/26 = 0.03846153846153846153846153846154
Y = Chance of getting anything but P = 25/26 = 0.96153846153846153846153846153846

Chance of getting 3 Ps in a row = X^3
Chance of getting 2 Non Ps in a row = Y^2

Chance of getting 3 Ps in a row followed by 2 Non Ps = X^3 * Y^2

Commutative property says the order of the underlying multiplication operations doesn't matter - so the order of the letters shouldn't impact the probability.

5.2603334832598513842167775853578e-5

-

You need to clarify if you want the number of words possible with 3 p's, the probability of randomly generated 5 letter words having 3 p's, or whatever specific answer is desired.

I guess this is the probability of a single randomly generated word having exactly 3 P's in it:

Adding to what Don said, Let P represent the letter P, and x be any letter other than P.