10
1 ECE340 spring 2010 Homework6 Solutions Problems: 34.2, 35.1, 36.1, 36.2, 37.1, 37.2 34.2 a) To find the variances of U and V, we use the following steps: ߪ ܧሿെሺܧሾሿሻ ܧሾሺ3 4ሻ ሿെሺܧሾ3 4ሿሻ ܧሾ9 24 16 ሿ െ ሺ3ܧሾሿ 4ܧሾሿሻ 9ܧሿ 24ܧሾሿ 16ܧሿ െ 9ሺܧሾሿሻ 24ܧሾሿܧሾሿ െ 16ሺܧሾሿሻ 9ሼܧሿെሺܧሾሿሻ ሽ 16ሼܧሿെሺܧሾሿሻ ሽ 24ܧሾሿ െ 24ܧሾሿܧሾሿ 9 ߪ 16 ߪ ݏ ݎ ݐ9 ∗ 9 16 ∗ 25 ൌ 481 ߪ ܧሿെሺܧሾሿሻ ܧሾሺ5 െ 2ሻ ሿെሺܧሾ5 െ 2ሿሻ ܧሾ25 20 4 ሿ െ ሺ5ܧሾሿ െ 2ܧሾሿሻ 25ܧሿ െ 20ܧሾሿ 4ܧሿ െ 25ሺܧሾሿሻ 20ܧሾሿܧሾሿ െ 4ሺܧሾሿሻ 25ሼܧሿെሺܧሾሿሻ ሽ 4ሼܧሿെሺܧሾሿሻ ሽ െ 20ܧሾሿ 20ܧሾሿܧሾሿ 25 ߪ 4 ߪ ݏ ݎ ݐ25 ∗ 9 4 ∗ 25 ൌ 325 b) To find the correlation coefficient of U and V, we follow the definition: ߩ ܧቊቈ ܧሾሿ ߪ ܧሾሿ ߪ ቋ ൌ ܧሾሿ െ ܧሾሿܧሾሿ ߪ ߪ In our case: ߩ ܧቊቈ ܧሾሿ ߪ ܧሾሿ ߪ ቋ ൌ ܧሾሿ െ ܧሾሿܧሾሿ ߪ ߪ ܧሾሺ3 4ሻሺ5 െ 2ሻሿ െ ܧሾ3 4ሿܧሾ5 െ 2ሿ ߪ ߪ ܧሾ15 14 െ 8 ሿ െ ሺ3ܧሾሿ 4ܧሾሿሻሺ5ܧሾሿ െ 2ܧሾሿሻ ߪ ߪ 15ܧሿ 14ܧሾሿ െ 8ܧሿ െ ሺ15ሺܧሾሿሻ 14ܧሾሿܧሾሿ െ 8ሺܧሾሿሻ ߪ ߪ 15 ߪ 14ܧሾሿ െ 8 ߪ 14ܧሾሿܧሾሿ ߪ ߪ 15 ߪ 8 ߪ ߪ ߪ ݏ ݎ ݐሻൌ 15 ∗ 9 െ 8 ∗ 25 √481 √325 0.1644 35.1 a) Firstly, if we introduce another random variable R such that R = 2Y, then the pdf of R is

ECE340 spring 2010 Homework 6 Solutions 3 4.2, 3 5.1, 3 6 ...ece-research.unm.edu/hayat/ece340_10/sol_hw6.pdf1 ECE340 spring 2010 Homework‐6 Solutions Problems: 3‐4.2, 3‐5.1,

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ECE340 spring 2010 Homework 6 Solutions 3 4.2, 3 5.1, 3 6 ...ece-research.unm.edu/hayat/ece340_10/sol_hw6.pdf1 ECE340 spring 2010 Homework‐6 Solutions Problems: 3‐4.2, 3‐5.1,

1  

ECE340 spring 2010 Homework‐6 Solutions 

 Problems:  3‐4.2, 3‐5.1, 3‐6.1, 3‐6.2, 3‐7.1, 3‐7.2  3‐4.2 

a) To find the variances of U and V, we use the following steps: 

  3 4 3 4   9 24 16 3 4   

9 24 16 9 24 16   9  16 24 24   9 16                             9 ∗ 9 16 ∗ 25 481  

 

  5 2 5 2   25 20 4 5 2   

25 20 4 25 20 4   25  4 20 20   25 4                             25 ∗ 9 4 ∗ 25 325  

 b) To find the correlation coefficient of U and V, we follow the definition: 

 

In our case: 

3 4 5 2 3 4 5 2

15 14 8 3 4 5 2

15 14 8 15 14 8

15 14 8 14

15 8            

15 ∗ 9 8 ∗ 25

√481√3250.1644 

  3‐5.1  

a) Firstly, if we introduce another random variable R such that R = 2Y, then the pdf of R is 

Page 2: ECE340 spring 2010 Homework 6 Solutions 3 4.2, 3 5.1, 3 6 ...ece-research.unm.edu/hayat/ece340_10/sol_hw6.pdf1 ECE340 spring 2010 Homework‐6 Solutions Problems: 3‐4.2, 3‐5.1,

2  

1

4      2 2

0          

 

This can be obtained, for example, by first going after the probability distribution function of R ()as we always do in class), relating it to that of X, and then taking the derivative with respect to r. Now we have the following: 

2   

Now, for every fixed  ,  must be such that  ∞  

Thus, 

  ,  

Now, since X and Y are statistically independent, we know that X and R are also independent, we have the following: 

     

We also know that the pdf of Z is the following:  

, which is a convolution 

between the pdf of R and that of X. Note that we could have come to this expression by recalling that the pdf of the sum of two independent random variables is the convolution of the respective pdfs.  To evaluate the convolution, we have the following 5 cases: Case 1: 

 2 

Case 2: 

 2 1 

Page 3: ECE340 spring 2010 Homework 6 Solutions 3 4.2, 3 5.1, 3 6 ...ece-research.unm.edu/hayat/ece340_10/sol_hw6.pdf1 ECE340 spring 2010 Homework‐6 Solutions Problems: 3‐4.2, 3‐5.1,

3  

1

42

41 

   

Case 3: 

  1 2 

1

42

1

 Case 4: 

 2 3 

1

42

4

3

 Case 5: 

Page 4: ECE340 spring 2010 Homework 6 Solutions 3 4.2, 3 5.1, 3 6 ...ece-research.unm.edu/hayat/ece340_10/sol_hw6.pdf1 ECE340 spring 2010 Homework‐6 Solutions Problems: 3‐4.2, 3‐5.1,

4  

 3 

 So, to sum up we have the result of the pdf of random variable Z =X + 2Y as the following: 

 

41           2 1

1

4                          1 2

4

3

4         2 3

0                              

 

 b) To find the probability that 0 1, we have the following: 

0 11

4

1

  3‐6.1   Firstly, we introduce another random variable W as the following: 

 Now we layout the random variables we have in hand and their connections: 

  ,  ,  

 ,  

,   Now  

0 11 1

So the joint pdf of Z and W is the following:  

Page 5: ECE340 spring 2010 Homework 6 Solutions 3 4.2, 3 5.1, 3 6 ...ece-research.unm.edu/hayat/ece340_10/sol_hw6.pdf1 ECE340 spring 2010 Homework‐6 Solutions Problems: 3‐4.2, 3‐5.1,

5  

, , , , | | , , ,4           1,   0 10                                                         4           1,    10                                                         

 

Now the marginal pdf for Z is the following: 

,  

To evaluate the integral, we have discussions on the value of Z: Case 1: 

 0 1 

, 42

 Case 2: 

 1 2 

, 42

36 4  

 To sum up, we have the following: 

2

3                                    0 1 

2

36 4            1 2

0                                         

 

 3‐6.2 

Firstly, we are concerned about how we generate random variables X, Y in Matlab with the specified pdf in problem 3‐6.1 as the following:   

2       0 10         

 

Page 6: ECE340 spring 2010 Homework 6 Solutions 3 4.2, 3 5.1, 3 6 ...ece-research.unm.edu/hayat/ece340_10/sol_hw6.pdf1 ECE340 spring 2010 Homework‐6 Solutions Problems: 3‐4.2, 3‐5.1,

6  

 2       0 10         

 

 Notice that if we have two independent uniformly distributed random variables P, Q such that both of them have the following pdf: (we can easily generate uniformly distributed random variable with command ‘rand’ in Matlab) 

1         0 10         

 

 1         0 10         

 

And we define: 

√  

 

Then we have the following: 

√ ,             0 1 

So, 

1 ,        0 1 

Thus, 

 2       0 10         

 

Similarly, we have the following pdf for Y: 

 2       0 10         

 

 What we can see from above is that if we generate two independent random variables P and Q in Matlab with command ‘rand’, and let  

√  

 

We get the two independent random variables that have the pdf specified in problem 3‐6.1.    The following Matlab code is used for generating a graphical approximation to the pdf of Z, where Z is the sum of two independent random variables, X and Y, distributed in region [0, 1] with the following pdf:  

2       0 10         

 

 2       0 10         

 

 clc clear all close all N = 100000; %number of samples

Page 7: ECE340 spring 2010 Homework 6 Solutions 3 4.2, 3 5.1, 3 6 ...ece-research.unm.edu/hayat/ece340_10/sol_hw6.pdf1 ECE340 spring 2010 Homework‐6 Solutions Problems: 3‐4.2, 3‐5.1,

7  

M = 50;%number of histogram bins p = rand(1,N); %generate N samples of P as a uniformly distributed random variable from 0 to 1 q = rand(1,N); %generate N samples of Q as a uniformly distributed random variable from 0 to 1 x = sqrt(p); y = sqrt(q); z = x + y; %N samples of random variable Z %generate the pdf of Z calculated from problem 3-6.1 f_Z = zeros(1000); t = zeros(1000); for i = 1:1000 t(i) = (i-1)*(2/1000); if t <= 1 f_Z(i) = (2/3)*(t(i)^3); else f_Z(i) = (2/3)*(-t(i)^3+6*t(i)-4); end end figure(1) subplot(2,1,1) [m,n]=hist(x,M); bin = max(n)/M;%bin size pp = m/(N*bin); bar(n,pp)%plot the graph grid on title('PDF of X'); xlabel('x'); ylabel('f_x'); xlim([0,1]); subplot(2,1,2) [m,n]=hist(y,M); bin = max(n)/M;%bin size pp = m/(N*bin); bar(n,pp)%plot the graph grid on title('PDF of Y'); xlabel('y'); ylabel('f_y'); xlim([0,1]); figure(2) [m,n]=hist(z,M); bin = max(n)/M;%bin size pp = m/(N*bin); bar(n,pp)%plot the graph grid on title('PDF of Z'); xlabel('z'); ylabel('f_z'); xlim([0,2]); hold on plot(t,f_Z,'r--','LineWidth',4)

Page 8: ECE340 spring 2010 Homework 6 Solutions 3 4.2, 3 5.1, 3 6 ...ece-research.unm.edu/hayat/ece340_10/sol_hw6.pdf1 ECE340 spring 2010 Homework‐6 Solutions Problems: 3‐4.2, 3‐5.1,

8  

legend('approximation of pdf of Z','calculated pdf of Z from problem 3-6.1') The plots are shown below: 

 

 Notice that the shape of the approximated pdf (blue bars in second figure) of Z is very close the pdf function we calculated in problem 3‐6.1.  

  

 

Page 9: ECE340 spring 2010 Homework 6 Solutions 3 4.2, 3 5.1, 3 6 ...ece-research.unm.edu/hayat/ece340_10/sol_hw6.pdf1 ECE340 spring 2010 Homework‐6 Solutions Problems: 3‐4.2, 3‐5.1,

9  

3‐7.1 Firstly, the characteristic functions for random variables X and Y is found as follows: 

Φ1

Φ 3 3 33

Now, Since Z = X + Y, and X and Y are independent, the characteristic function of Z is Φ Φ Φ  

So,  

Φ Φ Φ1

1

3

3

3

2

1

1

1

33

  3‐7.2 

a) Firstly we notice that for a Gaussian random variable X with zero mean and variance  , we have the following pdf 

1

√2,                  ∞ ∞ 

The characteristic function of the random variable X is found via  

Φ1

√2

1

√2 

Now recall the Fourier‐transform pair:                

 

In our case: 1

 

               

12

2  

So, we have the characteristic function can be written as the following: 

Φ1

√2

1

√22  

Now the characteristic function for random variable X (Gaussian) is the following: 

Φ  b) On page 72 of the book, we have the equation for the   central moment for a Gaussian 

random variable (equation (2‐27)) as the following: 0,                                         1 ∙ 3 ∙ 5 ∙∙∙ 1 ,      

 

To verify this with the characteristic function of X, we do the following: Since in our case the mean E[X] = 0, our   central moment becomes: 

 Also according to the equation (3‐53) on page 150 of the book, we have the following:  

Page 10: ECE340 spring 2010 Homework 6 Solutions 3 4.2, 3 5.1, 3 6 ...ece-research.unm.edu/hayat/ece340_10/sol_hw6.pdf1 ECE340 spring 2010 Homework‐6 Solutions Problems: 3‐4.2, 3‐5.1,

10  

1 Φ

 

 

So, the first central moment of X is: 

1 Φ

 

1

 

1|   0 

The second central moment of X is: 

1 d Φ

 

1

 

1

1|  

|   | 2 1

 Following these steps for n = 3, 4, 5 …, we see the nth central moment is indeed: 

0,                                         1 ∙ 3 ∙ 5 ∙∙∙ 1 ,