Linsolve - Maple Programming Help

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[1], _t[2], ...  are used by default.  If an optional fourth parameter t is specified, and it is a name, the names t[1], t[2], etc. will be used instead.

Examples

 > $A≔\mathrm{Matrix}\left(\left[\left[1,2,3\right],\left[1,3,0\right],\left[1,4,3\right]\right]\right)$
 ${A}{≔}\left[\begin{array}{rrr}{1}& {2}& {3}\\ {1}& {3}& {0}\\ {1}& {4}& {3}\end{array}\right]$ (1)
 > $b≔\mathrm{Vector}\left(\left[1,2,3\right]\right)$
 ${b}{≔}\left[\begin{array}{r}{1}\\ {2}\\ {3}\end{array}\right]$ (2)
 > $x≔\mathrm{Linsolve}\left(A,b\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}5$
 ${x}{≔}\left[\begin{array}{r}{4}\\ {1}\\ {0}\end{array}\right]$ (3)
 > $A\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}x-b\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}5$
 $\left[\begin{array}{r}{0}\\ {0}\\ {0}\end{array}\right]$ (4)
 > $x≔\mathrm{Linsolve}\left(A,b,'r',t\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}6$
 ${x}{≔}\left[\begin{array}{c}{5}{+}{3}{}{{t}}_{{3}}\\ {1}{+}{3}{}{{t}}_{{3}}\\ {{t}}_{{3}}\end{array}\right]$ (5)
 > $r$
 ${2}$ (6)
 > $A\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}x-b\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}6$
 $\left[\begin{array}{r}{0}\\ {0}\\ {0}\end{array}\right]$ (7)

An example using GF(2^4).

 > $\mathrm{alias}\left(a=\mathrm{RootOf}\left({y}^{4}+y+1\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}2\right):$
 > $A≔\mathrm{Matrix}\left(\left[\left[1,a,{a}^{2}\right],\left[1,{a}^{2},1\right],\left[1,{a}^{3},{a}^{2}\right]\right]\right)$
 ${A}{≔}\left[\begin{array}{ccc}{1}& {a}& {{a}}^{{2}}\\ {1}& {{a}}^{{2}}& {1}\\ {1}& {{a}}^{{3}}& {{a}}^{{2}}\end{array}\right]$ (8)
 > $b≔\mathrm{Vector}\left(\left[1,a,{a}^{2}\right]\right)$
 ${b}{≔}\left[\begin{array}{c}{1}\\ {a}\\ {{a}}^{{2}}\end{array}\right]$ (9)
 > $x≔\mathrm{Linsolve}\left(A,b\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}2$
 ${x}{≔}\left[\begin{array}{c}{0}\\ {{a}}^{{3}}{+}{1}\\ {0}\end{array}\right]$ (10)
 > $z≔A\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}x-b\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}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)
 > $\mathrm{Expand}\left(\mathrm{convert}\left(z,\mathrm{list}\right)\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}2$
 $\left[{0}{,}{0}{,}{0}\right]$ (12)
 >