Sei sulla pagina 1di 6

Discrete Random Variables Exercises and Solutions

For any questions: Alp Eren AKYÜZ – alperen.akyuz@boun.edu.tr


NOTE: The purpose of these exercises is to make you familiar with the Properties of the
Discrete Random Variables. Please note any questions you may have during the first
reading, and ask me when you get the chance

Expected Value
Expected value is a weighted average of the values in a data set. This weights may be
priorities, importance levels etc. In here the weights are the probabilities of the observations.
You can think of the expected value as a general formula that corresponds to what you have
learned as “the arithmetic mean”, earlier in the course. Expected value, is best explained by
working through an example, so consider the following question:

Question 1: You are playing a free lottery, which you will win with the probability p=0.1
and the prize is 100$. What is the expected value of a single lottery?

Answer 1: Construct a simple payoff diagram:


0.1  100
0.9  0
What happens if you play this lottery over and over for a long time? In a fair game,
you expect to win 10% of the time and los 90% of the time. If you divide the total money you
gain by the total number of times you play the lottery, you calculate the expected value:
TotalMoneyGained
E  Money   E  X  
TotalLotteriesPlayed
n  0.1100  n  0.9  0

n
n  0.1100  n  0.9  0

n
N
  0.1100   0.9  0  10   P  X i  X i
i 1

Notice that you never gain 10$ by playing this lottery just one time: you either get 0$
or 100$. So if the probability of having 10$ is zero, why do we use the expected value? It is
safe to use the expected value, because it is just used for representation purposes, i.e.
summarizing the data. It need not be exactly in the data set.
Special Case - Arithmetic Mean: Arithmetic Mean is a weighted average of a data set,
1
where the weights are all the same and equal to . We can use the expected value formula
N
to prove this:
N
1
 P X  X
i 1
i i and P  X i  
N
N N
1
  P  Xi  Xi   Xi
i 1 i 1 N
N
1

N
X
i 1
i

X i
 i 1
q.e.d .
N

Calculating the expected value of a data set with a scientific calculator:


Let the data set be: 100,120,140 , and the corresponding probabilities be: 0.2, 0.3, 0.5 .

You type in:

100 0.2 120 0.3 140 0.5

Variance of a Discrete Random Variable:


The formula is nearly the same as the variance formula for non-random variables. In here
you weigh the square of differences with the probabilities:
N
var  X    X2    X i  E  X i   P  X i 
2

i 1

For the data set 100,120,140 and probabilities 0.2, 0.3, 0.5 :
You type in:

100 126 2 .2

120 126 2 .3

140 126 2 .5

OR alternatively, you can pre-compute the differences in a simple table then apply the
formula. This is easier than the previous one:

Xi  E  Xi 
 
100  126  26
120  126  6
140  126  14

26 2 .2

6 2 .3

14 2 .5

Covariance of two data sets with random variables:


Covariance is a measure of dependency between two data sets. Important implications are:

 If X and Y are independent  cov  X , Y   0 .

 If cov  X , Y   0  X and Y are NOT independent.

 If cov  X , Y   0  X and Y are independent. (CAREFUL HERE!!!)


N
cov  X , Y    XY    X i  E  X i   Yi  E Yi   P  X iYi 
i 1
Let the data sets be X  100,120 and Y  160,150 and the contingency table be:

160 150 Total


100 0.12 0.18 0.30
120 0.28 0.42 0.70
Total 0.40 0.60 1.00

It is easier to calculate if you pre-compute the differences by constructing simple tables:


Xi Yi Xi  E  Xi  Yi  E Yi 
100 160 -14 6
120 150 6 -4
E  X i   114 E Yi   154 - -

 X i  E  X i   Yi  E Yi   6 -4

-14 -84 (0.12) 56 (0.18)


6 36 (0.28) -24 (0.42)

Now we can use the calculator:

You type in:

84 .12

56 .18

36 .28 24 .42

You may comment as the following: The covariance between the variables X and Y is
negative but not relatively large. So it can be said that these variables move in opposite
directions; but weakly.
Portfolio Expected Return and Expected Risk:
In our investment decision we prefer to diversify, since diversification reduces our
exposure to risk. In real life the exact situation is a bit more complicated; but for now just
reduce your attention to a world in which there are only two stocks, X and Y. Suppose X is
expected to yield a lower but less risky return; while on the other hand Y is expected to yield
a higher but riskier return. These conditions correspond to the following:

E  X   E Y 
 X  Y
Now suppose that you want higher returns than X yields and a lower risk exposure
than Y introduces. You simply combine the two stocks to arrive at a mid-point that is more
suitable for you. Suppose you form your portfolio such that the ratio of X is w and the ratio
of Y is 1-w:

P  wX  1  w  Y w   0,1

Then the expected returns will be a linear combination of the two other expected
returns:

E  P   wE  X   1  w E Y  w   0,1

The expected risk1 is somewhat like the open form of  a  b 


2

 P  w2 x2  2 w 1  w  XY  1  w   Y2 w   0,1
2

NOTE: In portfolio questions you will probably not be given the raw data, instead you will
be given the expected values and variances of two datasets. Otherwise it would be quite time
consuming, since the portfolio variance formula requires pre-calculating the expected values,
variances and covariances for the two data sets. Shortly, if you are presented with the
expected values and variances of two data sets, be prepared to solve a portfolio question.

Question 2: Ezio Auditore lives in medieval Florence and plans on retiring at age fifty, if
he survives that long. He needs to form a retirement portfolio for himself, and only has two
options: depositing into the Bank di Medici(X) which means guaranteed returns with low
risk; or gambling(Y). He is willing to take some risk if he can earn a little more, so he decides
to deposit 90% of his money and gamble with the remaining 10%. The expected returns and
risks are as the following: E  X   100, E Y   1000,  X  5,  Y  100,  XY  10 . What
are the expected return and the expected risk of this portfolio?

1
In financial engineering, risk is interchangeably used with the variance(or standard deviation).
Answer 2: Just apply the formulae:
E  P   .9 100   .11000  =190

P  .81 25  2 .1.9 10  .0110000  31.9695

You type in:

.81 25

2 .1 .9 10

.1 10000

NOTE: The buttons used in this tutorial:

Potrebbero piacerti anche