Download Chapter 2: Random variables

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
2.1 Introduction
In an experiment of chance, outcomes occur randomly. We often
summarize the outcome from a random experiment by a simple
number.
Definition 2.1
A variable is a symbol such as X, Y, Z, x or H, that assumes values
for different elements. If the variable can assume only one value, it
is called a constant.
A random variable is a variable whose value is determined by the
outcome of a random experiment.
Example 2.1
A balanced coin is tossed two times. List the elements of the
sample space, the corresponding probabilities and the
corresponding values x, where X is the number of getting head.
Solution
Elements of
sample space
Probability
x
HH
¼
2
HT
¼
1
TH
¼
1
TT
¼
0
Also we can write P(X=2)=1/4, for example, for the probability
of the event that the random variable X will take on the value 2.
Definition 2.2:
Discrete Random Variables
A random variable is discrete if its set of possible values
consist of discrete points on the number line.
Continuous Random Variables
A random variable is continuous if its set of possible values
consist of an entire interval on the number line.
Examples of discrete random variables:
• number of scratches on a surface
• proportion of defective parts among 1000 tested
• number of transmitted bits received error
Examples of continuous random variables:
• electrical current
• length
• pressure
• time
• voltage
Definition 2.3:
If X is a discrete random variable, the function given by
f(x)=P(X=x) for each x within the range of X is called the
probability distribution of X.
Requirements for a discrete probability distribution:
1) The probability of each value of the discrete random variable
is between 0 and 1, inclusive. That is, 0  P( X  x)  1
2) The sum of all the probabilities is 1. That is,
 P( X  x)  1
xS
Example 2.2
Check whether the distribution is a probability distribution.
X
0
1
2
3
4
P(X=x)
0.125
0.375
0.025
0.375
0.125
Solution
4
 P( X  x)  P( X  0)  P( X  1)  P( X  2)  P( X  3)  P( X  4)
0
= 0.125+0.375+0.025+0.375+0.125
= 1.025
1
# so the distribution is not a probability distribution.
Example 2.3
Check whether the function given by
x2
f ( x) 
for x =1,2,3,4,5
25
can serve as the probability distribution of a discrete random
variable.
Solution
5

1
x2
25
1
= f (1)  f (2)  f (3)  f (4)  f (5)
1 2 2  2 3  2 4  2 5  2
=




25
25
25
25
25
3
4
5
6
7
=
   
25 25 25 25 25
25
=
25
1
5
f ( x)  
# so the given function is a probability distribution of a
discrete random variable.
Definition 2.4:
A function with values f(x), defined over the set of all
numbers, is called a probability density function of the
continuous random variable X if and only if
b
P(a  X  b)   f ( x) dx
a
for any real constant a and b with a  b
Requirements for a probability density function of a
continuous random variable X:
1) f ( x)  0 for -  x  
2)



f ( x) dx  1. That is the total area under graph is 1.
Example 2.4
Let X be a continuous random variable with the
following probability density function
c(2 x3  5) ,  1  x  1
f ( x)  
, otherwise
0
1) Evaluate c
2) Find P(0  X  1)
Solution
a)
1
P ( 1  X  1) 
3
c
(2
x
 5) dx

1
1
= c  (2 x 3  5) dx
1
4
= c(
1
2x
 5 x)
4
1
 2(1) 4
  2( 1) 4

= c 
 5(1)   
 5( 1)  
4
4
 


 11   9  
= c 
    
2
  2 

= c 10 
=1
 c
1
10
b)
1
1
2 x 3  5  dx

10
0
P (0  X  1)  
4
1
1 2x
=
(
 5x )
10 4
0
  2(0) 4

1  2(1) 4
=
 5(1)   
 5(0)  

10  4
  4

1  11 
=
 
10  2 
11
=
20
= 0.55
The cumulative distribution function of a discrete random
variable X , denoted as F(x), is

F ( x)  P( X  x)   f (t ) for    x  
tx

For a discrete random variable X, F(x) satisfies the following
properties:
1) 0  F ( x)  1
2) If x  y, then F ( x)  F ( y )

If the range of a random variable X consists of the values
x1  x2  x3  ...  xn , then f ( x1 )  F ( x1 ) and
f ( xi )  F ( xi )  F ( xi 1 ) for i  2,3,..., n

The cumulative distribution function of a continuous
random variable X is
x
F ( x)  P( X  x) 

f (t ) dt for    x  

Let F  x  be the distribution function for a continuous random
dF ( x)
variable X . Then f ( x) 
 F ( x)
dx
wherever the derivative exists.
Example 2.5
5 x
Given the probability function f ( x) 
for x  1, 2,3, 4,
10
find F ( x)
solution
x
1
2
3
4
f(x)
4/10
3/10
2/10
1/10
F(x)
4/10
7/10
9/10
1
Example 2.6
If X has the probability density
k  e 3 x for x  0
f ( x)  
elsewhere
0
Find
i) k
ii) F ( x)
iii) P(0.5  x  1)
Solution

i)
 f  x  dx  1


 k e
0
3 x

e 
dx  k 


3

0
3 x
  1 
 k 0   
  3  
k
 1
3
 k 3
ii) for x  0,
F  x 
x
 0 dt  0

for x  0,
F  x 
0


x
0 dt   3e 3t dt
0
x
 0  3 e 3t dt
0
x
e 
 3


3

0
3t
 1 e 3 x  e0   1  e 3 x
0
 F  x  
3 x
1  e
for x  0
for x  0
iii) P  0.5  X  1  F 1  F  0.5 

 
 1  e 31  1  e 3 0.5
 1  e 3   1  e 1.5 
 0.173

2.5.1 Expected Value
 The mean of a random variable X is also known as the
expected value of X as    X  E ( X )

If X is a discrete random variable,
 X  E ( X )   xf ( x)   xP( X  x)
xS

xS
If X is a continuous random variable,
X  E( X ) 

 xf ( x)

Var ( X )   2   X2  E (( X   ) 2 ), where
Var ( X )   ( X   ) 2 P ( X  x), in the discrete case,
xS

Var ( X ) 
2
(
X


)
f ( x)dx , in the continuous case when it exists.


Var ( X ) exists if and only if   E ( X ) and E ( X 2 ) both exist, and
then Var ( X )  E ( X 2 )  ( E ( X )) 2
The standard deviation is    X  Var ( X )   X2
2.5.4 Properties of Expected Values
For any constant a and b,
i) E (a)  a
ii) E (bX )  bE ( X )
iii) E (aX  b)  aE ( X )  b
2.5.5 Properties of Variances
For any constant a and b,
i) Var ( X )  0
ii) Var (bX )  b Var ( X )
2
iii) Var (aX  b)  a 2Var ( X )
Example 2.7
Find the mean, variance and standard deviation
of the probability function
x
f ( x) 
for x  1, 2,3, 4
10
Solution
Mean:
n
E  X    x  f  x
i 1
4
x
 x
10
i 1
1
2
3
4
 1  2   3   4 
10
10
10
10
30

3
10
Varians:
EX
x
n
2
2
 f  x
i 1
4
x
x 
10
i 1
1
2
3
4
 12   22   32   4 2 
10
10
10
10
 10
2
Var ( X )  E ( X 2 )  ( E ( X )) 2
 10  32  1
 X  Var ( X )  1
Example 2.8
Let X be a continuous random variable with the
Following probability density function
3
 x(2  x), 0  x  2
f ( x)   4
0
, otherwise
Find
a) E ( X )
b) Var ( X )
Solution
a) E  X

 
x f
 x
dx

2


x
0
3
x  2  x  dx
4
2
3

4

3

4
2
x2
2  x
dx
0
2
3
2
x

x
dx

0
3  2 x3
x4 




4 3
4 
2
0
3

3  2  2 
24 

  0



4
3
4 




34

  1
43
b)E  X

2
 
x2  f
 x
dx

2


x2 
0
2
3

4

3

4
2
3
x  2  x  dx
4
x 3  2  x  dx
0
3
4
2
x

x
dx

0
2
3  2x4
x5 
 


4 4
5 0
 2  2 4 

25 

  0



4
5





38
6
  
45
5
3

4
Var ( X )  E ( X 2 )  ( E ( X )) 2
6
1

 12 
5
5
Related documents