1

I was learning the following questions in this site
question 1
question 2
which are indeed similar problems. But, one thing I observed is, in both of these problems, letters are repeating only two times. But, consider the following situation where one letter repeats two times and another three times.

How many arrangements of the letters in the word ABCDDEEE have no consecutive letter the same?

With similar logic, by applying inclusion-exclusion principle,

Answer must be $$\dfrac{8!}{2! \times 3!}-\left(\dfrac{7!}{3!}+\dfrac{6!}{2!}\right)+5! =2280$$

But, I have checked with a program and answer appears to be $960$.

Could you please help me to understand why I am going wrong here? If anyone any general approach is there, please suggest.

Kiran
  • 4,198
  • 1
    I agree with your first term...but not the rest. To count the strings containing $DD$ we look at the $7$ symbols ${A,B,C,DD,E,E,E}$...there are $\frac {7!}{3!}$ of these. Similarly, looking at the $6$ symbols ${A,B,C,D,D,EEE}$ we get $\frac {6!}{2!}$ strings containing $EEE$. And then we have the $5$ symbols ${A,B,C,DD,EEE}$ so $5!$ strings containing both $DD,EEE$. But those values don't give $960$ either. – lulu Dec 02 '16 at 15:49
  • @lulu thanks for pointing this out. edited my question with the info. still trying hard to find out the actual answer. – Kiran Dec 02 '16 at 15:54
  • Well, I don't see the error in the $2280$ computation (which, of course, doesn't mean there isn't one). – lulu Dec 02 '16 at 15:59

3 Answers3

1

Your potential answer only subtracts triple E. It doesn't address double E.

OK, I got the 960 by taking a quite different approach.

The three Es must be separated with at least one letter between the first and second and between the second and third. So we have four spots around the 3 Es and the middle two of those spots must each have at least one letter. So we have three other letter to distribute among the 4 spots: which gives us 6!/(3!*3!) ways the letters can be distributed without consider the letters are different. Multiply that by 5!/2! (five other letters but the Ds are dupes) to get the total possible arrangements. That is 1200.

Repeat the same process considering the two Ds as a single entity: 5!/(3!*2!) * 4!. This yields 240 arrangements with the Es separated but the Ds together.

The difference is our answer: 960

Daniel Fischer
  • 206,697
1

We shall solve by successively applying the well known "gap" and "subtraction" methods.

Firstly, we shall keep the $E's$ separate by placing them in the gaps of $-A-B-C-D-D-$ and permute the other letters, thus $\binom63\cdot\frac{5!}{2!} = 1200$ ways.

We shall now subtract arrangements with the $D's$ together treating them as a super $D$, $-A-B-C-\mathscr D-$, i.e. $\binom53\cdot4!= 240$

Thus we get $1200-240 = \boxed{960}$

  • 1
    On careful re-reading of Tony Mulieri's answer (and comments) posted earlier, I find that basically the same approach has been used. I am leaving this post only because it is briefer. – true blue anil Dec 03 '16 at 04:04
  • How can we generalize this method, say for the word 'ABCDDEEEFF, how will be the calculations? I find this very complex as number of repeated groups increases – Kiran Dec 03 '16 at 09:27
  • 1
    Your observation about increasing complexity is true; you can have a look at another answer which includes a general answer that can apply to any such case. See http://math.stackexchange.com/questions/1916411/arrangements-of-mississippi-with-all-ss-and-ps-separated/1916541#1916541 – true blue anil Dec 03 '16 at 11:16
  • did u mean 'Jair Taylor's formula'? – Kiran Dec 03 '16 at 13:42
  • Yes, it was mentioned in the linked answer. – true blue anil Dec 03 '16 at 18:09
  • though I could solve many problems with the experience gained, find myself completely helpless for word like ABCCDDDEEEE can u please help? – Kiran Dec 03 '16 at 20:26
  • Do you mean difficulty in using Jair Taylor's formula ? – true blue anil Dec 04 '16 at 04:22
  • no, I mean, with the way you explain, which i find easier, what could be the approach for a word like ABCCDDDEEEE – Kiran Dec 04 '16 at 08:01
  • 1
    Can't immediately see a way. Advise you post it as a separate question, give a link to this, and mention that you want it solved without using Jair Taylor's formula. – true blue anil Dec 04 '16 at 09:24
  • ok, still trying, will post it as a seperate question. I am now learning all such questions from this website. – Kiran Dec 04 '16 at 11:11
  • i got answer for 'ABCCDDDEEEE' as $15180$ using a tool http://www.careerbless.com/calculators/word/index.php [see generated question 23 after entering the word 'ABCCDDDEEEE' ) Request you to kindly share your thoughts on this answer and solution. thanks – Kiran Dec 18 '16 at 23:04
  • @Kiran: The answer agrees with Jair Taylor formula. However, we don't know how it was arrived at. Could be short programs for each case. Anyway, good tool, thanks ! – true blue anil Dec 19 '16 at 04:12
  • i cannot post the solution given by the tool here as this is a comment. can i post that question and answer as a different question for your review if it does not violate this site policy? – Kiran Dec 19 '16 at 17:05
  • 1
    If you mean that the way the tool has solved it is known to you, I believe you could post it as a question, and answer it to share the solution for the benefit of the community. – true blue anil Dec 19 '16 at 18:06
  • I have posted a similar but more complex question here http://math.stackexchange.com/questions/2064933/hat-is-the-number-of-ways-letters-in-the-word-kombinatoorika-can-be-rearranged which is to find arrangements of the word 'KOMBINATOORIKA'. The tool gives output as $710579520$. If you can review the output of the tool (second answer), it will be a great help for me as I am thinking of using it extensively for my study. thanks – Kiran Dec 19 '16 at 18:19
  • 1
    @Kiran: Schmuland has confirmed using Jair Taylor's formula, and Taussig has pointed out a flaw in the first method right at the start. So there is nothing further I can say at this point. But when I get more time, I'll try to see if a simpler method is there. – true blue anil Dec 20 '16 at 02:43
1

Write $X$ for each of $A$, $B$, $C$ and leave a lot of space around these: $\ \underline{\quad}X\underline{\quad}X\underline{\quad}X\underline{\quad}\ $. Then consider the following cases:

(a) All three $E$s in the same slot. This requires the two $D$s to separate the $E$s. Makes $4$.

(b) Two $E$s in one slot and one $E$ in another slot. This requires one $D$ to separate the $E$s. The remaining $D$ can be put in any of the now $6$ slots. Makes $4\cdot3\cdot 6=72$.

(c) One $E$ each in three of the four large slots. Then select two of the now $7$ slots for a $D$. Makes $4\cdot{7\choose2}=84$.

We now have $4+72+84=160$ cases in all. Replacing the $X$s by $A$, $B$, $C$ in any order brings us to $6\cdot160=960$ admissible strings.

  • Thanks. please also let me know if there any general approach for these kind of problems which is applicable for all words like ABCDDEE, ABCDDDEE, ABCDDDEEEFFFF etc? By understanding all the different solutions given , for all such problems, what I feel is there is no common way to do this and complexity increases as number of letters and their frequency increases – Kiran Dec 03 '16 at 09:18