Living in perfect harmony

How many permutations of the word "HARMONY" have exactly 2 letters between the letters "M" and "N"?


The answer is 960.

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.

14 solutions

First, let's see how many ways there are to arrange the other letters in the word harmony in the simplest case: M _ _ N _ _ _
Here, M and N are 2 spaces apart, and there are 5 ! 5! ways to place the other 5 letters. Note: This is because no letters are repeated in the word. If there were, we would have to account for it. However, that discussion is not relevant now.

Now, we need to find out how many ways to place the "M" and the "N" so that they are two spaces apart. First, we deal with the case that "M" is first and "N" is next.
1. M _ _ N _ _ _ 2. _ M _ _ N _ _ 3. _ _ M _ _ N _ 4. _ _ _ M _ _ N
In order to account for the times that "M" and "N" are flipped, we must multiply the number of cases by 2 2 .
4 4 cases × 2 = 8 \times 2 = 8 *cases *

As shown earlier, each of the 8 8 cases have 5 ! 5! permutations each .
This means that final answer is 8 8 cases × 5 ! p e r m u t a t i o n s 1 c a s e = 960 p e r m u t a t i o n s \times \frac{5! permutations}{1 case} = \boxed{960 permutations} .

Does the word HARMONY have something to do with chess 960 ? ;-)

Snehal Shekatkar - 7 years, 5 months ago

i'm forget that m _ _ n can be write in n _ _ m -_-

Rifqi Khairul Anam - 7 years, 1 month ago

SAME PINCH!!!!!!

I solved the problem in the same way.

PUSHPESH KUMAR - 7 years, 4 months ago

Make a space like this. M _ _ N _ _ _

  1. M and N can move 4 times, 4 4 .
  2. M and N can switch in a straight line (fixed position), 2 ! 2! .
  3. Choose 2 letters from 5 letters (order does matter), P ( 5 , 2 ) P(5,2)
  4. Switch 3 letters left in a straight line, 3 ! 3!

Multiply everything together we get 4 2 ! P ( 5 , 2 ) 3 ! = 960 4*2!*P(5,2)*3! = \boxed{960}

Well, you can skip number 3, just switch 5 letters in a straight line and we get 5 ! 5! . *slaps myself.

Samuraiwarm Tsunayoshi - 7 years, 5 months ago
Caique Ferreira
Dec 24, 2013

O M e N, podem estar em 4 posições. Sobrará 5 letras distintas, então será: 4 \times 5! = 480. Porém o M e o N podem trocar de posição, então o resultado será: 2! \times 480 = 960

Prasun Biswas
Dec 25, 2013

Here, we have all the 7 letters in the word "HARMONY" distinct. Now, since 2 letters are to be between M and N, let us take the 4 letters as one letter. So, now the word can be permuted in 4 P 4 = 4 ! = 24 4P4 = 4! = 24 ways. Now, the 2 letters that are to be placed between M and N should be only 2 letters out of the 5 other letters of the word. So, these 2 places between M and N can be filled in 5 P 2 = 5 × 4 = 20 5P2 = 5\times 4 = 20 ways corresponding to each arrangement. Also, corresponding to each arrangement, the positions of M and N can be interchanged in 2 ! = 2 2! = 2 ways.

So, total no. of arrangements = 4 P 4 × 5 P 2 × 2 ! = 4 ! × ( 5 × 4 ) × 2 = 48 × 20 = 960 =4P4 \times 5P2 \times 2! = 4! \times (5\times 4) \times 2 = 48 \times 20 = \boxed{960}

Eddie The Head
Dec 24, 2013

We can choose in how many ways can we place the letters between M and N..as there are 5 remaining letters..the=is can be done in 5C2 *2! ways(considering the letters can be interchanged among themselves)... Now to determine the total number of possible words we have to arrange this 4 letter word consisting of M,N and the letters between them and the remaining 3 letters which can be done in 4! ways.... It is to be noted that M,N can be arranged among themselves too in 2! ways So total number of possibilities = 5C2 * 2! * 4! * 2! = 960

Gautam Singh
Apr 8, 2014

N(HARMONY) = 7 , Hence we have 7 place arrangement _ _ _ _ _ _ _ . Let assume that M _ _ N _ _ _ means M at 1st place N at 4th place so for the rest of the five place we have 5! arrangements. Also we have 2! arrangements for M and N . So When M and N are 1st and 4th place and M adn N on 4th and 1st place then the total number of arrangement = 2! * 5!

Now we have 4 such cases like _ M _ _ N _ _ , _ _ M _ _ N _ , _ _ _ M _ _ N , M_ _ N _ _ _ so total Number = 4* 2! *5! = total

Datu Oen
Mar 27, 2014
  1. We consider the MN as one letter. We can arrange these 2 in 2 ! 2! ways

  2. There are 5 letters to be arranged in 5 ! 5! ways.

  3. Since MN was taken as 1, they will occupy 1 space. There are 2 letters to be inserted between them which occupies 2 spaces. the number of ways of doing this (inserting MN) is ( 7 1 2 ) = 4 (7 - 1 - 2) = 4 ways.

Thus, by 1, 2, and 3, we have 2 ! 5 ! 4 = 960 2! \cdot 5! \cdot 4 = 960

Srijan Kumar
Mar 26, 2014

Lets create independent process here : 1. Selecting 2 letters out of (the 5 letters except M and N). 2. Creating a 4 letter word with 2 letters between M N. 3. Arranging the 4 elements (3 remaining letters and one conglomorate of M--N.

ways for 1 = 5C2 = 10

ways for 2 = (#configs of M and N) * (#configs of 2 letters selected) = 2 * 2 = 4

ways for 3 = 4P4 = 24

independent processes multiply so : 10 * 4 * 24 = 960

Meldrin Rebello
Mar 9, 2014

960

Jeremi Litarowicz
Jan 13, 2014

First, we derive that there are 8 8 ways of placing M and N in seven slots so that they have 2 slots between them. All the other slots are filled with the remaining 5 letters. This can be done in 5 ! = 120 5!=120 ways. Thus the total combinations that satisfy the condtions are 120 × 8 = 960 120 \times 8 = 960 .

Ishan Pandey
Dec 29, 2013

There are seven available places to fill and 7 different letters to do so. The restriction here is : M and N should always be separated by two letters. Now , we will form a group of M , N and two letters (selected from 5 available) in between them. Thus: the number of ways of selecting 2 letters out of 5= 5 C 2=10 the number of ways of rearranging these two letters=2!=2 the number of ways in which we can rearrange M and N = 2! Thus total number of ways of forming the group including the rearrangement process=40

Once the group is formed we have 4 places to fill and rearrange with 4 given objects= 4!=24 Thus total number of permutations= 24*40=960

Akhmad Dainuri
Dec 25, 2013

if we want to put the letter M and N between exactly 2 letters, it means that we just have to find the permutation of 5 letters left, so it is 5! and then, we have 4 positions in 7 places, then we can change the position of M and N, so we have to multiply it with 2,

so, the results = 5! . 4. 2 = 960

We have that the letters M M and N N can be placed as follows:

M _ _ N _ _ _

_ M _ _ N _ _

_ _ M _ _ N _

_ _ _ M _ _ N

And the same orders, but with putting first the N N . So we have 8 8 cases in which we can put all the permutations of the 5 5 restant letters. We know those permutations are 120 120 , so the answer is 120 × 8 = 960 120 \times 8 = \boxed {960} .

Nicholas Tomlin
Dec 24, 2013

Consider a permutation of form {–,–,–,–,–,–,–}, such that the permutation must contain either {M,–,–,N} or {N,–,–,M}.

There are 5 remaining letters (H,A,R,O,Y), so there are 2 5 4 = 40 2\cdot 5 \cdot 4 = 40 ways to create a four-letter permutation with exactly 2 letters between "M" and "N".

There are 7 total spaces in the original permutation, so there are 4 possible ways to place the {M,–,–,N}/{N,–,–,M} sub-permutation. There are three spaces left, so there are 4 3 2 = 24 4\cdot 3 \cdot 2 = 24 ways to arrange the sub-permutation among the other letters.

Hence, the solution is 40 24 = 960 40 \cdot 24 = \boxed{960} .

from itertools import permutations
def main():
    counter = 0
    for x in permutations("HARMONY"):
        x = list(x)
        find_m = x.index('M')
        find_n = x.index('N')
        if abs(find_m - find_n) == 3:
            counter += 1
    print(counter)
main()

Sahibjot Saggu - 7 years, 5 months ago

Log in to reply

Sorry but I might've cheated a bit by programming it because I don't know much about combinations. :-)

Sahibjot Saggu - 7 years, 5 months ago

Log in to reply

On the contrary, we like to see different methods. Thank you for posting code.

Sheldon Collier - 7 years, 5 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...