Ee132b Hw2 Sol

4
EE132B-HW Set #2 - Sol. UCLA 2013 Fall Prof. Izhak Rubin Problem 1 For the Gaussian distribution with mean μ and variance σ 2 , find the moment generating function. Using the moment generating function, calculate the mean and the variance. (Hint: The probability density function for a Gaussian random variable X with mean μ and variance σ 2 is given by f X (x)= 1 2πσ 2 exp - (x - μ) 2 2σ 2 . Ans: By using the laplace transform, we obtain Φ X (s)= E e -sX = -∞ e -sx 1 2πσ 2 e - 1 2σ 2 (x-μ) 2 dx = -∞ 1 2πσ 2 e - 1 2σ 2 [x 2 -2(μ-σ 2 s)x+μ 2 ] dx = -∞ 1 2πσ 2 e - 1 2σ 2 (x-(μ-σ 2 s)) 2 +2(μσ 2 s)-σ 4 s 2 dx = e - 1 2 (2μs-σ 2 s 2 ) -∞ 1 2πσ 2 e - 1 2σ 2 (x-(μ-σ 2 s)) 2 dx = e - 1 2 (2μs-σ 2 s 2 ) . We can obtain the first and second moment of X , which is given by E[X ]= - lim s0 d ds Φ X (s)= - lim s0 - 1 2 2μ - 2σ 2 s Φ X (s)= μ. E[X 2 ] = lim s0 d 2 d 2 s Φ X (s) = lim s0 σ 2 Φ X (s)+ 1 2 2μ - 2σ 2 s 2 Φ X (s) = μ 2 + σ 2 . (1) Thus, the variance is given as V ar[X ]= E[X 2 ] - E[X ] 2 = σ 2 . Problem 2 Consider the following probability density function: f X (x)= λe -λ|x| 2 , x (-∞, ), where λ> 0. 1

description

ee

Transcript of Ee132b Hw2 Sol

Page 1: Ee132b Hw2 Sol

EE132B-HW Set #2 - Sol. UCLA 2013 Fall Prof. Izhak Rubin

Problem 1

For the Gaussian distribution with mean µ and variance σ2, find the momentgenerating function. Using the moment generating function, calculate the mean andthe variance. (Hint: The probability density function for a Gaussian random variableX with mean µ and variance σ2 is given by

fX(x) =1√

2πσ2exp

(

−(x − µ)2

2σ2

)

.

Ans:By using the laplace transform, we obtain

ΦX(s) = E[

e−sX]

=∫ ∞

−∞e−sx 1√

2πσ2e

− 1

2σ2(x−µ)2

dx

=∫ ∞

−∞

1√2πσ2

e− 1

2σ2 [x2−2(µ−σ2s)x+µ2]dx

=∫ ∞

−∞

1√2πσ2

e− 1

2σ2

[

(x−(µ−σ2s))2

+2(µσ2s)−σ4s2

]

dx

= e− 1

2(2µs−σ2s2)

∫ ∞

−∞

1√2πσ2

e− 1

2σ2 (x−(µ−σ2s))2

dx

= e− 1

2(2µs−σ2s2).

We can obtain the first and second moment of X, which is given by

E[X] = − lims→0

d

dsΦX(s) = − lim

s→0−1

2

(

2µ − 2σ2s)

ΦX(s) = µ.

E[X2] = lims→0

d2

d2sΦX(s)

= lims→0

[

σ2ΦX(s) +(

1

2

(

2µ − 2σ2s)

)2

ΦX(s)

]

= µ2 + σ2.

(1)

Thus, the variance is given as

V ar[X] = E[X2] − E[X]2 = σ2.

Problem 2

Consider the following probability density function:

fX(x) =λe−λ|x|

2, ∀x ∈ (−∞, ∞),

where λ > 0.

1

Page 2: Ee132b Hw2 Sol

EE132B-HW Set #2 - Sol. UCLA 2013 Fall Prof. Izhak Rubin

(a) Calculate the mean directly.

(b) Calculate the variance directly.

(c) Find the moment generating function.

(d) Find the mean and the variance from the moment generating function.

Ans:

(a) E [X] =∫∞

−∞ x f (x) dx =∫ 0

−∞ xλ2eλxdx +

∫∞0 xλ

2e−λxdx

= − ∫∞0 xλ

2e−λxdx +

∫∞0 xλ

2e−λxdx = 0

(b) V ar [X] = E [X2]=∫∞

−∞ x2 λ2e−λ|x|dx

= 2∫∞

0 x2 λ2e−λxdx = 2

λ2

(c) ΦX (s) = E[

e−sX]

=∫∞

−∞ e−sx λ2e−λ|x|dx

=∫ 0

−∞λ2e(λ−s)xdx +

∫∞0

λ2e−(λ+s)xdx

= λ2

(

1λ−s

+ 1λ+s

)

(4) E [X] = − lims→0

dds

λ2

[

1λ−s

+ 1λ+s

]

= 0

E [X2] = lims→0

d2

ds2

λ2

[

1λ−s

+ 1λ+s

]

= 2λ2

V ar [X] = 2λ2

Problem 3

A coin is flipped until heads occur twice. Define two random variables X and Y

to be the trial numbers at which the first and the second heads are observed. Assumethat at any trial, the probability that a head occurs is p ∈ (0, 1).

(a) Show that the joint probability is given by

P (X = m, Y = n) =

{

p2qn−2 , ∀m = 1, 2, . . . ; ∀n = 2, 3, . . . ,

0 , otherwise.(2)

(b) Calculate the marginal probability mass function for X and Y .

(c) Calculate the conditional probability that X = m, given Y = n (i.e., P (X =m | Y = n)).

Ans:

2

Page 3: Ee132b Hw2 Sol

EE132B-HW Set #2 - Sol. UCLA 2013 Fall Prof. Izhak Rubin

(a) Let q = 1 − p, then we obtain

P (X = m, Y = n) = P (Y = n | X = m)P (X = m)

= P (Y − X = n − m | X = m).

We set Z = Y − X, we obtain

P (X = m, Y = n) = P (Z = n − m | X = m)

= (1 − q)qn−m−1(1 − q)qm−1

= (1 − q)2qn−2.

(b) The marginal probability of X is given by

P (X = m) =∞∑

n=m+1

(1 − q)2qn−2 = (1 − q)2 qm−1

(1 − q)= (1 − q)qm−1.

The marginal probability of Y is given as

P (Y = n) =n−1∑

m=0

(1 − q)2qn−2 = (n − 1)(1 − q)2qn−2.

(c) The conditional probability that X = m given Y = n, which is given by

P (X = m | Y = n) =P (X = m, Y = n)

P (Y = n)=

1

n − 1, ∀m = 1, 2, . . . , n − 1; ∀n = 2, 3, . . . .

Otherwise, P (X = m | Y = n) = 0.

Problem 4

Two DTEs are communicating via modems and RS-232C interfaces over a halfduplex link. Data transmission is one directional with each message of length M .After a message is transmitted, the sender waits for a CTS message of length na beforesending another message. Assume error-free operation and the following parametervalues:

• R (line bit rate) = 9600 bps

• M (message length) = 1000 bits (all data bits)

• nh (overhead in each message packet) = 24 bits

• na (acknowledgement length) = 24 bits

• tp (propagation time in one direction) = 1 msec

3

Page 4: Ee132b Hw2 Sol

EE132B-HW Set #2 - Sol. UCLA 2013 Fall Prof. Izhak Rubin

Minimum transition time between states (1,3) and (1,1) (CTS delay) is equal to10 msec at message transmitting end, and 20 msec at message receiving end (CTStransmitting end). All other delays during message transmission and reception areassumed to be negligible. For the stated conditions, determine the effective data ratein bps.Ans:

H Data message

H Data message ACK

ACK

tp

tp

CTS

delay in

RX

CTS

delay in

TX

H Data message

H Data message

tp

t

t

Figure 1: The waveforms seen by transmitter and receiver of the data message

The Figure 1 illustrates waveforms seen by transmitter and receiver of the datamessage. As the figure indicates, the receiver completes reception of the data message(plus overhead) at a time equal to tp plus the time M+nh

R(which requires to transmit

the data message) and is ready to transmit after a delay equal to the CTS delay atthe receiver. Reception of the CTS at the transmitter is then complete at time tp

plus na

Rafter the receiver begins transmission. After another delay, equal to the CTS

delay at the transmitter, the transmitter can begin to send the next message. Thus,the time required per data message of M bits is

24 + 1000 + 24

9600+ 0.001 × 2 + 0.020 + 0.010 = 0.14117 (seconds)

4