0% found this document useful (0 votes)
14 views23 pages

Understanding Random Variables in Statistics

A random variable is defined as a variable whose values are determined by the outcomes of a random experiment, and can be classified as discrete or continuous. The document provides examples and explanations of discrete random variables, continuous random variables, probability mass functions, and probability density functions, along with various examples illustrating these concepts. Additionally, it discusses cumulative distribution functions and properties of probability distributions for discrete random variables.

Uploaded by

sushentakur
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)
14 views23 pages

Understanding Random Variables in Statistics

A random variable is defined as a variable whose values are determined by the outcomes of a random experiment, and can be classified as discrete or continuous. The document provides examples and explanations of discrete random variables, continuous random variables, probability mass functions, and probability density functions, along with various examples illustrating these concepts. Additionally, it discusses cumulative distribution functions and properties of probability distributions for discrete random variables.

Uploaded by

sushentakur
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

Random Variable

Abdullah Al Islam
Lecturer
Dept. of Statistics
Random Variables
• A variable whose values are determined by the outcomes of
a random experiment is called random variable.
• A random variable is a function that assigns a real number to
each sample point in a sample space.
• Random variables can be discrete or continuous.

• Examples:
✓x = SAT score for a randomly selected student
✓x = number of people in a room at a randomly
selected time of day
✓x = number on the upper face of a randomly
tossed die
Example
Toss a fair coin three times and
define x = number of heads.
x
HHH x p(x)
3
1/8 P(x = 0) = 1/8 0 1/8
HHT 2
1/8 P(x = 1) = 3/8 1 3/8
2
HTH 1/8 P(x = 2) = 3/8
2 2 3/8
THH
1/8 P(x = 3) = 1/8
1/8
1 3 1/8
HTT 1
1/8
1 Probability Histogram
1/8
THT for x
0
1/8
TTH

TTT
Example
Toss two dice and define
x = sum of two dice. x p(x)

2 1/36
3 2/36
4 3/36
5 4/36
6 5/36
7 6/36
8 5/36
9 4/36
10 3/36
11 2/36
12 1/36
Discrete Random Variable
▪ A random variable X is called a discrete random variable if its set of possible
values is countable, i.e., x  {x1, x2, …, xn} or x  {x1, x2, …}
That is, a variable which takes different discrete values with specified
probabilities.
Example:
Let us consider the experiment of two child family in which the probability that a
child will be a boy and a girl equal. Let X be a random variable which is defined
by the number of boys.
Sample Point Number of Boys Probability of X
BB 2 1/4
BG 1 1/4
GB 1 1/4
GG 0 1/4
Cont.
Values of X:x 0 1 2 total

P(x) 1/4 1/2 1/4 1

Here, the random variable X takes finite number of values 0, 1, 2. Therefore X is a


discrete random variable.
Usually, a discrete random variable takes integer values. But sometimes it can also
take fractional isolated values.
Continuous Random Variable
• A random variable X is called a continuous random variable if it can
take values on a continuous scale, i.e., x  {x: a < x < b; a, b R}
Example:
The height of your students in your classroom. The values could be
anywhere from, say, 4.5 feet to 7.2 feet. In general, quantities such as
pressure, height, mass, weight, density, volume, temperature, and
distance are examples of continuous random variable.
Probability Mass Function

• If X is a discrete random variable with possible values x1, x2,….xn and


f(x1), f(x2), ….f(xn) be their corresponding probabilities, then the set of
ordered pair (x,f(x)) is called the probability function of the discrete
random variable X.
Symbolically, f(xi) = P[ X=xi ], If X = xi , i= 1,2,----n
Properties: If f(x) is a probability function of a discrete random variable
X, then f(x) satisfies the following properties:
I. 0 ≤ 𝑓 𝑥 ≤ 1, for each possible values of X
II. σ 𝑓 𝑥𝑖 = 1.
Example
✓ A coin is tossed three times in which the probability of head is
twice as the probability of tail. If number of heads is a random
variable, find the probability function of the random variable.
Also find (a) 𝑃 𝑥 ≥ 1 , 𝑏 𝑃 𝑥 = 2 𝑎𝑛𝑑 𝑐 𝑃 𝑥 ≤ 1
Let H and T denote the head and tail of the coin, respectively. The
sample space of the experiment is
Ω = 𝐻𝐻𝐻, 𝐻𝐻𝑇, 𝐻𝑇𝐻, 𝑇𝐻𝐻, 𝐻𝑇𝑇, 𝑇𝐻𝑇, 𝑇𝑇𝐻, 𝑇𝑇𝑇
= {w1, w2, w3, w4, w5, w6, w7, w8}
Here, P(H)=2/3 and P(T) = 1/3
Example
• The probabilities of the different points of the sample space are:
P(HHH)= 8/27, P(HHT)= P(HTH)= P(THH)= 4/27, P(HTT)= P(THT)= P(TTH)=
2/27, P(TTT)= 1/27
Let, X be a random variable defined by the number of heads.
Sample points in Ω: wi Probability of wi Numbers of heads X:x Probability P(x)
HHH 8/27 3 8/27
HHT 4/27 2 12/27
HTH 4/27 2
THH 4/27 2
HTT 2/27 1 6/27
THT 2/27 1
TTH 2/27 1
TTT 1/27 0 1/27
Cont.
The probability function of the random variable X is:

Values of X:x 0 1 2 3

f(x) 1/27 6/27 12/27 8/27

1 26
a) 𝑃 𝑥 ≥ 1 = 1 − 𝑃 𝑥 < 1 = 1 − 𝑓 0 = 1 − 27
=
27
12
b) 𝑃 𝑥 = 2 = 𝑓 2 = 27
1 6
c) 𝑃 𝑥 ≤ 1 = 𝑃 𝑥 = 0 + 𝑃 𝑥 = 1 = 𝑓 0 + 𝑓 1 = 27
+
27
=
7/27
Example
✓Suppose the different size of shoes sold by a departmental store in the
last month are as follows:
Sizes of Shoes 5 5.5 6 6.5 7 7.5 8 8.5 9

Number of 25 30 95 105 155 210 170 125 85


pairs sold

(i) Find the probability function of sizes of the shoes sold by the
departmental store. Compute the probability of the sizes of the shoes
sold by the shop (ii)more than 7, (iii)less than7, (iv)between 6 and 8
Solution: i)Here the sizes of shoes may be considered as a random
variable X. The relative frequencies for the different sizes of shoes are
considered as their respective probabilities.
Example
Then the possible values of X and their probabilities constitute the
probability distribution of X is given by the following table:
Probability distribution of the sizes of the shoes
Sizes of 5 5.5 6 6.5 7 7.5 8 8.5 9
Shoes
X:x
P(x) 0.025 0.030 0.095 0.105 0.155 0.210 0.170 0.125 0.085

ii) 𝑃 𝑋 > 7 = 𝑃 𝑋 = 7.5 + 𝑃 𝑋 = 8 + 𝑃 𝑋 = 8.5 + 𝑃(𝑋 = 9)


iii) 𝑃 𝑋 < 7 = 𝑃 𝑋 = 5 + 𝑃 𝑋 = 5.5 + 𝑃 𝑋 = 6 + 𝑃 𝑋 = 6.5
iv) 𝑃 6 < 𝑋 < 8 = 𝑃 𝑋 = 6.5 + 𝑃 𝑋 = 7 + 𝑃(𝑋 = 7.5)
Example
✓Consider the sample space with three children family.
Suppose the probability of a boy is 4/7. Let X be the
number of boys. Compute the probability function of
the number of boys. A family with three children is
selected at random, what is the probability that the
family contains (i) exactly 2 boys,
(ii) at most two boys
(iii) at least two boys and
(iv) no boys.
Probability density function
• A function f(x) of a continuous random variable X is called a
probability density function if it satisfies the following two conditions:
I. 𝑓(𝑥) ≥ 0

II. ‫׬‬−∞ 𝑓 𝑥 𝑑𝑥 = 1
Example: Let X be a continuous random variable with probability
density function is given by:
2
𝑓 𝑥 = 𝑥, 𝑖𝑓 1 < 𝑥 < 2
3
Find, a) 𝑃(𝑋 ≤ 1.2), b) 𝑃 𝑋 > 1.2 ,
c) 𝑃 1.2 < 𝑋 < 1.6 , d) 𝑃 𝑋 = 1.5 and
e) 𝑃(𝑋 > 3)
Example
✓The pressure measured in pounds per cm2 at a certain is a random
variable X whose probability density function is
2
𝑓 𝑥 = 3𝑥 − 𝑥 2 , 𝑖𝑓 0 < 𝑥 < 3
9
Find the probability that the pressure at this valve is
a) Not more than 2 pounds per cm2
b) Greater than 2 pounds per cm2
c) Between 1.5 and 2.5 pounds per cm2
d) Less than 1.5 pounds per cm2
Example
✓A continuous random variable has the following probability density
function
𝑓 𝑥 = 𝑘𝑥 2 , 0≤𝑥≤1
i. Find the value of k.
ii. Find the probability of a) 𝑃 0.2 ≤ 𝑋 ≤ 0.5
𝑏) 𝑃 𝑋 ≤ 0.3
𝑐) 𝑃 0.25 < 𝑋 < 0.5
𝑑) 𝑃(𝑋 > .75)
Example
✓Suppose that in a certain region of a country the daily rainfall(in
inches) is a continuous random variable X with probability density
3
function f(x) given by, 𝑓 𝑥 = 2𝑥 − 𝑥 2 , 0 < 𝑥 < 2
4
Find the probability that a at a given day in this region the rainfall is
i. not more than 1 inch
ii. more than 1.5 inches
iii. between 0.5 and 1.5 inches
iv. equal to 1 inch and
v. less than 1 inch
Cumulative Distribution Function
• If X is a random variable, its distribution function is a function F(x):
Ɍ→ [0, 1] such that, F(x) = P (X ≤ x)
Where P (X ≤ x) is the probability that X is less than or equal to x.

1.0 P(x)
5/6
2/3
1/2
1/3
1/6
1 2 3 4 5 6 x
Properties
i. F(x) is increasing function; i.e. F(a) ≤ F(b),
when a≤ b.
ii. Limit at minus infinity. F(x) satisfies
lim 𝐹 𝑥 = 0
𝑥→−∞
[Link] at plus infinity. F(X) satisfies
lim 𝐹 𝑥 = 1
𝑥→∞
Probability Distributions for Discrete
Random Variables
The probability distribution for a discrete
random variable x resembles the relative
frequency distributions we constructed in
Chapter 2. It is a graph, table or formula that
gives the possible values of x and the
probability p(x) associated with each value.

We must have
0  p( x)  1 and  p( x) = 1
Example
Toss a fair coin 3 times and record x the
number of heads.
x p(x) xp(x) (x-)2p(x) 12
0 1/8 0 (-1.5)2(1/8)  =  xp( x) = = 1.5
8
1 3/8 3/8 (-0.5)2(3/8)
2 3/8 6/8 (0.5)2(3/8)
3 1/8 3/8 (1.5)2(1/8)
 = ( x −  ) p ( x)
2 2

 2 = .28125 + .09375 + .09375 + .28125 = .75


 = .75 = .688
Example
The probability distribution for x the
number of heads in tossing 3 fair
coins.
Symmetric; mound-
• Shape? shaped

• Outliers? None

• Center?  = 1.5

• Spread?  = .688

You might also like