Chapter 2 Random Variables

Similar documents
Probability, Random Processes and Inference

Discrete Random Variable

Discrete Random Variables

Relationship between probability set function and random variable - 2 -

Course: ESO-209 Home Work: 1 Instructor: Debasis Kundu

Lecture Notes 1 Probability and Random Variables. Conditional Probability and Independence. Functions of a Random Variable

Brief Review of Probability

MAT 271E Probability and Statistics

Lecture Notes 1 Probability and Random Variables. Conditional Probability and Independence. Functions of a Random Variable

M378K In-Class Assignment #1

Continuous-Valued Probability Review

Random variables. DS GA 1002 Probability and Statistics for Data Science.

Statistics for Economists. Lectures 3 & 4

Random variable X is a mapping that maps each outcome s in the sample space to a unique real number x, x. X s. Real Line

Random variable X is a mapping that maps each outcome s in the sample space to a unique real number x, < x <. ( ) X s. Real Line

5. Conditional Distributions

Statistics and Econometrics I

1.1 Review of Probability Theory

Chapter 2: Random Variables

Recitation 2: Probability

Probability Theory for Machine Learning. Chris Cremer September 2015

Introduction to Stochastic Processes

Review of Probability. CS1538: Introduction to Simulations

Probability, Random Processes and Inference

Why study probability? Set theory. ECE 6010 Lecture 1 Introduction; Review of Random Variables

Week 2. Review of Probability, Random Variables and Univariate Distributions

for valid PSD. PART B (Answer all five units, 5 X 10 = 50 Marks) UNIT I

1. Discrete Distributions

Chapter 2: The Random Variable

General Random Variables

Probability. Lecture Notes. Adolfo J. Rumbos

1 Presessional Probability

Probability Theory and Random Variables

Review (probability, linear algebra) CE-717 : Machine Learning Sharif University of Technology

RVs and their probability distributions

Chapter 1: Revie of Calculus and Probability

Chapter 3: Random Variables 1

Math 151. Rumbos Fall Solutions to Review Problems for Exam 2. Pr(X = 1) = ) = Pr(X = 2) = Pr(X = 3) = p X. (k) =

Probability Review. Gonzalo Mateos

1 Random Variable: Topics

STAT 414: Introduction to Probability Theory

Deep Learning for Computer Vision

DISCRETE RANDOM VARIABLES: PMF s & CDF s [DEVORE 3.2]

Algorithms for Uncertainty Quantification

Introduction to probability theory

Notes for Math 324, Part 17

Chapter 2: Discrete Distributions. 2.1 Random Variables of the Discrete Type

Recap of Basic Probability Theory

1. If X has density. cx 3 e x ), 0 x < 0, otherwise. Find the value of c that makes f a probability density. f(x) =

Chapter 3 Discrete Random Variables

Northwestern University Department of Electrical Engineering and Computer Science

Arkansas Tech University MATH 3513: Applied Statistics I Dr. Marcel B. Finan

Preliminary Statistics Lecture 2: Probability Theory (Outline) prelimsoas.webs.com

STAT2201. Analysis of Engineering & Scientific Data. Unit 3

Recap of Basic Probability Theory

1 Probability and Random Variables

MAT 271E Probability and Statistics

ECE 302: Probabilistic Methods in Electrical Engineering

The random variable 1

Conditional Probability

Probabilistic Systems Analysis Spring 2018 Lecture 6. Random Variables: Probability Mass Function and Expectation

STAT 418: Probability and Stochastic Processes

Name: Firas Rassoul-Agha

Statistics for Managers Using Microsoft Excel (3 rd Edition)

MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.436J/15.085J Fall 2008 Lecture 8 10/1/2008 CONTINUOUS RANDOM VARIABLES

6.041/6.431 Spring 2009 Quiz 1 Wednesday, March 11, 7:30-9:30 PM. SOLUTIONS

PROBABILITY THEORY. Prof. S. J. Soni. Assistant Professor Computer Engg. Department SPCE, Visnagar

CMPSCI 240: Reasoning Under Uncertainty

Discrete Probability Refresher

G.PULLAIAH COLLEGE OF ENGINEERING & TECHNOLOGY DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING PROBABILITY THEORY & STOCHASTIC PROCESSES

Stochastic Models in Computer Science A Tutorial

Lecture 2: Repetition of probability theory and statistics

Introduction to Probability and Stocastic Processes - Part I

ELEG 3143 Probability & Stochastic Process Ch. 2 Discrete Random Variables

4.2 Probability Models

L2: Review of probability and statistics

Review of Probability Theory

ECE 302 Division 2 Exam 2 Solutions, 11/4/2009.

CME 106: Review Probability theory

CS626 Data Analysis and Simulation

Introduction to Probability and Statistics Slides 3 Chapter 3

Statistics for Managers Using Microsoft Excel/SPSS Chapter 4 Basic Probability And Discrete Probability Distributions

MA/ST 810 Mathematical-Statistical Modeling and Analysis of Complex Systems

Midterm Exam 1 Solution

MTH302 Quiz # 4. Solved By When a coin is tossed once, the probability of getting head is. Select correct option:

ELEG 3143 Probability & Stochastic Process Ch. 1 Probability

Chapter 1 Statistical Reasoning Why statistics? Section 1.1 Basics of Probability Theory

A6523 Signal Modeling, Statistical Inference and Data Mining in Astrophysics Spring 2011

MAT 271E Probability and Statistics

Fundamental Tools - Probability Theory II

Chapter 1. Sets and probability. 1.3 Probability space

Review of probability. Nuno Vasconcelos UCSD

Chapter 3, 4 Random Variables ENCS Probability and Stochastic Processes. Concordia University

IE 230 Probability & Statistics in Engineering I. Closed book and notes. 60 minutes.

Math 416 Lecture 3. The average or mean or expected value of x 1, x 2, x 3,..., x n is

Probability Theory Review

IEOR 3106: Introduction to Operations Research: Stochastic Models. Professor Whitt. SOLUTIONS to Homework Assignment 1

Summary of basic probability theory Math 218, Mathematical Statistics D Joyce, Spring 2016

CDA6530: Performance Models of Computers and Networks. Chapter 2: Review of Practical Random Variables

Random Variables. Random variables. A numerically valued map X of an outcome ω from a sample space Ω to the real line R

Transcription:

Stochastic Processes Chapter 2 Random Variables Prof. Jernan Juang Dept. of Engineering Science National Cheng Kung University Prof. Chun-Hung Liu Dept. of Electrical and Computer Eng. National Chiao Tung University Spring 2015 15/3/2 Chapter 2 : Random Variables 1

What is a Random Variable? Random Experiments Associated with Numerical Results In many probabilistic models, the outcomes are of a numerical nature, e.g., if they correspond to instrument readings or stock prices. In some experiments, the outcomes are NOT numerical, but they may be associated with some numerical values of interest. For example, if the experiment is the selection of students from a given population, we may wish to consider their grade point average. Basic Concepts of Random Variables Given an experiment and the corresponding set of possible outcomes (the sample space), a random variable associates a particular number with each outcome. This number is referred as the numerical value or the experimental value of the random variable. Mathematically, a Random Variable (RV) is a real-valued function of the experimental outcome. 15/3/2 Chapter 2 : Random Variables 2

What is a Random Variable? Visualization of a random variable: It is a function that assigns a numerical value to each possible outcome of the experiment. An example of a random variable The experiment consists of two rolls of a 4-sided die, and the random variable is the maximum of the two rolls. If the outcome of the experiment is (4, 2), the experimental value of this random variable is 4. 15/3/2 Chapter 2 : Random Variables 3

More Examples of Random Variables In an experiment involving a sequence of 5 tosses of a coin, the number of heads in the sequence is a random variable. However, the 5-long sequence of heads and tails is not considered a random variable because it does not have an explicit numerical value. In an experiment involving two rolls of a die, the following are examples of random variables: 1. The sum of the two rolls. 2. The number of sixes in the two rolls. 3. The second roll raised to the fifth power. In an experiment involving the transmission of a message, the time needed to transmit the message, the number of symbols received in error, and the delay with which the message is received are all random variables. 15/3/2 Chapter 2 : Random Variables 4

Random Variables : A More Math. Point of View Schematic Explanation for Random Variable X: Borel set : Sigma-field on the real line. Consider an experiment H with sample space. The elements or points of, are the random outcome of H. If to every we assign a real number X( ), we establish a correspondence rule between and R, the real line. Such a rule (subject to certain constraint), is called a Random Variable (RV). 15/3/2 Chapter 2 : Random Variables 5

Random Variables : A More Math. Point of View Defn : Let H be an experiment with sample space. Then the random variable X is a function whose domain is that satisfies the following : (i) For every Borel set of numbers B, the set event and (ii) is an Example : A person, chosen at random in the street, is asked if he or she has a younger brother. If the answer is No (Yes), the data is encoded as Zero (One). This experiment has sample space and sigma field, and P[{No}] = 3 and. 4 P[{Yes}] = 1 4 15/3/2 Chapter 2 : Random Variables 6

More Examples of Random Variables Example : A bus arrives at random in [0,T]; Let t denote the time of arrival. The sample description space is = {t : t 2 [0,T]}. A RV X is defined by Assume that the arrival time is uniform over [0,T]. We can now ask and compute what is Example : An urn contains three colored balls. The balls are colored white (W), black (B), and red (R), respectively. So. We can define the following RV We can try to compute P[X apple x] for any number x. 15/3/2 Chapter 2 : Random Variables 7

More Concepts on Random Variables Starting with a probabilistic model of an experiment: A random variable is a real-valued function of the outcome of the experiment. A function of a random variable defines another random variable. We can associate with each random variable certain averages of interest, such the mean and the variance. A random variable can be conditioned on an event or on another random variable. There is a notion of independence of a random variable from an event or from another random variable. Discrete Random Variables : A random variable is called discrete if its range (the set of values that it can take) is finite or at most countably infinite. 15/3/2 Chapter 2 : Random Variables 8

Concepts related to Discrete RVs Starting with a probabilistic model of an experiment: A discrete random variable is a real-valued function of the outcome of the experiment that can take a finite or countably infinite number of values. A (discrete) random variable has an associated probability mass function (PMF), which gives the probability of each numerical value that the random variable can take. A function of a random variable defines another random variable, whose PMF can be obtained from the PMF of the original random variable. 15/3/2 Chapter 2 : Random Variables 9

Probability Mass Function (PMF) For a discrete random variable X, these are captured by the prob. mass function (PMF for short) of X, denoted p X. In particular, if x is any possible value of X, the probability mass of x, denoted p X (x) is the prob. of the event {X = x} consisting of all outcomes that give rise to a value of X equal to x: p X (x) =P[{X = x}] For example, let the experiment consist of two independent tosses of a fair coin, and let X be the number of heads obtained. Then the PMF of X is Throughout this course, we will use upper case characters to denote random variables, and lower case characters to denote real numbers such as the numerical values of a random variable. 15/3/2 Chapter 2 : Random Variables 10

Probability Mass Function (PMF) Note that where in the summation above, x ranges over all the possible numerical values of X. By a similar argument, for any set S of real numbers, we also have For example, if X is the number of heads obtained in two independent tosses of a fair coin, as above, the probability of at least one head is Calculating the PMF of X is conceptually straightforward, and is illustrated in the following figure. 15/3/2 Chapter 2 : Random Variables 11

Probability Mass Function (PMF) (a) Illustration of the method to calculate the PMF of a random variable X. For each possible value x, we collect all the outcomes that give rise to X=x and add their probabilities to obtain p X (x). (b) Calculation of the PMF px of the random variable X = maximum roll in two independent rolls of a fair 4- sided die. There are four possible values x, namely, 1, 2, 3, 4. To calculate p X (x) for a given x, we add the probabilities of the outcomes that give rise to x. 15/3/2 Chapter 2 : Random Variables 12

Bernoulli Random Variable Consider the toss of a biased coin, which comes up a head with probability p, and a tail with probability 1 p. The Bernoulli random variable takes the two values 1 and 0, depending on whether the outcome is a head or a tail: Its PMF is For all its simplicity, the Bernoulli random variable is very important. In practice, it is used to model generic probabilistic situations with just two outcomes, such as: The state of a telephone at a given time that can be either free or busy. A person who can be either healthy or sick with a certain disease. 15/3/2 Chapter 2 : Random Variables 13

Binomial Random Variable The Motivating Sense of Binomial : A biased coin is tossed n times. At each toss, the coin comes up a head with probability p, and a tail with probability 1 p, independently of prior tosses. Let X be the number of heads in the n-toss sequence. We refer to X as a binomial random variable with parameters n and p. The PMF of X consists of the binomial probabilities P The normalization property, specialized to the binomial x p X(x) =1 random variable, is written as Some special cases of the binomial PMF are sketched in the following figure: 15/3/2 Chapter 2 : Random Variables 14

Binomial Random Variable The PMF of a binomial random variable. If p = 1/2, the PMF is symmetric around n/2. Otherwise, the PMF is skewed towards 0 if p < 1/2, and towards n if p > 1/2. 15/3/2 Chapter 2 : Random Variables 15

Geometric Random Variable Consider we repeatedly and independently do an experiment with the probability of success p, where 0 <p<1. The geometric random variable is the number X of doing experiments needed for a success to come up for the first time. So it PMF is given by since (1 p) k 1 p is the probability of the sequence consisting of k-1 successive tails followed by a head, as shown in the following figure. The PMF (1 p) k 1 p decreases as a geometric progression with parameter 1 p. Is it a legitimate PMF? Yes, because 15/3/2 Chapter 2 : Random Variables 16

Poisson Random Variable A Poisson random variable takes nonnegative integer values. Its PMF is given by where is a positive parameter characterizing the PMF; see the figure. k The PMF e k! of the Poisson random variable for different values of. Note that if < 1, then the PMF is monotonically decreasing, while if > 1, the PMF first increases and then decreases as the value of k. 15/3/2 Chapter 2 : Random Variables 17

Continuous Random Variables and Their PDFs A random variable X is called continuous if its probability law can be described in terms of a nonnegative function f X, called the probability density function (pdf) of X, which satisfies for every subset B of the real line. In particular, the probability that the value of X falls within an interval is The probability that X takes value R in an interval a [a,b] is b f X(x)dx, which is the shaded area in the figure. 15/3/2 Chapter 2 : Random Variables 18

Continuous Random Variables and Their PDFs For any single value a, we have P[X = a] = R a. For this a f X(x)dx =0 reason, including or excluding the endpoints of an interval has no effect on its probability: Note that to qualify as a PDF, a function f X ( ) must be nonnegative, i.e., f X (x) 0 for every x, and must also satisfy the normalization equation Graphically, this means that the entire area under the graph of the PDF must be equal to 1. 15/3/2 Chapter 2 : Random Variables 19

Continuous Random Variables and Their PDFs To interpret the PDF, note that for an interval small length, we have [x, x + ] with very What physical meaning does the above equation imply? f X (x) can be interpreted as probability mass per unit length around x. If is very small, the prob. that X takes value in the interval [x, x + ] which is the shaded area in the figure, which is approximately equal to f X (x) x. 15/3/2 Chapter 2 : Random Variables 20

Continuous Uniform RV : Example Example: Continuous Uniform Random Variable. A gambler spins a wheel of fortune, continuously calibrated between 0 and 1, and observes the resulting number. Assuming that all subintervals of [0,1] of the same length are equally likely, this experiment can be modeled in terms a random variable X with PDF for some constant c. This constant can be determined by using the normalization property so that c = 1. 15/3/2 Chapter 2 : Random Variables 21

Continuous Uniform Random Variable Generalization: consider a random variable X that takes values in an interval [a, b], and again assume that all subintervals of the same length are equally likely. We refer to this type of random variable as uniform or uniformly distributed. Its PDF has the form where c is a constant. f X ( ) For to satisfy the normalization property, we must have 15/3/2 Chapter 2 : Random Variables 22

Continuous Uniform Random Variable Note that the probability P[X 2 I] that X takes value in a set I is Example (Piecewise Constant PDF.) : Alvin s driving time to work is between 15 and 20 minutes if the day is sunny, and between 20 and 25 minutes if the day is rainy, with all times being equally likely in each case. Assume that a day is sunny with probability 2/3 and rainy with probability 1/3. What is the PDF of the driving time, viewed as a random variable X? We interpret the statement that all times are equally likely in the sunny and the rainy cases, to mean that the PDF of X is constant in each of the intervals [15, 20] and [20, 25]. Furthermore, since these two intervals contain all possible driving times, the PDF should be zero everywhere else: 15/3/2 Chapter 2 : Random Variables 23

Continuous Uniform RV : Example where c 1 and c 2 are some constants. We can determine these constants by using the given probabilities of a sunny and of a rainy day: so that 15/3/2 Chapter 2 : Random Variables 24

Cumulative Distribution Function (CDF) The Cumulative Distribution Function (CDF) of a random variable X is denoted by F X ( ) and provides the probability P[X apple x]. In particular, for every x we have Loosely speaking, the CDF to the value x. F X (x) accumulates probability up Remark : Any random variable associated with a given probability model has a CDF, regardless of whether it is discrete, continuous, or other. This is because {X apple x} is always an event and therefore has a well-defined probability. 15/3/2 Chapter 2 : Random Variables 25

Discrete CDF : Example The CDF is related to the PMF through the formula F X (x) =P[X apple x] = X kapplex p X (k), 15/3/2 Chapter 2 : Random Variables 26

Continuous CDF : Example The CDF is related to the PDF through the formula F X (x) =P[X apple x] = 15/3/2 Chapter 2 : Random Variables 27 Z x 1 f X (t) dt.

Cumulative Distribution Function (CDF) Generalization: The cumulative distribution function (CDF) is defined by The above equation means the prob. that the set of all outcomes in the sample space such that the function X( ) has values less than or equal to x Properties of F X (x) 15/3/2 Chapter 2 : Random Variables 28

CDF : Examples Example : A bus arrives at random in (0,T]. Let RV X denote the time of arrival. Suppose it is known that the bus is equally likely or uniformly likely to come at any time within (0,T]. What is the CDF of X? 15/3/2 Chapter 2 : Random Variables 29

CDF : Examples Example : Compute the CDF for a binominal RV with parameter (n, p) Let X be the binominal RV and X 2 {0, 1, 2, 3,...,n} Since X only takes on integers, then event, where is the largest integer equal to or smaller than x Then F X (x) is given by P[1.99 <Xapple 3] = 0.6656 15/3/2 Chapter 2 : Random Variables 30

CDF : Examples Example: The Maximum of Several Random Variables. You are allowed to take a certain test three times, and your final score will be the maximum of the test scores. Thus, X = max{x 1,X 2,X 3 }, where X 1,X 2,X 3 are the three test scores and X is the final score. Assume that your score in each test takes one of the values from 1 to 10 with equal probability 1/10, independently of the scores in other tests. What is the PMF p X of the final score? We calculate the PMF indirectly. We first compute the CDF F X (k) and then obtain the PMF as 15/3/2 Chapter 2 : Random Variables 31

More Properties of CDF 15/3/2 Chapter 2 : Random Variables 32

Probability Density Function (PDF) 15/3/2 Chapter 2 : Random Variables 33

PDF : Properties and Examples 15/3/2 Chapter 2 : Random Variables 34

Normal (Gaussian) Distribution Definitions of Expectation (Mean) and Variance for a continuous RV 15/3/2 Chapter 2 : Random Variables 35

Other Important PDFs 15/3/2 Chapter 2 : Random Variables 36

Exponential, Rayleigh and Uniform PDFs 15/3/2 Chapter 2 : Random Variables 37

Table of Continuous PDfs and CDFs erf, 1 p 2 Z x 0 e 1 2 t2 dt 15/3/2 Chapter 2 : Random Variables 38

Table of Discrete PDFs and CDFs 15/3/2 Chapter 2 : Random Variables 39

Some Examples of Discrete CDF and PMF Example : 15/3/2 Chapter 2 : Random Variables 40

Example : Some Examples of Discrete CDF and PMF 15/3/2 Chapter 2 : Random Variables 41

Expectation of a Discrete RV Definition : X is a discrete RV and its expectation is defined by 15/3/2 Chapter 2 : Random Variables 42

Expectation of the Function of a RV 15/3/2 Chapter 2 : Random Variables 43

Jointly Distributed Random Variables A Motivating Example : Consider a probability space (, F, P) involving an underlying experiment consisting of the simultaneous throwing of two fair coins. Since the ordering is not important here and the key outcomes are 1 = HH, 2 = HT, 3 =TT, the sample space is = {HH,HT,TT}, the sigma-field of events is F = {;,,HT,TT,HH,{TT,HT}, {HH,TT}, {HH,HT}} The probabilities are 0, 1, ½, ¼, ¼, ¾, ¾, and ½. Now define two random variables ( 0, if at least one H X 1 ( 1 )= 1, otherwise ( 1, if one H and one T X 2 ( 1 )= 1, otherwise Then P [X 1 = 0] = 3/4, P [X 1 = 1] = 1/4, P [X 2 = 1] = 1/2, P [X 2 = 1] = 1/2. P [X 1 =0,X 2 = 1] = P [{HH}] = 1 4, P [X 1 =1,X 2 = 1] = P [{;}] =0. 15/3/2 Chapter 2 : Random Variables 44

Jointly Distributed Random Variables Definition of Joint CDF of RVs X and Y 15/3/2 Chapter 2 : Random Variables 45

Jointly Distributed Random Variables In other words, we also have F XY (x, y) = Z x Z y 1 1 Properties of Joint CDFF XY (x, y) f XY (, )d d (1) F XY (1, 1) = 1; F XY ( 1,y)=F XY (x, 1) = 0; also F XY (x, 1) =F X (x); F XY (1,y)=F Y (y); (2) If x 1 apple x 2, y 1 apple y 2, then F XY (x 1,y 1 ) apple F XY (x 2,y 2 ) (3) F XY (x, y) =lim!,!0 F XY (x +,y+ ), > 0 (continuity from the right and from above) (4) For all x 2 x 1 and y 2 y 1, we must have F XY (x 2,y 2 ) F XY (x 2,y 1 ) F XY (x 1,y 2 )+F XY (x 1,y 1 ) 0 (How to prove this?) 15/3/2 Chapter 2 : Random Variables 46

Examples of a Joint CDF 15/3/2 Chapter 2 : Random Variables 47

Joint PDF and Its Marginal PDF 15/3/2 Chapter 2 : Random Variables 48

Summery of PDF, CDF and Expectation Definition of CDFF X (x) =P[X apple x] Definition of Expectation and Variance 15/3/2 Chapter 2 : Random Variables 49

Summery of PDF, CDF and Expectation 15/3/2 Chapter 2 : Random Variables 50

Independent Random Variables Definition of the Independence of two RVs f XY (x, y) =f X (x) f Y (y) 15/3/2 Chapter 2 : Random Variables 51

Conditional CDF and PDF Definition of Conditional CDF : Consider event C consisting of all outcomes 2 such that X( ) apple x and 2 B, where B is another event. So we know The conditional CDF of X given event B is defined by The conditional PDF is simply defined by Example : Let B = {X apple 10}. We want to find F X (x B). 15/3/2 Chapter 2 : Random Variables 52

Conditional CDF and PDF : Examples The previous results can be shown in the following figure. Can you calculate when? F X (x B) B = {b <Xapple a} 15/3/2 Chapter 2 : Random Variables 53

Conditional CDF and PDF : Examples Example (Poisson Conditioned on Even) : Let X be a Poisson RV with parameter µ>0. We wish to compute the conditional PMF and CDF of X given the event {X =0, 2, 4,...}, {X is even}. First observe that P[X even] is given by 1X µ k P[X =0, 2,...]= k! e µ. k=0,2,... Then for X odd, we have P[X =1, 3,...]= From these relations, we obtain 1X k=1,3,... µ k k! e µ. k 1X 0andeven µ k k! e µ k 1X 0andodd µ k k! e µ = 1X k=0 ( µ) k e µ = e 2µ k! 15/3/2 Chapter 2 : Random Variables 54

Conditional CDF and PDF : Examples and k 1 X 0andeven µ k k! e µ + k 1X 0andodd µ k k! e µ =1. Hence, P[X even] = P [X =0, 2,...]= 1 2 (1 + e 2µ ). Using the definition of conditional PMF, we obtain P X [k X even] = P[X = k, X even] P[X even] If k is even, then {X = k} is a subset of {X even}. If k is odd, {X = k} \ {X even} = ;. Hence P[X = k, X even] = P[X = k] for k even and it equals 0 for k odd. So we have ( 2µ k P X [k X even] = (1+2e µ )k! e µ, k 0 and even, 0, k odd 15/3/2 Chapter 2 : Random Variables 55

The Weighted Sum of Conditional CDFs The conditional CDF is then F X (x X even) = X p X (k X even) = all kapplex X 0applekapplex, and even 2µ k (1 + 2e µ )k! e µ The CDF can be written as a weighted sum of conditional distribution functions. Consider now that event B consists of n mutually exclusive events {A i }, i =1,...,n, defined on the same prob. Space as B. with B, {X apple x}, we immediately obtain from the total prob. formula: F X (x) = nx F X (x A i )P[A i ] i=1 The above result describes F X (x) as a weighted sum of conditional distribution functions. One way to view it is an average over all the conditional CDFs. 15/3/2 Chapter 2 : Random Variables 56

Conditional CDF and PDF : Examples Example (Defective Memory Chips) : In the automated manufacturing of computer memory chips, company Z produces one defective chip for every five good chips. The defective chips (DC) have a time of failure X that obeys the CDF F X (x DC) =(1 e x/2 )u(x) (x in months) while the time of failure for the good chips (GC) obeys the CDF F X (x GC) =(1 e x/10 )u(x) (x in months) The chips are visually indistinguishable. A chip is purchased. What is the probability that the chip will fail before six months of use? Sol : The unconditional CDF for the chip is F X (x) =F X (x DC)P [DC]+F X (x GC)P [GC] where P [DC] and P [GC] are the probabilities of selecting a defective and good chip, respectively. From the given data P [DC] = 1 and P [GC] = 5. Thus, 6 6 F X (6) = [1 e 3 ] 1 6 +[1 e 0.6 ] 5 6 =0.534 15/3/2 Chapter 2 : Random Variables 57

Bayes Formula for PDFs Consider the events B and {X = x} defined on the same probability space. Then from the definition of conditional probability, so it seems reasonable to write P[B X = x] = P [B,X = x] P [X = x] What s wrong with the above equation? The problem is that if X is a continuous RV, then P[X = x] =0. Hence it will become undefined. Nevertheless, we can compute P[B X = x] by taking appropriate limits of probabilities involving the event {x <Xapple x + x}. Thus, consider the expression P[B x <Xapple x + x] = P [x <Xapple x + x B]P [B] P [x <Xapple x + x] Then note that P[x < X apple x + x B] =F (x + x B) F (x B) 15/3/2 Chapter 2 : Random Variables 58

Bayes Formula for PDFs Dividing numerator and denominator on the right side by making x! 0, we obtain P[B X = x] = lim!0 P[B x <Xapple x + x] = f X(x B)P [B] f X (x) x and The left quantity is sometimes called the a posteriori prob. (or a posteriori density) of B given X=x. Then we can have the following result : P[B] = Z 1 1 P[B X = x]f X (x) dx How to interpret the above expression? Why? P[B] can be called the average probability of B, suggested by its form. 15/3/2 Chapter 2 : Random Variables 59

Bayes Formula for PDFs : Example Example (Detecting Closed Switch) : A signal, X, can come from one of three different sources designated as A, B, or C. The signal from A is distributed as N(-1,4); the signal from B is distributed as N(0,1) and the signal from C has an N(1,4) distribution. In order for the signal to reach its destination at R, the switch in the line must be closed. Only one switch can be closed when the signal X is observed at R, but it is unknown which switch it is. However, it is known that switch a is closed twice as often as switch b, which is closed twice as often as switch c (see the figure). 15/3/2 Chapter 2 : Random Variables 60

Bayes Formula for PDFs : Example (a) Compute P[X apple 1] (b) Given that we observe the event {X > 1}, from which source was this signal most likely? Sol : (a) Let P[A] denote the prob. that A is responsible for the observation at R. From the information about the switches we get P [A] =2P [B] =4P [C] and P [A]+2P [B]+4P [C] =1 P [A] = 4 7 P [B] = 2 7 P [C] = 1 7 Next we compute P [X apple 1] from P [X apple 1] = P [X apple 1 A]P [A]+P [X apple 1 B]P [B]+P [X apple 1 C]P [C], where P [X apple 1 A] = 1 2 15/3/2 Chapter 2 : Random Variables 61

Bayes Formula for PDFs : Example P [X apple 1 B] = 1 2 erf(1) = 0.159 P [X apple 1 C] = 1 2 erf(1) = 0.159 Hence, P [X apple 1] = 1 2 4 7 +0.159 2 7 +0.159 1 7 =0.354 (b) We wish to compute max{p [A X > 1],P[B X > 1],P[C X > 1]} Note that P [X > 1 A] =1 P [X apple 1 A] and other cases are the same. So concentrating on source A, and using Bayes rule, we get Thus, P [A X > 1] = (1 P [X apple 1 A])P [A] 1 P [X apple 1] P [B X > 1] = 0.372 P [C X > 1] = 0.186 P [A X > 1] = 0.44 (Source A was the most likely cause of the event {X > 1}.) 15/3/2 Chapter 2 : Random Variables 62

Conditional CDF and PDF 15/3/2 Chapter 2 : Random Variables 63