# How many ways can four letters abcd be arranged such that a always comes before b and c always comes before d?

How many ways can four letters abcd be arranged such that a always comes before b and c always comes before d?

Total number of ways abcd can be arranged? 4! Half of them a if before b, half b is before a. Similarly, in half, c is before d, and other half, d is before a.

But we can't divide 4! by 2 - because there are some in which b is before a AND d is before c. So what's the answer?

• just count them. Mar 12, 2012 at 10:24
• For some reason your comment on my answer disappeared. You misunderstood me, I was enumerating the possibilities (not favourable cases). Only one out of four possibilities was favourable, so the answer becomes (total cases)/4 Mar 12, 2012 at 10:59

It would be $\frac{4!}{2\cdot 2}$. The "a before b" and "c before d" are two independent events, so we can straightaway divide by two twice. You can also look at it this way:

There are four (equally likely) possibilities that can occur when we arrange a,b,c,d without any rules --

• a before b, c before d (favourable)
• a before b, c after d (not favourable)
• a after b, c after d (not favourable)
• a after b, c before d (not favourable)

Only one out of the four equally likely possibilities is favourable, and we have a total number of $4!$ cases, thus the answer if $\frac{4!}{4}=6$. If you want, the favourable cases are: abcd,acbd,acdb,cdab,cabd,cadb.

Actually, you can just divide by $2$ twice. Each of the four scenarios listed below account for an equal number of possibilities, by the same symmetry you noticed for dividing by two originally.

$$\rm \begin{array}{|c|c|c|} \hline & \text{a before b} & \text{b before a} \\ \hline \text{c before d} & \large\color{LimeGreen}\bullet & \large\color{Red}\bullet \\ \hline \text{d before c} & \large\color{Red}\bullet & \large\color{Red}\bullet \\ \hline \end{array}$$

You have ${4\choose 2}$ choices for where to place a & b (obviously, putting a in the first of these); but c & d then have to fill the remaining places in a predetermined order. So there are $6$ ways.

Did you mean a before b (just before b), or is it acbd allowed (a before b, and c before d)? Please be more specific.

• I upvote it so you have enough points to put it as a comment next time. Mar 12, 2012 at 15:23
• Zeina I meant a before b, not right before b. Sorry for not being clear enough. So in acbd, a is before b, and c is before d. Thanks! Mar 16, 2012 at 22:29

Consider a&b and c&d alike. This will not disturb the order i.e. a is before b, and c is before d, as we are not interchanging the position of (a,b) and (c,d). This gives the answer: $\frac{4!}{2! \cdot 2} = 6$.