1

The number of different words can be formed using all the letters from the word NARAYAN so that $N$ does not lie between any two A's, is

My solution: There are $7$ places overall so first select two places for $R,Y$ which can be done in ${7\choose 2}$ ways and there are $2!$ ways to arrange them.

Now there are three possibility for ordere of $A,N$

(i) $AAANN$

(ii) $NNAAA$

(iii) $NAAAN$

Hence final answer is ${7\choose 2}\cdot 2!\cdot 3=126$

Note: Some examples of Arrangement which is not allowed are ANA, ANNAA, ARNA, ARYNAA.

My doubt: I am looking for better method to solve this for example question is having word $AAAAABBBBBYRCD$ such that $B$ does not lie between any two A's ?

mathophile
  • 4,640
  • 1
    Not sure the rules are clear. Are you just blocking things like $ANA$ or would $ARNA$ also be blocked? – lulu Dec 26 '24 at 17:53
  • Both are blocked – mathophile Dec 26 '24 at 17:54
  • I suggest editing to clarify that...as written, this is extremely ambiguous. If I'd had to guess, I would have guessed incorrectly, for example. – lulu Dec 26 '24 at 17:55
  • And where are you having trouble with the generalization? Your example would have $14$ total entries, so place the four singletons, giving $\binom {14}4\times 4!$ options and then note that each $B$ must either precede or follow all the $A's$ giving $6$ possible options. – lulu Dec 26 '24 at 17:58

3 Answers3

1

Here's an approach to the second question that extends your method.

  1. Select 4 places for DRCY from 14 slots: $\binom {14}4$ options
  2. Select an arrangement of DRCY: $4!$ options

From there, we're looking for arrangements of AAAAABBBBB (within the 10 remaining slots) such that no B lies between two A's. The trick to doing this efficiently is to think of AAAAA as a single contiguous block.

That is, we can count the arrangements of [AAAAA]BBBBB, where we think of BBBBB as a single letter. since we are spelling a word of 6 letters in which A is repeated 5 times, the count for such arrangements is $$ \frac{6!}{5!} = 6. $$ Alternatively, it's not hard to count things out directly if we simply arrange them systematically. It's clear, I think, that the following list $$ [AAAAA]BBBBB\\ B[AAAAA]BBBB\\ \vdots\\ BBBB[AAAAA]B\\ BBBBB[AAAAA] $$ contains 6 possibilities.

One way or the other, we end up with the following answer: $$ \binom{14}4 \cdot 4! \cdot 6 = 144\,144. $$

Ben Grossmann
  • 234,171
  • 12
  • 184
  • 355
  • OP is not allowing arrangements like $ARYNAA.$ – true blue anil Dec 26 '24 at 20:22
  • @true Yes, and this correctly excludes such arrangements – Ben Grossmann Dec 26 '24 at 20:46
  • See, OP has clarified what (s)he means in queries. The patterns below do not qualify $A[BBBBB]AAAA\ \vdots\ AAAA[BBBBB]A$ – true blue anil Dec 26 '24 at 20:56
  • @trueblueanil A[BBB]AAAA does not refer to the entirety of the pattern, it is the sequence of letters with which to fill in the spaces left after the first step. As an example, steps 1 and 2 might leave you with $$ D,-,-,R,-,-,-,C,-,-,-,-,-,Y $$ the pattern A[BBBBB]AAAA would then correspond to the full string $$ D A B R B B B C B A A A A Y $$ – Ben Grossmann Dec 26 '24 at 22:40
  • I understand your filling in, but OP's clarifications imply that all the A's must be on one side and all B's on the other. That is why I start with only two patterns, all A's folowed by all B's or vice versa, whereas you have six patterns where four violate OP's conditions. – true blue anil Dec 27 '24 at 04:49
  • @true It’s not clear where you’re getting that from, what “clarifications” are you talking about? OP explicitly lists NAAAN as a possibility for the original problem, which seems to contradict your interpretation. – Ben Grossmann Dec 27 '24 at 07:41
  • But when questioned about what is not allowed, OP explicitly lists arrangements like ANNAA, ARNA, ARYNAA. What you are citing is his attempt which is patently incorrect in view of his clarifications. – true blue anil Dec 27 '24 at 08:14
  • @trueblueanil I see the issue now, it seems I interchanged the role of A and B and didn't notice. Hopefully my edited answer is correct – Ben Grossmann Dec 27 '24 at 15:11
1

Taking careful note of invalid arrangements like ARNA, ARYNAA, and the wording which says $N$ must not be between any two $A's

here is a way using $\texttt{successive placement}$

$\underline{\texttt{NARAYAN}}$

  • first arrange the N's and A's in two ways: $.N.N.A.A.A. \;or \; .A.A.A.N.N.$
  • The dots are gaps between letters where the others can be placed one by one, and when a letter is placed, an extra dot is available for the next letter, so R and Y can be placed in $6*7 = 42$ ways, giving a final answer of $2*42 = 84$

$\underline{\texttt{AAAAABBBBBYRCD}}$

  • Again, only two arrangements are possible for the $A's \;and\; B's,\; .A.A.A.A.A.B.B.B.B.B.\;$ or
    $.B.B.B.B.B.A.A.A.A.A.$ with $11$ initial gaps (dots)
  • Place $YRCD$ turn by turn in $11*12*13*14=24024$ ways to give a final answer of $48048$ ways

Added

Successive placement is more useful where there are special restrictions on placement, see here For these particular problems, you could also solve more familiarly as

[1] $2\times ^{7}P_{2}= 84$

[2] $2\times ^{14}P_4 = 48048$

1

A GENERAL SOLUTION

Suppose there are $x$ copies of $A$, $y$ copies of $B$ and $n$ further different letters. For no $B$ to be between two $A$s:

Write the $B$s in a line.

There are then $y+1$ places for the $y$s.

Place the next letter in one of $x+y+1$ places and so on.

The total number of arrangements is $\binom{x+y+n}n n!(y+1)$

GENERALISING FURTHER

If the $n$ other letters contain multiplicities, just divide by the necessary factorials in the standard manner.

user1172706
  • 2,791