
Linearity of Expectation in Random Variables
Explore the concept of linearity of expectation in random variables, including its definition, intuition, and proof. Discover how this concept applies to multiple random variables and scenarios in a practical example involving fishing.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Linearity of Expectation CSE 312 Spring 21 Lecture 12
Expectation Expectation The expectation (or expected value ) of a random variable ? is: ? ? = ? (? = ?) ? Intuition: The weighted average of values ? could take on. Weighted by the probability you actually see them.
Linearity of Expectation Linearity of Expectation For any two random variables ? and ?: ? ? + ? = ? ? + ?[?] Note:? and ? do not have to be independent Extending this to n random variables, ?1,?2, ,?? ? ?1+ ?2+ + ?? = ? ?1+ ? ?2+ + ? ?? This can be proven by induction.
Linearity of Expectation - Proof Linearity of Expectation For any two random variables ? and ?: ? ? + ? = ? ? + ?[?] Note:? and ? do not have to be independent ? ? + ? = ??(?)(? ? + ?(?)) = ?? ? ? ? + ?? ? ? ? = ? ? + ? ?
Linearity of Expectation Linearity of Expectation For any two random variables ? and ?: ? ? + ? = ? ? + ?[?] More generally, for random variables ? and ? and scalars ?,? and ? : ? ?? + ?? + ? = ?? ? + ?? ? + ?
Fishy Business Say you and your friend go fishing everyday. You catch X fish, with ? ? = 3 Your friend catches Y fish, with ? ? = 7 How many fish do both of you bring on an average day?
Fishy Business Say you and your friend go fishing everyday. You catch X fish, with ? ? = 3 Your friend catches Y fish, with ? ? = 7 How many fish do both of you bring on an average day? Let Z be the r.v. representing the total number of fish you both catch ? ? = ? ? + ? = ? ? + ? ? = 3 + 7 = 10
Fishy Business Say you and your friend go fishing everyday. You catch X fish, with ? ? = 3 Your friend catches Y fish, with ? ? = 7 How many fish do both of you bring on an average day? Let Z be the r.v. representing the total number of fish you both catch ? ? = ? ? + ? = ? ? + ? ? = 3 + 7 = 10 You can sell each for $10, but you need $15 for expenses. What is your average profit?
Fishy Business Say you and your friend go fishing everyday. You catch X fish, with ? ? = 3 Your friend catches Y fish, with ? ? = 7 How many fish do both of you bring on an average day? Let Z be the r.v. representing the total number of fish you both catch ? ? = ? ? + ? = ? ? + ? ? = 3 + 7 = 10 You can sell each for $10, but you need $15 for expenses. What is your average profit? ? 10? 15 = 10? ? 15 = 100 15 = 85
Coin Tosses If we flip a coin twice, what is the expected number of heads that come up?
Coin Tosses If we flip a coin twice, what is the expected number of heads that come up? Let ? be the r.v. representing the total number of heads 1 4 if ? = 0 1 2 if ? = 1 1 4 if ? = 2 ??? =
Coin Tosses If we flip a coin twice, what is the expected number of heads that come up? Let ? be the r.v. representing the total number of heads 1 4 if ? = 0 1 2 if ? = 1 1 4 if ? = 2 ??? = ? ? = ?? ? ? ? =1 4 0 +1 2 1 +1 4 2 = ?
Repeated Coin Tosses Now what if the probability of flipping a heads was p p and that we wanted to find the total number of heads flipped when we flip the coin n n times? If ? is the r.v. representing the total number of heads that come up. ? ???1 ?? ? ? ? ? ? = ?=0 ? (? = ?) = ?=0 ? ? ? ? ??(1 ?)? ? = ? ?=1
Repeated Coin Tosses Now what if the probability of flipping a heads was p p and that we wanted to find the total number of heads flipped when we flip the coin n n times? ? ???1 ?? ? ? ? ? ? = ?=0 ? (? = ?) = ?=0 ? ???(1 ?)? ? = ?? ?=1 ? ? = ?=1 ? ? 1 ? 1?? 1(1 ?)? ? ? 1 ? 1 ? ??(1 ?)? 1 ? = ??(? + (1 ?))? 1= ?? ? ?= ?? 1 ? ? ? 1 = ?? ?=0
Indicator Random Variables For any event ?, we can define the indicator random variable ? for ? ? = 1 if event A occurs otherwise ? = 1 = ? ? = 0 = 1 (?) 0
Repeated Coin Tosses (contd) The probability of flipping a heads is p p and we wanted to find the total number of heads flipped when we flip the coin n n times?
Repeated Coin Tosses (contd) The probability of flipping a heads is p p and we wanted to find the total number of heads flipped when we flip the coin n n times? Let ? be the total number of heads Let us define ??as follows: ??= 1 = ? ??= 0 = 1 ? ??= 1 if the ith coin flip is heads otherwise 0 ? ?? = 1 ? + 0 1 ?
Repeated Coin Tosses (contd) The probability of flipping a heads is p p and we wanted to find the total number of heads flipped when we flip the coin n n times? Let ? be the total number of heads Let us define ??as follows: ??= 1 0 ??= 1 = ? ??= 0 = 1 ? if the ith coin flip is heads otherwise ? ?? = 1 ? + 0 (1 ?) By Linearity of Expectation, ? ? = ? ?=1 ?[??] =? ?1+ ? ?2+ + ? ?? = ?? ? ? ?? = ?=1
Computing complicated expectations We often use these three steps to solve complicated expectations 1. 1. Decompose Decompose: : Finding the right way to decompose the random variable into sum of simple random variables ? = ?1+ ?2+ + ?? 2. 2. LOE LOE: : Apply Linearity of Expectation ? ? = ? ?1+ ? ?2+ + ?[??] 3. 3. Conquer Conquer: : Compute the expectation of each ?? Often ?? are indicator random variables
Pairs with the same birthday In a class of m m students, on average how many pairs of people have the same birthday? Decompose: Decompose: LOE: LOE: Conquer: Conquer:
Pairs with the same birthday In a class of m m students, on average how many pairs of people have the same birthday? Decompose: Decompose: Let us define ?as the number of pairs with the same birthday Let us define ???as follows: ???= 1 0 LOE: LOE: ? 2??? if the i,j have the same bithday otherwise? = ?,? ? 2? ??? ? ? = ?,? Conquer: Conquer: 365 1 ? ??? = ? ???= 1 = 365 365= ? 2 365 ? 2 1 ? ? = ? ??? = 365
Rotating the table n n people are sitting around a circular table. There is a name tag in each place. Nobody is sitting in front of their own name tag. Rotate the table by a random number k k of positions between 1 and n-1 (equally likely) ? is the number of people that end up in front of their own name tag. Find Decompose: Decompose: Find ? ? . . LOE: LOE: Conquer: Conquer:
Rotating the table n n people are sitting around a circular table. There is a name tag in each place. Nobody is sitting in front of their own name tag. Rotate the table by a random number k k of positions between 1 and n-1 (equally likely) ? is the number of people that end up in front of their own name tag. Find Decompose: Decompose:Let us define ??as follows: Find ? ? . . ??= 1 if person i sits infront of their own name tag otherwise? = ?=1 ??? 0 LOE: LOE: ?? ?? ? ? = ?=1 Conquer: Conquer: 1 ? ? ?? = ? ??= 1 = ? 1 ? ? = ? ? ?? = ? 1
Frogger A frog starts on a 1-dimensional number line at 0. At each second, independently, the frog takes a unit step right with probability ?1, to the left with probability ?2, and doesn't move with probability ?3, where ?1+ ?2+ ?3= 1. After 2 seconds, let ? be the location of the frog. Find Find ? ? . .
Frogger Brute Force A frog starts on a 1-dimensional number line at 0. At each second, independently, the frog takes a unit step right with probability ??, to the left with probability ??, and doesn't move with probability ??, where ??+ ??+ ??= 1. After 2 seconds, let ? be the location of the frog. Find ?? ? = 2 2???? ? = 1 2????+ ??2 ? = 0 2???? ? = 1 ?? ? = 2 0 otherwise Find ? ? . . 2 ??? = 2 2+ 1 2????+ 0 2????+ ??2+ 1 2????+ (2)?? 2= ?(?? ??) ? ? = ?? ? ? ? = ( 2)??
Frogger LOE A frog starts on a 1-dimensional number line at 0. At each second, independently, the frog takes a unit step right with probability ??, to the left with probability ??, and doesn't move with probability ??, where ??+ ??+ ??= 1. After 2 seconds, let ? be the location of the frog. Find Find ? ? . . Let us define ??as follows: 1 0 1 if the frog moved left on the ?th step otherwise ??= if the frog moved right on the ?th step ? ?? = 1 ??+ 1 ??+ 0 ??= (?? ??) By Linearity of Expectation, 2 2 ? ? = ? ?=1 ?? = ?=1 ?[??] = ?(?? ??)