Docsity

Understanding Expected Values in Probability and Statistics: Week 10 in Discrete Math, Slides of Discrete Mathematics

Toggle sidebar
bg1
4/2/2013
1
April 2, 2013 Applied Discrete Mathematics
Week 10: Advanced Counting
1
Expected Values
Once we have defined a random variable for our
experiment, we can statistically analyze the
outcomes of the experiment.
For example, we can ask: What is the average value
(called the expected value) of a random variable
when the experiment is carried out a large number of
times?
Can we just calculate the arithmetic mean across all
possible values of the random variable?
April 2, 2013 Applied Discrete Mathematics
Week 10: Advanced Counting
2
Expected Values
No, we cannot, since it is possible that some
outcomes are more likely than others.
For example, assume the possible outcomes of an
experiment are 1 and 2 with probabilities of 0.1 and
0.9, respectively.
Is the average value 1.5?
No, since 2 is much more likely to occur than 1, the
average must be larger than 1.5.
April 2, 2013 Applied Discrete Mathematics
Week 10: Advanced Counting
3
Expected Values
Instead, we have to calculate the weighted sum of
all possible outcomes, that is, each value of the
random variable has to be multiplied with its
probability before being added to the sum.
In our example, the average value is given by
0.1โ‹…1 + 0.9โ‹…2 = 0.1 + 1.8 = 1.9.
Definition: The expected value (or expectation) of
the random variable X(s) on the sample space S is
equal to:
E(X) = โˆ‘sโˆˆSp(s)X(s).
April 2, 2013 Applied Discrete Mathematics
Week 10: Advanced Counting
4
Expected Values
Example: Let X be the random variable equal to the
sum of the numbers that appear when a pair of dice
is rolled.
There are 36 outcomes (= pairs of numbers from 1
to 6).
The range of X is {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}.
Are the 36 outcomes equally likely?
Yes, if the dice are not biased.
Are the 11 values of X equally likely to occur?
No, the probabilities vary across values.
April 2, 2013 Applied Discrete Mathematics
Week 10: Advanced Counting
5
Expected Values
P(X = 2) = 1/36
P(X = 3) = 2/36 = 1/18
P(X = 4) = 3/36 = 1/12
P(X = 5) = 4/36 = 1/9
P(X = 6) = 5/36
P(X = 7) = 6/36 = 1/6
P(X = 8) = 5/36
P(X = 9) = 4/36 = 1/9
P(X = 10) = 3/36 = 1/12
P(X = 11) = 2/36 = 1/18
P(X = 12) = 1/36
April 2, 2013 Applied Discrete Mathematics
Week 10: Advanced Counting
6
Expected Values
E(X) = 2โ‹…(1/36) + 3โ‹…(1/18) + 4โ‹…(1/12) + 5โ‹…(1/9) +
6โ‹…(5/36) + 7โ‹…(1/6) + 8โ‹…(5/36) + 9โ‹…(1/9) +
10โ‹…(1/12) + 11โ‹…(1/18) + 12โ‹…(1/36)
E(X) = 7
This means that if we roll the dice many times, sum
all the numbers that appear and divide the sum by
the number of trials, we expect to find a value of 7.
Docsity.com
pf2

Partial preview of the text

Download Understanding Expected Values in Probability and Statistics: Week 10 in Discrete Math and more Slides Discrete Mathematics in PDF only on Docsity!

April 2, 2013 Applied Discrete MathematicsWeek 10: Advanced Counting 1

Expected Values

Once we have defined a random variable for our experiment, we can statistically analyze the outcomes of the experiment.

For example, we can ask: What is the average value (called the expected value ) of a random variable when the experiment is carried out a large number of times?

Can we just calculate the arithmetic mean across all possible values of the random variable?

April 2, 2013 Applied Discrete MathematicsWeek 10: Advanced Counting 2

Expected Values

No, we cannot, since it is possible that some outcomes are more likely than others.

For example, assume the possible outcomes of an experiment are 1 and 2 with probabilities of 0.1 and 0.9, respectively.

Is the average value 1.5?

No, since 2 is much more likely to occur than 1, the average must be larger than 1.5.

April 2, 2013 Applied Discrete MathematicsWeek 10: Advanced Counting 3

Expected Values

Instead, we have to calculate the weighted sum of all possible outcomes, that is, each value of the random variable has to be multiplied with its probability before being added to the sum.

In our example, the average value is given by 0.1โ‹…1 + 0.9โ‹…2 = 0.1 + 1.8 = 1.9.

Definition: The expected value (or expectation) of the random variable X(s) on the sample space S is equal to:

E(X) = โˆ‘sโˆˆSp(s)X(s).

April 2, 2013 Applied Discrete MathematicsWeek 10: Advanced Counting 4

Expected Values

Example: Let X be the random variable equal to the sum of the numbers that appear when a pair of dice is rolled. There are 36 outcomes (= pairs of numbers from 1 to 6). The range of X is {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}.

Are the 36 outcomes equally likely? Yes, if the dice are not biased. Are the 11 values of X equally likely to occur? No, the probabilities vary across values.

April 2, 2013 Applied Discrete MathematicsWeek 10: Advanced Counting 5

Expected Values

P(X = 2) = 1/

P(X = 3) = 2/36 = 1/

P(X = 4) = 3/36 = 1/

P(X = 5) = 4/36 = 1/

P(X = 6) = 5/

P(X = 7) = 6/36 = 1/

P(X = 8) = 5/

P(X = 9) = 4/36 = 1/

P(X = 10) = 3/36 = 1/

P(X = 11) = 2/36 = 1/

P(X = 12) = 1/

April 2, 2013 Applied Discrete MathematicsWeek 10: Advanced Counting 6

Expected Values

E(X) = 2โ‹…(1/36) + 3โ‹…(1/18) + 4โ‹…(1/12) + 5โ‹…(1/9) +

E(X) = 7

This means that if we roll the dice many times, sum all the numbers that appear and divide the sum by the number of trials, we expect to find a value of 7.

Docsity.com

April 2, 2013 Applied Discrete MathematicsWeek 10: Advanced Counting 7

Expected Values

Theorem: If X and Y are random variables on a sample space S, then E(X + Y) = E(X) + E(Y). Furthermore, if Xi, i = 1, 2, @, n with a positive integer n, are random variables on S, then E(X 1 + X 2 + @ + Xn) = E(X 1 ) + E(X 2 ) + @ + E(Xn). Moreover, if a and b are real numbers, then E(aX + b) = aE(X) + b.

Note the typo in the textbook!

April 2, 2013 Applied Discrete MathematicsWeek 10: Advanced Counting 8

Expected Values

Knowing this theorem, we could now solve the previous example much more easily:

Let X 1 and X 2 be the numbers appearing on the first and the second die, respectively.

For each die, there is an equal probability for each of the six numbers to appear. Therefore, E(X 1 ) = E(X 2 ) = (1 + 2 + 3 + 4 + 5 + 6)/6 = 7/2.

We now know that E(X 1 + X 2 ) = E(X 1 ) + E(X 2 ) = 7.

April 2, 2013 Applied Discrete MathematicsWeek 10: Advanced Counting 9

Expected Values

We can use our knowledge about expected values to compute the average-case complexity of an algorithm. Let the sample space be the set of all possible inputs a 1 , a 2 , @, an, and the random variable X assign to each aj the number of operations that the algorithm executes for that input. For each input aj, the probability that this input occurs is given by p(aj). The algorithmโ€™s average-case complexity then is:

E(X) = โˆ‘j=1,@,np(aj)X(aj)

April 2, 2013 Applied Discrete MathematicsWeek 10: Advanced Counting 10

Expected Values

However, in order to conduct such an average-case analysis, you would need to find out:

  • the number of steps that the algorithms takes for any (!) possible input, and
  • the probability for each of these inputs to occur. For most algorithms, this would be a highly complex task, so we will stick with the worst-case analysis. In the textbook (page 283 in the 4th^ Edition, page 384 in the 5th^ Edition , page 431 in the 6th^ Edition , page 482 in the 7th^ Edition), an average-case analysis of the linear search algorithm is shown.

Docsity.com