0% found this document useful (0 votes)
2 views8 pages

XiriusLibrary-StasticsNoteRandomVariable2-STA102

A random variable is a function that assigns real numbers to outcomes in a sample space, classified into discrete and continuous types. Discrete random variables take on distinct values, while continuous ones can take any value within an interval. The document also covers expectation, variance, probability distributions, and cumulative distribution functions with examples for better understanding.
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)
2 views8 pages

XiriusLibrary-StasticsNoteRandomVariable2-STA102

A random variable is a function that assigns real numbers to outcomes in a sample space, classified into discrete and continuous types. Discrete random variables take on distinct values, while continuous ones can take any value within an interval. The document also covers expectation, variance, probability distributions, and cumulative distribution functions with examples for better understanding.
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 Variables

A random variable is a function that assigns a real number to each outcome in a sample space,
which represents all possible outcomes of a given experiment.
Example 1
Let’s consider the experiment of tossing 3 coins simultaneously.
S HHH , HHT , HTH , THH , HTT , THT , TTH , TTT
Let X be the random variable representing the number of tails obtained when three coins are
tossed simultaneously.
x x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8
0,1,1,1, 2, 2, 2,3
Let Y be the random variable representing the number of heads obtained when three coins are
tossed simultaneously.
y y1 , y2 , y3 , y4 , y5 , y6 , y7 , y8
3, 2, 2, 2,1,1,1,0
Random variables can be classified into two types: discrete and continuous
Discrete Random Variables
A discrete random variable is one that can take on a finite or countably infinite set of distinct
values. These values are typically whole numbers and arise from outcomes that can be
individually counted, such as coin tosses, card draws, or dice rolls.
Continuous Random Variable
A continuous random variable is one that can take on any value within a given interval,
representing an infinite number of possible outcomes. Examples include measurements such as
height, weight, temperature, and time.
Expectation of a Random Variable

The mathematical expectation of a random variable denoted by E(X) is defined as

n
E(X) = 
i 1
xi p( x) for a discrete random variable


=  xf ( x)dx for a continuous random variable

It should be noted that the mean of a random variable is the expectation of the random variable.
Variance of a random variable
The variance, V(X) of any random variable is defined as:

V(X) = E(X2) – [E(X)]2


n
Where E(X2) = 
i 1
xi2 p( x) for a discrete random variable



 x
2
= f ( x)dx for a continuous random variable

Probability Distributions
Discrete Probability Distribution Function
Any function P(x) = P(X = x) defined for a discrete random variable such that P(x)  0 for each x
n
and 
i 1
xi p( x) = 1, for all xi is called a probability distribution function for a random variable
X.
Example 1
A coin is tossed three times. What is the probability function of the appearance of the heads?
And show that the probability function is indeed a proper probability distribution function.
Solution
S HHH , HHT , HTH , THH , HTT , THT , TTH , TTT
The list of outcomes and the attached probabilities are:
Outcome Probability

TTT ⅛
TTH ⅛
THT ⅛
THH ⅛
HTT ⅛
HTH ⅛
HHT ⅛
HHH ⅛
TOTAL 1

If x represents the number of heads appearing, this will lead to the table below:
X P(x)
0 1/8
1 3/8
2 3/8
3 1/8
TOTAL 1
Since  P(x) = 1 and the values of x are all discrete, therefore P(x) is a proper probability
distribution function.
Example 2
A pair of fair dice is tossed and the sum of points obtained is observed. Find the probability
distribution of the event.
Solution
Let x be the sum of points obtained. The probability distribution is shown below:

X 2 3 4 5 6 7 8 9 10 11 12

P(x) 1 2 3 4 5 6 5 4 3 2 1
36 36 36 36 36 36 36 36 36 36 36

Continuous Probability Density Function


Any function f(x) defined for a continuous random variable x such that f(x)  0 for each x and


 xf ( x)dx  1 is called a probability density function.


Example 1
A continuous random variable X having values only between 0 and 4 has a density function
1
given by f(x) = ax , where a is constant.
2

a. Calculate a
b. Find Pr(1x2)
Solution
a. f(x) being a density function means that:
4 4

0 f ( x)dx  1  0 ( 2  ax)dx  1
1

4 4
1
dx axdx 1
0
2 0
4
2
1 4 x
2
x a 1
0
2 0
1 4 1
2
x 0 2
4 0 2
4
2
x 42 02
a a 8a
2 2 2
0

2 8a 1
8a 2 1
1
a
8

 f  x 
1 x
2 8
2
1 x
b. Pr (1x2) = 1 ( 2  8 )dx
2 2
1 x
1 2 dx  1 8 dx
2
2
1 2 1 x
2
x 8
1
2 1

1 2 2 1 1
2
x 1 2 2 2
2
2
1 x 1 4 1 3
8 2 8 2 2 16
1

1 2 8 3 5
=
2 16 16 16

Mean and Variance of a Probability Function


The mean and variance of any given probability function is given as:
Mean = E (X)= ∑ x P (x) – when x is discrete

=
 xf ( x)dx

-when x is continuous

Variance = V (X) = E (X2)- [E(X)]2


= ∑x2 p(x) - [∑ x p(x)]2 - when X is discrete
  2
=


x2 f ( x)dx  (  xf ( x)dx)

- when X is continuous

Example 1
Obtain the mean and the variance of X from the table below:
x 0 1 2
p(x) 1 2 1
4 4 4

Solution
Mean = E(x) = ∑x p(x)
= 0 14 1 2
4
2 1
4
4
= 24 2
4 4
1

Variance = V(X) = E(X2) - [E(X)]2


E(X2)= ∑X2 p(x)
= 02 1 4 12 2
4
22 1
4
6 6/4 – (4/4)2
= 24 4 4  V(X) =
4

6 4 2 1
= 6 4 -12
4 4 2
1
 Variance =
2
Example 2
A continuous random variable X has the density function,
1 x
f(x) =  , 0 x4. Obtain the mean and variance of X
2 8
Solution

Mean of X = E(X) =
 xf ( x)dx
4 4 2
1 x x x
0 x( 2  8 )dx  0 2  8 dx
4 4
x x2

0
2
dx  
0
8
dx
4 4
2 3
1 x 1 x
2 2 8 3
0 0

16 64 96 64 32 4
2 24 24 24 3

Variance = V(X) = E(X2)- [E(X)]2


4 4
x2 ( 1  x )dx  ( x2  x3 )dx
0 0 2 8
2
E X =
2 8
4
x2  x3 )dx  4 x2 x3
4

0 (
2 8 0 2
dx  
0
8
dx

4 4
3 4
1 x 1 x 64 256
2 3 8 4 6 32
0 0

512
192

14536
V ( X )  512   4 
2

= 0.889
192  3  1728

Distribution Functions
Cumulative Distribution Function

The cumulative distribution function of a random variable X can be defined as the probability
that the random variable X takes a value less than or equal to x; that is F x P X x

F x =  f (t ) , -  x   ;
q x
X is discrete

where f(t) is the value of the probability distribution of X at t, is called the distribution function
or cumulative distribution function of X.
x
Also, the function F(X) =  f (t )dt ; X is continuous
where f(t) is the value of the probability density function of X at t, is called the distribution
function or cumulative distribution function of the continuous random variable X.

Properties of a distribution function

1. F 0
2. F(+ ) = 1 F 1
3. If a b, then F a F b
4. P (a x b) F b –F a

5. For a continuous variable,


dF ( x)  f ( x)
dx
Example 1
1. Given the table below, find F(3)
0 1 2 3 4

1/16 4/16 6/16 4/16 1/16

Solution
F(3) = P (X  3)

= p(0) + p(1) + p(2) + p(3)

=
1464
16 16 16 16
15
16

Example 2

Given that f(x) = 3e-3x, x 0, find F(x).


Solution
x x
  3e dt =  e |
3t 3 t x
F(x) = f (t )dt = 0
 
3x
= 1e
0, x  0

F(x) = 
1e
3 x

 ,x 0

You might also like