Open oldoc63 opened 1 year ago
$$ Var(X+a)=Var(X) $$
This is because a variance of a constant is 0 (There is no range for a single number). Adding a constant to a random variable does not add any additional variance. Let’s take the previous example with the teacher curving grades: though the expected value (or average) of the test changes from 78 to 80, the spread and dispersion (or variance) of the test scores stays the same.
$$ Var(aX)=a^2Var(X) $$
$$ Var(X+Y)=Var(X)+Var(Y) $$
This principle ONLY holds if the X and Y are independent random variables. Let’s say that X is the event getting a heads on a single fair coin flip, and Y is the event rolling a 2 on a fair six-sided die:
$$ Var(X)=0.5∗(1−0.5)=0.25 $$
$$ Var(Y)=0.167∗(1−0.167)=0.139 $$
$$ Var(X+Y)=Var(X)+Var(Y)=0.25+0.139=0.389 $$
At the end of the year, your company's boss decides that the end-of-year bonus will be 8% of each employee's salary. If the average salary in the company is $75000, what is the expected value (or average value) of the bonuses?
The number of goals a soccer team scores follows the Poisson distribution with lambda equal to four. Set num_goals equal to 100 random draws from games following this Poisson distribution. Use stats.poisson.rvs() method from the scipy library with lambda equal to 4 and 100 random draws.
Someone thinks that the soccer team is being robbed of goals each game and decides that they are going to count each goal from this team as 2 goals.
Then calculate and print the variance of num_goals_2 to see that the variance of num_goals_2 is equal to the variance of num_goals times two squared (same as times four).
Let's practice calculating different values from the Poisson distribution:
There are several properties of expectation and variance that are consistent though all distributions:
Properties of Expectation
$$ E(X + Y) = E(X) + E(Y) $$
For example, if we wanted to count the total number of heads between 10 fair quarter flips and 6 fair nickel flips, the expected value combined would be 5 heads (from the quarters) and 3 heads (from the nickels) so 8 heads overall.
$$ E(aX) = aE(X) $$
For example, the expected number of heads from 10 fair coin flips is 5. If we wanted to calculate the number of heads fro this event run 4 times (40 total coin flips), the expected value would now be 4 times the original expected value, or 20.
a
to the distribution changes the expected value by the valuea
:$$ E(X+a)=E(X)+a $$
Let’s say that a test was given and graded, and the average grade was 78 out of 100 points. If the teacher decided to curve the grade by adding 2 points to everyone’s grade, the average would now be 80 points.