From: "je w" <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Linear Combination
Date: Thu, 18 Dec 2008 07:59:05 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 27
Message-ID: <gicvs9$1g8$>
References: <giakd7$ri2$> <gibs4e$cgd$> <giccbq$cnf$> <giceh7$rtl$> <gicikg$5l2$>
Reply-To: "je w" <>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1229587145 1544 (18 Dec 2008 07:59:05 GMT)
NNTP-Posting-Date: Thu, 18 Dec 2008 07:59:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1643636
Xref: comp.soft-sys.matlab:507679

"John D'Errico" <> wrote in message <gicikg$5l2$>...
> "Roger Stafford" <> wrote in message <giceh7$rtl$>...
> > "je w" <> wrote in message <giccbq$cnf$>...
> > > ........
> > > Yes both the coefficients for linear combinations and the elements of the array are *integers*; however, we are limiting the array to around 9 elements at most (the example array has 5 elements) in this case, hence, we are expecting a finite number of combinations. 
> > > .........
> > 
> >   I believe when John said "infinitely many such linear combinations" he was referring to the fact that if you allow your integer coefficients to have either sign (as he stated,) then any given linear combination of two terms can be replaced by infinitely many other possible combinations of the same two values.  For example, suppose your two values are 15 and 24 and you are looking for a linear combination of them such that c1*15+c2*24 = 93.  One solution is c1 = 3 and c3 = 2.  However another is c1 = -5 and c2 = 7.  Yet another is c1 = -13 and c3 = 12, and there are infinitely more that follow this same pattern, c1 dropping or increasing by 8's and c2 changing in the opposite direction by 5's.  Is it possible you had only positive-valued coefficients in mind when you spoke of "a finite number of combinations"?
> > 
> > Roger Stafford
> That cannot be, since one of the examples given had
> coefficients of both signs. And, yes, Roger was correct.
> John

Let me clarify and give more information:

Actually we want to find whether the successive elements are related to the previous elements, as long as they are related by integer coefficient.

Although there can be infinite possibilities for c1 & c2 (as stated by Roger & John), it is sufficient to determine that 15 and 24 are linearly related to 93 by knowing merely 1 pair of c1 and c2 value. 

We are not concerned with how many possible pairs of c1 and c2 there are, nor their exact values. We only need to know if 15 and 24 will be linearly related to 93.

In addition, the linear combination may be formed with more than 2 preceeding elements. For example, a possible combination could be a(x)=c1*a(i)+c2*a(j)+c3*a(k), where  a(i), a(j) & a(k) are the preceeding elements of a(x) in the array. We also want to know if such relationship exists.

Thank you for your kind help.