The Happy Animals Kennel has 18 cages in a row. They allocate these cages at random to 6 dogs, 6 cats, and 6 pot-bellied pigs (with one animal per cage). All arrangements are equally likely.
Let A be the number of times in the row of cages that two animals of the same species are adjacent. For example, in the arrangement DCPCDPPPDCDPCDCCPD (where D=dog, C=cat, and P=pig), we have A=3.
What is the expected value of A?
(not sure if expectation is the correct tag here)