# Combination question

1. May 7, 2014

### joshmccraney

1. The problem statement, all variables and given/known data
how many ways can $a,b,c,d,e,f,g,h,i,j$ (first ten letters of the alphabet) be interchanged if $a,b,c$ must be adjacent and if $d$ cannot be touching the $a$ nor can it touch the $b$?

3. The attempt at a solution
to start, i figure we can take the total number of ways that $a,b,c$ without the $d$ restriction and then subtract the ways the $d$ mingles with the $a,b$. thus, we have (i think)
$$3!8! - 3 \times 3!7!$$

thanks for the help!

2. May 7, 2014

### joshmccraney

actually, i think i need to make some cases, thus would it be:
$$3!8! - (3\times 2!2! + 4 \times 2!)7!$$
where the first case is when we have the $a,b$ adjacent and the second case we have the $c$ always in the middle.

what do you think?

3. May 9, 2014

### haruspex

I think you're still subtracting too much. The 7! factor is fine, of course.
Remember you should only be subtracting cases where a, b and c are an adjacent trio. That doesn't leave many illegal places for the d.

4. May 10, 2014

### joshmccraney

hmmmm how about $$3!8! - (2 \times 2!2! + 4 \times 2!)7!$$ if the $a,b$ are adjacent we have $2!$ spots for them and then $2!$ spots for them and the $c$. this then leaves us with $2$ spots for the $d$ to still touch the $a,b$.

we also have the situation where the $a,b$ are not adjacent, and the $c$ is in the middle. thus, there are $2!$ ways to arrange the $a,b$ around the $c$. however, there are now $4$ spots we can place the $d$.

without the $7!$ this leaves only 16 arrangements. that sounds good or too much?

5. May 10, 2014

### haruspex

After placing the c, I only see one spot for d to go to touch one of a, b.
I only see two for the d.
Placing d must not disrupt the existing assumed adjacencies.

6. May 10, 2014

### joshmccraney

Abdc
Dabc
Dbac
Cabd
Cdab
Cdba

I think there's 8, right?

7. May 10, 2014

### haruspex

Your 3!8! counts only cases where a, b, c form an adjacent triple. Abdc is not one of those, so it doesn't need to be subtracted.

8. May 10, 2014

### joshmccraney

great call! i don't know how i missed this! just for completeness, is it $$3!8! - (2 \times 2! + 2 \times 2!)7!$$

9. May 11, 2014

### haruspex

Yep.

10. May 11, 2014

### xiavatar

11. May 11, 2014

hmm. A soldier of me just reported that my name has been mentioned in this thread $7\times$
Anyway,glad that you solved a question involving my name.

12. May 11, 2014

### joshmccraney

It was anything but easy! Thank goodness for pf!