[go: up one dir, main page]

0% found this document useful (0 votes)
33 views28 pages

08 - Discrete Random Variables

The document discusses discrete random variables within the context of probability theory, explaining their definition, examples, and key concepts such as probability mass functions (pmf), cumulative distribution functions (cdf), expected value, variance, and standard deviation. It provides various examples to illustrate how to calculate probabilities and expectations for different random variables. Additionally, it includes exercises for practice on the concepts covered.

Uploaded by

deepu827341
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views28 pages

08 - Discrete Random Variables

The document discusses discrete random variables within the context of probability theory, explaining their definition, examples, and key concepts such as probability mass functions (pmf), cumulative distribution functions (cdf), expected value, variance, and standard deviation. It provides various examples to illustrate how to calculate probabilities and expectations for different random variables. Additionally, it includes exercises for practice on the concepts covered.

Uploaded by

deepu827341
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Discrete Random variables

Probability Theory
08. Discrete random variables

Shilpak Banerjee

Indian Institute of Technology Tirupati

1 / 28
Discrete Random variables

Recalling time

Some tools of the trade,


What is probability theory?
Experiments, Outcomes and events,
Probability (definition),
Combinatorial analysis,
Equally likely outcomes,
Conditional probability,
Total probability and Bayes theorem.

2 / 28
Discrete Random variables

Motivation

When we conduct an experiment, we have a sample space S and a


probability assignment P.

However sometimes we are interested in indirectly making


observations about the samples space.

Perhaps sometimes it may be very difficult to observe and work


with the sample points directly.

3 / 28
Discrete Random variables

Examples

Experiment consists of rolling 3 standard six sided dice.


However we are interested in the number of 6 obtained in the
outcome.
Experiment consists of rolling 2 standard six sided dice.
However we are interested in the sum of the outcomes.
Experiment consists of tossing 10 coins. However we are
interested in the number of heads obtained.
Experiment consists of drawing two cards from a standard
deck of 52 cards without replacement. However we are
interested only in the number of face cards in the draw.

4 / 28
Discrete Random variables

Random variable

Informally, following Wikipedia,


“A random variable is a mathematical formalization of a quantity
or object which depends on random events.”

But more formally, given an experiment i.e. (S, P) where S is a


sample space and P is a probability, then any real-valued function

X :S →R

is called a random variable.

Generalizations, though not considered in our class are possible


where random variables take values in spaces other than real
numbers.

5 / 28
Discrete Random variables

Examples
Experiment consists of rolling 3 standard six sided dice.
However we are interested in the number of 6 obtained in the
outcome.

X ((i, j, k)) = number of 6 in (i, j, k)

Experiment consists of rolling 2 standard six sided dice.


However we are interested in the sum of the outcomes.

X ((i, j)) = i + j

Experiment consists of tossing 10 coins. However we are


interested in the number of heads obtained.

X (sequence of length 10 in H and T )


= no of H in the sequence.

6 / 28
Discrete Random variables

Example

(S. Ross: A first course in probability, Example 1c, pp113)

Three balls are to be randomly selected without replacement


from an urn containing 20 balls numbered 1 through 20. If we
bet that at least one of the balls that are drawn has a number
as large as or larger than 17, what is the probability that we
win the bet?

Let X be the largest number selected. Then X is a random


variable taking on one of the values 3, 4, . . . , 20.
Assuming equal likelyhood
i−1

2
P ({X = i}) = 20
 i = 3, 4, . . . , 20
3

7 / 28
Discrete Random variables

Example (contd.)

Then our desired probability is

P(({X ≥ 17}) = P ({X = 17}) + P ({X = 18})


+ P ({X = 19}) + P ({X = 20})
16 17 18 19
   
2 2 2 2
= 20
 + 20
 + 20
 + 20

3 3 3 3
2 34 51 3
= + + +
19 285 380 20
≈ 0.508

8 / 28
Discrete Random variables

Discrete random variable and pmf


A random variable that can take on finite or countable number of
possible values is said to be discrete.

For a discrete random variable X , we define the probability mass


function p(a) or pmf of X by

pX (a) = P ({X = a}) = P ({x ∈ S : X (x) = a})

If values X takes are a1 , a2 , a3 . . . then



X
pX (ai ) ≥ 0 and pX (ai ) = 1
i=1

Note: When dealing with discrete random variables, we will mostly


be concerned with the case where the range of the random variable
is finite.
9 / 28
Discrete Random variables

Cumulative distribution function

Let X be a random variable defined on (S, P). We define the


cumulative distribution function of cdf or just distribution
function of X to be

FX (x) = P({X ≤ x}) −∞<x <∞

10 / 28
Discrete Random variables

Example

(S. Ross: A first course in probability, Example 1a, pp112)

Suppose that our experiment consists of tossing 3 fair coins. If


we let X denote the number of heads that appear, then X is a
random variable taking on one of the values 0, 1, 2, and 3. The
probability mass function of X can be calculated as follows
1
pX (0) = P({X = 0}) = P({X (x) = 0}) = P({TTT }) =
8
3
pX (1) = P({X = 1}) = P({TTH, THT , HHT }) =
8
3
pX (2) = P({THH, HTH, HHT }) =
8
1
pX (3) = P({HHH}) =
8

11 / 28
Discrete Random variables

Example
(S. Ross: A first course in probability, Example 2a, pp118)

The probability mass function of a random variable X is given


by p(i) = cλi /i!, i = 0, 1, 2, . . . where λ is a positive value.
Find (a) P({X = 0}) and (b) P({X > 2})

Since ∞
P
i=0 pX (i) = 1, we have

X λi
c = 1 =⇒ ce λ = 1 =⇒ c = e −λ
i!
i=0

Hence,
(a) P({X = 0}) = e −λ λ0 /0! = e −λ
(b) P({X > 2}) = 1 − P({X ≤ 2})
= 1 − p({X = 0}) − P({X = 1}) − P({X = 2})
= 1 − e −λ − λe −λ − λ2 e −λ /2
12 / 28
Discrete Random variables

A remark

In the last example, the sample space did not make an explicit
appearance and neither did the experiment.

We solved the problem using information given by the random


variable and the probability mass function only.

Though you can construct a hypothetical experiment,


corresponding to which we have the said random variable but it
will neither be useful, nor provide and further insight.

13 / 28
Discrete Random variables

Expected value

For a random variable X with pmf pX , we define the expectation


or expected value of X by
X
E [X ] = xpX (x)
x:p(x)>0

You can think of the expectation as a weighted sum of all possible


values of X with probability that X assumes it as weights.

14 / 28
Discrete Random variables

Example
(S. Ross: A first course in probability, Example 3a, pp119)

Find E [X ], where X is the outcome when we roll a fair die.


Since p(1) = p(2) = p(3) = p(4) = p(5) = p(6) = 1/6, we
obtain
1 1 1 1
E [X ] = 1 × + 2 × +3 × + 4 ×
6 6 6 6
1 1 7
+5× +6× =
6 6 2
(S. Ross: A first course in probability, Example 3b, pp120)

We say that I is an indicator variable for the event A if


(
1 if A occurs,
I =
0 if Ac occurs

Since p(1) = P(A), p(0) = 1 − P(A), we have E [I ] = P(A)


15 / 28
Discrete Random variables

Expectation of the function of a random variable

Theorem
If X is a discrete random variable that takes on one of the values
Xi , i ≥ 1 with respective probabilities pX (xi ), then, for any
real-valued function g ,
X
E [g (X )] = g (xi )pX (xi )
i

Proof: Proof is not conceptually complicated but still a bit tedious


to understand. So we skip it!
Corollary
If a and b are constants, then E [aX + b] = aE [X ] + b.

16 / 28
Discrete Random variables

Example
(S. Ross: A first course in probability, Example 4a, pp122)

Let X denote a random variable that takes on any of the


values −1, 0, and 1 with respective probabilities
P({X = −1}) = 0.2 P({X = 0}) = 0.5 P({X = 1}) = 0.3

Compute E [X 2 ].

E [X 2 ] = (−1)2 × (0.2)2 + 02 × (0.5) + 12 × (0.3) = 0.5


Let X denote the random variable counting the number of 6
in the roll of two fair dice. What is E (2X + 3)?
25 10 1
pX ({X = 0}) = , pX ({X = 1}) =
, pX ({X = 2}) =
36 36 36
25 10 1 1 11
E (X ) = 0 × +1× +2× = =⇒ E (2X + 3) =
36 36 36 3 3
17 / 28
Discrete Random variables

Moments

Expected value E [X ] is also known as the mean or the first


moment of X .

In general the nth moment of a discrete random variable X is


defined as
X
E [X n ] = x n pX (x)
x:p(x)>0

18 / 28
Discrete Random variables

Variance of a random variable


If X is a random variable with mean µ = E [X ], then the variance
of X , denoted by Var(X ), is defined by
Var(X ) = E [(X − µ)2 ]
Equivalently, variance can also be defined by
Var(X ) = E [X 2 ] − (E [X ])2
Proof of equivalence:
X
E [(X − µ)2 ] = (x − µ)2 p(x)
x
X
= (x 2 − 2µx + µ2 )p(x)
x
X X X
= x 2 p(x) − 2µ xp(x) + µ2 p(x)
x x x
= E [X 2 ] − 2µ2 + µ2
= E [X 2 ] − µ2
19 / 28
Discrete Random variables

Variance of a random variable

Intuitively, we can think of the variance as a measure of the spread


of the values of the random variable from the mean. The more the
variance, the more is the spread.

Other notations: We also use σ 2 or s 2 to denote the variance of a


random variable.

20 / 28
Discrete Random variables

Standard deviation

The standard deviation of X is defined to be


p
SD(X ) = Var(X )

Alternate notation: We also use the Greek letter sigma σ or the


letter s to denote standard deviation.

21 / 28
Discrete Random variables

Example

Calculate Var(X ) if X represents the outcome when a fair die


is rolled.
First we note that we have already computed the mean to be
7/2.

1 1 1 1
E [X 2 ] = 12 × + 22 × +32 × + 4×
6 6 6 6
1 1 91
+ 5 × + 62 × =
2
6 6 6
So the variance of X is
 2
2 2 91 7 35
Var = E [X ] − (E [X ]) = − =
6 2 12

22 / 28
Discrete Random variables

Variance of aX + b

Proposition
Let X be a discrete random variable, then for constants a and b,

Var(aX + b) = a2 Var(X )

Proof:

Var(aX + b) = E [aX + b − aµ − b)2 ]


= E [a2 (X − µ)2 ]
= a2 E [(X − µ)2 ]
= a2 Var(X )

23 / 28
Discrete Random variables

Exercises
1. (https://www.probabilitycourse.com/)

Let X be a discrete random variable with the following pmf





0.1 if x = 0.2




0.2 if x = 0.4

0.2 if x = 0.5
pX (x) =


0.3 if x = 0.8




0.2 if x = 1

0 otherwise

(a) Find the range of the random variable X .


(b) Find P(X ≤ 0.5).
(c) Find P(0.25 < X < 0.75).
(d) Find P(X = 0.2|X < 0.6).
Ans: (a) {0.2, 0.4, 0.5.0.8, 1}, (b) 0.5, (c) 0.4, (d) 0.2.
24 / 28
Discrete Random variables

Exercises
2. (S. Lipschutz & J. Schiller: Introduction to probability and statistics, Solved problems 5.1, pp153)

Suppose a random variable X takes on the values −3, −1, 2


and 5 with respective probabilities given by
2k − 3 k + 1 k − 1 k −2
, , , and
10 10 10 10
Determine the distribution of X .
Ans: P(X = −3) = 0.3, P(X = −1) = 0.4, P(X = 2) = 0.2, P(X = 5) = 0.1.

3. (S. Lipschutz & J. Schiller: Introduction to probability and statistics, Solved problems 5.2, pp153)
A fair coin is tossed four times. Let X denote the number of
heads occurring. Find
(a) The distribution of X .
(b) E (X ).
(c) The probability graph of X .
Ans: (a) P(X = 0) = 1/16, P(X = 1) = 4/16, P(X = 2) = 6/16, P(X = 3) = 4/16, P(X = 4) = 1/6,

(b) 2.

25 / 28
Discrete Random variables

Exercises

4. (S. Lipschutz & J. Schiller: Introduction to probability and statistics, Solved problems 5.3, pp154)

A fair coin is tossed until a head or five tails occurs. Find the
expected number of tosses of the coin.
Ans: 1.9.

5. (S. Lipschutz & J. Schiller: Introduction to probability and statistics, Solved problems 5.9, pp158)
Find the expectation, variance and standard deviation for the
following distributions:
x −6 −4 3 12
(a)
f (x) 1/4 1/8 1/2 1/8
x 2 3 5 8
(b)
f (x) 0.3 0.1 0.4 0.2
Ans: (a) 1, 32.5, 5.7, (b) 4.5, 5.35, 2.31.

26 / 28
Discrete Random variables

Exercises

6. (S. Lipschutz & J. Schiller: Introduction to probability and statistics, Solved problems 5.12, pp160)

Let X be a random variable with distribution:


x 1 2 3
f (x) 0.3 0.5 0.2
Let Y = Φ(X ). Find the mean, variance and standard
deviation of Y when
(a) Φ(x) = x.
(b) Φ(x) = x 3 .
(c) Φ(x) = 2x .
(d) Φ(x) = x 2 + 3x + 4.
Ans: (a) 1.9, 0.49, 0.7, (b) 9.7, 84, 9.17, (c) 4.2, 23.6, 4.86, (d) 13.9, 20.8, 4.56.

27 / 28
Discrete Random variables

End of section

28 / 28

You might also like