(adsbygoogle = window.adsbygoogle || []).push({}); 1. The problem statement, all variables and given/known data

Given 2 independent uniform random variables X,Y = U [0,1], consider the random variables Z = g (X,Y) for g = (x,y) = sqrt (-2ln(x) . cos(2piy). Since finding the distribution of g(X,Y) analytically is quite tough, I need to generate MATLAB program for

1 - 10,000 uniformly distributed random samples for X and Y

2 - For each sample of X and Y, compute Z= g(X,Y)

3 - Draw a histogram over the resulting samples in Z

4 - Estimate the moments mZ for n = 1,2....6.

3. The attempt at a solution

I tried for the first solution and I'm hopelessly stuck. MATLAB gives me an error saying "Attempted to access (0,1); index must be a positive integer or logical."

I don't understand where I'm going wrong.

Please help!

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: MATLAB for uniform random variables

**Physics Forums | Science Articles, Homework Help, Discussion**