For a group of polynomial equations (in the Augmented Matrix, X [I, n + 1] represents the values of formulas, and X [I, j] represents the coefficients of the J items of the I equation, here, the Augmented Matrix may not necessarily be N, but may be less; opt indicates the operation rule ):
(X [1, 1] * A [1]) OPT (X [1, 2] * A [2]) opt... opt (X [1, N] * A [n]) = x [1, n + 1]
(X [2, 1] * A [1]) OPT (X [2, 2] * A [2]) opt... opt (X [2, N] * A [n]) = x [2, n + 1]
...
(X [N, 1] * A [1]) OPT (X [N, 2] * A [2]) opt... opt (X [N, N] * A [n]) = x [N, N + 1]
If Gaussian elimination is used, OPT must meet the following requirements:
A opt B = B opt
For X [I] * A [I] and X [J] * A [I], there is a way to change X [I] Or X [J] to 0 (not necessarily the OPT operation)
There is a way for a opt B = c To Make A = C opt2 B, Here opt2 represents an operation (not necessarily opt itself)
That's probably the case...
Dianyuan: For each equation, assume I, and X [I] [now] is not 0 (now is the variable of the currently deigned element, more general, as long as the coefficients of the following equation can be eliminated.) then, for all j> I equations, we can delete all X [J] [now] values that are not 0 (or that need to be decharged) in one way.
Back-to-generation: We finally obtain an inverted triangle matrix of an equation (Division without solution or meaningless) Where X [I] [I] is not 0. Then, based on property 3, transfer the other j> I A [J] of the current equation and the coefficient to the right elimination according to property 3 (at this time, a [J] must be obtained)
No solution: When a matrix exists, the left formula is 0 and the right formula is! = 0 (pay attention to the special judgment of the real number), so there is no solution ..
Free variable: the free variable is determined by the entire equation once these unknown values are determined. However, these quantities are unknown. (For example, if x + y = 5, the free yuan is 1, because the other one can be uniquely identified, whether X or Y), and the answer is the solution, obviously, because free yuan can be assigned randomly, and these values are only two, open and not open, then the number of solutions is 2 ^ free yuan. The method for freely changing elements is very simple. To explain it in the white book, it is actually only when n Different equations (that is, no matter how many other equations are used, they will not be the same) to determine N solutions. If we only determine x equations, then the number of free variables is n-X. (This X can be obtained easily, because in the Gaussian elimination process, the yuan will be eliminated, and the same equation will be eliminated as follows: 0 = 0. This is a useless equation.
Example:
[Bzoj] 1013: [jsoi2008] sphere (Gaussian elimination element)
The most basic Gaussian elimination element has been solved.
[Poj] 1222 extended lights out (Gaussian deyuan)
Exclusive or equation (mod 2 equation), because the exclusive or equation satisfies the above three properties, it can use Gaussian deyuan. You only need to build a model, and make a variable for each point. The values are only two, 0 and 1, indicating that the nodes are not open or open. Then the coefficient indicates whether the variable is associated (that is, when the coefficient is changed to 1, the variable with the other coefficient is changed). Then each equation corresponds to a value, that is, the final state of the variable.
[Poj] 1830 switch problem (Gaussian deyuan)
The number of non-solutions and the number of free variables must be determined for an equation.
[Poj] 2947 widget Factory (Gaussian deyuan)
Mod k equation. In the MOD sense, the equation also satisfies the three properties above, so Gaussian deyuan can be considered. But pay attention to it during back-to-generation, because it is in the MOD sense, X [I] [I] * A [I] = x [I] [n + 1] (mod k, therefore, if we want to produce a [I], we can use Extended Euclidean, or we can directly add K to obtain it. (Make sure there is a solution in the MOD sense)
Conclusion: Gaussian elimination