You are on page 1of 35

RANDOM VARIABLES

MODULE 3
CONCEPT AND DEFINITION

Random Variable
For a given sample space S of some experiment, a random variable
is any rule that associates a number with each outcome in S .

Bernoulli Random Variable


Any random variable whose only possible values are 0 and 1 is
called a Bernoulli random variable.
CONCEPT AND DEFINITION
Let us consider an experiment whereby a fair coin is tossed two times. The sample space
of this experiment would be:

S = (T,T) , (T,H) , (H,T) , (H,H)

The elements of S can be listed in table form. To denote the elements of the sample
space more conveniently, we will arbitrarily designate the element by the number of
heads in that particular element. If we let x = number of heads, we come up with the
following table:
Table 1.

Arbitrary Designation of the Element by the Number of Heads

x Element of Sample Space

0 T,T
1 T,H
1 H,T
2 H,H
CONCEPT AND DEFINITION
We are usually interested in the probabilities associated to each of the events. Since
table 1 consists of all the possible events, each of the elements will have a probability of
¼. We can compress table 1 and rewrite it with the inclusion of the corresponding
probability.

The table would be:

Table 2
Probability Distribution of x, Number of Heads

x Probability f(x)

0 ¼
1 ½
2 ¼
PROBABILITY DISTRIBUTION

PROBABILITY DISTRIBUTION may be a table or a function that


permits us to compute or determine the probability for any event that I
defined in terms of the values of the random variable. It gives us the
probabilities associated with each of the values of the random
variable.

Example 1: A pair of dice is rolled. If we let x= sum of the two numbers


that show up on the uppermost face of the dice, determine the
probability distribution of x.
PROBABILITY DISTRIBUTION
Probability Distribution of x, the sum of the numbers on the uppermost face of the dice
Example 1:
Sample Points x f(x)
(11) 2 1/36
(12)(21) 3 2/36

(13)(22)(31) 4 3/36

(14)(23)(32)(41) 5 4/36

(15)(24)(33)(42)(51) 6 5/36

(16)(25)(34)(43)(52)(61) 7 6/36

(26)(35)(44)(53)(62) 8 5/36

(36)(45)(54)(63) 9 4/36

(46)(55)(64) 10 3/36

(56)(65) 11 2/36

(66) 12 1/36
TYPES OF RANDOM VARIABLES

DISCRETE RANDOM VARIABLE is one which can assume only a finite


or countably infinite number of distinct values. Examples are :

(a) number of heads that come up in the tossing of a coin,

(b) (b) the number of defectives that appear in a production lot,

(c) (c) the number of balls that can be drawn from an urn containing
red balls and blue balls.

CONTINUOUS RANDOM VARIABLE can assume only any of the


infinitely many values in a given range. The most common continuous
random variables include weight, height, volume or temperature.
TYPES OF RANDOM VARIABLES
Discrete random variables
v Number of sales
v Number of calls
v Shares of stock
v People in line
v Mistakes per page

Continuous random variables


v Length
v Depth
v Volume
v Time
v Weight
DISCRETE PROBABILITY DISTRIBUTIONS

A discrete probability distribution is the probability function of a discrete random variable. A


discrete probability distribution may be expressed in table form or by means of a formula.
The formula will normally be denoted as f(x). The characteristics of a discrete probability
distribution are as follows:

1. f(x) ³ 0. This implies that for all values of x, f(x) cannot be negative. Since f(x)
represents the probability, the probability cannot be negative.

2. å f(x) = 1. The sum of the separate values of x over all x values must equal to 1. The
distribution exhausts all possible cases; hence, the sum of their probabilities must be 1.

3. P(x =X) = f(x). The probability that X assumes a value x would be equal to the value of
the function when X = x. This implies that f(x) is the probability. In a continuous
distribution, this is not the case.
DISCRETE PROBABILITY DISTRIBUTIONS

Example 2: A salesman schedules 5 calls a day. If x is the number of


sales in 1 day, then

"6 − x
$
f(x) = # 15 if x= 1,2,3,4,5
$0
% otherwise

a. Is f(x) a discrete probability distribution?


b. Find the probability that the salesman makes
i. only 1 sale in a day
ii. at least 2 sales in a day.
DISCRETE PROBABILITY DISTRIBUTIONS

Example 2:
a. ∑ f(x) = 1
6 −1 6 − 2 6 − 3 6 − 4 6 − 5
= + + + + = 1 (yes).
15 15 15 15 15

6 −1 1
b. i) P(x=1) = f(1) = =
15 3
ii. P(x ≥ 2)=P(x=2)+P(x=3)+P(x=4)+P(x=5)
=f(2)+f(3)+f(4)+f(5)
4 3 2 1 2
= + + + =
15 15 15 15 3
DISCRETE PROBABILITY DISTRIBUTIONS

Example 3: Let x= number of minutes it takes to drain a soda filler of a


particular flavor in order to change to a new flavor. The probability
distribution for x is:

F(x) =Kx where x = 1, 2,3, 4, 5

Find the value of K.


DISCRETE PROBABILITY DISTRIBUTIONS

Example 3:
Since ∑ f(x) = 1

K(1)+K(2)+K(3)+K(4)+K(5) = 1
K =1
1
K =
15

Therefore,the probability distribution of x is :

x
f(x) =
15
DISCRETE PROBABILITY DISTRIBUTIONS

Ê Example 4: An urn contains 5 marbles, 2 of which are green and the


remaining 3 are red. From the urn, we draw 3 marbles with
replacement. If we let x be the number of red marbles obtained, set
up the probability distribution for x.
CUMULATIVE DISTRIBUTION FUNCTION F(X)

The cumulative distribution function gives the probability that X takes


on values less than or equal x. For a discrete random variable:

F(x) = P(x £ x) = F(c) = å f(x)


CUMULATIVE DISTRIBUTION FUNCTION F(X)

Example 5: Find the cumulative distribution of the probability distribution in


example 1. Also use F(x) to evaluate the following:

1. P(x £ 4)

2. P(x < 6)

3. P(x > 7)

4. P(x ³ 3)

5. P(4 £ x £ 8)

6. P(4 < x < 8)

7. P(x = 5)
Review Question 1

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
b. At least 12 patients arrive
c. At most 11 patients arrive
Review Question 2

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 3

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
CONTINUOUS PROBABILITY DISTRIBUTION

Ê The probability distribution function of a continuous random


variable is known as the continuous probability density
function.
CONTINUOUS PROBABILITY DISTRIBUTION

Characteristics of the Continuous Density Function

1. f(x) ≥ 0 for all x ∈ R


x2
2. P(X1 < x < x 2 ) = ∫ f ( x ) dx
x1

3. ∫ f(x) dx = 1
−∞

4. P(X = x) ≠ f(x)
MATHEMATICAL EXPECTATION
Ê Mathematical Expectation – the expected value or simply the
expectation of the random variable x. It is basic concept in the
formulation of summary measures for probability distributions. It is
generally employed in the areas such as:

Ê Insurance industry
Ê Operations research
Ê Management sciences
Ê Systems analysis
Ê economics
MATHEMATICAL EXPECTATION
Ê Let us consider the coin tossing example. The probability distribution was
derived as:
x 0 1 2
f(x) 1/4 1/2 1/4

Ê Supposing we perform the experiment 20 times. Based on the distribution,


we will be expected to get no head 5 times, 1 head 10 times and 2 heads 5
times. To get the average number of heads obtained we simply get the
weighted average.

, - ./- / .,(1)
!"#$ℎ&"' ()"*($" = = 1 ℎ"('
1-

Ê Hence,
E(x) = 1 head
MATHEMATICAL EXPECTATION

Ê Let X be a random variable with probability distribution f(x). The


expected value of X or the mathematical expectation of X is

E ( X ) = å xf ( x) if X is discrete
x
¥
= ò xf ( x)dx if X is continuous

EXAMPLE 1
1. Use the data below to find out the expected number of the number of
credit cards that a student will possess.
x = # credit cards
E ( X ) = x1 p1 + x2 p2 + ... + xn pn
x P(x =X)
= 0(.08) + 1(.28) + 2(.38) + 3(.16)
0 0.08
1 0.28 + 4(.06) + 5(.03) + 6(.01)
2 0.38
3 0.16 =1.97
4 0.06 About 2 credit cards
5 0.03
6 0.01
EXAMPLE 2
A committee of size 5 is to be selected at random from 3 chemists and 5 physicists.
Find the probability distribution for the number of chemists on the committee?

!3$ !5$ !3$ !5 $ !3 $ !5$ !3$ !5 $


# &# & # &# & # &# & # &# &
"0% "5% 1 "1 % " 4% 15 " 2% " 3% 30 " 3% " 2% 10
f(0) = = , f(1)= = , f(2)= = ; f(3)= =
!8$ 56 ! 8 $ 56 ! 8 $ 56 ! 8 $ 56
# & # & # & # &
"5% "5% "5% "5%

The probability distribution for X


x 0 1 2 3
f(x) 1/56 15/56 30/56 10/56
EXAMPLE 3
3. In a gambling game a man is paid $5 if he gets all heads or all tails
when three coins are tossed and he pays out $3 if either one or two
heads show. What is his expected gain?
EXAMPLE 3

The sample space for the possible outcomes of this game is

S = {HHH , HHT , HTH , THH , HTT , THT , TTH , TTT }


Each of these events is equally likely and occurs with probability of each equal to
1/8.
Let Y be the amount of money the gambler can win, E1 is the event of winning
$5 and E2 is event of losing $3,
y 5 -3
E1 = {HHH , TTT }
E2 = {HHT , HTH , THH , HTT , THT , TTH } f ( y ) = P[Y = y ] 1 4 3 4
æ1ö æ3ö
µ = E (Y ) = å yf ( y) = (5) ç ÷ + (-3) ç ÷ = - 1
y è4ø è4ø

In this game the gambler will, on average, loss $1 per toss of the three coins.
Rules of the Expected Value

E (aX + b) = a × E ( X ) + b
This leads to the following:
1. For any constant a,
E (aX ) = a × E ( X ).

2. For any constant b, E ( X + b) = E ( X ) + b.


The Variance and Standard Deviation
Let X have pmf p(x), and expected value μ Then the variance of
X, denoted V(X)

2 2
(or sX or s ), is
V ( X ) = å ( x - µ ) × p( x) = E[( X - µ ) ]
2 2

The standard deviation (SD) of X is


s X = s X2
The Variance and Standard Deviation
Ex. The quiz scores for a particular student are given below:
22, 25, 20, 18, 12, 20, 24, 20, 20, 25, 24, 25, 18
Find the variance and standard deviation

Value 12 18 20 22 24 25
Frequency 1 2 4 1 2 3
Probability .08 .15 .31 .08 .15 .23
µ = 21
2 2 2
V ( X ) = p1 ( x1 - µ ) + p2 ( x2 - µ ) + ... + pn ( xn - µ )

s = V (X )
The Variance and Standard Deviation
2 2 2
V ( X ) = .08 (12 - 21) + .15 (18 - 21) + .31( 20 - 21)
2 2 2
+.08 ( 22 - 21) + .15 ( 24 - 21) + .23 ( 25 - 21)

V ( X ) = 13.25

s = V (X ) = 13.25 » 3.64
Shortcut Formula for Variance

é ù
V ( X ) = s = ê å x × p ( x) ú - µ
2 2 2

ëD û

( ) - éë E ( X )ùû
=E X 2 2
Rules of Variance
2 2 2
V (aX + b) = s aX +b =a ×s X
s aX +b = a × s X
and

This leads to the following:

2 2 2
1. s aX = a ×s X , s aX = a ×s X
2 2
2. s X +b = s X
END OF MODULE 3

You might also like