Mehran University of Engineering and
Technology, Jamshoro
Probability
and
RANDOM VARIABLES Stochastic
Processes
(PSP)
- Lecture#04
Random Variables - Concept
2
RANDOM VARIABLE
A random variable is a fundamental concept in probability
theory and stochastic processes.
It is a function that assigns numerical values to the
outcomes of a random experiment.
3
A random variable is denoted by an
uppercase letter such as X.
The notation means that is the value
associated with the outcome s by the RV .
𝑿 ( 𝒔)= 𝒙
Random Variable Outcome
Value of RV
4
IMPORTANCE
The outcome of a probabilistic experiment often
specifies a collection of numerical values such as
temperatures, voltages, numbers of arrivals or
departures in various time intervals, etc.
Each such numerical value varies, depending on the
particular outcome of the experiment, and thus can be
viewed as a mapping from the set 𝞨 of sample points to
the set ℝ of real numbers (note that ℝ does not include
±1).
These mappings from sample points to real numbers are
called random variables.
5
DESCRIPTION
sample space 𝛺 of a probability model to the set of real
A random variable (RV) is essentially a function X from the
numbers ℝ .
Three modifications are needed to make this precise.
First, X might be undefined or ± for a subset of 𝛺 that has 0
probability.
Second, the mapping X( 𝜔 ) must have the property that { 𝜔𝜖𝛺 :
X( 𝜔 ) 𝜖 x} is an event for each x ℝ ℝ .
Third, every finite set of RV’s has the property that for each the
set is an event.
6
EXAMPLE#01
When a student calls a university help desk for
technical support, he/she will either
immediately be able to speak to someone ( S,
for success) or will be placed on hold (F, for
failure). With S={S,F}, define an RV X by
The RV X indicates whether (1) or not (0) the
student can immediately speak to someone.
7
EXAMPLE#02
Flipping a coin
You flip a fair coin. Let X be a random
variable that represents the outcome:
• X=1 if it lands on heads
• X=0 if it lands on tails
The probabilities are:
P(X=1)=1/2, P(X=0)=1/2
8
EXAMPLE #03
Counting Chocolates in a Box
You open a box of chocolates, and the number of
chocolates inside varies.
Define X as the number of chocolates in the box.
(The value of X depends on which box you pick.)
• If the box has 10 chocolates, X=10.
• If the box has 15 chocolates, X=15.
9
EXAMPLE #04
Number of Siblings
You ask a random person how many siblings they have.
Define X as the number of siblings.
• If they have 1 sibling, X=1
• If they have 3 siblings, X=3.
• If they are an only child, X=0.
Each number has a probability depending on how common it
is.
10
EXAMPLE #05
Number of Messages You Receive
Let X be the number of messages you receive in an
hour.
• If you receive 5 messages, then X=5.
• If you receive 0 messages, then X=0.
• The number X changes randomly based on your
activity.
This is also a stochastic process if we track the
messages over time (e.g., messages per hour
throughout the day).
11
EXAMPLE #06
Dice Game with a Reward
You roll a 6-sided die, and your reward depends on the
number you roll. Define Y as your reward in rupees:
• If you roll a 6, you get Rs. 50 → Y=50.
• If you roll a 5, you get Rs. 20 → Y=20.
• Otherwise, you get Rs. 0 → Y=0.
The random variable Y represents how much money you win
based on a random dice roll.
12
EXAMPLE # 07
Two balls are drawn in succession without
replacement from a jar containing 4 red balls
and 3 black balls. The possible outcomes
and the values y of the random variable: Y,
where y is the number of red balls, are
13
CLASSIFICATION
Random
Variable
Continuous Discrete
RV RV
14
CONTINUOUS RANDOM VARIABLE
A continuous random variable is a random variable with an
interval (either finite or infinite) of real numbers for its range.
Sometimes a measurement (such as current in a copper wire)
can assume any value in an interval of real numbers (at least
theoretically).
Then arbitrary precision in the measurement is possible.
Of course, in practice, we might round off to the nearest tenth or
hundredth of a unit.
The random variable that represents this measurement is said to be
a continuous random variable.
In most practical problems, continuous RV represents
measured data.
15
DISCRETE RANDOM VARIABLE
A discrete random variable is a random variable with a finite
(or countable infinite) range.
In some experiments, we might record a count such as the
number of transmitted bits that are received in error.
Then the measurement is limited to integers. Or we might record
that a proportion such as 0.0042 of the 10,000 transmitted bits
were received in error.
Then the measurement is fractional, but it is still limited to discrete
points on the real line.
Whenever the measurement is limited to discrete points on the real
line, the random variable is said to be a discrete random variable.
In most practical problems, discrete RV represents count
data.
16
EXAMPLE
Characterize as a discrete or continuous.
Noise
Bowler speed
Scoring of a video game
Voice
Playing cards
Rolling a die
Pressure
Sessional marks
Length
Opening a book page
Temperature
Number of transmitted bits received in error
17
EXAMPLE
Characterize as a discrete or continuous.
Noise → Continuous
Bowler speed → Continuous
Scoring of a video game → Discrete
Voice → Continuous
Playing cards → Discrete
Rolling a die → Discrete
Pressure → Continuous
Sessional marks → Discrete
Length → Continuous
Opening a book page → Discrete
Temperature → Continuous
Number of transmitted bits received in error → Discrete
18
Quiz
19
CLASS ASSESSMENT # 01
D e c i d e w h e t h e r a d i s c r e t e o r c o n t i n u o u s r a n d o m v a r i a b l e i s th e b e st
model for each of the following variables:
1. The number of times a transistor in a computer memory changes 1. D
state in one operation. 2. C
2. The time until a projectile returns to earth. 3. C
3. The volume of gasoline that is lost to evaporation during the filling 4. D
of a gas tank.
5. C
4. The number of cracks exceeding one-half inch in 10 miles of an
interstate highway. 6. D
5. The outside diameter of a machined shaft. 7. C
6. The number of molecules in a sample of gas. 8. C
7. The weight of an injection-molded plastic part. 9. D
8. The concentration of output from a reactor. 10. D
9. The highway fatalities per year in a given state. 11. D
10. Number of scratches on a surface 12. C
11. Proportion of defective parts among 1000 tested
12. Distance to a garden from gate of house.
20
Probability Distribution
21
PROBABILITY DISTRIBUTION
Random variables are so important in random
experiments that sometimes we essentially ignore
the original sample space of the experiment and
focus on the probability distribution of the random
variable.
The probability distribution of a random variable X
is a description of the probabilities associated with
the possible values of X.
It says how the total probability of 1 is distributed
among (allocated to) the various possible X values.
22
PROBABILITY DISTRIBUTION
(CONTD…)
For a discrete random variable, the distribution is
often specified by just a list of the possible values
along with the probability of each. In some
cases(discrete or continuous), it is convenient to
express the probability in terms of a formula.
The Probability distribution is a table or an equation
that links each possible value that a random
variable can assume with its probability of
occurrence.
23
NOTATION
24
NOTATION
Probability
Value of RV
Random Variable Probability
Distribution function
25
EXAMPLE
Suppose, for example, that a business has just purchased four
laser printers, and let X be the number among these that require
service during the warranty period. Possible X values are then
0, 1, 2, 3, and 4.
The probability distribution will tell us how the probability of 1 is
subdivided among these five possible values— how much
probability is associated with the X value 0, how much is
apportioned to the X value 1, and so on. We will use the
following notation for the probabilities in the distribution:
In general, 𝑓 (x) will denote the probability assigned to the value
and so on.
x. 26
HOMEWORK
Probability Distribution for
Example # 01 ?
Example # 02 ?
Example # 03 ?
Example # 04 ?
Example # 05 ?
Example # 06 ?
27
Probability distribution can be for
Discrete Random Variables
Continuous Random Variables
28
• Probability Density
Function (PDF)
Continuous • Cumulative distribution
function (CDF)
• Probability Mass
Function (PMF)
Discrete • Cumulative distribution
function (CDF)
29