Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Random Integers Within Specfic Ranges
Date: Sat, 12 Mar 2011 14:53:04 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 10
Message-ID: <ilg1cg$r6q$1@fred.mathworks.com>
References: <ildgd8$dhl$1@fred.mathworks.com> <ilfv5b$6pa$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: www-00-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1299941584 27866 172.30.248.45 (12 Mar 2011 14:53:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 12 Mar 2011 14:53:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:715378

"Derek O'Connor" wrote in message <ilfv5b$6pa$1@fred.mathworks.com>...

> 
> If m is approx. equal to n then this method is optimal. If m is much smaller than n then there are two obvious inefficiencies: (1) a vector p of size n is used, and (2) the for-loop takes n-1 steps.
> 

Storing full p seems to be unavoidable in Roger's method.
The point (2) is not a point, just iterate m time then stop.

Bruno