Professional Documents
Culture Documents
1 Definition of random variable Sometimes, it is not enough to describe all possible results of an
experiment:
2 Discrete and continuous random variable
Toss a coin 3 times: {(HHH), (HHT), …}
Probability function Throw a dice twice: {(1,1), (1,2), (1,3), …}
Distribution function
Some tine it is useful to associate a number to each result of an experiment
Density function
Define a variable
3 Characteristic measures of a random variable
We don’t know the result of the experiment before we carry it out
Mean, variance
We don’t know the value of the variable before the experiment
Other measures
3 4
Estadística, Profesora: María Durbán Estadística, Profesora: María Durbán
1 Definition of random variable 1 Definition of random variable
si
Examples
E X(si) = b; si ∈ E
sk
Resistance to compression of concrete • The space RX is the set of ALL possible values of X(s).
• Each possible event of E has an associated value in RX
• We can consider Rx as another random space
5 6
Estadística, Profesora: María Durbán Estadística, Profesora: María Durbán
X(sk) = a 22 Discrete
RX Discrete and
and continuos
continuousrandom
randomvariables
variable
Probability function
a b Distribution function
Density function
The elements in E have a probability distribution, this distribution is also
associated to the values of the variable X. That is, all r.v. preserve the 3 Characteristic measures of a random variable
probability structure of the random experiment that generates it:
Mean, variance
Other measures
Pr( X = x) = Pr( s ∈ E : X ( s ) = x)
4 Transformation of random variables
7 8
Estadística, Profesora: María Durbán Estadística, Profesora: María Durbán
2 Discrete and continuous random variables 2 Discrete and continuous random variables
Examples
Examplesof
ofdiscrete
discreterandom
randomvariables
variables
The rank of a random variable una variable aleatoria is the set of
possible values taken by the variable. Number
Numberof
offaults
faultson
onaaglass
glasssurface
surface
Depending on the rank, the variables can be classified as: Proportion
Proportionof
ofdefault
defaultparts
partsininaasample
sampleof
of1000
1000
Generally count
Number
Numberof
ofbits
bitstransmited
transmitedand
andreceived
receivedcorrectly
correctly the number of times
Discrete:Those
Discrete: Thosethat
thattake
takeaafinite
finiteor
orinfinite
infinite(numerable)
(numerable)number
numberof
ofvalues
values that something
Examples happens
Examplesof
ofcontinuous
continuous random
randomvariables
variables
Continuous:Those
Continuous: Thosewhose
whoserank
rankisisan
aninterval
intervalof
ofreal
realnumbers
numbers
Electric
Electriccurrent
current
Longitude
Longitude Generally measure a
magnitude
Temperature
Temperature
9 Weight
Weight
10
Estadística, Profesora: María Durbán Estadística, Profesora: María Durbán
∑ p( x ) = 1
i =1
i
11 12
Estadística, Profesora: María Durbán Estadística, Profesora: María Durbán
2 Discrete random variables 2 Discrete random variables
E 0
1/ H H X P(X=x)
TH 4
HH TT 1/
HT 2
Pr 0 1/4
H T
X 1
1 1/2
RX
T H 2 1/4
0 1 2
T T
13 14
Estadística, Profesora: María Durbán Estadística, Profesora: María Durbán
p(x) X P(X=x)
0 1/4
F ( x0 ) = P ( X ≤ x0 )
1 1/2 F (−∞) = 0 F (+∞) = 1
if X takes values x1 ≤ x 2 ≤ K ≤ x n :
2 1/4 F ( x1 ) = P( X ≤ x1 ) = p ( x1 )
F ( x2 ) = P( X ≤ x2 ) = p ( x1 ) + p ( x2 )
M
x=0 x=1 x=2 X
F ( xn ) = P( X ≤ xn ) = ∑ i =1 p( xi ) = 1
n
15 16
Estadística, Profesora: María Durbán Estadística, Profesora: María Durbán
2 Discrete random variables 2 Discrete random variables
17 18
Estadística, Profesora: María Durbán Estadística, Profesora: María Durbán
19 20
Estadística, Profesora: María Durbán Estadística, Profesora: María Durbán
2 Continuous random variables 2 Continuous random variables
21 22
Estadística, Profesora: María Durbán Estadística, Profesora: María Durbán
histogram:
The density function
doesn’t have to be
0.4
symmetric, or be
define for all values fX (x | β )
0.3
x2
0.2
0.1
depend on one
0 5 10 15 20 25 30
or more
parameters
y
If we make the intervals smaller and smaller:
23 24
Estadística, Profesora: María Durbán Estadística, Profesora: María Durbán
2 Continuous random variables 2 Continuous random variables
f ( x)
25 26
Estadística, Profesora: María Durbán Estadística, Profesora: María Durbán
Example Example
The density function of the use of a machine in a year What is the probability that a machine randomly selected has
(in hours x100): been used less than 320 hours?
f(x) f(x)
As in the case of discrete random variables, we can define the distribution As in the case of discrete random variables, we can define the distribution
of a continuous random variables by means of the Distribution function: of a continuous random variables by means of the Distribution function:
x x
F ( x) = P( X ≤ x) = ∫ f (u ) du −∞ < x < ∞ F ( x) = P( X ≤ x) = ∫ f (u ) du −∞ < x < ∞
−∞ −∞
x 29 30
Estadística, Profesora: María Durbán
The Distribution function satisfies the following properties: The Distribution function satisfies the following properties:
−∞
If we define the following disjoint events: F (−∞) = Pr( X ≤ −∞) = ∫ f ( x)dx = 0
−∞
{ X ≤ a} {a < X ≤ b} → { X ≤ a} ∪ {a < X ≤ b} = { X ≤ b} +∞
First axiom of F (+∞) = Pr( X ≤ +∞) = ∫ f ( x)dx = 1
probability −∞
Pr( X ≤ b) = Pr( X ≤ a ) + Pr(a < X ≤ b) ≤ F (b)
≥0
31 32
Third axiom of probability
Estadística, Profesora: María Durbán Estadística, Profesora: María Durbán
2 Continuous random variables 2 Continuous random variables
Example
Example
x ⎪
2.5 5 ⎪
33 ⎩1 Pr( X ≤ 5) x≥5 34
Estadística, Profesora: María Durbán Estadística, Profesora: María Durbán
P(x<3.2) P(x<3.2)
x=3.2
⎧
⎪0.08 x 2 0 < x < 2.5
⎪⎪
F ( x) = ⎨-1 + 0.8 x - 0.08 x 2.5 ≤ x < 5
2
⎪
⎪
⎪⎩1 x≥5
35 36
Estadística, Profesora: María Durbán Estadística, Profesora: María Durbán
Introduction to Random Variables 3 Characteristic measures of a r.v.
Central measures
2 Discrete and continuous random variable In the case of a sample of data, the sample mean allocates a weight of
1/n to each value:
Probability function 1 1 1
x = x1 + x2 + K + xn
Distribution function n n n
Density function
The mean μ or Expectation of a r.v. uses the probability as a weight:
33Characteristic
Characteristicmeasures
measuresofofaarandom
randomvariable
variable
μ = E [ X ] = ∑ xi p( xi ) discrete r.v.
Mean, variance i
Other measures +∞
μ = E [ X ] = ∫ x f ( x) dx continuous r.v.
−∞
4 Transformation of random variables
37 38
Estadística, Profesora: María Durbán Estadística, Profesora: María Durbán
Intuitively: Median = value that divides the total probability in to parts ⎧ 0.4
⎪ 2.5 x, 0 < x < 2.5
⎪
⎪ 0.4
f ( x) = ⎨0.8 − x, 2.5 ≤ x < 5
⎪ 2.5
P( X ≤ m) = 0.5
⎪0, elsewhere
⎪
⎩
F (m) ≥ 0.5
+∞ 0.4 2 0.4 2
E[X ] = ∫
2.5 5
0.5 0.5 xf ( x)dx = ∫ x dx + ∫ 0.8 x − x dx
−∞ 0 2.5 2.5 2.5
= 2.5
39 40
Estadística, Profesora: María Durbán Estadística, Profesora: María Durbán
3 Characteristic measures of a r.v. 3 Characteristic measures of a r.v.
If we want to know the time of use such that 50% of the machines
have a use less or equal to that value
The percentil p of a random variable is the value xp that satisfies:
F (m) = 0.5
⎧0.08 x 2 0 < x < 2.5 p( X < x p ) ≤ p y p( X ≤ x p ) ≥ p discrete r.v.
⎪
F ( x) = ⎨-1 + 0.8 x - 0.08 x 2 2.5 ≤ x < 5 F (xp ) = p continuous r.v.
⎪1 x≥5
⎩
A special case are quartiles which divide the distribution in 4 parts
0.08 x 2 = 0.5 → m = 2.5
-1 + 0.8 x - 0.08 x 2 = 0.5 → m = 2.5 Q1 = p0.25
Q2 = p0.5 = Median
Q3 = p0.75
41 42
Estadística, Profesora: María Durbán Estadística, Profesora: María Durbán
Var [ X ] = E ⎡( X − E [ X ]) ⎤ Var [ X ] = E ⎡( X − E [ X ]) ⎤
2 2
⎣ ⎦ ⎣ ⎦
The sample variance of a set of data is given by:
1 1 1
Var [ X ] = E ⎡⎣ X 2 ⎤⎦ − ( E [ X ])
2
s2 = (x1 −x)2 + (x2 −x)2 +K+ (xn −x)2
n n n
The Variance of a r.v. also uses the probability as a weight:
E ⎡( X − E [ X ]) ⎤ = E ⎡ X 2 + ( E [ X ]) − 2 XE [ X ]⎤
2 2
⎣ ⎦ ⎣ ⎦
= E ⎡⎣ X 2 ⎤⎦ + ( E [ X ]) − 2 E [ X ] E [ X ] E [ X ] is a constant,
2
σ = Var [ X ] = ∑ ( xi − μ ) p( xi )
2 2
discrete r.v. does not depend on X
= E ⎡⎣ X 2 ⎤⎦ − ( E [ X ])
2
i It is a linear operator
+∞
σ 2 = Var [ X ] = ∫ ( x − μ ) 2 f ( x) dx continuous r.v. 43 44
Estadística, Profesora: María Durbán −∞ Estadística, Profesora: María Durbán
Introduction to Random Variables 4 Transformation of random variables
Mean, variance 11
Y = g( X ) |X |
Other measures XX
X
4 Transformation
4 Transformation of of random
random variables
variables log X X
45
e 46
Estadística, Profesora: María Durbán Estadística, Profesora: María Durbán
Example
If X is a continuous r.v. Y=h(X), where h is derivable and inyective
The velocity of a gas particle is a r.v. V with density function
dx
fY ( y ) = f X ( x ) (b 2 / 2)v 2 e − bv v > 0
dy fV (v) =
0 elsewhere
For discrete r.v.: The kinetic energy of the particle is W = mV 2 / 2 What is the density
function of W?
pY ( y ) = Pr(Y = y ) = ∑
h ( xi ) = y
Pr( X = xi )
51 52
Estadística, Profesora: María Durbán Estadística, Profesora: María Durbán
4 Transformation of random variables 4 Transformation of random variables
Example Example
The velocity of a gas particle is a r.v. V with density function The velocity of a gas particle is a r.v. V with density function
W = mV 2 / 2 → v = 2w / m v = − 2w / m
(b 2 / 2m) 2w / m e − b 2 w / m w > 0
fW ( w) =
( )e
dv 1
=
2
fV (h −1 ( w)) = (b 2 / 2) 2w / m −b 2 w / m
0 elsewhere
dw 2mw
53 54
Estadística, Profesora: María Durbán Estadística, Profesora: María Durbán
Expectation Expectation
+∞ +∞
E [ h( X ) ] =
∫ −∞
h( x) f X ( x)dx
E [ h( X ) ] =
∫ −∞
h( x) f X ( x)dx
∑ h( xi ) p ( X = xi ) ∑ h( xi ) p ( X = xi )
Y = h( X ) xi , h ( xi ) = y xi , h ( xi ) = y
increasing
Linear Transformations
+∞ +∞ dx
E [ y] = ∫ yf y ( y )dy = ∫ h( x) f X ( x) dy
−∞ −∞ dy Y = a + bX
E [Y ] = a + bE [ X ]
Var [Y ] = b 2Var [ X ]
55 56
Estadística, Profesora: María Durbán Estadística, Profesora: María Durbán