# Permutation question involving seating

In a class of 20 students having 20 chairs in 5 rows of 4 each. If the class has 10 boys and 10 girls, in how many ways, can the student's be placed in the chair's such that no boy is sitting in front of, behind, or next to another boy and no girl is sitting in front of, behind or next to another girl.

Please explain in detail.

Since I had just started this I am having no ideas about permutation formulas so please explain this answer by logical thinking. Please NOTE:-I am just a highschool student seeking help from teachers. So please be calm and don't close my question

• Well, have you tried to find an arrangement that works? Suppose the upper left seat is taken by a girl. How much freedom does that leave you in the rest of the assignment? – lulu Aug 18 '18 at 18:44
• It just clicked in my head. I got this answer no need to solve it. So I am taking my question back to save other users time. – Rafael Nadal Aug 18 '18 at 18:46
• @Thanks sir for paying attention to my question – Rafael Nadal Aug 18 '18 at 18:46

Given a colouring, you have $10!$ ways to have the boys seated, and $10!$ ways to have the girls seated. (All right, this part is about permutations.)
So the number of solutions is $2\cdot 10!\cdot 10!$.