Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Chapter 4: Probability: The Study of Randomness (Part 3) Dr. Nahid Sultana Chapter 4 Probability: The Study of Randomness 4.1 Randomness 4.2 Probability Models 4.3 Random Variables 4.4 Means and Variances of Random Variables 4.5 General Probability Rules* 4.4 Means and Variances of Random Variables The Mean of a Random Variable The Variance of a Random Variable Rules for Means and Variances The Law of Large Numbers 3 The Mean of a Random Variable The mean of a set of observations is their arithmetic average. The mean µ of a random variable X (also called expected value of X) is the weighted average of the possible values of X, reflecting that all outcomes might not be equally likely. Mean of a Discrete Random Variable Suppose that X is a discrete random variable whose probability distribution The mean of X is found by multiplying each possible value of X by its probability, then adding all the products: μ x = E ( X ) = x1 p1 + x2 p2 + x3 p3 + ... + xk pk = ∑ xi pi 4 Example: Mean of a discrete random variable Consider tossing a fair coin 3 times. Define X = the number of heads obtained. Value 0 1 2 3 Probability 1/8 3/8 3/8 1/8 X = 0: TTT X = 1: HTT THT TTH X = 2: HHT HTH THH X = 3: HHH The mean µ of X is μ x = x1 p1 + x2 p2 + x3 p3 + ... + xk pk = (0 *1 / 8) + (1* 3 / 8) + (2 * 3 / 8) + (3 *1 / 8) = 12 / 8 = 3 / 2 = 1.5 5 The Mean of a Random Variable Mean of a Continuous Random Variable If X is a continuous random variable probability distribution f(x) then the mean or expected value of X is found by: μx = E ( X ) = ∞ ∫ xf ( x)dx −∞ Example: Suppose we have a continuous random variable X with probability density function given by Calculate E(X). Solution: 6 Variance of a Random Variable Since we use the mean as the measure of center for a discrete random variable, we’ll use the standard deviation as our measure of spread. Variance of a Discrete Random Variable Suppose that X is a discrete random variable whose probability distribution is: and that µX is the mean of X. The variance of X is found by multiplying each squared deviation of X by its probability and then adding all the products: Var ( X ) = σ X2 = ( x1 − µ X ) 2 p1 + ( x2 − µ X ) 2 p2 + ... + ( xk − µ X ) 2 pk = ∑ ( xi − µ X ) 2 pi The standard deviation of a random variable is the square root of the variance. 7 Example: Variance of a discrete random variable Consider tossing a fair coin 3 times. Define X = the number of heads obtained. Value 0 1 2 3 Probability 1/8 3/8 3/8 1/8 The mean µ of X is 2 2 X = 0: TTT X = 1: HTT THT TTH X = 2: HHT HTH THH X = 3: HHH μX = 3 / 2 2 2 σ X = ( x1 − µ ) p1 + ( x2 − µ X ) p2 + ... + ( xk − µ X ) pk X 2 2 2 2 = (0 − 3 / 2) * 1 / 8 + (1 − 3 / 2) * 3 / 8 + ( 2 − 3 / 2) * 3 / 8 + (3 − 3 / 2) * 1 / 8 = 9 / 4 *1 / 8 + 1 / 4 * 3 / 8 + 1 / 4 * 3 / 8 + 9 / 4 *1 / 8 = 2(9 / 32) + 2(3 / 32) = 2(12 / 32) = 24 / 32 = 3 / 4 = 0.75 8 The Variance of a Random Variable Variance of a Continuous Random Variable If X is a continuous random variable probability distribution f(x) then the variance of X is given by: ∞ Var ( X ) = σ X = ∫ ( X − µ x ) f ( x)dx 2 2 −∞ Theorem: σ X = E( X 2 ) − E( X ) 2 Example: Suppose we have a continuous random variable X with probability density function given by Calculate Var(X). Solution: 9 Rules for Means and Variance Rules for Means and Variance Rule 1: If X is a random variable and a and b are fixed numbers, then: µa+bX = a + bµX σ2a+bX = b2σ2X Rule 2: If X and Y are two independent random variables, then: µX+Y = µX + µY σ2X+Y = σ2X + σ2Y Rule 3: If X and Y are not independent but have correlation ρ, then: µX+Y = µX + µY σ2X+Y = σ2X + σ2Y + 2ρσXσY 10 Example: Investment. You invest 20% of your funds in Treasury bills and 80% in an “index fund” that represents all U.S. common stocks. Your rate of return of over time is the proportional to that of the T-bills (X) and of the index fund (Y), such that R = 0.2 X + 0.8 Y. The Law of Large Numbers Suppose we would like to estimate an unknown µ. We could select an SRS and calculate sample mean . However, a different SRS would probably yield a different sample mean. How can x be an accurate estimate of μ? After all, different random samples would produce different values of x. If we keep on taking larger and larger samples, the statistic x is guaranteed to get closer and closer to the parameter µ . The law of large numbers says that as the number of observations drawn increases, the sample mean of the observed values gets closer and closer to the mean µ of the population. 12