Path: news.mathworks.com!not-for-mail From: "Tim " <junk@gmail.com> Newsgroups: comp.soft-sys.matlab Subject: Re: Weighted random number generator Date: Sat, 26 Mar 2011 01:14:04 +0000 (UTC) Organization: The MathWorks, Inc. Lines: 1 Message-ID: <imjeks$hc8$1@fred.mathworks.com> References: <g647ip$2d5$1@fred.mathworks.com> <g64alt$1kr$1@fred.mathworks.com> <g64fa3$hc7$1@fred.mathworks.com> <g657qb$k2g$1@fred.mathworks.com> Reply-To: "Tim " <junk@gmail.com> NNTP-Posting-Host: www-02-blr.mathworks.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: fred.mathworks.com 1301102044 17800 172.30.248.47 (26 Mar 2011 01:14:04 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Sat, 26 Mar 2011 01:14:04 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 1592783 Xref: news.mathworks.com comp.soft-sys.matlab:718233 I'm trying to do something very similar and I'm still confused on how to do it. Maybe what I'm doing is a bit different. Normally the random number generator has an equal probability of producing a number between 1 and zero. I would like to have the probability distribution fit the cosine squared function, with a shift. So the probability of getting a zero is the highest and the probability of getting pi/2 or -pi/2 is zero. Does that make sense?