How many ways can 4 men and 4 women stand in a line so that the men are together and the women are together Question: How many ways can $\mathbf{4}$ men and $\mathbf{4}$ women line up with all the women together and all the men together?
My thoughts: I begin my solution to the problem by adding the total amount of men and women together: $\mathbf{8}$. With that in mind, I find how many ways the men can be lined up. The men can be lined up in $\mathbf{4!}$ ways, likewise the women can be lined up in $\mathbf{4!}$ ways. Thus, the product of these two groups lining up is $\mathbf{576}$. 
This is where I can't really understand how the solution $\mathbf{1152}$ is met. Multiplying $\mathbf{576}$ $\cdot$ $\mathbf{2}$ gives me this value, but I don't understand why. What are your thoughts?
 A: There are two groups. The groups can be arranged in $2!$ ways and there are 4 people in each group so each group can be arranged in $4! \times 4!$ ways. The total number of arrangements is $1152 = 4! \times 4! \times 2!$
A: The first person can be chosen in $8$ ways. The next three persons can be chosen in $3$, $2$ and $1$ ways, respectively (they have to be the same sex as the first person). Then for the fifth person there are $4$ options again, and then $3$, $2$ and $1$ possibilities for the remaining $3$ persons. Therefore, the total number of ways is
$$
8 \times 3 \times 2 \times 1 \times 4 \times 3 \times 2 \times 1 = 1152. \quad (=2 \times 4! \times 4!)
$$
The expression $2 \times 4! \times 4!$ can be explained by the fact that there are $2$ ways to decide the gender of the first person and that there are $4!$ ways to order the men and $4!$ ways to order the women.
A: The men can go first, or the women can go first. Two options means multiply by two.
For another example, what if there is one man and one woman? How many ways can they line up? Well $1!\times 1!\times 2!$
A: The group of men can be in front or in the back: $2$ possibilities
In the group of men, there are $4\times3\times2$ possible positions $= 24$
In the group of women, same number: $24$
So the answer is $2 x 24 x 24 = 1152$
