IntegerRelations - Maple Programming Help

Home : Support : Online Help : Mathematics : Numerical Computations : Approximations : IntegerRelations Package : IntegerRelations/LinearDependency

IntegerRelations

 LinearDependency
 find an integer dependence (relation)

 Calling Sequence LinearDependency(v,opts)

Parameters

 v - list or Vector of (complex) floating-point numbers opts - (optional); equation of the form method=LLL or method=PSLQ specifying the algorithm used

Description

 • The LinearDependency(v,opts) command finds an integer relation between the numbers in v - if they are linearly dependent. Given a list (or a Vector) of $n$ real or complex numbers, LinearDependency outputs a list (or a Vector) $u$ of $n$ integers such that $\sum _{i=1}^{n}\phantom{\rule[-0.0ex]{5.0px}{0.0ex}}{u}_{i}{v}_{i}$ is close to zero.
 • By default, Bailey and Ferguson's PSLQ (Partial Sum of Least Squares) algorithm is used.
 • The optional argument method=LLL specifies that the LLL (Lenstra-Lenstra-Lovasz) lattice basis reduction algorithm be used.

Examples

 > $\mathrm{with}\left(\mathrm{IntegerRelations}\right):$
 > $r≔\sqrt{2}+\sqrt{3}$
 ${r}{:=}\sqrt{{2}}{+}\sqrt{{3}}$ (1)
 > $v≔\mathrm{expand}\left(\left[\mathrm{seq}\left({r}^{i},i=0..4\right)\right]\right)$
 ${v}{:=}\left[{1}{,}\sqrt{{2}}{+}\sqrt{{3}}{,}{5}{+}{2}{}\sqrt{{2}}{}\sqrt{{3}}{,}{11}{}\sqrt{{2}}{+}{9}{}\sqrt{{3}}{,}{49}{+}{20}{}\sqrt{{2}}{}\sqrt{{3}}\right]$ (2)
 > $v≔\mathrm{evalf}\left(v,12\right)$
 ${v}{:=}\left[{1.}{,}{3.14626436994}{,}{9.89897948556}{,}{31.1448064542}{,}{97.9897948556}\right]$ (3)
 > $v≔\mathrm{evalf}\left(v\right)$
 ${v}{:=}\left[{1.}{,}{3.146264370}{,}{9.898979486}{,}{31.14480645}{,}{97.98979486}\right]$ (4)
 > $u≔\mathrm{LinearDependency}\left(v\right)$
 ${u}{:=}\left[{1}{,}{0}{,}{-}{10}{,}{0}{,}{1}\right]$ (5)
 > $\mathrm{add}\left({u}_{i}{v}_{i},i=1..5\right)$
 ${0.}$ (6)
 > $m≔\mathrm{add}\left({u}_{i}{z}^{i-1},i=1..5\right)$
 ${m}{:=}{{z}}^{{4}}{-}{10}{}{{z}}^{{2}}{+}{1}$ (7)
 > $\mathrm{simplify}\left(\genfrac{}{}{0}{}{m}{\phantom{z=r}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{m}}{z=r}\right)$
 ${0}$ (8)
 > $r≔1+{\left(-2\right)}^{\frac{1}{3}}$
 ${r}{:=}{1}{+}{\left({-}{2}\right)}^{{1}{/}{3}}$ (9)
 > $v≔\mathrm{Vector}\left(\mathrm{expand}\left(\left[\mathrm{seq}\left({r}^{i},i=0..4\right)\right],12\right)\right)$
 ${v}{:=}\left[\begin{array}{c}{1}\\ {1}{+}{\left({-}{2}\right)}^{{1}{/}{3}}\\ {1}{+}{2}{}{\left({-}{2}\right)}^{{1}{/}{3}}{+}{\left({-}{2}\right)}^{{2}{/}{3}}\\ {-}{1}{+}{3}{}{\left({-}{2}\right)}^{{1}{/}{3}}{+}{3}{}{\left({-}{2}\right)}^{{2}{/}{3}}\\ {-}{7}{+}{2}{}{\left({-}{2}\right)}^{{1}{/}{3}}{+}{6}{}{\left({-}{2}\right)}^{{2}{/}{3}}\end{array}\right]$ (10)
 > $v≔\mathrm{evalf}\left(v,12\right):$$v≔\mathrm{evalf}\left(v\right)$
 ${v}{:=}\left[\begin{array}{c}{1.}\\ {1.629960525}{+}{1.091123636}{}{I}\\ {1.466220524}{+}{3.556976909}{}{I}\\ {-}{1.491220003}{+}{7.397559819}{}{I}\\ {-}{10.50228211}{+}{10.43062509}{}{I}\end{array}\right]$ (11)
 > $u≔\mathrm{LinearDependency}\left(v,\mathrm{method}=\mathrm{LLL}\right)$
 ${u}{:=}\left[\begin{array}{r}{-}{1}\\ {-}{2}\\ {6}\\ {-}{4}\\ {1}\end{array}\right]$ (12)
 > $\mathrm{add}\left({u}_{i}{v}_{i},i=1..5\right)$
 ${0.}{-}{1.}{}{{10}}^{{-8}}{}{I}$ (13)
 > $m≔\mathrm{add}\left({u}_{i}{z}^{i-1},i=1..5\right)$
 ${m}{:=}{{z}}^{{4}}{-}{4}{}{{z}}^{{3}}{+}{6}{}{{z}}^{{2}}{-}{2}{}{z}{-}{1}$ (14)
 > $\mathrm{simplify}\left(\genfrac{}{}{0}{}{m}{\phantom{z=r}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{m}}{z=r}\right)$
 ${0}$ (15)
 > $\mathrm{solve}\left(m=0,z\right)$
 ${1}{,}{-}{{2}}^{{1}{/}{3}}{+}{1}{,}\frac{{1}}{{2}}{}{{2}}^{{1}{/}{3}}{-}\frac{{1}}{{2}}{}{I}{}\sqrt{{3}}{}{{2}}^{{1}{/}{3}}{+}{1}{,}\frac{{1}}{{2}}{}{{2}}^{{1}{/}{3}}{+}\frac{{1}}{{2}}{}{I}{}\sqrt{{3}}{}{{2}}^{{1}{/}{3}}{+}{1}$ (16)
 > $\mathrm{evalc}\left(r\right)$
 $\frac{{1}}{{2}}{}{{2}}^{{1}{/}{3}}{+}\frac{{1}}{{2}}{}{I}{}\sqrt{{3}}{}{{2}}^{{1}{/}{3}}{+}{1}$ (17)