# $8$ people including $A,B,C$, and $D$ will be rearranged. In how many ways can they be rearranged such that $B$ and $C$ will be between $A$ and $D$?

$$8$$ people including $$A,B,C$$, and $$D$$ will be rearranged. In how many ways can they be rearranged such that $$B$$ and $$C$$ will be between $$A$$ and $$D$$?

I tried to break this into cases. However, it didn't work.

Regards

First choose 4 places, that you can do on $${8\choose 4}$$ ways, then on edge put $$A$$ and $$D$$, you can do that on 2 ways and in the midle $$B$$ and $$C$$, again on 2 ways. Then arrange all others on remaining places, that is on 4! ways. Now multiply all these. So the answer is $${8\choose 4}\cdot 2\cdot 2\cdot 4! = 8!/6$$

• That seems a bit unclear. Could you please make it more clear? – Mr. Maxwell Dec 16 '18 at 10:43
• Which part of it? – greedoid Dec 16 '18 at 10:43
• $${8\choose 4}$$ And what's also the reason you put B and c in the middle? – Mr. Maxwell Dec 16 '18 at 10:44
• What about it? You don't know what it means? – greedoid Dec 16 '18 at 10:45
• @Mr.Maxwell You have to put $B,C$ between $A,D$. This doesn't mean $A,D$ have to sit on the edges. The arrangement can also look like this: _ _ A _ B _ C D – Shubham Johri Dec 16 '18 at 11:12

We first choose among the $$8$$ positions the $$4$$ ones for $$A,B,C,D$$. This can be done in $$\binom{8}{4}$$ ways. These positions cab be filled in $$4$$ ways: $$ABCD$$, $$ACBD$$, $$DBCA$$, $$DCBA$$. The remanining $$8-4$$ positions can be filled in $$4!$$ ways. Hence the total number of arrangements is $${8\choose 4}\cdot 4 \cdot 4!$$

• Can you help me understand the first part. I'm a bit confused. When you do 8c4 doesn't that include instances such as: D_CAB_? If so, shouldn't you remove them because BC should be between AD. Thanks – adhg Dec 18 '18 at 1:39
• No. With $\binom{8}{4}$ we choose just the positions where we are going to put the letters $A$, $B$, $C$, $D$ (no order is specified). In the complement we will put the other letters. Then we place in chosen positions the letters $A$, $B$, $C$, $D$ in one of the $4$ orders and the remaining letters in the remaining positions in one of the $4!$ orders. – Robert Z Dec 18 '18 at 5:21
• ohh. Right! Got it – adhg Dec 18 '18 at 13:11

This answer assumes that ABCD is unique from ACBD, though I can answer for the other case as well if that is the case.

N = number of spots (8 in your case)

2 * summation(n = 1, N - 3){n! * (N+1-n)!}

In your case, this simplifies to

Take the two boundary tokens and orient them on the edges. There are two "symmetric" orientations for each orientation of the boundary tokens (A******D is distinct from D******A, and there are only two orientations of two tokens with two spots.) From there, you have the inner spaces, designated as "Sep". For each value Sep, there are Sep! permutations inside the boundary tokens, and (N - (Sep + 2))! permutations outside the boundary, so for each value Sep, there are Sep! * (N - (Sep + 2))! * 2 * (number of "slide" positions). The "Slide" positions are the orientations you can bring A and D to through sliding; in simple terms, if the string was A****D**, Slide is 3, since you can have A****D**, *A****D*, **A****D. Factor the 2 out and do some refactoring, plug in N = 8, and you get 2976.

EDIT: My final sum of 2976 was a quick desmos plugin, so if anyone would like to plug in the equation I provided above to verify, you can go ahead and do that.