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

P_S 3 Random Variables

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

P_S 3 Random Variables

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

RANDOM VARIABLES

Prof. D. SRINIVASACHARYA

DEPARTMENT OF MATHEMATICS
N.I.T., WARANGAL
Prof D Srinivasacharya, NIT Warangal,[email protected]
Random Variables
• The outcomes of the Random experiments are some times
connected with a numbers
Example. Consider the trail of tossing of three a coins
Let x = The number of heads, then

Outcome TTT HTT THT TTH HHT HTH THH HHH


X= 0 1 1 1 2 2 2 3
HHH THT 0
HTT
1
TTH HHT

HTH 2

THH TTT
3
Prof D Srinivasacharya, NIT Warangal,[email protected]
This random experiment gets the numerical output as
1, 2, 3,
Here X is called random variable
Def : A random variable is a function or rule that assigns a real
number to each outcome of an experiment.
(or)
A random variable is a real-valued variable that gets its value
from a random experiment. i.e.,

A one dimensional random variable is a real-valued function on


the sample space: X : S → R
Definition : Range of a random variable is the set of possible
values of the random variable.
➢ Random Variables are denoted by upper case letters X,Y,Z
➢ For each element of an experiment’s sample space, the
random variable can take on exactly one value
Prof D Srinivasacharya, NIT Warangal,[email protected]
Examples of random variables:
1. Let the number of computers sold per day by a local
merchant be a random variable. Integer values ranging
from zero to about 50 are possible values.
2. Let the number of pages in a mystery novel at a bookstore
be a random variable. The smallest number of pages is
125 while the largest number of pages is 547.
3. Let the time it takes an employee to get to work be a
random variable. Possible values are 15 minutes to over 2
hours.
4. Let the volume of water used by a household during a
month be a random variable. Amounts range up to several
thousand gallons.
5. Let the number of defective components in a shipment of
1000 be a random variable. Values range from 0 to 1000.

Prof D Srinivasacharya, NIT Warangal,[email protected]


Examples :
• X = number of heads when the experiment is flipping two
coins.
Range(X) = {0, 1, 2}
Notations : If X a real number, the set of all  in S such that
X() = a is denoted by X = a
P(X = a ) = P({ / X() = a })
P(X  a ) = P({ / X()  a })
P(a  X  b ) = P({ / X() [a, b] })
Example: If a pair of dice is tossed then the sampel space is
S = {(1,1), (1, 2), . . . (6,6) and n(S) = 36
Let X = sum of the numbers on the dice
Range of X = {2,3,4, . . .12}
P(X = 6 ) = Prob that the sum of the numbers is 6
= P({(1, 5), (2, 4), (3, 3), (4, 2), (5, 1)}) = 5/36
Prof D Srinivasacharya, NIT Warangal,[email protected]
Distribution function
Let X be a random variable. The function defined by
Fx(x) = P( X  x ) = P({ / X()  x }), -  < x < 
is called distribution function of the random variable X
Properties : if Fx(x) is the distribution function of a one
dimenisonl random variable, then
1. Fx(x)  Fx(y) if x < y i.e. distribution functions are
monotonically non-decreasing
2. 0  Fx(x)  1
3. lim Fx(x) = 0 and lim Fx(x) = 1
x⟶−∞ x⟶∞
Countable Set : If a set has finite number of elements or If it has
one-to-one correspondence with the set of natural numbers
N = {1, 2, 3, . . . }
Examples : 1. A = {5, 10, 15, 20, 25, 30, 35} Finite Set
2. N = {1, 2, 3, . . . } Countably infinite Set
3. Z =NIT{0,-1,
Prof D Srinivasacharya, 1, -2, 2, -3, 3, . . . }Countably infinite Set
Warangal,[email protected]
Discrete Random Variables
If a random variable take on only a finite or countable
number of values, then it is called discrete random
variable.

Probability Mass function


Suppose X is a one dimensional discrete random
variable taking at most countably infinite number of
values x1, x2, x3, . . . xn . . .
With each outcome xi , we associate a number
Pi = P(X = xi) = p(xi) for i = 1, 2, 3, . . .
is called the Probability Mass Function (PMF) of X
(xi, p(xi)) is called the probability distribution of X
Prof D Srinivasacharya, NIT Warangal,[email protected]
Properties of Probability Mass Function
If p(xi) is the PMF of a discrete random variable, then
1. p(xi)  0 for all i

2. i=1 P xi = 1
σ

Discrete Distribution function


The Cumulative distribution function or briefly
distribution function for a discrete random variable X
is given by
F(x) = P(X  x), where - < x <
= σ𝑥𝑖 ≤𝑥 P xi

Prof D Srinivasacharya, NIT Warangal,[email protected]


Example – Rolling 2 Dice (Red/Green)
Y = sum of the numbers on the dice.
Range of Y = {2,3,4, . . .12}
p(2) = P(Y = 2 ) = Prob that the sum of the numbers is 2
= P({(1, 1)}) = 1/36
The Probability Mass Function & CDF of Y is given below
y 2 3 4 5 6 7 8 9 10 11 12
p(y) 1/36 2/36 3/36 4/36 5/36 6/36 5/36 4/36 3/36 2/36 1/36
F(y) 1/36 3/36 6/36 10/36 15/36 21/36 26/36 30/36 33/36 35/36 36/36
Dice Rolling Probability Function Dice Rolling - CDF

0.18 1

0.9
0.16

0.8
0.14

0.7
0.12

0.6

0.1
p(y)

F(y)

0.5

0.08

0.4

0.06
0.3

0.04
0.2

0.02
0.1

0 0
2 3 4 5 6 7 8 9 10 11 12
Prof D Srinivasacharya, NIT Warangal,[email protected]
y
1 2 3 4 5 6 7
y
8 9 10 11 12 13
Example – If p(x) = x/15, x = 1, 2, 3, 4, 5
= 0 otherwise
Find P(x = 1 or 2) and P(1/2 < X < 5/2 / x > 1)
Given P(X = 1) = 1/15, P(X = 2) = 2/15, P(X = 3) = 3/15,
P(X = 4) = 4/15, P(X = 5) = 5/15

P(x = 1 or 2) = P(x = 1) + P(x = 2) = 1/15 + 2/15 = 1/5

1 5
𝑃( <𝑋< ∩ 𝑋>1 )
2 2
P(1/2 < X < 5/2 / x > 1) =
𝑃 𝑋>1
𝑃( 𝑋=1 𝑜𝑟 𝑋=2 ∩ 𝑋>1 )
=
𝑃 𝑋>1
𝑃 𝑋=2
=
1−𝑃 𝑋=1
2
15 1
= 1 =
1−15 7

Prof D Srinivasacharya, NIT Warangal,[email protected]


Continuous Random Variables
If a random variable take all possible values between
certain limits, then it is called continuous random
variable.
A random variable is said to be continuous when its
different values cannot be put in one-one
correspondence with a set of positive integers.
Probability Density function
Consider a small interval [x-dx/2,
x+dx/2] of length dx round a point f(x)dx
x. f(x)

Let f(x) be any continuous function


of x such that f(x)dx represents the
probability of X falls in the
infinitesimal interval [x-dx/2, x-dx/2 x+dx/2
x+dx/2].
Prof D Srinivasacharya, NIT Warangal,[email protected]
Symbolically
P(x - dx/2 < X < x + dx/2) = f(x) dx
The function so defined is known as probability density function
(pdf) or probability density of the random variable X.
The probability density function has the following properties
1. f(x)  0  x  R

2. ‫׬‬−∞ 𝑓(𝑥) 𝑑𝑥 =1
3. The probability P(E) is given by ‫𝑥𝑑 )𝑥(𝑓 𝐸׬‬
Continuous Distribution function
The cumulative distribution function or briefly distribution function
for a continuous random variable X is given by
𝑥
F(x) = P(X  x) = ‫׬‬−∞ 𝑓(𝑥) 𝑑𝑥 where - < x <
The relation between density function f(x) and distribution
𝑑𝐹(𝑥)
function F(x) is = 𝑓(𝑥)
𝑑𝑥 𝑏
𝑃 𝑎 ≤ 𝑋 ≤ 𝑏 = ‫ = 𝑥𝑑 )𝑥(𝑓 ׬‬F(b) – F(a)
Prof D Srinivasacharya, NIT Warangal,[email protected] 𝑎
Example – 1 : If X is a continuous random variable with pdf
f(x) = 2x, 0 < x < 1
= 0, otherwise
Find(i) P(X < ½) (ii) P(¼< X < ½ ) (iii) P(X > ¾ / X > ½ ) and
(iv) P(X < ¾ / X > ½ )
1/2 1/2 1
i) P(X < ½) = ‫׬‬−∞ 𝑓 𝑥 𝑑𝑥 = ‫׬‬0 2𝑥 𝑑𝑥 =
4
1/2 1/2 1 1 3
ii) P(¼< X < ½ ) = ‫׬‬1/4 𝑓 𝑥 𝑑𝑥 = ‫׬‬1/4 2𝑥 𝑑𝑥 = −
4 16
=
16
3 1 3 1
𝑃( 𝑋 > 4 ∩ 𝑋 > 2 ) 𝑃 𝑋>4 ‫׬‬3/4 2𝑥 𝑑𝑥
iii) P(X > ¾ / X > ½ ) = 1 = 1 = 1
𝑃 𝑋>2 𝑃 𝑋> ‫׬‬1/2 2𝑥 𝑑𝑥
2
7Τ16 7
X >½ X >¾ = ൗ 3Τ4 =
12
0 ¼ ½ ¾ 1
0 X <¾ ½ X >½ 1
iii) P(X < ¾ / X > ½ )
3 1 1 3 ¼ ¾
𝑃( 𝑋< 4 ∩ 𝑋>2 ) 𝑃 2 < 𝑋< 4
= 1 = 1 3/4
𝑃 𝑋> 𝑃 𝑋> ‫׬‬1/2 2𝑥 𝑑𝑥
2 2
= 1
Prof D Srinivasacharya, NIT Warangal,[email protected] ‫׬‬1/2 2𝑥 𝑑𝑥
Various Measures of central tendency,
dispersion
Let f(x) be the pdf of a random variable X where - < x <

1. Arithmetic mean = = ‫׬‬−∞ 𝑥 𝑓 𝑥 𝑑𝑥
∞ 1
2. Harmonic mean =1/H = ‫׬‬−∞(𝑥) 𝑓 𝑥 𝑑𝑥
3. If G is the geometric mean then

logG = ‫׬‬−∞ 𝑙𝑜𝑔𝑥 𝑓 𝑥 𝑑𝑥
4. rth moment about the point x=A is
/ ∞
𝜇𝑟 = ‫׬‬−∞(𝑥 − 𝐴)𝑟 𝑓 𝑥 𝑑𝑥
5. rth moment about mean is

𝜇𝑟 = ‫׬‬−∞(𝑥 − 𝜇)𝑟 𝑓 𝑥 𝑑𝑥

6. Variance = 𝜎2= ‫׬‬−∞(𝑥 − 𝜇)2 𝑓 𝑥 𝑑𝑥
∞ ∞ ∞
= ‫׬‬−∞ 𝑥 2 𝑓 𝑥 𝑑𝑥 − 2𝜇 ‫׬‬−∞ 𝑥𝑓 𝑥 𝑑𝑥 + 𝜇2 ‫׬‬−∞ 𝑓 𝑥 𝑑𝑥

= ‫׬‬−∞ 𝑥 2 𝑓 𝑥 𝑑𝑥 − 2𝜇. 𝜇 + 𝜇2
Prof D Srinivasacharya, NIT Warangal,[email protected]
7. Median : Median is the point that divides the entire distribution
in to two equal parts.
M 1
If M is median then ‫׬‬−∞ 𝑓 𝑥 𝑑𝑥 =
2

8. Mean Deviation about men= MD = ‫׬‬−∞ 𝑥 − 𝑚𝑒𝑎𝑛 𝑓 𝑥 𝑑𝑥
9. Quartiles : If Q1 and Q3 are first and third quartiles then
𝑄1 1 𝑄3 3
‫׬‬−∞ 𝑓 𝑥 𝑑𝑥 = and ‫׬‬−∞ 𝑓 𝑥 𝑑𝑥 =
4 4
𝐷 𝑖
10. Deciles : ith Decile Di is given by ‫׬‬−∞𝑖 𝑓 𝑥 𝑑𝑥 =
10
11. Mode : Mode is the value of x for which f(x) is maximum.
Mode is the solution of f/(x) = 0 and f//(x) < 0
12. Skewness :
13. Kurtosis :

Note : The formulae for these measures in case of discrete


frequency distribution can be easily extended by simply
replacing f (x) dx by p(xi) and integration over x by he
summation over 'i’.
Prof D Srinivasacharya, NIT Warangal,[email protected]
Problems
Example – 1 : If X is a continuous random variable with pdf
f(x) = k x (2 - x), 0  x  2.
Find the mean, variance, mean deviation about mean, mode,
harmonic mean and median

Since total probability is unity  ‫׬‬−∞ 𝑓 𝑥 𝑑𝑥 = 1
2
 ‫׬‬0 𝑓 𝑥 𝑑𝑥 = 1
2
 k ‫׬‬0 𝑥(2 − 𝑥)𝑑𝑥 = 1
2
2𝑥 2𝑥3
 𝑘 − =1
2 3 0
8
k 4 − =1
3
4 3
 k =1 k=
3 4
2
∞ 3 2 2 3 2𝑥 3 𝑥4
Mean = = ‫׬‬−∞ 𝑥 𝑓 𝑥 𝑑𝑥 = ‫( 𝑥 ׬‬2 − 𝑥)𝑑𝑥 = −
4 0 4 3 4 0
Prof D Srinivasacharya, NIT Warangal,[email protected]
3 2.23 24 3.24 1 1
Mean = = − = − =1
4 3 4 4 3 4
2 3 2
Varaince = 𝜎 2 = ‫׬‬0 𝑥 2 𝑓 𝑥 𝑑𝑥 − 𝜇2 = ‫׬‬0 𝑥 3 2 − 𝑥 𝑑𝑥 − 𝜇2
4
2
3 2𝑥 4 𝑥5 3.25 1 1 6 1
= − −1 = − −1= −1=
4 4 5 0 4 4 5 5 5

Mean Deviation about mean = MD


3 2
= ‫׬‬0 |𝑥 − 1|𝑓 𝑥 𝑑𝑥
4
3 1 3 2
= ‫׬‬0 𝑥 − 1 𝑓 𝑥 𝑑𝑥 + ‫׬‬1 𝑥 − 1 𝑓 𝑥 𝑑𝑥
4 4
3 1 3 2
= ‫׬‬0 (1 − 𝑥)𝑥(2 − 𝑥)𝑑𝑥 + ‫׬‬1 (𝑥 − 1)𝑥(2 − 𝑥)𝑑𝑥
4 4
3 1 3 2
= ‫׬‬0 (2𝑥 − 3𝑥 2 + 𝑥 3 )𝑑𝑥 + ‫׬‬1 (3𝑥 2 − 𝑥 3 − 2𝑥)𝑑𝑥
4 4
3 3𝑥 3 𝑥 4 1 3 3𝑥 3 𝑥 4 2
= 𝑥2 − + + − − 𝑥2
4 3 4 0 4 3 4 1
3 1 3 1
= 1−1 − + 8 − 4 − 4 − (1 − − 1)
4 4 4 4
3
=
8
Prof D Srinivasacharya, NIT Warangal,[email protected]
Mode is the value of x such that f/(x) = 0 and f//(x) < 0
3 3
Here f(x) = x(2-x) = (2 x – x2)
4 4
3 3
f/(x) = 0  (2 – 2 x) = 0  x = 1 and f//(x) = (– 2) < 0
4 4
Mode = 1
1 ∞ 1
Harmonic Mean H is given by = ‫׬‬−∞ 𝑓 𝑥 𝑑𝑥
𝐻 𝑥
2
3 2 3 𝑥2
= ‫׬‬0 (2 − 𝑥)𝑑𝑥 = 2𝑥 −
4 4 2 0
2
3 22 3
= 2.2 − =
4 2 0 2
2
Hence, H =
3
M 1 3 M 1
If M is the median then ‫׬‬0 𝑓 𝑥 𝑑𝑥 =  ‫׬‬0 𝑥(2 − 𝑥)𝑑𝑥 =
2 4 2
𝑀
2𝑥 2 𝑥3 2
 − =  3 𝑀2 − 𝑀3 =2
2 3 0 3
 𝑀3 − 3 𝑀2 + 2 = 0
 (𝑀 − 1)(𝑀2 − 2 M − 2) = 0
The only
Prof Dvalue of MNITlying
Srinivasacharya, in [0,2] is M = 1. Hence, Median = 1
Warangal,[email protected]

You might also like