# IB Class Notes

## Discrete Probability Distribution

Aims: By the end of this note, you will be able to

1. calculate the expectation of a discrete probability distribution;
2. calculate the variance of a discrete probability distribution [HL but good background for SL];
3. solve problems related to discrete probability distribution.

### What is discrete probability distribution?

1. Any discrete random variable X has an associated probability distribution. A discrete probability distribution tells us what is the associated probability for each event X = xi to occur.
2. A probability distribution can be represented in (i) tabular form, (ii) graphical form, or (iii) functional form.
3. In this section, we will concentrate in discrete probability distribution.

Example 1: Let the random variable X be the number of time we obtain even value outcome from rolling a fair die three times. Represent the discrete probability distribution in (i) tabular form, (ii) graphical form, or (iii) functional form.
Tabular form:
 x 0 1 2 3 P(X=x) 1/8 3/8 3/8 1/8

Function form: P(X=x) = 3Cx (1/2)3 , x ={0,1,2,3}
Graphical form:

(HL) From the probability distribution, you should be able to construct a cumulative probability distribution or simply cumulative distribution function. When this cumulative probability distribution is also called cumulative density function (cdf) when there is a focus on probability. Obviously you can also form a step function for frequency but this should not be confused with cumulative density function (cdf). The cumulative probability P(X< x) is also represented as F(x). The table below shows how the cumulative probability is calculated and organized and the following diagram represents the cumulative density function. The height of a step at x equals the probability P(X=x). Althought there is a straight line going from , say 0 to 1, there is actually no data in this region. Also observe how the end points have been represented in this step function.
 x 0 1 2 3 P(X=x) 1/8 3/8 3/8 1/8 P(X< x) 1/8 4/8 7/8 1

4. A discrete probability function has the following features:
(a) 0 ≤ P(X=xi) ≤ 1 for all value of xi .
(b) Σi=1n P(X=xi) = P(X=x1) + P(X=x2) + ... + P(X=xn) = 1

Note that it is acceptable for P(X=xi) to be denoted by Pi.

Exercise A:
(a) Represent the discrete probability distribution of the number of Head observed from tossing a fair coin twice using tabular form.

(b)Represent the discrete probability distribution of the number of picture card (King, Queen & Jack) observed from randomly selecting three cards wihtout replacement from a pack of playing cards using tabular form.

Answers: Your tables should have these probabilities: (a) P0=1/4,P1=1/2, P2=1/4; (b) P0=38/85, P1=36/85 , P2=132/1105, P3=11/1105
5. Knowing the probability distribution is helpful but in a lot of cases we will also like to know what outcome to expect if we repeat an experiment with random outcomes many times. This expected value is simply referred to as expectation and is denoted by E(X). It is read as "the expected value of X." This E(X) can also be interpreted as the mean value of X and often denoted as μ under this interpretation.

E(X) = Σi=1n [ xiP(X=xi) ]
E(X) = Σi=1n[ x1P(X=x1) + x2P(X=x2) + ... + xnP(X=xn) ] ---------(1)

Equation (1) is actually a measure of the central tendency of X. We say that this is a measure of weighted average and can also be read as the long-run average.
Example 3:
Calculate the E(X) of the following distribution:
 x 0 1 2 3 P(X=x) 1/8 3/8 3/8 1/8
E(x) = 0(1/8)+ 1(3/8)+ 2(3/8) + 3(1/8)
= 12/8
= 3/2
Note: Since this is a discrete distribution then E(X)=3/2 cannot actuall be observed from all possible outcomes of X. Another exmple of this is fertility rate. The fertility rate of a country can be 2.1 but we cannot actually observed a woman who has 2.1 children in her life-time.
 Use of GDC. The most efficient way to obtain the E(X) from GDC is to enter [STAT] 1:EDIT [ENTER] . Enter xs into L1 and P(X=x) into L2. Press [2nd][Mode] to quit once you are finished with data-keying. [STAT]select CALC, 1:1-Var Stats [ENTER]. You will see 1-Var Stats with a blinking cursor. Enter [2nd][1][,][2nd][2][ENTER] for "L1,L2" and it is important you enter the list with xs first before comma and the list containing the probabilities. E(X) is read from or Σx. Var(X) is read from (sx)2

Example 4: The probability that it will rain in MaOnShan on any one day is 0.21. How many days of the year would you expect it to rain in MaOfShan?
Answer: E(X) = 0.21(365) , where X represents a rainy day in MaOnShan.
E(X) = 76.7 (3s.f.)

In this case, E(X) = np where n is the total sample size and p represents the probability that event A (in this case rain) for each member in the sample. What is the rationale for this formula?
E(X) = Σi=1n [ xiP(X=xi) ] but each day has the same probability to rain thus, Pi =p and xi=1 for each day of the year. Thus, E(X) = Σi=1n p = np. Actually, example 4 is a special discrete probability distribution and is known as binomial probability distribution. We will learn more about this distribution in the next section.

6. Properties of E(X).
(i) E(k)=k where k is a constant.
That is the expectation of a constant is just that constant.

(ii) E(kX)= kE(X) where k is a constant.

(iii) E(f(X)) = Σi=1n [ f(xi)P(X=xi) ] where f(x) is some real valued function of the random variable X.
If f(x)=ax+b then we have the property (iv) below.

(iv) E(aX+b) = aE(X)+E(b)
E(aX+b) = aE(x) + b, where a and b are constants.
Example 5:
7.  x 0 1 2 3 P(X=x) 1/8 1/16 1/2 5/16
Given the following probability distribution for X above find (a) E(X), (b)E(X2), (c) [E(X)]2,& (d) E(X2+2X+1).
Solutions: (a) E(X) = 0(1/8) + 1(1/16) + 2(1/2) + 3(5/16)
E(X)= (1/16) + 1 + (15/16)
E(X)= 2.

(b) E(X2) = 0(1/8) + 1(1/16) + 4(1/2) + 9(5/16)
E(X2)= (1/16) + 2 + (45/16)
E(X2)= 39/8.

(c) [E(X)]2 = 4
Note that E(X2) is not equal to [E(X)]2.

(d) E(X2+2X+1) = E(X2) + 2E(X) + 1
E(X2+2X+1) = 39/8 + 2(2) + 1
E(X2+2X+1) = 79/8.
8. Expectation has many applications in real life. One application is on game. We say that a game is fair if E(X) = 0.
That is, in the long run, we have an equal chance of winning the game. If E(X)<0 then the game is not fair because in the long run we only expect to lose.

Example 6: In a game of die, you will roll a fair six-sided die. You will be paid in dollar the even value outcome and loose the corresponding amount of dollar if you obtain an odd value outcome from your die. The table below shows your payout.
 value 1 2 3 4 5 6 payout(x) -1 2 -3 4 -5 6 P(X=x) 1/6 1/6 1/6 1/6 1/6 1/6

E(X) = -1(1/6) + 2(1/6) -3(1/6) +4(1/6) -5(1/6) +6(1/6)
Expected payout is E(X) = 1/2 >0
Thus, you will have an advantage in the game and can expect to win \$0.50 in the long run. Unfortunately, no one who has learned probability will play this game with you.
9. Recall that variance can be interpreted as the average of the squared deviations about the mean. Population variance is often denoted by s2.
s2 = Σ fi(xi-μ)2/n ; where n is the total population size, n= Σ fi
s2 = Σ (fi/n)(xi-μ)2
s2 = Σ pi (xi-μ)2; using property (iii) of E(X) above we obtain
s2 = E [ (X - μ)2 ] ---------------(2)

So Var(X) = E [ (X - μ)2 ]
= E [X2 -2Xμ+ μ2]
= E (X2) -2μE(X) + μ2
= E (X2) - μ2
Var (X) = E (X2) - [E(X)]2 ---------------(3)

10. Properties of Variable.
1. Var(k) = 0, where k is a constant.
Since k is a constant then there is no variability in this set of data. Thus Var(k) = 0.
2. Var(kX) = k2Var(X)
This can be shown by employing equations (2) and (3) above.
3. Var(aX+b) = a2Var(X)
This is a more general case of property (ii) above.

11. Example 7:
 x 10 15 20 25 30 P(X=x) 1/10 1/5 1/5 3/10 1/5

Based on this probability distribution, calculate the following:
(a) E(X) and (b) Var(X).
Solutions:
(a) E(X) =10(1/10) + 15(1/5) + 20(1/5) +25(3/10) +30(1/5)
E(X) = 1 + 3 + 4 + 7.5 + 6
E(x) = 21.5

(b) Var(X) = E(X2) - [E(X)]2
Var(X) = [(100/10) + (225/5) +(400/5) +3(625/10) + (900/5)] - (21.5)2
Var(X) = 161/4

Example 8: Given that Var(X) =3, find (a) Var(2X) and (b) Var((1/2)-X/3).
(a) Var(2X) = 22Var(X)
= 4(3)
= 12.

(b) Var((1/2)-(X/3)) = (-1/3)2Var(X)
= (1/9)(3)
= 1/3

Exercise B:
(1) Find the mean and standard deviation of the following probability distribution.

 x 1 2 3 4 5 P(X=x) 2/25 7/25 12/25 3/25 1/25

(2) Given that E(X)=1 and Var(X)=3/2, find
(a) E(2x+1);
(b) Var(3-X).

Answers: (1)E(X)=69/25, standard deviation, s=0.907(3s.f) ; (2a) 3, (2b) 3/2.

Email KokMing Lee