Path: news.mathworks.com!not-for-mail From: "je w" <wangjing_sg@hotmail.com> 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$1@fred.mathworks.com> References: <giakd7$ri2$1@fred.mathworks.com> <gibs4e$cgd$1@fred.mathworks.com> <giccbq$cnf$1@fred.mathworks.com> <giceh7$rtl$1@fred.mathworks.com> <gicikg$5l2$1@fred.mathworks.com> Reply-To: "je w" <wangjing_sg@hotmail.com> NNTP-Posting-Host: webapp-05-blr.mathworks.com Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Trace: fred.mathworks.com 1229587145 1544 172.30.248.35 (18 Dec 2008 07:59:05 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Thu, 18 Dec 2008 07:59:05 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 1643636 Xref: news.mathworks.com comp.soft-sys.matlab:507679 "John D'Errico" <woodchips@rochester.rr.com> wrote in message <gicikg$5l2$1@fred.mathworks.com>... > "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <giceh7$rtl$1@fred.mathworks.com>... > > "je w" <wangjing_sg@hotmail.com> wrote in message <giccbq$cnf$1@fred.mathworks.com>... > > > ........ > > > 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.