Repel Kepler Peel

How many distinct words of any (nonzero) length can be formed using the letters of KEPLER at most once each?

Clarification: Such a word can have two Es but can't have duplicates of any other letter.


The answer is 1010.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Discussions for this problem are now closed

Kevin Bourrillion
Apr 25, 2014

Let's solve this problem as if the name in question were EUCLID first, then figure out how to deal with the duplicate letter.

I know of no formula for this, so let's start small and see what pattern emerges:

If the source word had 1 letter ("A"), we could clearly make 1 word ("A").

If it had 2 letters ("AB"), we could make 4 ("A", "B", "AB", "BA").

For 3, we have: 3P1=3 of length 1, 3P2=6 of length 2 and 3P3=6 of length 3. 3 + 6 + 6 = 15.

For 4, 4P1 + 4P2 + 4P3 + 4P4 = 4 + 12 + 24 + 24 = 64.

So far, 1, 4, 15, 64. If we continue in this fashion we will see a pattern emerge: when adding the nth letter, we start from the previous number, add one, then multiply by n. For 5 we will have 325, and for 6 (as in EUCLID), 1956 (which I verified longhand, to be safe).

Now we must deal with that pesky duplicate E in KEPLER. How many have we overcounted? It turns out that every word containing any E in it has been counted exactly twice:

  • for the words with only one E in them, they were counted once for each of the two Es in the source word.
  • whereas for the words with two Es, they were counted once for each of the two arrangements those two Es can be in.

So everything was double-counted except the words containing no Es at all. Since those are all the possible words using the letters KPLR, there must be 64 of them as we worked out above (how convenient!). So 1956 - 64 = 1892 of them are our doubles, representing 946 unique overcounted words.

We can take either 946 + 64 or 1956 - 946 to get our answer, 1010.

(Verified with a simple computer program to generate and unique-ify the actual words.)

Here is the brute force way:

length no e's 1 e 2 e's
1 1 4 4 1 1 0 0
2 2 12 12 2 4 2*4 1 1
3 3 24 24 3 12 3*12 3 4 3*4
4 4 24 24 4 24 4*24 6 12 6*12
5 5 0 0 5 24 5*24 10 24 10*24
6 6 0 0 0 0 15 24 15*24

For example, to get the number of 4 letter words with exactly 1 'e', we multiply the number of 3 letter words without 'e' (24) by 4 (the number of ways to insert an e, e.g., exxx, xexx, xxex, xxxe).

Ron Yang - 7 years, 1 month ago

i divided it into two cases. 1) Considering only K,E,P,L,R the number of words obtained are: 5C1+5C2 *2! +5C2 *3! + 5C4 *4! +5!

2) making both the Es a permanent fixture the number of words obtained are: 1+ 4C1 *3!/2! + 4C2 *4!/2! + 4C3 *5!/2! +4C4 *6!/2! the answer comes out to be 1016. could you let me know where i am going wrong .

souvik paul - 7 years, 1 month ago

Your notation is right. Probably you made an error in calculations. Case 1 gives 325 and case 2 gives 685, so the sum is 1010.

The explanation for case 1 is that each term is the number of permutations of 5 different letters by 1, 2, 3, 4 and 5 respectively. So S 1 = 1 5 5 P i = 5 P 1 + 5 P 2 + 5 P 3 + 5 P 4 + 5 P 5 = 325 S_1=\sum_1^5{{}_5P_i}={}_5P_1+{}_5P_2+{}_5P_3+{}_5P_4+{}_5P_5=325 . This is the same as your formula, because 5 P i = 5 ! ( 5 i ) ! = 5 C i i ! {}_5P_i={5!\over(5-i)!}={}_5C_i * i!

The explanation for case 2 is that each term is the number of combinations of 4 letters (excluding the 2 E's) by 0,1,2,3 and 4 respectively, multiplied by the number of permutations of 2,3,4,5 and 6 letters (including the 2 E's) of which 2 are same. The first factor is 4 C i {}_4C_i and the second factor is ( i + 2 ) ! 2 ! {(i+2)!\over2!} . So S 2 = 0 4 ( 4 C i ) ( i + 2 ) ! 2 ! = 685 S_2=\sum_0^4{({}_4C_i)*{(i+2)!\over2!}}=685 .

The final result is S 1 + S 2 = 325 + 685 = 1010 S_1+S_2=325+685=1010

Babis Athineos - 7 years, 1 month ago

Try considering both cases at once.. Its not likely to work your way

Proma Mukherjee - 7 years, 1 month ago

both cases cant be considered at once as there cant be 3 E's. I believe the cases are exhaustive.

souvik paul - 7 years, 1 month ago

@Souvik Paul Your notation is hard to follow. You are right that the cases are mutually exclusive, there may be something wrong in the calculation. Explain how you are calculating each case.

Julio Reyes - 7 years, 1 month ago

Recheck your calculations, it seems correct.

Durgesh Tiwari - 7 years, 1 month ago

Nice simple solution. Your example "easy" version has a problem, though :)

A Former Brilliant Member - 7 years, 1 month ago

derp, really glad you pointed that out. Wish I'd used NEWTON for the original problem now, but whatever, Kepler wasn't half bad.

Kevin Bourrillion - 7 years, 1 month ago

Incidentally, I haven't thought of any intuitive way to understand why the "add one then multiply by n" recurrence works. I listed the 15 words you can make out of ABC and tried to find a way to group them into 3 groups of 5 or 5 of 3, to no avail. Anyone?

Kevin Bourrillion - 7 years, 1 month ago

Try writing out the pattern with nPr in long form:

  • 1
  • 2 + 2 1 2 + 2 * 1
  • 3 + 3 2 + 3 2 1 3 + 3*2 + 3*2*1
  • 4 + 4 3 + 4 3 2 + 4 3 2 1 4 + 4*3 + 4*3*2 + 4*3*2*1
  • 5 + 5 4 + 5 4 3 + 5 4 3 2 + 5 4 3 2 1 5 + 5*4 + 5*4*3 + 5*4*3*2 + 5*4*3*2*1

So the point is that nPr = n * (n-1)P(r-1). So "multiply by n" turns the (1..n-1)-letter combinations from a length n-1 word into the (2..n)-letter combinations from a length n word, and then you have to add n new one letter words. And "multiply by n and then add n" is the same as "add 1 then multiply by n."

A Former Brilliant Member - 7 years, 1 month ago
Julio Reyes
May 1, 2014

To solve this problem we have to find the number of distinct words for different lengths.

Formulas: \textbf{Formulas: } n n is the number of choices, r r is how many we choose. Permutation: Order matters Combination: Order doesn’t matter P ( n , r ) = n ! ( n r ) ! C ( n , r ) = n ! r ! ( n r ) ! \begin{array}{cc} & _{\text{Permutation: Order matters}} &\quad _{\text{Combination: Order doesn't matter}} \\ & P(n,r) = \frac{n!}{(n-r)!} & \quad C(n,r) = \frac{n!}{r!(n-r)!} \end{array}

Length 6: \textbf{Length 6: } First we find the number of combinations that we can have of the two E's in the word. Then we multiply the number of combinations by the number of permutations we can have for the remaining four letters. Another way to find this case is to take the number of permutations as if all 6 letters are unique, then divide by 2 since each word will be a duplicate. However, that way will not work when the length is less than 6.

C ( 6 , 2 ) = 15 P ( 4 , 4 ) = 24 15 24 = 360 C(6,2) = 15 \quad P(4,4) = 24 \quad \Rightarrow \quad 15\cdot24 = \mathbf{360} \\

Length 5: \textbf{Length 5: } For this case and the rest, we further split them each into 2 mutually exclusive cases. One where the word contains 2 E's and the other when the word contains 1 E. For the first situation, we calculate it similarly as the case with length 6. For the second situation, we can go ahead and do a permutation since we don't have to worry about duplicates. Then we just add the number from each case.

C ( 5 , 2 ) = 10 P ( 4 , 3 ) = 24 10 24 = 240 P ( 5 , 5 ) = 120 240 + 120 = 360 C(5,2) = 10 \quad P(4,3) = 24 \quad \Rightarrow \quad 10\cdot24 = 240 \\ P(5,5) = 120 \quad \quad \Rightarrow \quad 240 +120 = \mathbf{360} \\

Length 4: \textbf{Length 4: }

C ( 4 , 2 ) = 6 P ( 4 , 2 ) = 12 6 12 = 72 P ( 5 , 4 ) = 120 72 + 120 = 192 C(4,2) = 6 \quad P(4,2) = 12 \quad \Rightarrow \quad 6\cdot12 = 72 \\ P(5,4) = 120 \quad \quad \Rightarrow \quad 72 +120 = \mathbf{192} \\

Length 3: \textbf{Length 3: }

C ( 3 , 2 ) = 3 P ( 4 , 1 ) = 4 3 4 = 12 P ( 5 , 3 ) = 60 12 + 60 = 72 C(3,2) = 3 \quad P(4,1) = 4 \quad \Rightarrow \quad 3\cdot4 = 12 \\ P(5,3) = 60 \quad \quad \Rightarrow \quad 12 +60 = \mathbf{72} \\

Length 2: \textbf{Length 2: } For this case, the first situation is a bit different since there is only 1 combination for 2 E's and we don't have any remaining letters to choose. But the calculation would still turn out the same if we chose to continue with the method from the previous cases.

C ( 2 , 2 ) = 1 P ( 4 , 0 ) = 1 1 1 = 1 P ( 5 , 2 ) = 20 1 + 20 = 21 C(2,2) = 1 \quad P(4,0) = 1 \quad \Rightarrow \quad 1\cdot1 = 1 \\ P(5,2) = 20 \quad \quad \Rightarrow \quad 1 + 20 = \mathbf{21} \\

Length 1: \textbf{Length 1: } For this last case, it is obvious that we can 5 different words. But the formula for permutations would still work if we chose to use it.

P ( 5 , 1 ) = 5 P(5,1) = \mathbf{5} \\

Now we simply add up the total from each case and we will have the number of unique words with length 1- 6.

360 + 360 + 192 + 72 + 21 + 5 = 1010 360 + 360 + 192 + 72 + 21 + 5 = \fbox{1010 } \\

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...