 Linsolve - Maple Programming Help

Home : Support : Online Help : Mathematics : Inert Functions : Linsolve

Linsolve

inert matrix solve

 Calling Sequence Linsolve(A, b) mod n Linsolve(A, b, 'r', 't') mod n

Parameters

 A - rectangular Matrix b - Vector 'r' - (optional) name 't' - (optional) name n - an integer, the modulus

Description

 • The Linsolve function is a placeholder for representing the solution x to the linear system $Ax=b$.
 • The call Linsolve(A,b) mod n computes the solution vector b if it exists of the linear system $Ax=b$ over a finite ring of characteristic n. This includes finite fields, $\mathrm{GF}\left(p\right)$, the integers mod p, and $\mathrm{GF}\left({p}^{k}\right)$ where elements of $\mathrm{GF}\left({p}^{k}\right)$ are expressed as polynomials in RootOfs.
 • If an optional third parameter r is specified, and it is a name, it is assigned the rank of the matrix A.
 • A linear system with an infinite set of solutions will be parameterized in terms of variables.  Maple uses the global names _t, _t, ...  are used by default.  If an optional fourth parameter t is specified, and it is a name, the names t, t, etc. will be used instead.

Examples

 > A := Matrix([[1,2,3],[1,3,0],[1,4,3]]);
 ${A}{≔}\left[\begin{array}{ccc}{1}& {2}& {3}\\ {1}& {3}& {0}\\ {1}& {4}& {3}\end{array}\right]$ (1)
 > b := Vector([1,2,3]);
 ${b}{≔}\left[\begin{array}{c}{1}\\ {2}\\ {3}\end{array}\right]$ (2)
 > x := Linsolve(A,b) mod 5;
 ${x}{≔}\left[\begin{array}{c}{4}\\ {1}\\ {0}\end{array}\right]$ (3)
 > A.x-b mod 5;
 $\left[\begin{array}{c}{0}\\ {0}\\ {0}\end{array}\right]$ (4)
 > x := Linsolve(A,b,'r',t) mod 6;
 ${x}{≔}\left[\begin{array}{c}{5}{+}{3}{}{{t}}_{{3}}\\ {1}{+}{3}{}{{t}}_{{3}}\\ {{t}}_{{3}}\end{array}\right]$ (5)
 > r;
 ${2}$ (6)
 > A.x-b mod 6;
 $\left[\begin{array}{c}{0}\\ {0}\\ {0}\end{array}\right]$ (7)

An example using GF(2^4).

 > alias(a=RootOf(y^4+y+1) mod 2):
 > A := Matrix([[1,a,a^2],[1,a^2,1],[1,a^3,a^2]]);
 ${A}{≔}\left[\begin{array}{ccc}{1}& {a}& {{a}}^{{2}}\\ {1}& {{a}}^{{2}}& {1}\\ {1}& {{a}}^{{3}}& {{a}}^{{2}}\end{array}\right]$ (8)
 > b := Vector([1,a,a^2]);
 ${b}{≔}\left[\begin{array}{c}{1}\\ {a}\\ {{a}}^{{2}}\end{array}\right]$ (9)
 > x := Linsolve(A,b) mod 2;
 ${x}{≔}\left[\begin{array}{c}{0}\\ {{a}}^{{3}}{+}{1}\\ {0}\end{array}\right]$ (10)
 > z := A.x - b mod 2;
 ${z}{≔}\left[\begin{array}{c}{1}{+}{a}{}\left({{a}}^{{3}}{+}{1}\right)\\ {{a}}^{{2}}{}\left({{a}}^{{3}}{+}{1}\right){+}{a}\\ {{a}}^{{3}}{}\left({{a}}^{{3}}{+}{1}\right){+}{{a}}^{{2}}\end{array}\right]$ (11)
 > Expand(convert(z,list)) mod 2;
 $\left[{0}{,}{0}{,}{0}\right]$ (12)