homework set 4 – solutionsdvanalp/ece 650/ece 650 hw solutions/ece_hw3_fall_14...ece 650 homework...

15
ECE 650 1 ECE 650 Homework Set 3 Solutions 1. Note that the aimpoint error (say R) is a Rayleigh RV. a. From the table in the back of Papoulis, the average is: in 51 . 2 2 2 / b. P{R > 4} = 1 F(4) = exp(-2) = 0.1353. MATLAB check: >> 1-raylcdf(4,2) ans = 0.1353 2a. Step 1: Let S = X + Y. Find f S (s) = f X (s) * f Y (s) Step 2: Let W = S + Z. Find f W (w) = f S (w) * f Z (w); fix f S (); flip & shift f Z () by w on axis: f W (w) = f S (w) * f Z (w) = d ) w ( f ) ( f z s Case 1: w < 0 or w > 6 f w (w) = 0 Case 2: 0 < w < 2 f w (w) = d 4 1 2 1 d ) w ( f ) ( f w 0 z s w 0 = 16 w 2 1/2 0 2 4 s f(s) 1/2 0 w 4 f s () = ¼ f w (w-)

Upload: hoangtu

Post on 16-Jun-2018

251 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Homework Set 4 – Solutionsdvanalp/ECE 650/ECE 650 HW Solutions/ece_hw3_fall_14...ECE 650 Homework Set 3 – Solutions 1. Note that the aimpoint error ... 0.5 1/2 w-2 2 w ... (Yates

ECE 650 1

ECE 650 Homework Set 3 – Solutions

1. Note that the aimpoint error (say R) is a Rayleigh RV.

a. From the table in the back of Papoulis, the average is:

in51.222/

b. P{R > 4} = 1 – F(4) = exp(-2) = 0.1353.

MATLAB check: >> 1-raylcdf(4,2)

ans =

0.1353

2a. Step 1: Let S = X + Y. Find fS(s) = fX(s) * fY(s)

Step 2: Let W = S + Z. Find fW(w) = fS(w) * fZ(w); fix fS(); flip &

shift fZ() by w on axis:

fW(w) = fS(w) * fZ(w) = d)w(f)(f zs

Case 1: w < 0 or w > 6 fw(w) = 0

Case 2: 0 < w < 2

fw(w) =

d

4

1

2

1d)w(f)(f

w

0zs

w

0

= 16

w2

1/2

0 2 4 s

f(s)

1/2

0 w 4

fs() = ¼

fw(w-)

Page 2: Homework Set 4 – Solutionsdvanalp/ECE 650/ECE 650 HW Solutions/ece_hw3_fall_14...ECE 650 Homework Set 3 – Solutions 1. Note that the aimpoint error ... 0.5 1/2 w-2 2 w ... (Yates

ECE 650 2

Case 3: 2 < w < 4

fw(w) =

d)w(f)(f zs

w

2w

d14

1

2

1d

4

1

2

1 w

2

2

2w

= 4

3w

4

3

8

w2

Over-all Answer (obtaining the rest by symmetry):

0 w < 0, w > 6

w2/16 0 w 2

4

3w

4

3

8

w2

2 < w 4

(6-w)2/16 4 < w 6

0 2 4 60

0.1

0.2

0.3

0.4

0.5

1/2

w-2 2 w 4

fs() = ¼ fw(w-) fs() = -¼ + 1

f(w) =

w

Histogram (blue) vs. pdf (red) for W

Page 3: Homework Set 4 – Solutionsdvanalp/ECE 650/ECE 650 HW Solutions/ece_hw3_fall_14...ECE 650 Homework Set 3 – Solutions 1. Note that the aimpoint error ... 0.5 1/2 w-2 2 w ... (Yates

ECE 650 3

MATLAB Code: % ece_650_hw4_prob2

% First generate the 3 vectors and the sum;

hold off

x = unifrnd(0, 2, 10000, 1);

y = unifrnd(0, 2, 10000, 1);

z = unifrnd(0, 2, 10000, 1);

w = x + y + z;

%

% Then create the density histogram;

centers = 0 : .1 : 6;

freq = hist(w, centers);

relfreq = freq/sum(freq);

dens = relfreq/.1; % bin widths are .1

bar(centers, dens, 1)

hold on

%

%Then generate the theoretical pdf for w

piece1 = (centers .^2)/16;

piece1 = piece1 .* ((centers >= 0)& (centers <=2));

piece2 = -(centers .^2)/8 + .75*centers - .75;

piece2 = piece2 .* ((centers >2)& (centers <= 4));

piece3 = ((6-centers).^2)/16;

piece3 = piece3 .* ((centers > 4)&(centers <= 6));

theo = piece1 + piece2 + piece3;

plot(centers,theo,'ro')

3a. Joint pdf contains 2 delta’s: 1 at (x = 1, y = 1), with area (1/2); and 1 at

(x = -1, y = 0), with area (1/2). (Note: I’m using (x,y) equiv. to (x1,x2)).

x

y

f(x,y)

(1,1)

(-1,0)

(1/2)

(1/2)

Page 4: Homework Set 4 – Solutionsdvanalp/ECE 650/ECE 650 HW Solutions/ece_hw3_fall_14...ECE 650 Homework Set 3 – Solutions 1. Note that the aimpoint error ... 0.5 1/2 w-2 2 w ... (Yates

ECE 650 4

b. Marginal pdf’s

c.

H T

X 1 -1

Y 1 0

Z 2 -1

f(z) contains 2 deltas, each of area (1/2); one is at z = 2; the

other is at z = -1. Note that x and y are not independent; hence,

we cannot just convolve their pdf’s to get the pdf for z.

4. (Papoulis 6-1, a & f) Note that the solution for (a) is equivalent to the

convolution of fX(z) with fY(z).

x

f(x)

y

f(y)

-1 0 1

(1/2) (1/2) (1/2) (1/2)

0 1

z

f(z)

-1 0 2

(1/2) (1/2)

Page 5: Homework Set 4 – Solutionsdvanalp/ECE 650/ECE 650 HW Solutions/ece_hw3_fall_14...ECE 650 Homework Set 3 – Solutions 1. Note that the aimpoint error ... 0.5 1/2 w-2 2 w ... (Yates

ECE 650 5

5. fXY(x, y) = (1/8) e-(x/2 + y/4)

U(x) U(y),

Note: f(x, y) factors: fXY(x, y) = (1/2) e-x/2

U(x) (1/4) e

-y/4 U(y) = fX(x) fY(y)

Also note that each of the marginal densities is exponential.

a. f(x) = (1/2) e-x/2

U(x) b. f(y) = (1/4) e-y/4

U(y)

c. Since the pdf factors into the marginal densities, X and Y are independent,

so: f(x|y) = f(x)

d. Similarly, f(y|x) = f(y)

e. As shown above, X and Y are independent.

6. Based on the equation of the line: x + 2y = 2, define a new rv

Z = X + 2Y, with E(Z) = 0 and Z2 = X

2 + 4

Y

2 = 1 + 4 = 5.

Then Pr(X + 2Y > 2) = Pr(Z > 2) = 1- normcdf(2, 0, sqrt(5)) = .1855

7a. var(10X) = 100(2) = 200 7b. var(10X + 3) = 200

7c. var(-X) = 2 7d. E(X2) = 2+100 = 102

8. (Carol Ash) var(X – Y) = E{(X - Y)2} – {E(X – Y)}

2 = E{( X

2 – 2 X Y +

Y 2)} –{E(X) – E(Y)}

2 = E{ X

2} – 2E(X Y) + E{ Y

2} – {[E(X)]

2 –

2E(X)E(Y) +[E(Y)]2} = var(X) + var(Y) – 2{E(X Y) – E(X)E(Y)} =

var(X) + var(Y) – 2 cov(X, Y)

Page 6: Homework Set 4 – Solutionsdvanalp/ECE 650/ECE 650 HW Solutions/ece_hw3_fall_14...ECE 650 Homework Set 3 – Solutions 1. Note that the aimpoint error ... 0.5 1/2 w-2 2 w ... (Yates

ECE 650 6

9. (Yates & Goodman, Ch. 9)

P(x,y) y = -3 y = -1 y = 1 y = 3 Marginals for

X

x = -1 1/6 1/8 1/24 0 Pr{X=-1} =1/3

x = 0 1/12 1/12 1/12 1/12 Pr{X =0} =1/3

x = 1 0 1/24 1/8 1/6 Pr{X =1} =1/3

Marginals

For Y

Pr{Y=-

3} =1/4

Pr{Y =-

1} =1/4

Pr{Y=1}

=1/4

Pr{Y=3}

=1/4

Check: Total

Prob = 1

fX(x) fY(y)

b. No, X and Y are not independent because (for example) f(x|y = -3)

f(x).

10. (Yates & Goodman, Ch. 5)

432

1

02

x

0

1

04321

x

0

1

0

x

0

1

0

dxdxdxkxdxdxdxdxk424

43

x

0

1

043

x

0

1

0x

22

1

0

dxdx12

kdxdxx

2

k 44

2

4k14

kx

4

kdxx

2

k 1

0x

2444

1

0 4

f(x2, x3) = )x1(x4dx1x4dxdx14dxdx4 324

1

x241

x

0

1

x41

3

2

3

= 4x2(1-x3), 0 < x2 < 1, 0 < x3 < 1

0 else

x -1 0 1

(1/3) (1/3) (1/3)

y -3 -1 1 3

1

(1/4) (1/4) (1/4) (1/4)

Page 7: Homework Set 4 – Solutionsdvanalp/ECE 650/ECE 650 HW Solutions/ece_hw3_fall_14...ECE 650 Homework Set 3 – Solutions 1. Note that the aimpoint error ... 0.5 1/2 w-2 2 w ... (Yates

ECE 650 7

f(x3) =

1x0),x1(2dx)x1(x4dx)x,x(f 33

1

0x232

1

0x232

22

0 else

Solution starts on next page.

11. (Papoulis 4th

ed., 6.58)

Page 8: Homework Set 4 – Solutionsdvanalp/ECE 650/ECE 650 HW Solutions/ece_hw3_fall_14...ECE 650 Homework Set 3 – Solutions 1. Note that the aimpoint error ... 0.5 1/2 w-2 2 w ... (Yates

ECE 650 8

Page 9: Homework Set 4 – Solutionsdvanalp/ECE 650/ECE 650 HW Solutions/ece_hw3_fall_14...ECE 650 Homework Set 3 – Solutions 1. Note that the aimpoint error ... 0.5 1/2 w-2 2 w ... (Yates

ECE 650 9

12. (Papoulis 4th

ed., 6-71)

13. C =

2/31

11

32

22

)Cdet(

1C,

22

23 1 since det(C) = =

2. Using x for x1 and y for x2, we get:

f(x, y)

y

x

2/31

11]yx[

2

1exp

22

1

f(x, y) = (1/(2 sqrt(2)) exp(-1/2 x2 + xy - (3/4) y

2)

14. Note: both X1 and X2 have mean 2, var 16/12 = 4/3.

X1, X2 independent X1, X2 uncorrelated E{ X1 X2 } = E[X1] E[X2] = 2

2 = 4;

var(X1) = E(X12) – X1

2 4/3 = E(X12) – 4 E(X1

2) = E(X2

2) = 16/3;

R =

3/164

43/16

15. T: N(0, 9), observation: R = T + X, where X: U(-3,3), independent of T

a. var(R) = var(T) + var(X) = 9 + 62/12 = 12

dx

y)2/3(x

yx]yx[

2

1

(arg. of exp.)

= -1/2 [ x(x-y) + y(-x + (3/2)y) ]

= -1/2 x2 + xy - (3/4) y

2

Page 10: Homework Set 4 – Solutionsdvanalp/ECE 650/ECE 650 HW Solutions/ece_hw3_fall_14...ECE 650 Homework Set 3 – Solutions 1. Note that the aimpoint error ... 0.5 1/2 w-2 2 w ... (Yates

ECE 650 10

b. cov(R, T) = E{( R - R)( T – T) T = 0, R = E(T) + E(X) = 0

cov(R, T) = E{ R T } = E{( T + X) T } = E{ T 2} +

E{ X T }

= 9 + E(X) E(T) = 9

c. T = AR + B.

A = cov(R, T) / var(R) = 9/12 = ¾

As a check: A = rrt t/r = [sqrt(3)/2] (3/sqrt(12)) = 3/4

B = T – A R = 0

T = ¾ R

16. input Y: N(0, 1), output (observable) X = Y + N, where noise N is N(0,

4). (Y, N independent); note Y = 0,X = Y + N = 0

a. For linear MMSE estimate of Y in terms of X;

A = Y/X = cov/X2

cov = E(XY) - XY= E((Y+N) Y) - 0 = E(Y2 + NY) = E(Y

2) + E(N)E(Y)

= 1;

Y = 1; var(X) = var(Y+N) = var(Y) + var(N) = 5

X = sqrt(5)

A = 1/sqrt(5)

B = Y – A X, where X = E(Y+N) = 0; so B = 0 – (1/sqrt(5)) 0 = 0;

Linear MMSE estimate: Y 5

1 X

b. Find the best (arbitrary) MMSE estimate of Y in terms of X; i.e. find the

function c(X) that minimizes the mean squared error.

Since X and Y are jointly Gaussian, the best estimate is the Linear MMSE

estimate given in part (a).

17. Z = XY, X & Y independent; find fz(z).

Let Z = XY; let W = Y; Or: z = g(x, y) = xy; w = h(x, y) = y;

Step 1: Find the Jacobian of the transformation: |J(x, y)| =

= = |y|

0

^

y

w

x

wy

z

x

z

10

xy

^

^

Page 11: Homework Set 4 – Solutionsdvanalp/ECE 650/ECE 650 HW Solutions/ece_hw3_fall_14...ECE 650 Homework Set 3 – Solutions 1. Note that the aimpoint error ... 0.5 1/2 w-2 2 w ... (Yates

ECE 650 11

Step 2: Solve “backwards” for roots x and y (in terms of w, z): y = w,

x = z/w

Step 3: fzw(z, w) =

Step 4: Integrate to find fz(z):

fz(z) = dww

)w(f)w/z(fdw)w,z(f

yxzw

18.

0 elsewhere

c. f(y|x) = )x(f

)y,x(f, where f(x) =

1y

xy

21

x

xy2

y2dy)xy(2dy)y,x(f

= 2{ [1/2 +x] – [x2/2 + x

2] } = -3 x

2 + 2x + 1

So: f(y|x) = )x(f

)y,x(f= 1yx0,

1x2x3

)xy(22

d. mmse estimate of Y, given X = x.

E[Y|x] =

dy

1x2x3

)xyy(2dy)x|y(fy

2

2

1y

xy

23

2

1

x

22 2

xy

3

y

1x2x3

2dy)xyy(

1x2x3

2

w

)w(f)w/z(f

w

)w,w/z(f

)y,x(J

)y,x(f yxxyxy

1yx0),xy(2)y,x(f

Page 12: Homework Set 4 – Solutionsdvanalp/ECE 650/ECE 650 HW Solutions/ece_hw3_fall_14...ECE 650 Homework Set 3 – Solutions 1. Note that the aimpoint error ... 0.5 1/2 w-2 2 w ... (Yates

ECE 650 12

= 3x6x9

2x3x5

2

x

3

x

2

x

3

1

1x2x3

22

333

2

19. X =

3

2

1

X

X

X

, where Xk = k Yk, and where the Yk are independent

Gaussian RV’s with mean k and unit variance.

a. mean vector

b. Correlation matrix, RX

Ind. implies uncorr.

Similarly, E( X 1 X 3) = E( X 3 X 1) = 9; E( X 2 X 3) = E( X 3 X 2) = 36;

E( X 22) = 20; E( X 3

2) = 90

Thus,

c. Finding f(x1,x2): Note cov( X 1, X 2) = R12 – X1X2 = 0, so X 1 and X 2 are

uncorrelated and therefore independent since Gaussian (Yk Gaussian

implies Xk = kYk Gaussian).

f(x1,x2) = f(x1)f(x2)

9

4

1

)Y(E3

)Y(E2

)Y(E

)Y3(E

)Y2(E

)Y(E

)X(E

)X(E

)X(E

3

2

1

3

2

1

3

2

1

)X(E)XX(E)XX(E

)XX(E)X(E)XX(E

)XX(E)XX(E)X(E

R2

32313

322

212

31212

1

X

4)2)(1(2)Y(E)Y(E2)Y2Y(E)XX(E

211)Y(E)X(E

212121

2Y

2Y

21

21 11

90369

36204

942

RX

Page 13: Homework Set 4 – Solutionsdvanalp/ECE 650/ECE 650 HW Solutions/ece_hw3_fall_14...ECE 650 Homework Set 3 – Solutions 1. Note that the aimpoint error ... 0.5 1/2 w-2 2 w ... (Yates

ECE 650 13

d. correlation matrix, R, for random variables X1 and X2; picking off the

relevant entries from the given R matrix:

20. Let X be a R vector with mean X =

3

1 and covariance matrix CX =

22

25.

a. RX = CX + XXT

b. R12 = 5; Cov(X1, X2) = C12 = 2; 12 = cov/(X1X2)

= 2/sqrt(10) = sqrt(10)/5; X12X2

2 = 2

c. W: elt. white; find H, C, such that X = HW + C, to yield X described

above

C = X; H = E 1/2

, where E: columns are eigenvectors of CX

To find eigenvalues of CX: det (CX – I) = 0 = 6, 1

To find eigenvector x corresponding to = 6:

CX x = x becomes

204

42RX

8

)4x(

2

)1x(exp

4

1

2

)x(exp

2

1

2

)x(exp

2

1

22

21

2X

2X2

X2

X

2X1

X2

2

21

1

1

115

5631

3

1

22

25

Page 14: Homework Set 4 – Solutionsdvanalp/ECE 650/ECE 650 HW Solutions/ece_hw3_fall_14...ECE 650 Homework Set 3 – Solutions 1. Note that the aimpoint error ... 0.5 1/2 w-2 2 w ... (Yates

ECE 650 14

Solving for x yields

Similarly, the eigenvector corresponding to = 1 is:

Thus, H = E 1/2

So X = HW + C

21. (old test question) Two Gaussian random variables X1 and X 2 have 0

means and variances 4 and 9 respectively. Their covariance CX1X2 is equal to

3.

a.

CX =

93

34

b.

CY = H CX Ht =

42

31

93

34

43

21

2

1

2

1

x6

x6

x

x

22

25

51

52

x

52

51

x

52

56

51

562

10

06

52

51

515

2

3

1

52

56

51

562

W

Page 15: Homework Set 4 – Solutionsdvanalp/ECE 650/ECE 650 HW Solutions/ece_hw3_fall_14...ECE 650 Homework Set 3 – Solutions 1. Note that the aimpoint error ... 0.5 1/2 w-2 2 w ... (Yates

ECE 650 15

25266

6628

42

31

4524

152CY

c. Joint pdf, f(y1, y2), for the random variables Y1 and Y2.

YY

Y

1TC2

1

21 e2

1)y,y(f

where C =

25266

6628

= det(C) = 2700, C-1

=

0104.0244.

0244.0933.

YY

Y

0104.0244.

0244.0933.

2

1

21

T

e0031.)y,y(f