Вы находитесь на странице: 1из 33

Random Variable and

Mathematical Expectation
-Dr. Umesh R A
Random Variable
Definition: A random variable is a variable
whose possible values are numerical outcomes
of a random phenomenon. usually denoted by
‘X’, Each value have its own definite probability.

Example: If you roll a die, the outcome is random (not


fixed) and there are 6 possible outcomes, occur with
probability 1/6.
Types of Random variables
1. Discrete random variables have a countable
number of outcomes
•Examples: No of Dead/alive, No of accidents, etc.

2. Continuous random variables have an infinite


number of possible values in a given range.
•Examples: Blood pressure, Weight, Speed, etc.
Probability functions
•A probability function maps the possible
values of Random Variable (X) against their
respective probabilities, i.e. p(x).

•p(x) always lie between/equal to 0 and 1.

•The area under a probability function is 1.


Probability functions
Types based on nature of Random Variable
1. Probability Mass Function (pmf)

2. Probability Density Function (pdf)


Probability Mass Function
Definition:
Let X be a discrete random variable with x1, x2 ,x3 , … xn;
Then the function
PX(x) = P(X=x), for x=1,2,3,...
is called the probability mass function (pmf) of X.

The probability mass function of a discrete random


variable is simply the collection of all these
probabilities.
Example:
Roll of a die
 P(x)  1
all x
1/6
p(x)

1 2 3 4 5 6
x
Probability mass function (pmf)
X P(x)
1 P(x=1) = 1/6
2 P(x=2) = 1/6
3 P(x=3) = 1/6
4 P(x=4) = 1/6
5 P(x=5) = 1/6
6 P(x=6) = 1/6
Total 1
Probability Density Function
Definition:
Let X be a continuous random variable, Then the
function
PX(a<x<b) = a∫b fx (x)dx
is called the probability density function (pdf) of X.

Most often, the equation used to describe


a continuous probability distribution is called
a probability density function .
Example:
The probability that x is any exact particular value
(such as 1.9976) is 0; we can only assign probabilities
to possible ranges of x.

p(x)=e-x

1.9976 x
Example:
For example, the probability of x falling within 1 to 2
shown in below diagram;
1

p(x)=e-x

x
1 2
2
2
x x 2 1
P(1  x  2) 
 e  e
1
 e  e   . 135  . 368  . 23
1
Distribution Function
Definition:
•The distribution function F(x), also called the
cumulative distribution function (CDF), describes the
probability that a variate x takes value less than or
equal to x.
•The distribution function is,
F(x) = P( X ≤ x ) ------(Discrete)
F(x) = (-inf)∫x fx (x) dx --(Continuous)
Cumulative Distribution Function
(CDF)
Example: Throwing a die experiment
1.0 P(x)

5/6
2/3
1/2
1/3
1/6

1 2 3 4 5 6
x
Cumulative distribution function

X P(x)
1 P(x≤1) = 1/6
2 P(x≤2) = 2/6
3 P(x≤3) = 3/6
4 P(x≤4) = 4/6
5 P(x≤5) = 5/6
6 P(x≤6) = 6/6
Practice Problem:
The number of patients seen in the ER in any given
hour is a random variable represented by x. The
probability distribution for x is:
x 10 11 12 13 14
P(x) .4 .2 .2 .1 .1

Find the probability that in a given hour:


a. exactly 14 patients arrive p(x=14)= .1
b. At least 12 patients arrive p(x12)= (.2 + .1 +.1) = .4
c. At most 11 patients arrive p(x≤11)= (.4 +.2) = .6
Review Question 1
If you toss a die, what’s the probability that
you roll a 3 or less?

a.1/6
b.1/3
c.1/2
d.5/6
e.1.0
Review Question 1
If you toss a die, what’s the probability that
you roll a 3 or less?

a.1/6
b.1/3
c.1/2
d.5/6
e.1.0
Review Question 2
Two dice are rolled and the sum of the face
values is six. What is the probability that at
least one of the dice came up a 3?

a.1/5
b.2/3
c.1/2
d.5/6
e.1.0
Review Question 2
Two dice are rolled and the sum of the face
values is six. What is the probability that at
least one of the dice came up a 3?

a.1/5 How can you get a 6 on two


b.2/3 dice? 1-5, 5-1, 2-4, 4-2, 3-3
c.1/2 One of these five has a 3.
d.5/6 1/5
e.1.0 (Use conditional probability!)
Mathematical Expectation
Expected value of a random
variable
•Expected value is just the average or mean (µ)
of random variable x.

•It’s sometimes called a “weighted average”


because more frequent values of X are
weighted more highly in the average.

•It’s also how we expect X to behave on-


average over the long run.
Expected value, formally

E(X )   x i p(x i
)
all x

E(X) = µ
Example: expected value

Recall the following probability distribution of ER


arrivals:

x 10 11 12 13 14
P(x) .4 .2 .2 .1 .1

 x i p ( x )  10 (. 4 )  11 (. 2 )  12 (. 2 )  13 (. 1 )  14 (. 1 )  11 . 3
i 1
Example: The Lottery

•A certain lottery works by picking 6 numbers from 1


to 49. It costs Rs. 1 to play the lottery, and if you
win, you win Rs. 20,00,000.

•If you play the lottery once, what are your expected
winnings or losses?
[Cont…]
•Calculate the probability of winning in 1 try:
“49 choose 6”
1 1 1
   7.2 x 10
-8
Out of 49 numbers, this is
 
49
49 ! 13 ,983 ,816
  the number of distinct
 6  43 ! 6 !
combinations of 6.

•The probability function (note, sums to 1.0):


X (in Rs.) p(x)
-1 .999999928

20,00,000 7.2 x 10--8


The probability function
X (in Rs.) p(x)
-1 .999999928

20,00,000 7.2 x 10--8

Expected Value

E(X) = 20,00,000 * 7.2 x 10-8+ 0.999999928 (-1)


= .144 - .999999928 = -0.855999928
•Negative expected value is never good!
•You shouldn’t play if you expect to lose money!
Expected Value
If you play the lottery every week for 10 years, what
are your expected winnings or losses?

520 x (- 0.855999928) = - 445.12 Rs.


Gambling
How casinos can afford to give so many free drink !!!

A roulette wheel has the numbers 1 through 36, as


well as 0 and 00. If you bet $1 that an odd number
comes up, you win or lose $1 according to whether
or not that event occurs. If random variable X
denotes your net gain, X=1 with probability 18/38
and X= -1 with probability 20/38.

E(X) = 1(18/38) – 1 (20/38) = -$.053


[Cont…]
On average, the casino wins (and the player loses) 5
cents per game.

The casino rakes in even more if the stakes are higher:

E(X) = 10(18/38) – 10 (20/38) = -$.53

If the cost is $10 per game, the casino wins an


average of 53 cents per game. If 10,000 games are
played in a night, that’s a cool $5300.
Variance / Standard Deviation
“The expected (or average) squared distance (or
deviation) from the mean”

  Var ( x )  E [( x   ) ]   (xi   )
2 2 2
p(x i
)
all x
Discrete case:
 (xi   )
2
Var ( X )  p(x i
)
Continuous case: all x

 (xi   )
2
Var ( X )  p(x i
)dx
all x
Variance
  (xi   )
2 2
 p(x i
)
all x

  ( x i   ) p(x
2 2
 i
)
all x

2 2
 ( 1  200 ,000 ) (. 5 )  ( 400 ,000  200 ,000 ) (. 5 )
2
 200 ,000

 
2
200 ,000  200 ,000

Now you examine your personal risk tolerance…


Review Question 3
The expected value and variance of a coin toss
(H=1, T=0) are?

a. .50, .50
b. .50, .25
c. .25, .50
d. .25, .25
Review Question 3
The expected value and variance of a coin toss
(H=1, T=0) are?

a. .50, .50
b. .50, .25
c. .25, .50
d. .25, .25

Вам также может понравиться