Lecture 06
Lecture 06
MAT3026 Lecture 6 1
The Random Variable
A random variable X is a function that assigns to every element in the sample
space S a number representing the outcome of a random process.
We are interested in the range of values of X and their probabilities. Here, It is
important to make the distinction between a random process that has
outcomes in discrete space and one that has outcomes in continuous space.
outcomes outcomes
x x
Discrete space; the number of Continuous space; the number of
outcomes in this is space is countable. outcomes in this space is uncountable.
Q2 Q1
x
Q3 Q4
Any value continuous discrete
between 0 outcomes outcomes
and 360o
x (degrees) x (quadrant)
0 360 1 2 3 4
MAT3026 Lecture 5 3
The Probablity Distribution
Definition: If X is a discrete random variable, the function given by f (x) = P(X=x)
for each x in the range of X is called the probability distribution of X.
pmf pdf
MAT3026 Lecture 5 4
Basic Properties of the pmf Example of a discrete random
variable with three alternative
forms of expressing the pmf.
describes the probability for each outcome
x, and therefore must be positive.
x 1 2 3 4
The random variable covers all possible outcomes f (x) 0.3 0.4 0.1 0.2
and so the total probability is 1.
MAT3026 Lecture 5 5
Basic Properties of the pdf
The probability density function (pdf) pdf
for a continuous random variable has
the following properties:
MAT3026 Lecture 5 6
Example (discrete)
For the experiment of tossing a coin three times, find
the probability distribution for the random variable X
representing the number of heads in the outcome.
Sample Number X 0 1 2 3
space of heads Probability
f (x) 1/8 3/8 3/8 1/8 sum= 1
HHH 3 1/8
HHT 2 1/8
f (x) pmf
HTH 2 1/8
3/8 3/8
HTT 1 1/8
THH 2 1/8
1/8 1/8
THT 1 1/8
TTH 1 1/8 x, number
TTT 0 1/8
0 1 2 3 of heads
Solution
1.
pdf
2.
MAT3026 Lecture 5 8
Expectation Values
Expectation values are mathematical objects that summarize a distribution
in the form of a few descriptive values (descriptive statistics).
MAT3026 Lecture 5 9
Examples of the mean and standard deviation
(we will learn how to calculate and later).
= 1.67
= 0.24
Estimation
MAT3026 Lecture 5 10
Estimation
Examples
Estimate and for the following pdfs
= 4.17,
= 5.00, = 1.86
= 2.89
MAT3026 Lecture 5 11
Definition: mean,
Let X be a random variable with probability distribution f (x).
The mean of X is
MAT3026 Lecture 5 12
The expectation of the function g(X) is:
if X is discrete
if X is continuous
Some properties
a, b, n are constants
This approximation
improves as 0
MAT3026 Lecture 5 13
Example (discrete)
What is the mean number of heads obtained when three coins are tossed?
Solution f (x)
Results from an earlier today
X 0 1 2 3
f (x) 1/8 3/8 3/8 1/8
x
0 1 2 3
E(X)
= 01/8 + 13/8 + 23/8 + 31/8 = 1.5 Note that in this case, since is
the center of mass we can
The mean outcome of the random directly say, “by symmetry the
process is 1.5 heads. mean is 1.5”
MAT3026 Lecture 5 14
Example: A factory produces circular metal discs with various diameters X (cm)
with the probabilities P given below:
a) Calculate the average
diameter of the discs.
b) Calculate the average area
of the discs.
Solution x
with x = the disc diameter
E[X] = 4(1/12) + 5(1/12) + 6(1/4) + 7(1/4) + 8(1/6) + 9(1/6)
= 41/6 = 6.8333 6.8 cm.
Cross-check this result with an
estimate from a sketch of the pmf.
MAT3026 Lecture 5 15
Example: A factory produces circular metal discs with various diameters X (cm)
with the probabilities P given below:
a) Calculate the average
diameter of the discs.
b) Calculate the average area
of the discs.
Solution area = r 2 x
E[area] = E[ X 2/ 4] = x2/ 4
= (/4) E[X 2]
= (/4) [ 421/12 + 521/12 + 621/4 + 721/4 + 821/6 + 921/6 ]
= (/4) 48.8333’ = 38.3536 38.4 cm2.
Estimate: similar
(/4) E[X 2] (/4) E[X]2 = (/4) (41/6)2 = 36.7 cm2 Note that E[X]2 E[X2]
MAT3026 Lecture 5 16
Example (continuous)
The diameter, x, in cm of a sample of steel spheres can be considered to be a
uniform continuous random variable of the form: f (x) = k for 5 < X < 7 cm.
a) Sketch the pdf and determine the value of k for this pdf.
b) Determine the mean diameter of the steel spheres.
c) Calculate the mean volume of the steel spheres.
a)
b)
MAT3026 Lecture 5 17
The diameter, x, in cm of a sample of steel spheres can be considered to be a
uniform continuous random variable of the form: f (x) = k for 5 < X < 7 cm.
a) Sketch the pdf and determine the value of k for this pdf.
b) Determine the mean diameter of the steel spheres.
c) Calculate the mean volume of the steel spheres.
c)
Estimate: E[V]
MAT3026 Lecture 5 18
Variance and Standard Deviation
The variance ( 2) of a random variable X is defined by:
discrete
continuous
This is a measure of by how much the distributution varies about the mean value.
This is generally
easier to calculate
The standard deviation is then
Property:
MAT3026 Lecture 5 19
Example: The power (GWatts) generated by a tidal
power station is a continuous random variable X
having the probability density shown right.
Find the mean and standard deviation of X.
Solution
First, sketch and estimate: 1.7 0.25
1.67
We can describe the distribution in a more
simple way, as: Power = 1.67 0.24 GW
MAT3026 Lecture 5 20
Example:
In a computer game, a virtual first aid kit provides a random
healing value, H, to a player represented by the following
probability density function:
a) Show that this is a valid pdf.
b) Calculate the average healing value.
c) Calculate the standard deviation of the healing value.
d) What is the average and standard deviation of 100 H ?
Solution
First sketch and estimate the mean and s.d.
0.8, 2 covering about two-thirds of the
distribution 0.2
a)
Total probability = 1
MAT3026 Lecture 5 21
b) Calculate the average healing value.
Average = mean = E[H]
MAT3026 Lecture 5 22
Homework
1. Reviewing today’s lecture notes
they can be found on the course website.
2. Reading - read Walpole Sections 3.1, 3.2, 3.3, 4.1, 4.2
3. Exercises - can be found on the course website.
MAT3026 Lecture 5 23