IntegerRelations
LinearDependency
find an integer dependence (relation)
Calling Sequence
Parameters
Description
Examples
LinearDependency(v,opts)
v
-
list or Vector of (complex) floating-point numbers
opts
(optional); equation of the form method=LLL or method=PSLQ specifying the algorithm used
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 ∑i=1n⁡ui⁢vi is close to zero.
By default, Bailey and Ferguson's PSLQ (Partial Sum of Least Squares) algorithm is used if the numbers in v are real.
The optional argument method=LLL specifies that the LLL (Lenstra-Lenstra-Lovasz) lattice basis reduction algorithm be used, which is the default if v contains non-real values.
with⁡IntegerRelations:
r≔sqrt⁡2+sqrt⁡3
r≔2+3
v≔expand⁡seq⁡ri,i=0..4
v≔1,2+3,5+2⁢2⁢3,11⁢2+9⁢3,49+20⁢2⁢3
v≔evalf⁡v,12
v≔1.,3.14626436994,9.89897948556,31.1448064542,97.9897948556
v≔evalf⁡v
v≔1.,3.146264370,9.898979486,31.14480645,97.98979486
u≔LinearDependency⁡v
u≔1,0,−10,0,1
add⁡ui⁢vi,i=1..5
0.
m≔add⁡ui⁢zi−1,i=1..5
m≔z4−10⁢z2+1
simplify⁡eval⁡m,z=r
0
r≔1+−213
v≔Vector⁡expand⁡seq⁡ri,i=0..4,12
v≔11+−2131+2⁢−213+−223−1+3⁢−213+3⁢−223−7+2⁢−213+6⁢−223
v≔evalf⁡v,12:v≔evalf⁡v
v≔1.1.629960525+1.091123636⁢I1.466220524+3.556976909⁢I−1.491220003+7.397559819⁢I−10.50228211+10.43062509⁢I
u≔LinearDependency⁡v,method=LLL
u≔−1−26−41
0.−1.×10−8⁢I
m≔z4−4⁢z3+6⁢z2−2⁢z−1
solve⁡m=0,z
1,−213+1,2132−I⁢3⁢2132+1,2132+I⁢3⁢2132+1
evalc⁡r
2132+I⁢3⁢2132+1
See Also
identify
IntegerRelations[LLL]
IntegerRelations[PSLQ]
Download Help Document
What kind of issue would you like to report? (Optional)