Example 24 For couples to go to the movies, 8 people sit in a row. If a woman's neighbor can only be her husband or another woman, how many different seating arrangements are there?
(1995 Japanese Olympiad Preliminary Problem)
First, arrange the women, which has 4! ways. If a man sits between two women, there must be at least 2 men (the husbands of the two women). Similarly, if a woman sits between two men, there must be at least 2 women (the wives of the two men). If we consider the women sitting together as a group, the ways to group the women (regardless of order) are: $1+1+1+1, 2+1+1, 2+2, 3+1, 4$.

A woman sitting alone must be at one of the ends of the row (since each woman has only one husband), so the grouping $1+1+1+1$ does not meet the requirement.

When the women are grouped as $2+1+1$, the women must be at the ends, and the men can only be grouped as $2+2$, which is the following (1) type: woman-man-woman-woman-man-woman-man, in which the men have only 1 arrangement.

When the women are grouped as $2+2$, there are only the following (2), (3), (4), (5) 4 types:
(2) woman-woman-man-man-man-woman-woman
(3) woman-woman-man-man-woman-woman-man or man-woman-woman-man-man-woman-woman
(4) woman-woman-man-woman-woman-man-man or man-man-woman-woman-man-woman-woman
(5) man-woman-woman-man-woman-woman-man

In these cases, the men have $2!, 1, 1, 1$ arrangements, totaling $2! + 2 \times 1 + 2 \times 1 + 1 = 7$ ways.

When the women are grouped as $3+1$, there are only the following (6), (7), (8) 3 types:
(6) woman-woman-man-man-man-woman or woman-man-man-man-woman-woman-woman
(7) man-man-woman-woman-woman-man or woman-man-woman-woman-woman-man-man
(8) man-woman-man-man-woman-woman-woman-man or man-woman-woman-woman-man-man-woman

In these cases, the men have $2!, 1, 1$ arrangements, totaling $2 \times 2! + 2 \times 1 + 2 \times 1 = 8$ ways.

When the women are grouped as 4, there are only the following (9), (10), (11) 3 types:
(9) woman-woman-woman-man-man-man-man or man-man-man-man-woman-woman-woman-woman
(10) man-man-man-woman-woman-woman-woman-man or woman-woman-woman-woman-man-man-man-man
(11) man-man-woman-woman-woman-woman-man-man

In these cases, the men have $3!, 2!, 2!$ arrangements, totaling $2 \times 3! + 2 \times 2! + 2! = 18$ ways.

In summary, the total number of arrangements is $4!(1 + 7 + 8 + 18) = 24 \times 34 = 816$ ways.