Path: news.mathworks.com!not-for-mail
From: "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid>
Newsgroups: comp.soft-sys.matlab
Subject: Re: operation with a vector of n elements
Date: Thu, 20 Mar 2008 06:08:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 30
Message-ID: <frsv03$bv4$1@fred.mathworks.com>
References: <focquj$ked$1@fred.mathworks.com> <foct9h$njq$1@fred.mathworks.com> <fod80o$kni$1@fred.mathworks.com> <frseku$cg9$1@fred.mathworks.com>
Reply-To: "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1205993283 12260 172.30.248.38 (20 Mar 2008 06:08:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 20 Mar 2008 06:08:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:458208


"Harish Jain" <hp_jain@yahoo.com> wrote in message <frseku$cg9
$1@fred.mathworks.com>...
> "Marcelo Tames" <jmarcelo.tb@mathworks.com> wrote in message
> <fod80o$kni$1@fred.mathworks.com>...
> > I think I get what you mean, and yes it?s a homework that 
> > kept me thinking the whole afternoon, thanks fort the ideas 
> My homework is one step beyond this point. 
> 
> I need some of the all the element except itself and do not
> use division (/) operator (That means only use *
> (Multiplication).
> 
> One step further from here is to create liner solution for
> minimum computations.
> 
> Let me know your thoughts.
> 
> -Harish Jain
-----------
  So--oo!  You want a "linear" solution - that is, an order(n) algorithm - and 
no division allowed?  Hmm!  Well, I will only give you a hint on this 
homework, because I wouldn't want to spoil things for you (and your 
classmates.)  In matlab there is a function called 'cumprod' that does 
wondrous, wondrous things and yet is only an order(n) operation.  Using this 
function appropriately, there is a way to fashion an algorithm that will solve 
your problem and still remain order(n).  Does this stir up the little grey cells 
sufficiently well?

Roger Stafford