How many ways can a word be formed from $8$ A's and $5$ B's if every A is next to another A and every B is next to another B? How many ways can a word be formed from $8$ A's and $5$ B's if every A is next to another A and every B is next to another B?
Note: It doesn't have to be an actual legal word.  At least I think so.
I can't do it with permutations or combinations, and I don't think listing these all out is a very good idea.  Thanks in advance for posting a solution!
 A: Each $B$ occurs at some position in the word. Label these from left to right the first $B$, the second $B$, and so forth.
Now consider how every $B$ can be next to another $B$ when there are exactly five $B$s.


*

*The first $B$ and second $B$ must be adjacent.

*The fourth $B$ and fifth $B$ must be adjacent.

*The third $B$ can be adjacent to the second $B$, or to the fourth $B$, or both.
So far this provides two patterns:  $A^k BBB A^m BB A^n$ and
$A^k BB A^m BBB A^n$, where $A^r$ is $r$ repetitions of $A$ and
$k + m + n = 8$.
But since every $A$ must be adjacent to another, that rules out all
sequences in which $k = 1$ or $m = 1$ or $n = 1$.
This suggests the following counting:


*

*Count all ways to distribute $8$ indistinguishable objects (the $A$s) among three distinguishable boxes (the spaces occupied by the sequences $A^k$, $A^m$, and $A^n$) if there must be at least two objects per box. Multiply this number by $2$ to count the variations $A^k BBB A^m BB A^n$ and
$A^k BB A^m BBB A^n$.

*Count all the ways to distribute $8$ indistinguishable objects among two distinguishable boxes if there must be at least two objects per box. This corresponds to setting exactly one of $k, m, n$ to zero. Multiply this number by $5$ to count the variations $A^k BBB A^m BB A^n$ and
$A^k BB A^m BBB A^n$ where $k=0$ or $n=0$ and to count the single variation where $m=0$.

*Count the four sequences in which all the $A$s are in one "box": $AAAAAAAABBBBB$, $BBAAAAAAAABBB$, $BBBAAAAAAAABB$, and $BBBBBAAAAAAAA$.
The total number of words is the sum of those three counts.
A: The $B's$ can either come as a block of $5$ of as a block of $3$ and a disjoint block of $2$.  Let's count these cases separately.
Case I:  Block of $5$.  Then the number of $A's$ in front must be $\{0,2,3,4,5,6,8\}$ so $\fbox 7$.
Case II.  block of $2$ plus block of $3$.  Let's say the $2$-block comes first (the other case has the same count).  Then we have three places to put $A's$ and we need at least $2$ in the middle.
IIa.  $2$ in the middle.  Then We have $\{0,2,3,4,6\}$ in front so $\fbox 5$
IIb.  $3$ in the middle.  Then we have $\{0,2,3,5\}$ in front so $\fbox 4$.
IIc.  $4$ in the middle.  Then we have $\{0,2,4\}$ in front so $\fbox 3$.
IId.  $5$ in the middle.  Then we have $\{0,3\}$ in front so $\fbox 2$.
IIe.  $6$ in the middle.  Then we have $\{0,2\}$ in front so $\fbox 2$.
IIf.  $8$ in the middle.  Then  $\fbox 1$.
Thus we have $5+4+3+2+2+1=17$.  Double to get $\fbox {34}$
So I see $\fbox {41}$ altogether.
Note:  this is very error prone.  I would advise checking it with extreme skepticism.
A: Based on this, there are 2 cases.  Either the A's are split into 4 pairs, or the A's are split into 2 triplets and 1 pair.  In either case, the B's will be split 3-2.
Take the first case, where the A's are split into 4 pairs, and the B's are split into 3-2.  There only 3 blocks, call them A'(=AA), B'(=BB), and C'(=BBB).  You have 4 A', 1 B', and 1 C'.  It is easy to determine how many such combinations there are.  Now do the same with the second case.  Finally, eliminate a few cases that are double counted by being in both case 1 and 2 (For example, AAAAAAAABBBBB is in both)--this can be done manually.
A: Line up the A's in a row, creating 9 gaps.  
Since we can't isolate the first or last A, no B's can be put in the 2nd or 8th gaps.
1) If the B's are in a block of 5, there are 7 gaps left to put this block.
2) If the B's are in a 2-block and a 3-block, there are $\binom{7}{2}-4=17$ ways to choose the gaps to put them in,
$\hspace{.2 in}$since there are 7 gaps to choose from and we cannot put the blocks in consecutive gaps, and  
$\hspace{.2 in}$ then there are $2!$ ways to place them in the gaps chosen.
This gives a total of $7+17\cdot2=\color{red}{41}$ possible arrangements.
