# The I-Test Manish Gupta - 05305006 Santosh Kumar - 05305003 Soumitra Pal - 05305015 Group - 6.

## Presentation on theme: "The I-Test Manish Gupta - 05305006 Santosh Kumar - 05305003 Soumitra Pal - 05305015 Group - 6."— Presentation transcript:

The I-Test Manish Gupta - 05305006 Santosh Kumar - 05305003 Soumitra Pal - 05305015 Group - 6

Agenda Introduction Definitions Theorems Algorithm Conclusion

Introduction a 1 I 1 + a 2 I 2 + … + a n I n = a 0 M k ≤ I k ≤ N k, 1 ≤ k ≤ n M k & N k can be * or integers

Introduction (2) GCD-Test – Considers integrality – Ignores limits Banerjee-Test – Considers limits – Ignores integrality, checks for real solution – Not applicable if some limits are unknown How about considering both?

Definition - Solvability a 1 I 1 + a 2 I 2 + … + a n I n = a 0 is (M 1,N 1 ; M 2,N 2 ; …; M n,N n ) integer solvable n > 0 If there exists j 1, j 2.. j n s.t. a 1 j 1 + a 2 j 2 + … + a n j n = a 0 For each k, 1 ≤ k ≤ n: if M k and N k are integers then M k ≤ j k ≤ N k If M k is an integer and N k = * then M k ≤ j k If N k is an integer and M k = * then j k ≤ N k n = 0 if a 0 =0

Definition - Interval Equation a 1 I 1 + a 2 I 2 + … + a n I n = [L,U] --------- (1) L,U integers. M k ≤ I k ≤ N k, 1 ≤ k ≤ n It is a set of these equations a 1 I 1 + a 2 I 2 + … + a n I n = L a 1 I 1 + a 2 I 2 + … + a n I n = L+1 …. a 1 I 1 + a 2 I 2 + … + a n I n = U

Solvability of Interval Equation Eq(1) is (M 1,N 1 ; M 2,N 2 ; …; M n,N n ) integer solvable – n>0, if at least 1 from the above set is integer solvable. – n=0, if L ≤ 0 ≤ U a 1 I 1 + a 2 I 2 + … + a n I n = a 0 can be written as an interval equation as follows: a 1 I 1 + a 2 I 2 + … + a n I n = [a 0, a 0 ]

Theorem 1 GCD test for Interval Equation a 1 I 1 + a 2 I 2 + … + a n I n = [ L, U ] Has integer solution if and only if L ≤ d* ceil(L/d) ≤ U Where d = gcd(a 1, a 2,.., a n ) e.g. 4x + 6y = [9,12] 9≤10≤12 So, solution exists

Lemma 2a Shift 1 variable to right If a n ≤ U-L+1, and a n >0 a 1 I 1 + a 2 I 2 + … + a n I n = [ L, U ] is (M 1,N 1 ; M 2,N 2 ; …; M n,N n ) integer solvable iff a 1 I 1 + a 2 I 2 + … + a n-1 I n-1 = [ L - a n N n, U - a n M n ] is (M 1,N 1 ; M 2,N 2 ; …; M n-1,N n-1 ) integer solvable.

Lemma 2b Shift 1 variable to right If -a n ≤ U-L+1, and a n < 0 a 1 I 1 + a 2 I 2 + … + a n I n = [ L, U ] is (M 1,N 1 ; M 2,N 2 ; …; M n,N n ) integer solvable iff a 1 I 1 + a 2 I 2 + … + a n-1 I n-1 = [ L - a n M n, U - a n N n ] is (M 1,N 1 ; M 2,N 2 ; …; M n-1,N n-1 ) integer solvable.

Theorem 2 Shift 1 variable to right If |a n | ≤ U-L+1 a 1 I 1 + a 2 I 2 + … + a n I n = [ L, U ] is (M 1,N 1 ; M 2,N 2 ; …; M n,N n ) integer solvable iff a 1 I 1 + a 2 I 2 + … + a n-1 I n-1 = [ L - a n + N n + a n - M n, U - a n + M n + a n - N n ] is (M 1,N 1 ; M 2,N 2 ; …; M n-1,N n-1 ) integer solvable.

Example Usage of Theorem 2 gcd(1, -3, 7) = 1 GCD test says “solution may exist” Interval equation: x -3y +7z = [ 8,8] By result in the previous slide a n + = 1, a n - = 0, M n = 1, N n =3 -3y + 7z = [ 8 - 1.3 + 0.1, 8 - 1.1 + 0.3 ] x – 3y + 7z = 8 1≤x≤3; 1≤y≤2; 1≤z ≤ 4 Limits for Banerjee 2≤8≤28 Banerjee test says “solution may exist” And then 7z = [5+3, 7+6] So, 7z = [8, 13] Which is impossible So, I – test says no solution.

Theorem 3 If |a n | ≤ U-L+1 and the IE a 1 I 1 + a 2 I 2 + … + a n I n = [ L, U ] is integer solvable but a 1 I 1 + a 2 I 2 + … + a n-1 I n-1 = [ L - a n + N n + a n - M n, U - a n + M n + a n - N n ] is not integer solvable, then solution of I n is outside [M n, N n ]

Motivation for Theorem 4 To apply Theorem 2, |a n | ≤ U-L+1 Can we do something if the above does not hold?

Theorem 4Reduce both sides a 1 I 1 + a 2 I 2 + … + a n I n = [ L, U ] is (M 1,N 1 ; M 2,N 2 ; …; M n,N n ) integer solvable, iff (a 1 /d) I 1 + (a 2 /d) I 2 + … + (a n /d) I n = [ceil(L/d), floor(U/d) ] is (M 1,N 1 ; M 2,N 2 ; …; M n,N n ) integer solvable Note that a 1 /d, a 2 /d, …, a n /d are integers.

Example Usage of Theorem 4 2x -6y +14z =16 1≤x≤3;1≤y≤2;1≤z≤4 Both GCD and Banerjee say “maybe” Consider IE, 2x -6y +14z = [16,16] Theorem 2 is inapplicable because coefficients are greater than (U-L+1)=1 Using Theorem 4, x-3y+7z = [8,8] This we have seen before.

Theorem 5 Analogous to Theorem 3 Combined with result of Theorem 4

Theorem 6 Handle unknown limits when gcd = 1 If M i =N i =* for 1≤i≤k and gcd(a 1,a 2,..a k ) = 1 a 1 I 1 + a 2 I 2 +… + a k+1 I k+1 + … + a n I n = [L,U] is ( * (1),* (1) ; * (2),* (2) ; … ; * (k),* (k) ; M k+1,N k+1 ; …; M n,N n ) integer solvable for any M k+1,N k+1,..,M n,N n. This shows if both the limits are unknown for >=1 variables and if gcd of the coefficients of those variables is 1 then no need of Theorem 2 or 4, a 1 I 1 + a 2 I 2 +… + a k+1 I k+1 + … + a n I n = [L,U] is definitely integer solvable

Theorem 7 Handle unknown limits when gcd > 1 If M i =N i =* for 1≤i≤k and gcd(a 1,a 2,..a k ) = d a 1 I 1 + a 2 I 2 + … + a k+1 I k+1 + … + a n I n = [L,U] is (* (1),* (1) ; * (2),* (2) ; … ; * (k),* (k) ; M k+1,N k+1 ; …; M n,N n ) integer solvable iff dI + a k+1 I k+1 + … + a n I n = [L,U] is (*,*; M k+1,N k+1 ; …; M n,N n ) is integer solvable. This shows that the set of variables with both limits unknown can be compressed into 1 variable, to reduce bookkeeping when theorem 2 and 4 are applied later.

I – Test algorithm Input: a0,a1,a2,..,an,M1,N1,…Mn,Nn Output: no,yes,maybe Algorithm: 1. If there are some unknown bounds d = gcd of coefficients of variables with unknown bounds If d is 1, apply theorem 6.theorem 6 Else apply theorem 7.theorem 7

I – Test algorithm (2) 2. While (1) While theorem 2 is applicable apply theorem 2theorem 2 if there are no more coefficients on LHS if L <= 0 <= UL <= 0 <= U return yes else return no Find gcd of the coefficients in the LHS list Perform the interval-equation GCD test.interval-equation GCD test If GCD test says “no” then return no If gcd != 1 apply theorem 4theorem 4 else return maybe.

Example for Algo - 1 3I 1 + 5I 2 + a 3 I 3 + a 4 I 4 = a 0 1 ≤ a 3,a 4 ≤ 5 gcd (3, 5) = 1 algo returns ‘yes’ using theorem 6

Example for Algo - 2 120I 1 + 180I 2 + 2I 3 + 4I 4 + 6I 5 = 8 1 ≤ a 3,a 4,a 5 ≤ 5 IE: 120I 1 + 180I 2 + 2I 3 + 4I 4 + 6I 5 = [8, 8] Bounds for I 1 & I 2 are unknown gcd(120,180) = 60 ≠ 1, apply theorem 7 60I + 2I 3 + 4I 4 + 6I 5 = [8, 8] => L=U=8 U-L+1 = 1, all coeffs > 1, can’t apply thm 2 apply theorem 4 30I + I 3 + 2I 4 + 3I 5 = [4, 4] => L=U=4 can apply theorem 2 for I 3

Example for Algo – 2 (2) a 3 + =1, a 3 - =0, [U,L] = [4, 4] theorem 2 theorem 2 new [U,L] = [4 - 1.5 - 0.1, 4 - 1.1 + 0.5] = [-1, 3] 30I + 2I 4 + 3I 5 = [-1, 3] again theorem 2 applicable for I 4, 2 ≤ 3 - (-1) + 1 30I + 3I 5 = [-1-2.5+0.1, 3-2.1+0.5] = [-11, 1] Apply theorem 2 for I 5 that gives, 30I = [-11-3.5+0.1, 1-3.1+0.5] = [-26, -2] Now control comes out of the inner while loop Interval GCD test applied, says no. Algo returns no.

Discussion on the algorithm Accurate when returns ‘yes’ or ‘no’ Returns ‘maybe’ when the equation has a solution which satisfies limits – Not only on all variables that I-test could move to RHS – But also may be on the rest of the variables. In case of ‘maybe’ (coefficients too big to apply Theorem 2 and none of the remaining limits are *) – then apply complete “step by step Banerjee test”. – [L ban, U ban ] ∩ [L,U] = ø

Conclusion : Cost & Benefits Banerjee bound computation component is same as the Banerjee test (or less if it finishes before all terms are moved to the RHS). In worst case, I-test needs n GCD tests but practically it uses no more than 1 GCD test. Extends the range of applicability of Banerjee test Distinguishes “definite” yes from “tentative” Banerjee yes

Thank you!

Download ppt "The I-Test Manish Gupta - 05305006 Santosh Kumar - 05305003 Soumitra Pal - 05305015 Group - 6."

Similar presentations