Okay, a matrix m x n is defined as:
A_{m x n} = \left[ \begin{array}{ccccc} a_{11} & a_{12} & a_{13} & . . . & a_{1n} \\ a_{21} & a_{22} & a_{23} & . . . & a_{2n} \\ \vdots & \vdots & \vdots & \vdots & . . . \\ a_{m1} & a_{m2} & a_{m3} & . . . & a_{mn} \end{array} \right]
a_{ij} 0 < i < m, 0 < j < n is one item in the matrix. For example, i = 1, j = 1, then you will have a_{ij} = a_{11}
And my matrix will have a_{1j} = 1 \mbox{ and } a_{i1} = 1
So it will look like:
An item a_{ij} is the one that lies on the i row, and the j column of the matrix.
A = \left[ \begin{array}{ccccc} 1 & 1 & 1 & 1 & . . . \\ 1 & a_{22} & a_{23} & a_{24} & . . . \\ 1 & a_{32} & a_{33} & a_{34} & . . . \\ \vdots & \vdots & \vdots & \vdots & . . . \end{array} \right]
Then I say : a_{ij} = a_{(i - 1)j} + a_{i(j - 1)}
Example : a_{22} = a_{12} + a_{21} = 1 + 1 = 2
a_{23} = a_{13} + a_{22} = 1 + 2 = 3
The item a_{ij} is the sum of the item above it and the item to the left of it.
And so on, so my matrix will look like:
A = \left[ \begin{array}{ccccc} 1 & 1 & 1 & 1 & . . . \\ 1 & 2 & 3 & 4 & . . . \\ 1 & 3 & 6 & 10 & . . . \\ \vdots & \vdots & \vdots & \vdots & . . . \end{array} \right]
Then I calculate : \delta = n - (2(p - 1) + 1). There are 2 cases:
1. \delta \leq 0 : No selection.
2. \delta > 0:
Then the number of selection will be:
C = a_{\delta p} + \sum_{x = 1}^{\delta} a_{xp}
It means:
C = a_{\delta p} + a_{1p} + a_{2p} + a_{3p} + ... + a_{\delta p}
Where p is the number of people you want to select, n is the total number of people sitting on the round table.
* Solving your problem using my method:
\delta = n - (2(p - 1) + 1) = 3
p = 7, n = 16 (This is what you have total people = 16, number of selected people = 7).
A = \left[ \begin{array}{ccccccc} 1 & 1 & 1 & 1 & 1 & 1 & 1. . . \\ 1 & 2 & 3 & 4 & 5 & 6 & 7. . . \\ 1 & 3 & 6 & 10 & 15 & 21 & 28. . . \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & . . . \end{array} \right]
So you will have:
C = a_{\delta p} + a_{1p} + a_{2p} + a_{3p} + ... + a_{\delta p}
= a_{37} + a_{17} + a_{27} + a_{37} = 28 + 28 + 7 + 1 = 64.
So there are 64 different ways to randomly choose 7 people, in which in every 2 selected people, they don't sit next to each other.
You can try another number of people sitting on the table (n), and the number of selected people (p).
You can use this as a method to check your answer.
Viet Dao,