1

Say I have characters abcde and the following constraints:

  • a must come before b
  • a must come before c
  • c must come before d

I thought the answer is $\frac{5!}{2!3!} = 10$. $2!$ comes from a$\to$b and $3!$ comes from a$\to$c$\to$d. However, if I write out the answers, there are $15$ possible solutions. Can someone explain this please?

2 Answers2

1

A way to count is forget $e$, cause $e$ can be in any place.

Now, the problem is count words $abcd$ with the given constraists. Before it, note that for the paragraph above, if $uvzt$ is a such a word, then $e$ can be in any of 5 places:_u_v_z_t_. Then, the total of words $uvzt$ will be multiplicated by $5$.

Let us count! given the constraists, $a$ is the first one letter. Then the words are all of the form $avzt$. Again, by the constraints, $d$ is $z$ or $t$. If we fixed $d$ in z ($avdt$) then $v=c$ and $t=b$. That is: if $d$ is in the third, place, it is only one word: $acdb$.

If $d$ is in the fourth place, then the second place is any of $b$ or $c$ and the third place is the other. Then, there are 2 words of the form $avzt$ ($abcd$ and $acbd$)

Conclusion: There are $1+2=3$ words of the form $xyzt$, where $x,y,z,t\in\{a,b,c,d\}$, satisfying the initial constraints, and by the initial considerations, there are $5\times3=15$ words.

sinbadh
  • 7,521
0

Method 1: Since $a$ appears before $c$ and $c$ appears before $d$, the letters $a$, $c$, and $d$ must appear in that order. Since $b$ appears after $a$, we can insert $b$ in one of the three spaces to the immediate right of one of the letters in the string $acd$. $$a \square c \square d \square$$ For each of the three ways we can do this ($abcd$, $acbd$, $acdb$), we now have five spaces to put the $e$, the three spaces between successive letters and the two ends. Hence, there are $3 \cdot 5 = 15$ permutations of the letters $a, b, c, d, e$ in which $a$ appears before $b$, $a$ appears before $c$, and $c$ appears before $d$.

Method 2: We make an adjustment to your attempt. Observe that without the constraint that $a$ appear before $b$, we would have had four choices for where we could place $b$ in the string $acd$. $$\square a \square c \square d \square$$ Three of these placements are allowed, so the number of allowed arrangements of the letters $a$, $b$, $c$, $d$ is $$\frac{3}{4} \cdot \frac{4!}{3!}$$ where we divide the $4!$ ways the $4$ letters could be arranged by the $3!$ ways the letters $a$, $c$, and $d$ could be arranged if they did not have to appear in the order $a, c, d$. The fact that $b$ appears after $a$ in $3/4$ of the arrangements in which the letters $a$, $c$, and $d$ appear in that order is why you could not divide by $2!$ in your attempt. Since we can place the $e$ in any of the five spaces, we obtain $$\frac{3}{4} \cdot \frac{4!}{3!} \cdot 5 = \frac{3}{4} \cdot \frac{5!}{3!}$$

Method 3: There are five ways to place the $e$. Since $a$ must appear before $b$, $a$ must appear before $c$, and $c$ must appear before $d$, $a$ must be placed in the leftmost open space. Since there are no further constraints on the placement of $b$, we can place it in any of the three remaining spaces. Since $c$ must appear before $d$, we must place $c$ and $d$ in the remaining spaces in that order. Hence, there are $5 \cdot 1 \cdot 3 \cdot 1 \cdot 1 = 15$ permutations of the letters $a, b, c, d, e$ in which $a$ appears before $b$, $a$ appears before $c$, and $c$ appears before $d$.

N. F. Taussig
  • 76,571