0% found this document useful (0 votes)
3 views

5. Introduction to Random Variables

The document is a lecture on random variables, covering definitions, examples, and types such as discrete and continuous random variables. It explains concepts like probability mass functions, cumulative distribution functions, and probability density functions, along with sample problems. The lecture is part of a course on probability methods in engineering at COMSATS University Islamabad.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

5. Introduction to Random Variables

The document is a lecture on random variables, covering definitions, examples, and types such as discrete and continuous random variables. It explains concepts like probability mass functions, cumulative distribution functions, and probability density functions, along with sample problems. The lecture is part of a course on probability methods in engineering at COMSATS University Islamabad.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

3/12/2024

Lecture 5:
Introduction to Random
Variables
CPE251 Probability Methods in Engineering
Dr. Zaid Ahmad, MIEEE
Advisor, IEEE CUI Lahore
COMSATS University Islamabad, Lahore Campus

Random Variable
A random variable is a function that assigns a real number 𝑋(𝜁) to each outcome 𝜁 of
the sample space of a random experiment.
For example, when a coin is tossed thrice, two random variables can be associated
with this experiment: 𝑋 = number of heads and 𝑌 = number of tails.
The capital letters 𝑋 and 𝑌 are the labels of the random variables, while small letters
𝑥 and 𝑦 denote the values of the random variables
𝑆 = {𝑇𝑇𝑇, 𝑇𝑇𝐻, 𝑇𝐻𝑇, 𝑇𝐻𝐻, 𝐻𝑇𝑇, 𝐻𝑇𝐻, 𝐻𝐻𝑇, 𝐻𝐻𝐻}
𝑆 = {0,1,2,3}
𝑆 = {0,1,2,3}

1
3/12/2024

Examples

Sample Problem
A fair coin is flipped three times and the number of heads 𝑋 is observed. If the
probability of occurring a head is 𝑝. Compute 𝑃 𝑋 = 0 and 𝑃[𝑋 = 2].

We are to find the probability of no head and exactly two heads


𝑃 𝑋 = 0 = 𝑃 𝑇𝑇𝑇 = 1−𝑝
𝑃 𝑋=2
= 𝑃 𝑇𝐻𝐻, 𝐻𝑇𝐻, 𝐻𝐻𝑇 =𝑝 1−𝑝 +𝑝 1−𝑝 +𝑝 1−𝑝
= 3𝑝 1 − 𝑝

2
3/12/2024

Discrete Random Variable


A random variable 𝑋 is called a discrete random variable if 𝑆 is countable.

Example: Coin tossed thrice, 𝑋 = number of heads, 𝑝 =

𝒙 𝟎 𝟏 𝟐 𝟑
1 3 3 1
𝑃[𝑋 = 𝑥]
8 8 8 8

Probability Mass Function


A function 𝑝 (𝑥) is known as probability function, or probability mass function or
probability distribution if

1. 𝑝 𝑥 ≥ 0
2. ∑𝑝 𝑥 = 1
3. 𝑃 𝑋 = 𝑥 = 𝑝 (𝑥)

3
3/12/2024

Example
A shipment of 20 similar laptops to a retail outlet contains 3 that are defective. If a
school makes a random purchase of 2 of these laptops, find the probability
distribution for the number of defectives.

𝐷 = defective, 𝑁 = not defective, 𝑋 = number of defectives picked by the school


The sample space for this case is 𝑆 = {𝑁𝑁, 𝑁𝐷, 𝐷𝑁, 𝐷𝐷}
For every outcome, there is a probability of number of defective and not defective
laptops.

Let 𝑛 is the total number of defective laptops selected and 𝑛 is the total number of
not defective laptops.

Then, probability that 𝑥 number of defective laptops are picked by the school is:
𝑛 𝑛
𝑝 𝑥 =𝑃 𝑋=𝑥 = 𝑥 2−𝑥
20
2

4
3/12/2024

Cumulative Distribution Function


(Discrete Random Variable)
The cumulative distribution function 𝐹 (𝑥) of a random variable 𝑋 is given by

𝐹 𝑥 = 𝑝 (𝑡)

Continuous Random Variable


When a random variable 𝑋 can take on values on a continuous scale, it is called
continuous random variable.

They represent measured data unlike count data (discrete random variable)

The probability of exactly one value of a discrete random variable is 0. Therefore, it


cannot be tabulated like discrete random variable.

The probability of an interval of a continuous random variable is non-zero.

10

5
3/12/2024

Probability Density Function or Density


Function
The probability of a continuous random variable can be stated as a function 𝑓(𝑥).

𝑓(𝑥) may or may not be continuous for all values. However, frequently used 𝑓(𝑥) are
continuous.

11

Probability Density Function or Density


Function
The function 𝑓 (𝑥) is a probability density function (pdf) for the continuous random
variable 𝑋, defined over the set of real numbers, if

1. 𝑓 𝑥 ≥ 0, ∀𝑥 ∈ 𝑅
2. ∫ 𝑓 𝑥 𝑑𝑥 = 1
3. 𝑃 𝑎 < 𝑋 < 𝑏 = ∫ 𝑓 (𝑥) 𝑑𝑥

12

6
3/12/2024

Cumulative Distribution Function


(Continuous Random Variable)
The cumulative distribution function 𝐹 𝑥 of a continuous random variable 𝑋 is

𝐹 𝑥 =𝑃 𝑋≤𝑥 = 𝑓 𝑡 𝑑𝑡 , −∞ ≤ 𝑥 ≤ ∞

13

Example

14

7
3/12/2024

15

16

8
3/12/2024

EXERCISE 1 EXERCISE 2

17

References
1. Walpole, R.E., Myers, R.H., Myers, S.L. and Ye, K. (2007) Probability &
Statistics for Engineers & Scientists. 9th Edition, Pearson Education, Inc.
2. Leon-Garcia, A. (2008). Probability, Statistics, and Random Processes for
Electrical Engineering. 3rd Edition, Pearson/Prentice Hall.

18

You might also like