Question 1116072
THE WAY THE SOLUTION WAS CALCULATED:
I have to agree with the {{{5!*7*6*5*4=604800}}} solution.
{{{6!=720}}} is the number of ways that you can arrange {{{6}}} non-math students in a row.
Get those students in the examination room, and let them pick spots in the row of chairs.
Ask each of them to leave empty seats in between them.
Remove the chairs that have no one sitting next to them.
You have now {{{6+1=7}}} empty spots
where you can place the math students
in a row of 6+7=13 seats.
As each math student walks in, let them choose among the 7 empty seats.
There are {{{7*6*5*4=840}}} different ways they can choose.
The first math student has 7 choices;
the second one has 6;
the third one has 5,
and the last one has 4 choices.
 
WHY {{{10!-7!}}} DOES NOT WORK:
{{{7!}}} is the number of ways you can get 7 groups in a row
so that all the members of each group are together.
As a consequence, {{{10!-7!}}} is the number of ways to place the 10 students to avoid having all 4 math students together, but not preventing cluster of 3 math students seating together, or pairs of math students seating together.
 
ANOTHER WAY:
Out of 10 seats in a row, numbered 1 through10,
there are only 35 ways to pick 4 non-contiguous seats for the math students:
{{{matrix(5,35,
"# 1","# 2","# 3","# 4","# 5","# 6","# 7","# 8","# 9","# 10",
"# 11","# 12","# 13","# 14","# 15","# 16","# 17","# 18","# 19","# 20",
"# 21","# 22","# 23","# 24","# 25","# 26","# 27","# 28","# 29","# 30",
"# 31","# 32","# 33","# 34","# 35",
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,4,
3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,6,4,4,4,4,4,4,5,5,5,6,5,5,5,6,6,
5,5,5,5,6,6,6,7,7,8,6,6,6,7,7,8,7,7,8,8,6,6,6,7,7,8,7,7,8,8,7,7,8,8,8,
7,8,9,10,8,9,10,9,10,10,
8,9,10,9,10,10,9,10,10,10,
8,9,10,9,10,10,
9,10,10,10,
9,10,10,10,10)}}} .
For each of those choices, you can have
{{{4!=24}}} different seating orderings for the math students, and
{{{6!=720}}} different seating orderings for the non-math students.
That multiplies to
{{{35*24*720=604800}}} different seating arrangements.