Hello coldfireWikipedia entry.
If is the number of derangements of items, then, we get:
1. No student sits in their original row. This implies that a derangement of the six rows has occurred, and the probability of this is , since there are possible derangements, and possible arrangements of items. So that's .
2. Exactly 2 groups sit in their original row. The number of ways of choosing which 2 rows are left unchanged is . The remaining 4 rows are then deranged. This can be done in ways. So the probability of this is .
3. The number of ways in which exactly 3 groups sit in their original rows is ; the number of ways in which exactly 4 groups sit in their original rows is , ... Can you complete it from here?
4. There are derangements of the 6 rows, and, within each row, there are derangements of the 9 columns. Each of the six rows is deranged (I love the thought of deranged students!) so the total number of possibilities is , which is a very large number.
Set against this, however, is the fact that there are possible arrangements of the rows, and, within each row, possible arrangements of the columns. So that's altogether.
The probability of this, then, is ...? (If I and my spreadsheet have done the arithmetic correctly, this comes out at about .)