Chapter 2: Random Variables 2.1. Concept of a Random Variable 2.2. Distribution Functions 2.3. Density Functions Functions of random variables Hypergeometric Distribution 2.4. Mean Values and Moments 2.5. The Gaussian Random Variable 2.6. Density Functions Related to Gaussian 2.7. Other Probability Density Functions 2.8. Conditional Probability Distribution and Density Functions 2.9. Examples and Applications Notes and figures are based on or taken from materials in the course textbook: Probabilistic Methods of Signal and System Analysis (3rd ed.) by George R. Cooper and Clare D. McGillem; Oxford Press, 1999. ISBN: 0-19-512354-9. B.J. Bazuin, Spring 2015 1 of 15 ECE 3800 Conditional Probability (Review from Chapter 1) Defining the conditional probability of event A given that event B has occurred. Using a Venn diagram, we know that B has occurred … then the probability that A has occurred given B must relate to the area of the intersection of A and B … Pr A B Pr A | B Pr B , for PrB 0 or Pr A | B Pr A B , for PrB 0 Pr B For elementary events, Pr A | B Pr A B Pr A, B , for PrB 0 Pr B Pr B If A is a subset of B, then the conditional probability must be Pr A | B Pr A B Pr A , for A B Pr B Pr B Therefore, it can be said that Pr A | B Pr A B Pr A Pr A , for A B Pr B Pr B If B is a subset of A, then the conditional probability becomes Pr A | B Pr A B Pr B 1 , for B A Pr B Pr B If A and B are mutually exclusive, Pr A | B Pr A B 0 0 , for B A Pr B Pr B Notes and figures are based on or taken from materials in the course textbook: Probabilistic Methods of Signal and System Analysis (3rd ed.) by George R. Cooper and Clare D. McGillem; Oxford Press, 1999. ISBN: 0-19-512354-9. B.J. Bazuin, Spring 2015 2 of 15 ECE 3800 Conditional Probability Distribution and Density Functions Using the Probability Distribution Function (PDF), define F x | M Pr X x | M Pr X x | M Pr X x, M , for Pr M 0 Pr M where X x, M is the event of all outcomes such that X x and M Note: X is the value of the random variable when the experimental outcome is . Every M may be an event that depends upon some other random variable, which may be either continuous or discrete. The examples to be considered are in chapter 3. It can be shown that F x | M is a valid probability distribution function with all the expected characteristics: 1. 0 F x | M 1, for x 2. F | M 0 and F | M 1 3. F x | M is non-decreasing as x increases 4. Pr x1 X x2 | M F x2 | M F x1 | M The event M that conditions the probability has several possibilities: 1. Every M may be an event that can be expressed in terms of the random variable X. The case that is discussed in chapter 2 and that we start with, 2. Every M may be an event that depends upon some other random variable, which may be either continuous or discrete. The examples to be considered in chapter 3. 3. Every M may be an event that depends upon both the random variable X and some other random variable. Examples and cases not dealt with in this text. For our purposes (#1 above) envision that M X m or M X m So now we need to investigate the two cases of interest completely … Notes and figures are based on or taken from materials in the course textbook: Probabilistic Methods of Signal and System Analysis (3rd ed.) by George R. Cooper and Clare D. McGillem; Oxford Press, 1999. ISBN: 0-19-512354-9. B.J. Bazuin, Spring 2015 3 of 15 ECE 3800 Using M X m then F x | M Pr X x | X m Pr X x, X m Pr X m There are two possibilities depending on the values of x and m selected. If x m , then the event described by M X m is contained in the event described for X x and Pr X x, X m Pr X m F x | M 1 , for x m Pr X m Pr X m Since the event M is a subset and has occurred, then we know that x will occur based on M. If x m , then the event described by M X m contains the event described for X x and Pr X x, X m Pr X x Pr X x , for x m F x | M Pr X m Pr X m Pr X m The distribution function is effectively scaled by the probability of the event. As a result the new probability density function is a scaled version of the initial distribution, but a ceiling function is applied for those points beyond m that would be greater than 1.0. A new probability density function may result from the above and it can be defined as f x | M dF x | M dx Properties of the new pdf must include 1. f x | M 0, for x 2. f x | M dx 1 3. F x | M x f u | M du 4. Pr x1 X x 2 x2 f x | M dx x1 Notes and figures are based on or taken from materials in the course textbook: Probabilistic Methods of Signal and System Analysis (3rd ed.) by George R. Cooper and Clare D. McGillem; Oxford Press, 1999. ISBN: 0-19-512354-9. B.J. Bazuin, Spring 2015 4 of 15 ECE 3800 Note that for the conditional pdf, where x m , we must have f x | M dF x | M d 1 0 , for x m dx dx and f x | M dF x | M 1 d Pr X x f x , for x m dx Pr X m dx F m Summary: For x m F x | M Pr X x, X m Pr X m 1 Pr X m Pr X m For x m F x | M Pr X x, X m Pr X x F x Pr X m Pr X m F m f x , xm f x | M F m 0, xm All normal operations can be performed on the new density and distribution functions. Moments The moments of a random variable are defined as the expected value of the powers of the measured output or … n x E X |M n f x | M dx The expected value of a function is: E g X | M g X f x | M dx Notes and figures are based on or taken from materials in the course textbook: Probabilistic Methods of Signal and System Analysis (3rd ed.) by George R. Cooper and Clare D. McGillem; Oxford Press, 1999. ISBN: 0-19-512354-9. B.J. Bazuin, Spring 2015 5 of 15 ECE 3800 Example p. 100: Gaussian density function given that the event, M, is less than or equal to the mean value f X x x X 2 , for x exp 2 2 2 1 X is the mean and is the variance where For the event M, F x M X 1 2 Then, constructing a conditional probability distribution, F x X | M , the density function is defined as x X 2 f x f x 2 , for x X exp f x | M 2 1 F X 2 2 2 and f x | M 0 , for x X The new conditional distribution and density has a mean and variance that can be computed. The new mean is X x X 2 2 dx E x x exp 2 2 x 2 E x u X 0 x E x 2 X 0 x From math tables u2 exp 2 2 2 1 u2 exp 2 2 2 2 du 0 u2 2 du u exp 2 2 x 2 du 2 x2 dx exp x exp 2 2 2 2 2 2 2 x u2 2 X 2 2 E x exp 2 2 2 2 Ex X 2 0 Notes and figures are based on or taken from materials in the course textbook: Probabilistic Methods of Signal and System Analysis (3rd ed.) by George R. Cooper and Clare D. McGillem; Oxford Press, 1999. ISBN: 0-19-512354-9. B.J. Bazuin, Spring 2015 6 of 15 ECE 3800 Cond. gaussian Dist. and Density Fundtions 1 0.9 0.8 0.7 0.6 pdf PDF c-pdf C-PDF 0.5 0.4 0.3 0.2 0.1 0 -4 -3 -2 -1 0 1 The new variance is x X Ex x exp 2 2 2 x X 2 2 2 0 Ex 2 x 2 2 2 E x2 X 2 2 2 4 dx u2 exp uX 2 2 2 2 3 du X 2 2 2 Var x E x 2 E x 2 1 see CondGaussianRandn.m Notes and figures are based on or taken from materials in the course textbook: Probabilistic Methods of Signal and System Analysis (3rd ed.) by George R. Cooper and Clare D. McGillem; Oxford Press, 1999. ISBN: 0-19-512354-9. B.J. Bazuin, Spring 2015 7 of 15 ECE 3800 Chapter 2 Examples Problem 2-2.4: A random variable X has a probability distribution function of the form Note: use sin not cos! FX x 0 A 1 sin b x 1 x 2 2 x 2 2 x Determine the probability density function f X x 0 x 2 A b cosb x 0 2 x 2 2 x a) Find the values of A and b that make this a valid probability distribution function. FX 2 A 1 sinb 2 1 FX 2 A 1 sinb 2 0 FX 2 FX 2 2 A 1 A 1 Therefore 2 FX 2 A 1 sin b 2 0 sinb 2 1 b2 Therefore 2 and b FX x 0 4 x 2 1 1 sin x 2 x 2 2 4 1 2x and fX x 0 x 2 cos x 8 4 0 2 x 2 2 x Notes and figures are based on or taken from materials in the course textbook: Probabilistic Methods of Signal and System Analysis (3rd ed.) by George R. Cooper and Clare D. McGillem; Oxford Press, 1999. ISBN: 0-19-512354-9. B.J. Bazuin, Spring 2015 8 of 15 ECE 3800 Problem 2-2.4 Dist. and Density Fundtions 1 0.9 0.8 0.7 0.6 pdf PDF 0.5 0.4 0.3 0.2 0.1 0 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 b) Find the probability that X>1 Pr X 1 1 FX 1 Pr X 1 1 - FX 1 1 Pr X 1 1 - FX 1 1 1 sin 2 4 1 1 2 2 1 1 1 0.146 sin 2 2 4 4 2 2 2 c) Find the probability that X is negative Pr X 0 FX 0 Pr X 0 F X 0 1 1 1 sin 0 2 2 Notes and figures are based on or taken from materials in the course textbook: Probabilistic Methods of Signal and System Analysis (3rd ed.) by George R. Cooper and Clare D. McGillem; Oxford Press, 1999. ISBN: 0-19-512354-9. B.J. Bazuin, Spring 2015 9 of 15 ECE 3800 d) Find the mean X E X x f X x dx X EX 2 x 8 cos x 4 dx 2 1 x cosax dx a 2 cosax a sinax x 2 1 x X EX cos x sin x 8 2 4 4 4 2 4 2 x X E X cos x sin x 4 2 4 2 2 2 2 2 2 sin 2 X E X cos 2 sin 2 cos 2 4 2 4 4 2 4 X E X 1 1 0 2 x a2 x2 2 cos ax sin ax a2 a3 32 Var X 4 2 2 x cosax dx see HW_2_2_4.m Problem 2-2.4 Histogram 5000 4500 4000 Number of Samples 3500 3000 2500 2000 1500 1000 500 0 -2.5 -2 -1.5 -1 -0.5 0 0.5 Amplitude 1 1.5 2 2.5 Notes and figures are based on or taken from materials in the course textbook: Probabilistic Methods of Signal and System Analysis (3rd ed.) by George R. Cooper and Clare D. McGillem; Oxford Press, 1999. ISBN: 0-19-512354-9. B.J. Bazuin, Spring 2015 10 of 15 ECE 3800 Problem 2-4.5: A random variable X has a probability density function of the form f X x a x 2 0 x2 ax 2 x3 a) Find the value a 1 f X x dx 2 3 2 1 a x dx a x dx 0 2 x3 1 a 3 1 a 2 x2 a 2 0 3 2 23 03 32 22 16 15 8 9 4 a a a a a 3 3 2 2 6 3 2 2 a 6 31 a) Find the mean of the random variable X X E X x f X x dx X E X 2 xa x 3 2 dx x a x dx 0 x4 X EX a 4 X EX a 2 2 0 x3 a 3 3 2 24 04 33 23 16 27 8 6 48 76 124 2 a a a a 4 4 3 3 3 3 31 12 62 4 Notes and figures are based on or taken from materials in the course textbook: Probabilistic Methods of Signal and System Analysis (3rd ed.) by George R. Cooper and Clare D. McGillem; Oxford Press, 1999. ISBN: 0-19-512354-9. B.J. Bazuin, Spring 2015 11 of 15 ECE 3800 Find the mean square or 2nd moment of the random variable X X 2 x EX 2 2 f X x dx 2 X 2 x EX 2 3 2 2 a x dx x 2 a x dx 0 X X 2 E X 2 a 2 2 EX 2 x5 a 5 2 0 x4 a 4 3 2 25 34 24 32 81 16 6 128 325 1359 4.383 a a a 5 4 4 4 4 31 20 310 5 Find the variance or standard deviation 2 X2 X 2 4.383 2 2 0.383 0.620 c) Find the probability that 2<x≤3 Pr 2 X 3 3 f X x dx 2 3 Pr 2 X 3 a x dx 2 x2 Pr 2 X 3 a 2 3 2 32 22 6 9 4 15 a a 0.484 2 2 31 2 31 Notes and figures are based on or taken from materials in the course textbook: Probabilistic Methods of Signal and System Analysis (3rd ed.) by George R. Cooper and Clare D. McGillem; Oxford Press, 1999. ISBN: 0-19-512354-9. B.J. Bazuin, Spring 2015 12 of 15 ECE 3800 Find the probability that 2 - 0.620 < X ≤ 2 + 0.620 Pr X f X x dx 2 0.62 2 Pr X a x 2 dx 2 0.62 x3 Pr X a 3 2 2 0.62 a x dx 2 x2 a 2 2 0.62 2 23 1.383 2.62 2 22 a a a Pr X a 3 3 2 2 6 8 2.628 6.864 4 31 3 3 2 2 6 1.791 1.432 31 0.624 Notes and figures are based on or taken from materials in the course textbook: Probabilistic Methods of Signal and System Analysis (3rd ed.) by George R. Cooper and Clare D. McGillem; Oxford Press, 1999. ISBN: 0-19-512354-9. B.J. Bazuin, Spring 2015 13 of 15 ECE 3800 Problem 2-5.5: A common method for detecting a signal in the presence of noise is to establish a threshold level and compare the value of any observation with this threshold. If the threshold is exceeded, it is decided that the signal is present. Sometimes, of course, noise alone will exceed the threshold and this is known as a “false alarm” (also referred to as the “false alarm rate” or FAR). Usually it is desired to have the probability of a false alarm very small. At the same time, we should like any observation that does contain a signal plus the noise to exceed the threshold with a large probability. Suppose we have Gaussian noise with zero mean and variance of 1 Volt^2 and we set a threshold level of 5V. a) Find the probability of a false alarm (FAR) f X x x X 2 ,for x exp 2 2 2 1 f X x FX x x2 exp 2 2 1 ,for x x u2 du x exp 2 2 u 1 Threshold = 5, therefore X>5 FAR 1 FX 5 1 5 Q5 0.2867 10 6 b) If a signal having a value of 8 Volts is observed in the presence of this noise, find the probability of detection (PD). The signal plus noise is represented by a Gaussian distribution centered at 8V. The threshold for detection remains at 5V (and above). f S x FS x x 82 exp 2 2 1 ,for x x u 82 du u 8 exp 2 2 u 1 Threshold = 5, therefore X>5 when mean(X)=8. PD PrX 5, X 8 1 FS 5 1 5 8 1 3 3 0.9987 Notes and figures are based on or taken from materials in the course textbook: Probabilistic Methods of Signal and System Analysis (3rd ed.) by George R. Cooper and Clare D. McGillem; Oxford Press, 1999. ISBN: 0-19-512354-9. B.J. Bazuin, Spring 2015 14 of 15 ECE 3800 Expected Values of a Sinusoid with Random Phase Let Y a cosw t where a, w, and t are constants, and is a uniform random variable in the interval (0,2π). The random variable Y results from sampling the amplitude of a sinusoid with random phase . Find the expected value of Y and expected value of the power of Y, Y2. 2 EY Ea cosw t a cosw t 0 EY EY 1 d 2 a 2 sinw t 0 2 a sinw t 2 sinw t 0 2 EY a 0 0 2 The average power is Ea EY 2 2 cosw t a 2 cosw t 2 2 EY2 EY 2 2 1 d 2 a 1 1 cos2 w t 2 d 2 2 2 2 a 2 1 1 2 sin2 w t 2 0 2 2 0 2 2 EY2 a2 2 2 2 1 1 a 0 2 2 2 2 Note that these answers are in agreement with the time averages of sinusoids: the time average (“dc” value) of the sinusoid is zero; the time-average power is a2/2. Note: different results occur for a uniform distribution from (0, π)! EY a sinw t 0 a sinw t sinw t 0 2a sinw t Notes and figures are based on or taken from materials in the course textbook: Probabilistic Methods of Signal and System Analysis (3rd ed.) by George R. Cooper and Clare D. McGillem; Oxford Press, 1999. ISBN: 0-19-512354-9. B.J. Bazuin, Spring 2015 15 of 15 ECE 3800