Introduction To Random Variables PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

05/04/2023

Introduction to Random
Variables
CPE251 PROBABILITY METHODS IN EGNINEERING

Dr. Zaid Ahmad


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
05/04/2023

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
05/04/2023

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
05/04/2023

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 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
05/04/2023

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
05/04/2023

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
05/04/2023

Cumulative Distribution Function


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

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

13

Example

14

7
05/04/2023

15

16

8
05/04/2023

Exercise 1

17

Exercise 2

18

9
05/04/2023

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.

19

10

You might also like