#### Topic: The equation with several unknown persons

Hello, it is necessary to write the code which finds all x1... xn: - |a1*x1+a2*x*2... an*xn=M; |x1... xn <=K; (any x no more given number) - e.g. 120*x1+26*x2+51*x3+24*x4+98*x5+91*x6+47*x6+60*x7=3166 K = 15; whether There is any formula for the decision of such equations? While comes to mind - to adapt ant .

#### Re: The equation with several unknown persons

Hello, #John, you wrote: whether J> There is any formula for the decision of such equations? J> while comes to mind - to adapt ant . The Simplex method from the linear programming. If over integer numbers, a method of branches and boundaries.

#### Re: The equation with several unknown persons

Hello, #John, you wrote: J> Hello, J> it is necessary to write the code which finds all x1... xn: J> - J> |a1*x1+a2*x*2... an*xn=M; J> |x1... xn <=K; (any x no more given number) J> - (a, x) =M find n-1 vectors y1... y (n-1) such what (a, y) =0 result write down in a type x=x0+c1*y1 +... +c (n-1) *y (n-1) and already solve restrictions for x through c J> e.g. J>120*x1+26*x2+51*x3+24*x4+98*x5+91*x6+47*x6+60*x7=3166 J> K = 15; whether J> There is any formula for the decision of such equations? J> while comes to mind - to adapt ant . a = {120,26,51,24,98,91,47,60} y [1] = {26,-120,0,0,0,0,0,0} y [2] = {0,51,-26,0,0,0,0,0} y [3] = {0,0,24,-51,0,0,0} y [4] = {0,0,0,98,-24,0,0} y [5] = {0,0,0,0,47,-91,0} y [6] = {0,0,0,0,0,60,-47} x=x0 + c1*y1 +... c6*y6 where x0 - any decision for example x0 = {3166/120,0,0,0,0,0,0,0} and further drive c1. c6 but so to satisfy x1. xn <K

#### Re: The equation with several unknown persons

Hello, #John, you wrote: J> - J> |a1*x1+a2*x*2... an*xn=M; J> |x1... xn <=K; (any x no more given number) J> - J> e.g. J>120*x1+26*x2+51*x3+24*x4+98*x5+91*x6+47*x6+60*x7=3166 J> K = 15; If xn - the whole nonnegative numbers for O (M*N*K) it is possible to solve dynamics