Skip to main content

"The hawaiian" has 11 letters. How many permutations are possible for five of these letters?

This problem is much more difficult. Let's try to solve it.


First, assume temporarily that two "i" letters are different, call them i_1 and i_2. Also call three "a" as a_1, a_2 and a_3, and two h as h_1 and h_2.


Then there are 11*10*9*8*7 = 55440 possible "words" (the first letter is any of 11, the second is any of 10 and so on). But because equal letters actually make the same "words", some "words" was counted twice or more times. We have to subtract the number of "parasitic" counts although it is relatively small.


The words that counted more than once are divided into several disjoint sets:
1) with two i's but without repetitions of a and h;
2) with two h's but without repetitions of a and i;
3) with two a's but without repetitions of i and h;
4) with three a's but without repetitions of i and h;
5) with two i's and two a's;
6) with two i's and tree a's;
7) with two i's and two h's
8) with two h's and two a's;
9) with two h's and tree a's.


The first group contains words counted twice and its size is (5*4) * (6*5*4) = 2400 (the first i at one of the 5 places, the second at one of 4, then 11-2i-1h-2a=6 different letters remain). So we have to subtract 2400/2 = 1200. The group 2 also gives -600, and the group 3 too.


The group 4 gives (5*4*3) * (6*5) = 1800 and the words are counted 6 times, -300.


Groups 5, 7, 8: 5*4*3*2*6 = 720 and counted 4 times, so -180.


Group 6 and 9: 5*4*3*2*1 = 120 and counted 12 times, -10.


Totally -(1200*3 + 300 + 180*3 + 10*2) = -4460. So the answer is 55440 - 4460 = 50980.


Uff.

Comments

Popular posts from this blog

Is there a word/phrase for "unperformant"?

As a software engineer, I need to sometimes describe a piece of code as something that lacks performance or was not written with performance in mind. Example: This kind of coding style leads to unmaintainable and unperformant code. Based on my Google searches, this isn't a real word. What is the correct way to describe this? EDIT My usage of "performance" here is in regard to speed and efficiency. For example, the better the performance of code the faster the application runs. My question and example target the negative definition, which is in reference to preventing inefficient coding practices. Answer This kind of coding style leads to unmaintainable and unperformant code. In my opinion, reads more easily as: This coding style leads to unmaintainable and poorly performing code. The key to well-written documentation and reports lies in ease of understanding. Adding poorly understood words such as performant decreases that ease. In addressing the use of such a poorly ...

A man has a garden measuring 84 meters by 56 meters. He divides it into the minimum number of square plots. What is the length of the square plots?

We wish to divide this man's garden into the minimum number of square plots possible. A square has all four sides with the same length.Our garden is a rectangle, so the answer is clearly not 1 square plot. If we choose the wrong length for our squares, we may end up with missing holes or we may not be able to fit our squares inside the garden. So we have 84 meters in one direction and 56 meters in the other direction. When we start dividing the garden in square plots, we are "filling" those lengths in their respective directions. At each direction, there must be an integer number of squares (otherwise, we get holes or we leave the garden), so that all the square plots fill up the garden nicely. Thus, our job here is to find the greatest common divisor of 84 and 56. For this, we prime factor both of them: `56 = 2*2*2*7` `84 = 2*2*3*7` We can see that the prime factors and multiplicities in common are `2*2*7 = 28` . This is the desired length of the square plots. If you wi...

What warning does Chuchundra issue to Rikki?

Chuchundra, the sniveling, fearful muskrat who creeps around walls because he is too terrified to go into the center of a room, meets Rikki in the middle of the night. He insults Rikki by begging him not to kill him. He then insults him by suggesting that Nag might mistake Chuchundra for Rikki. He says, "Those who kill snakes get killed by snakes."  He issues this warning to Rikki not to help keep Rikki safe but as a way of explaining why Rikki's presence gives him, Chuchundra, more reason to fear.  Chuchundra starts to tell Rikki what Chua the rat told him--but breaks it off when he realizes he might be overheard by Nag. He says, "Nag is everywhere, Rikki-Tikki." Rikki threatens to bite Chuchundra to get him to talk. Even then, Chuchundra won't overtly reveal any information. But he does say, "Can't you hear, Rikki-Tikki?" This is enough of a clue for the clever mongoose. He listens carefully and can just make out the "faintest scratch-s...