Variance and Standard Deviation
Christopher Croke
University of Pennsylvania
Math 115
Christopher Croke Calculus 115 This is a ”weighted average”. For a uniform distribution, i.e. 1 f (xi ) = N where N = #{xi }, then it is just the usual average:
ΣN x E(X ) = i=1 i . N
Problem: What is the expected number of heads in four tosses?
Expected value
The expected value E(X ) of a discrete random variable X with probability function f (xi ) is:
E(X ) = Σi xi · f (xi ).
Christopher Croke Calculus 115 For a uniform distribution, i.e. 1 f (xi ) = N where N = #{xi }, then it is just the usual average:
ΣN x E(X ) = i=1 i . N
Problem: What is the expected number of heads in four tosses?
Expected value
The expected value E(X ) of a discrete random variable X with probability function f (xi ) is:
E(X ) = Σi xi · f (xi ).
This is a ”weighted average”.
Christopher Croke Calculus 115 Problem: What is the expected number of heads in four tosses?
Expected value
The expected value E(X ) of a discrete random variable X with probability function f (xi ) is:
E(X ) = Σi xi · f (xi ).
This is a ”weighted average”. For a uniform distribution, i.e. 1 f (xi ) = N where N = #{xi }, then it is just the usual average:
ΣN x E(X ) = i=1 i . N
Christopher Croke Calculus 115 Expected value
The expected value E(X ) of a discrete random variable X with probability function f (xi ) is:
E(X ) = Σi xi · f (xi ).
This is a ”weighted average”. For a uniform distribution, i.e. 1 f (xi ) = N where N = #{xi }, then it is just the usual average:
ΣN x E(X ) = i=1 i . N
Problem: What is the expected number of heads in four tosses?
Christopher Croke Calculus 115 Problem: Consider our random variable X which is the sum of the coordinates of a point chosen randomly from [0, 1] × [0, 1]? What is E(X )?
Expected value of a continuous random variable
For a continuous random variable with probability density function f (x) on [A, B] we have:
Z B E(X ) = xf (x)dx. A
Christopher Croke Calculus 115 Expected value of a continuous random variable
For a continuous random variable with probability density function f (x) on [A, B] we have:
Z B E(X ) = xf (x)dx. A
Problem: Consider our random variable X which is the sum of the coordinates of a point chosen randomly from [0, 1] × [0, 1]? What is E(X )?
Christopher Croke Calculus 115 The next one is the variance Var(X ) = σ2(X ). The square root of the variance σ is called the Standard Deviation.
For continuous random variable X with probability density function f (x) defined on [A, B] we saw:
Z B E(X ) = xf (x)dx. A (note that this does not always exist if B = ∞.) The variance will be: Z B σ2(X ) = Var(X ) = E((X − E(X ))2) = (x − E(X ))2f (x)dx. A
Variance
The first first important number describing a probability distribution is the mean or expected value E(X ).
Christopher Croke Calculus 115 For continuous random variable X with probability density function f (x) defined on [A, B] we saw:
Z B E(X ) = xf (x)dx. A (note that this does not always exist if B = ∞.) The variance will be: Z B σ2(X ) = Var(X ) = E((X − E(X ))2) = (x − E(X ))2f (x)dx. A
Variance
The first first important number describing a probability distribution is the mean or expected value E(X ). The next one is the variance Var(X ) = σ2(X ). The square root of the variance σ is called the Standard Deviation.
Christopher Croke Calculus 115 (note that this does not always exist if B = ∞.) The variance will be: Z B σ2(X ) = Var(X ) = E((X − E(X ))2) = (x − E(X ))2f (x)dx. A
Variance
The first first important number describing a probability distribution is the mean or expected value E(X ). The next one is the variance Var(X ) = σ2(X ). The square root of the variance σ is called the Standard Deviation.
For continuous random variable X with probability density function f (x) defined on [A, B] we saw:
Z B E(X ) = xf (x)dx. A
Christopher Croke Calculus 115 The variance will be: Z B σ2(X ) = Var(X ) = E((X − E(X ))2) = (x − E(X ))2f (x)dx. A
Variance
The first first important number describing a probability distribution is the mean or expected value E(X ). The next one is the variance Var(X ) = σ2(X ). The square root of the variance σ is called the Standard Deviation.
For continuous random variable X with probability density function f (x) defined on [A, B] we saw:
Z B E(X ) = xf (x)dx. A (note that this does not always exist if B = ∞.)
Christopher Croke Calculus 115 Variance
The first first important number describing a probability distribution is the mean or expected value E(X ). The next one is the variance Var(X ) = σ2(X ). The square root of the variance σ is called the Standard Deviation.
For continuous random variable X with probability density function f (x) defined on [A, B] we saw:
Z B E(X ) = xf (x)dx. A (note that this does not always exist if B = ∞.) The variance will be: Z B σ2(X ) = Var(X ) = E((X − E(X ))2) = (x − E(X ))2f (x)dx. A
Christopher Croke Calculus 115 Variance
The first first important number describing a probability distribution is the mean or expected value E(X ). The next one is the variance Var(X ) = σ2(X ). The square root of the variance σ is called the Standard Deviation.
For continuous random variable X with probability density function f (x) defined on [A, B] we saw:
Z B E(X ) = xf (x)dx. A (note that this does not always exist if B = ∞.) The variance will be: Z B σ2(X ) = Var(X ) = E((X − E(X ))2) = (x − E(X ))2f (x)dx. A
Christopher Croke Calculus 115 Alternative formula for variance: σ2 = E(X 2) − µ2. Why?
E((X − µ)2) = E(X 2 − 2µX + µ2) = E(X 2) + E(−2µX ) + E(µ2)
= E(X 2) − 2µE(X ) + µ2 = E(X 2) − 2µ2 + µ2 = E(X 2) − µ2.
Problem:(uniform probability on an interval) Let X be the random variable you get when you randomly choose a point in [0, B]. a) find the probability density function f . b) find the cumulative distribution function F (x). c) find E(X ) and Var(X ) = σ2.
Christopher Croke Calculus 115 Why?
E((X − µ)2) = E(X 2 − 2µX + µ2) = E(X 2) + E(−2µX ) + E(µ2)
= E(X 2) − 2µE(X ) + µ2 = E(X 2) − 2µ2 + µ2 = E(X 2) − µ2.
Problem:(uniform probability on an interval) Let X be the random variable you get when you randomly choose a point in [0, B]. a) find the probability density function f . b) find the cumulative distribution function F (x). c) find E(X ) and Var(X ) = σ2.
Alternative formula for variance: σ2 = E(X 2) − µ2.
Christopher Croke Calculus 115 E((X − µ)2) = E(X 2 − 2µX + µ2) = E(X 2) + E(−2µX ) + E(µ2)
= E(X 2) − 2µE(X ) + µ2 = E(X 2) − 2µ2 + µ2 = E(X 2) − µ2.
Problem:(uniform probability on an interval) Let X be the random variable you get when you randomly choose a point in [0, B]. a) find the probability density function f . b) find the cumulative distribution function F (x). c) find E(X ) and Var(X ) = σ2.
Alternative formula for variance: σ2 = E(X 2) − µ2. Why?
Christopher Croke Calculus 115 = E(X 2) + E(−2µX ) + E(µ2)
= E(X 2) − 2µE(X ) + µ2 = E(X 2) − 2µ2 + µ2 = E(X 2) − µ2.
Problem:(uniform probability on an interval) Let X be the random variable you get when you randomly choose a point in [0, B]. a) find the probability density function f . b) find the cumulative distribution function F (x). c) find E(X ) and Var(X ) = σ2.
Alternative formula for variance: σ2 = E(X 2) − µ2. Why?
E((X − µ)2) = E(X 2 − 2µX + µ2)
Christopher Croke Calculus 115 = E(X 2) − 2µE(X ) + µ2 = E(X 2) − 2µ2 + µ2 = E(X 2) − µ2.
Problem:(uniform probability on an interval) Let X be the random variable you get when you randomly choose a point in [0, B]. a) find the probability density function f . b) find the cumulative distribution function F (x). c) find E(X ) and Var(X ) = σ2.
Alternative formula for variance: σ2 = E(X 2) − µ2. Why?
E((X − µ)2) = E(X 2 − 2µX + µ2) = E(X 2) + E(−2µX ) + E(µ2)
Christopher Croke Calculus 115 Problem:(uniform probability on an interval) Let X be the random variable you get when you randomly choose a point in [0, B]. a) find the probability density function f . b) find the cumulative distribution function F (x). c) find E(X ) and Var(X ) = σ2.
Alternative formula for variance: σ2 = E(X 2) − µ2. Why?
E((X − µ)2) = E(X 2 − 2µX + µ2) = E(X 2) + E(−2µX ) + E(µ2)
= E(X 2) − 2µE(X ) + µ2 = E(X 2) − 2µ2 + µ2 = E(X 2) − µ2.
Christopher Croke Calculus 115 b) Find σ2. It is easier in this case to use the alternative definition of σ2: Z B σ2 = E(X 2) − E(X )2 = x2f (x)dx − E(X )2. A
Problem: Consider our random variable X which is the sum of the coordinates of a point chosen randomly from [0; 1] × [0; 1]? What is Var(X )?
Variance - Continuous case
Problem Consider the problem of the age of a cell in a culture. We had the probability density function was f (x) = 2ke−kx on ln(2) [0, T ] where k = T . a) Find E(X ).
Christopher Croke Calculus 115 Problem: Consider our random variable X which is the sum of the coordinates of a point chosen randomly from [0; 1] × [0; 1]? What is Var(X )?
Variance - Continuous case
Problem Consider the problem of the age of a cell in a culture. We had the probability density function was f (x) = 2ke−kx on ln(2) [0, T ] where k = T . a) Find E(X ). b) Find σ2. It is easier in this case to use the alternative definition of σ2: Z B σ2 = E(X 2) − E(X )2 = x2f (x)dx − E(X )2. A
Christopher Croke Calculus 115 Variance - Continuous case
Problem Consider the problem of the age of a cell in a culture. We had the probability density function was f (x) = 2ke−kx on ln(2) [0, T ] where k = T . a) Find E(X ). b) Find σ2. It is easier in this case to use the alternative definition of σ2: Z B σ2 = E(X 2) − E(X )2 = x2f (x)dx − E(X )2. A
Problem: Consider our random variable X which is the sum of the coordinates of a point chosen randomly from [0; 1] × [0; 1]? What is Var(X )?
Christopher Croke Calculus 115 Why? n E(X ) = Σn k pk qn−k k=1 k Now for any p and q this is
∂ n ∂ = p Σ pk qn−k = p (p + q)n = pn(p + q)n−1. ∂p k ∂p
For our choice of p and q this is just np.
Problem: For our ballplayer hitting .300 coming to bat 4 times a game what is the expected number of hits?
Expected value for a binomial random variable
For X a binomial random variable with parameters n and p
E(X ) = np
Christopher Croke Calculus 115 n E(X ) = Σn k pk qn−k k=1 k Now for any p and q this is
∂ n ∂ = p Σ pk qn−k = p (p + q)n = pn(p + q)n−1. ∂p k ∂p
For our choice of p and q this is just np.
Problem: For our ballplayer hitting .300 coming to bat 4 times a game what is the expected number of hits?
Expected value for a binomial random variable
For X a binomial random variable with parameters n and p
E(X ) = np
Why?
Christopher Croke Calculus 115 Now for any p and q this is
∂ n ∂ = p Σ pk qn−k = p (p + q)n = pn(p + q)n−1. ∂p k ∂p
For our choice of p and q this is just np.
Problem: For our ballplayer hitting .300 coming to bat 4 times a game what is the expected number of hits?
Expected value for a binomial random variable
For X a binomial random variable with parameters n and p
E(X ) = np
Why? n E(X ) = Σn k pk qn−k k=1 k
Christopher Croke Calculus 115 ∂ = p (p + q)n = pn(p + q)n−1. ∂p
For our choice of p and q this is just np.
Problem: For our ballplayer hitting .300 coming to bat 4 times a game what is the expected number of hits?
Expected value for a binomial random variable
For X a binomial random variable with parameters n and p
E(X ) = np
Why? n E(X ) = Σn k pk qn−k k=1 k Now for any p and q this is
∂ n = p Σ pk qn−k ∂p k
Christopher Croke Calculus 115 = pn(p + q)n−1.
For our choice of p and q this is just np.
Problem: For our ballplayer hitting .300 coming to bat 4 times a game what is the expected number of hits?
Expected value for a binomial random variable
For X a binomial random variable with parameters n and p
E(X ) = np
Why? n E(X ) = Σn k pk qn−k k=1 k Now for any p and q this is
∂ n ∂ = p Σ pk qn−k = p (p + q)n ∂p k ∂p
Christopher Croke Calculus 115 For our choice of p and q this is just np.
Problem: For our ballplayer hitting .300 coming to bat 4 times a game what is the expected number of hits?
Expected value for a binomial random variable
For X a binomial random variable with parameters n and p
E(X ) = np
Why? n E(X ) = Σn k pk qn−k k=1 k Now for any p and q this is
∂ n ∂ = p Σ pk qn−k = p (p + q)n = pn(p + q)n−1. ∂p k ∂p
Christopher Croke Calculus 115 Problem: For our ballplayer hitting .300 coming to bat 4 times a game what is the expected number of hits?
Expected value for a binomial random variable
For X a binomial random variable with parameters n and p
E(X ) = np
Why? n E(X ) = Σn k pk qn−k k=1 k Now for any p and q this is
∂ n ∂ = p Σ pk qn−k = p (p + q)n = pn(p + q)n−1. ∂p k ∂p
For our choice of p and q this is just np.
Christopher Croke Calculus 115 Expected value for a binomial random variable
For X a binomial random variable with parameters n and p
E(X ) = np
Why? n E(X ) = Σn k pk qn−k k=1 k Now for any p and q this is
∂ n ∂ = p Σ pk qn−k = p (p + q)n = pn(p + q)n−1. ∂p k ∂p
For our choice of p and q this is just np.
Problem: For our ballplayer hitting .300 coming to bat 4 times a game what is the expected number of hits?
Christopher Croke Calculus 115 How does this change if no one gets paid after 4 balls turn up white?
Expected value
Problem: Two players play a game by drawing balls (without replacement) in turn from an urn that has 2 red balls and 4 white balls in it. A player wins when he draws a red ball. The player going first will get $2 if he wins while the player going second will get $3. Would you rather go first or second or does it matter at all?
Christopher Croke Calculus 115 Expected value
Problem: Two players play a game by drawing balls (without replacement) in turn from an urn that has 2 red balls and 4 white balls in it. A player wins when he draws a red ball. The player going first will get $2 if he wins while the player going second will get $3. Would you rather go first or second or does it matter at all? How does this change if no one gets paid after 4 balls turn up white?
Christopher Croke Calculus 115 Expected value
Problem: Two players play a game by drawing balls (without replacement) in turn from an urn that has 2 red balls and 4 white balls in it. A player wins when he draws a red ball. The player going first will get $2 if he wins while the player going second will get $3. Would you rather go first or second or does it matter at all? How does this change if no one gets paid after 4 balls turn up white?
Christopher Croke Calculus 115 Note Var(X ) = E((X − µ)2). The alternative description works for the same reason as in the continuous case. i.e.
Var(X ) = E(X 2) − E(X )2
The standard deviation has the same units as X . (I.e. if X is measured in feet then so is σ.)
variance in the discrete case
If f (xi ) is the probability distribution function for a random variable with range {x1, x2, x3, ...} and mean µ = E(X ) then:
2 2 2 2 Var(X ) = σ = (x1 −µ) f (x1)+(x2 −µ) f (x2)+(x3 −µ) f (x3)+...
It is a description of how the distribution ”spreads”.
Christopher Croke Calculus 115 The alternative description works for the same reason as in the continuous case. i.e.
Var(X ) = E(X 2) − E(X )2
The standard deviation has the same units as X . (I.e. if X is measured in feet then so is σ.)
variance in the discrete case
If f (xi ) is the probability distribution function for a random variable with range {x1, x2, x3, ...} and mean µ = E(X ) then:
2 2 2 2 Var(X ) = σ = (x1 −µ) f (x1)+(x2 −µ) f (x2)+(x3 −µ) f (x3)+...
It is a description of how the distribution ”spreads”. Note Var(X ) = E((X − µ)2).
Christopher Croke Calculus 115 The standard deviation has the same units as X . (I.e. if X is measured in feet then so is σ.)
variance in the discrete case
If f (xi ) is the probability distribution function for a random variable with range {x1, x2, x3, ...} and mean µ = E(X ) then:
2 2 2 2 Var(X ) = σ = (x1 −µ) f (x1)+(x2 −µ) f (x2)+(x3 −µ) f (x3)+...
It is a description of how the distribution ”spreads”. Note Var(X ) = E((X − µ)2). The alternative description works for the same reason as in the continuous case. i.e.
Var(X ) = E(X 2) − E(X )2
Christopher Croke Calculus 115 variance in the discrete case
If f (xi ) is the probability distribution function for a random variable with range {x1, x2, x3, ...} and mean µ = E(X ) then:
2 2 2 2 Var(X ) = σ = (x1 −µ) f (x1)+(x2 −µ) f (x2)+(x3 −µ) f (x3)+...
It is a description of how the distribution ”spreads”. Note Var(X ) = E((X − µ)2). The alternative description works for the same reason as in the continuous case. i.e.
Var(X ) = E(X 2) − E(X )2
The standard deviation has the same units as X . (I.e. if X is measured in feet then so is σ.)
Christopher Croke Calculus 115 We have seen that the payout and probabilities for the first player are: Payout Probability 8 2 15 1 0 15 6 −3 15 2 The expected value was µ = − 15 . What is the variance?
Problem: Remember the game where players pick balls from an urn with 4 white and 2 red balls. The first player is paid $2 if he wins but the second player gets $3 if she wins. No one gets payed if 4 white balls are chosen.
Christopher Croke Calculus 115 2 The expected value was µ = − 15 . What is the variance?
Problem: Remember the game where players pick balls from an urn with 4 white and 2 red balls. The first player is paid $2 if he wins but the second player gets $3 if she wins. No one gets payed if 4 white balls are chosen. We have seen that the payout and probabilities for the first player are: Payout Probability 8 2 15 1 0 15 6 −3 15
Christopher Croke Calculus 115 What is the variance?
Problem: Remember the game where players pick balls from an urn with 4 white and 2 red balls. The first player is paid $2 if he wins but the second player gets $3 if she wins. No one gets payed if 4 white balls are chosen. We have seen that the payout and probabilities for the first player are: Payout Probability 8 2 15 1 0 15 6 −3 15 2 The expected value was µ = − 15 .
Christopher Croke Calculus 115 Problem: Remember the game where players pick balls from an urn with 4 white and 2 red balls. The first player is paid $2 if he wins but the second player gets $3 if she wins. No one gets payed if 4 white balls are chosen. We have seen that the payout and probabilities for the first player are: Payout Probability 8 2 15 1 0 15 6 −3 15 2 The expected value was µ = − 15 . What is the variance?
Christopher Croke Calculus 115 Problem: Remember the game where players pick balls from an urn with 4 white and 2 red balls. The first player is paid $2 if he wins but the second player gets $3 if she wins. No one gets payed if 4 white balls are chosen. We have seen that the payout and probabilities for the first player are: Payout Probability 8 2 15 1 0 15 6 −3 15 2 The expected value was µ = − 15 . What is the variance?
Christopher Croke Calculus 115 Problem: Compute E(X ) and Var(X ) where X is a random variable with probability given by the chart below: X Pr(X = x) 1 0.1 2 0.2 3 0.3 4 0.3 5 0.1
We will see later that for X a binomial random variable σ2 = npq. Problem: What is the variance of the number of hits for our batter that bats .300 and comes to the plate 4 times?
This often makes it easier to compute since we can compute µ and E(X 2) at the same time.
Christopher Croke Calculus 115 We will see later that for X a binomial random variable σ2 = npq. Problem: What is the variance of the number of hits for our batter that bats .300 and comes to the plate 4 times?
This often makes it easier to compute since we can compute µ and E(X 2) at the same time. Problem: Compute E(X ) and Var(X ) where X is a random variable with probability given by the chart below: X Pr(X = x) 1 0.1 2 0.2 3 0.3 4 0.3 5 0.1
Christopher Croke Calculus 115 Problem: What is the variance of the number of hits for our batter that bats .300 and comes to the plate 4 times?
This often makes it easier to compute since we can compute µ and E(X 2) at the same time. Problem: Compute E(X ) and Var(X ) where X is a random variable with probability given by the chart below: X Pr(X = x) 1 0.1 2 0.2 3 0.3 4 0.3 5 0.1
We will see later that for X a binomial random variable σ2 = npq.
Christopher Croke Calculus 115 This often makes it easier to compute since we can compute µ and E(X 2) at the same time. Problem: Compute E(X ) and Var(X ) where X is a random variable with probability given by the chart below: X Pr(X = x) 1 0.1 2 0.2 3 0.3 4 0.3 5 0.1
We will see later that for X a binomial random variable σ2 = npq. Problem: What is the variance of the number of hits for our batter that bats .300 and comes to the plate 4 times?
Christopher Croke Calculus 115