Spring 2023/2024: ECE 30200 (Section 2) Homework HINTs      

Probabilistic Methods in Electrical and Computer Engineering (Spring 2023 by Prof. Saul Gelfand)

HINTs Author: Bianjiang Yang

Comp1 HINTs

Q1:

You should be familiar with:

  1. the definition of CDF: F X ( x ) = P r ( X x )
  2. the properties of inverse function: F X 1 ( F X ( x ) ) = x and F X 1 ( F X ( x ) ) = x . See https://en.wikipedia.org/wiki/Inverse_function and https://www.math.utah.edu/lectures/math1220/2PostNotes.pdf Page2
  3. the properties of increasing function a b f ( a ) f ( b )
  4. the CDF of the continuous Uniform Distribution between 0 and 1: F U ( u ) = u when u ( 0,1 ) , F U ( u ) = 1 when u 1 , F U ( u ) = 0 when u 0 .

Q2:

Solve the CDF by considering two conditions:

(1) ( x < 0 ) : F X ( x ) = x f X ( x ) d x , w h e r e | x | = x

(2) ( x > 0 ) : F X ( x ) = 0 f X ( x ) d x + 0 x f X ( x ) d x , | x | = x , | x | = x

After solving the CDF of X, solve the inverse function by considering two parts as well (i.e., u less than 1/2 and u greater and equal to 1/2)

Please note that f X ( x ) = 1 2 σ 2 e 2 σ 2 | x |

Q3:

I recommend using MATLAB, the following functions should be helpful:

  1. histogram, rememeber to set 'Normalization' as 'pdf'.
  2. fplot, to define a function f(x) as fx to feed into fplot, use fx = @(x) f(x);
  3. rand, try to use uniform_realizations=rand(N,1); where N is the number of realizations.

For submission, please submit a ZIP that includes a PDF of your derivation in Q1&2 and plots(plot both the pdf function(analytical) and histogram(numerical) in one figure so that they can be compared with each other) in Q3; a MATLAB/Python3 file which includes runnable code for Q3.

HW5 HINTs

Q1:

Take (d)(ii) as an example, P ( Y < X 2 ) = P ( Y < X 2 Y [ 0,1 ] X [ 0,1 ] ) = P ( Y [ 0 , X 2 ] X [ 0,1 ] ) = 0 1 0 x 2 f X , Y ( x , y ) d y d x

Alternatively, you can solve it by: P ( Y < X 2 ) = P ( Y < X 2 Y [ 0,1 ] X [ 0,1 ] ) = P ( Y [ 0,1 ] X [ Y , 1 ] ) = 0 1 y 1 f X , Y ( x , y ) d x d y

Draw a Graph to determine the low/upper bound of an integral is recommended: check Q1_d(iii) here

Q2:

C o v ( X , Y ) = 0 U n c o r r e l a t e d

E ( X Y ) = 0 O r t h o g o n a l

f X , Y ( x , y ) = f X ( x ) f Y ( y ) I n d e p e n d e n t

Q3:

(b):

P ( Y > X | x ) = P ( Y > X Y ( 0,1 ) X ( 0,1 ) | X = x ) = P ( Y ( X , 1 ) | X = x ) = x 1 f Y | X ( y | x ) d y

(c):

P ( Y > X ) = P ( Y > X Y ( 0,1 ) X ( 0,1 ) ) = P ( Y ( X , 1 ) X ( 0,1 ) ) = 0 1 x 1 f X , Y ( x , y ) d y d x = 0 1 x 1 f Y | X ( y | x ) f X ( x ) d y d x = 0 1 ( x 1 f Y | X ( y | x ) d y ) f X ( x ) d x = 0 1 ( P ( Y > X | x ) ) f X ( x ) d x

HW6 HINTs

Q1:

(b):

Use either density method(with an auxiliary variable) or distribution method. (See Lec27-29)

Please note that fz(z) should have different expressions for z in range (0,1) and (1,2). Check details here

(c):

The convolution can be defined as: f X * f Y ( z ) = f X ( x ) f Y ( z x ) d x

You can first prove the inequality for z in the range of (0,1), after showing that, the proof is already finished.

For z in the range of (0,1), the integral value range of x is determined by:

0 z 1,0 x 1,0 z x 1 because for marginal PDF of x and y, the variable x and y are required to be in the range of (0,1). Your goal is to solve the range of x in terms of z.

Q2:

(a):

Define U:={the time when the packet has arrived on one of the paths}, T1:={the time when the packet has arrived on path1}, T2:={the time when the packet has arrived on path2}, by knowing that T1 and T2 are independent, you can first find CDF of U by:

F U ( u ) = P r ( U u ) = P r ( m i n { T 1 , T 2 } u ) = P r ( ( T 1 u ) ( T 2 u ) ) = P r ( T 1 u ) + P r ( T 2 u ) P r ( ( T 1 u ) ( T 2 u ) ) = P r ( T 1 u ) + P r ( T 2 u ) P r ( T 1 u ) P r ( T 2 u ) = F T 1 ( u ) + F T 2 ( u ) F T 1 ( u ) F T 2 ( u )

Then take the derivative of u to get PDF of U.

(b):

Define V:={the time when the packet has arrived on both of the paths}, by knowing that T1 and T2 are independent, you can first find CDF of V by:

F V ( v ) = P r ( V v ) = P r ( m a x { T 1 , T 2 } v ) = P r ( ( T 1 v ) ( T 2 v ) ) = P r ( T 1 v ) P r ( T 2 v ) = F T 1 ( v ) F T 2 ( v )

Then take the derivative of v to get PDF of V.

(c):

By using the PDF of U and V, solve E[V-U]=E[V]-E[U]

Q3

(b):

helpful formulas:

V a r [ a X + b Y ] = a 2 V a r [ X ] + b 2 V a r [ Y ] + 2 a b C o v [ X , Y ]

ρ v w = C o v ( V , W ) σ v σ w = E [ ( V V ) ( W W ) ] σ v σ w

(d) and (e):

Method1: By having the joint PDF of V and W from (c), solve marginal PDF of W, and then solve the conditional PDF of V given W by:

f V | W ( v | w ) = f V , W ( v , w ) f W ( w )

Method2 (Simpler): By having E[V], E[W], Var[V], Var[W], and correlation coefficient of V and W from (a)(b)(c), you should be able to utilize the formula in Lec30 Page4 to solve the conditional PDF of V given W.

Q4

(b):

P e = P r ( e r r o r ) = P r ( f a l s e a l a r m ) P r ( H 0 ) + ( 1 P r ( D e t e c t i o n ) ) P r ( H 1 )

Q5

Solve the following:

E [ X ] , E [ Y ] , σ x , σ y , ρ x y , f Y | X ( y | x )

Then, find the LMMSE, MMSE, MAP for "Y given X" by using formulas in Lec32-33.

Comp2 HINTs

For 1(c), doing a convolution of pdfs for X1, X2 and X3 is recommended.

Alternatively, consider distribution method as shown below.

From 1(a) and (b), we know that: Z 3 = 2 ( X 1 + X 2 + X 3 ) 3

We also know that: S 3 = X 1 + X 2 + X 3

I recommend solving the pdf of S 3 , then solve the pdf of Z 3

F S 3 ( s ) = P r ( S 3 s ) = P r ( X 1 + X 2 + X 3 s )

where X 1 , X 2 , X 3 ( 0,1 )

If you sketch the possible values of ( X 1 , X 2 , X 3 ) , you will see they are in a cube.

The probability of X 1 + X 2 + X 3 s is the remaining volume of the cube after cutting by the plane X 1 + X 2 + X 3 = s

Some useful geometry facts from stackexchange, please don't simple copy the answer from there, because what we need is a little different.

After solving F S 3 ( s ) , take the derivate to have f S 3 ( s ) , then solve f Z 3 ( z ) by "function of a random variable" using either density method or distribution method. The transformation function is z = g ( s ) = 2 s 3

For coding, similar to Computer Problem1. Use either MATLAB or Python.

WHAT TO SUBMIT: please submit multiple files to Brightspace(just upload multiple files, do NOT ZIP, this will help me quickly grade):

(1) your derivation for Q1

(2) Figure1 (rememeber to plot (i)(ii)(iii) in one Figure): (i) a plot with the pdf function from Q1(c)(the real pdf) / (ii) histogram(numerical solution, n=3) for Q2 / (iii) a plot of a gaussian function with zero-mean&unit-variance (approximation solution)

(3) Figure2 (rememeber to plot (i)(ii) in one Figure): (i) a plot of histogram (numerical solution, n=30) for Q2 / (ii) a plot of a gaussian function with zero-mean&unit-variance(approximation solution)

(4) a printout result generated from your code for Q3.

(1)(2)(3)(4) can be in a single PDF file

(5) Your code file (*.py or *.m)

Final Review

link

Spring 2024 Midterm1 Lecture Notes Review

link

Spring 2024 Lecture 30 Notes

link