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

Discrete Random Variables

This document provides an overview of discrete random variables. Some key points: - Discrete random variables take on countable values that are separated or disjointed. Examples include the number of children in a family or number of accidents in a week. - A discrete random variable is represented by a symbol like X and has an associated probability function P(X=x) that gives the probabilities of each possible value. - Probability functions are frequently displayed as step functions or bar charts to clearly show the probabilities for each value. - Events involving discrete random variables, like X≥3, can be evaluated by calculating the probabilities of individual values that satisfy the event. - Examples are provided to demonstrate calculating probabilities

Uploaded by

syahmi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
124 views

Discrete Random Variables

This document provides an overview of discrete random variables. Some key points: - Discrete random variables take on countable values that are separated or disjointed. Examples include the number of children in a family or number of accidents in a week. - A discrete random variable is represented by a symbol like X and has an associated probability function P(X=x) that gives the probabilities of each possible value. - Probability functions are frequently displayed as step functions or bar charts to clearly show the probabilities for each value. - Events involving discrete random variables, like X≥3, can be evaluated by calculating the probabilities of individual values that satisfy the event. - Examples are provided to demonstrate calculating probabilities

Uploaded by

syahmi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 46

SSCE 2193

Engineering Statistics
Chapter 1 Random Variables
1A
Discrete Random Variables
Data Types
• Statistics uses many different types of data. They
can be non-numerical data, such as state of birth,
level of education, occupation, etc. These are
qualitative data. We shall look at such data in
Chapter 5 and 7.
• The type we are interested in at the moment are
quantitative data. They are numbers. These can be
1. Discrete: number of children, number of
distinctions, number of credits, etc.
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
Data Types (contd)
2. Positive continuous: weight, height, time,
etc. These have real values which are
continuous, but only positive values are
allowed.
3. Continuous: temperature, credit in bank,
etc. These are also continuous, but may also
accept negative values.

SSCE 2193 Engineering Statistics 1A


Discrete Random Variables
Random Variables
• If we use a variable X to represent discrete values,
we call X a discrete random variable. The word
random here means the values of X are obtained
by observation or experiment, not determined by a
certain rule.
• All statistical data are random in nature. This is
because all data used are obtained as a result of
actual processes of collection.

SSCE 2193 Engineering Statistics 1A


Discrete Random Variables
Discrete Variables
• A discrete variable X contains separated, disjoint
data. Typical examples are those numbers used in
counting.
• For example, in a survey on the number of
accidents happening in a week, the values
obtained would be 0, 1, 2, etc.
• Another example is when we measure the number
of luggage bags carried by a passenger, 0, 1, 2,
etc.
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
Variable Representation
• We use a symbol X (or Y, Z) to represent a
discrete variable in the form of a set.
• If X can take the values of 1, 3, 7 and 15 only,
then we write X = {1, 3, 7,15}.
• When the elements in X are all values between
two number, we use a simplified symbol, such as
X = {x| 1  x  10}, which is the same as {1, 2, 3,
4, 5, 6, 7, 8, 9, 10}.
• In some cases, the values of X can be described
using a formula. For example, X = {i2, 5  i  25}.
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
Symbols
• The practice in describing events is to
combine the use of capital and small-case
letters. Thus if X={1, 2, 3, 4, 5, 6}, then we
use small case letter x to represent the
elements in the probabilities. Thus we write
P(X = x), meaning x can be any of the
elements 1, 2, 3, 4, 5 and 6.

SSCE 2193 Engineering Statistics 1A


Discrete Random Variables
Randomness
• When we have a set of random discrete data, there
is an added property which we need to introduce:
probability.
• Suppose we find that 30% of passengers on an
express bus do not carry any bag, 50% carry one,
15% carry 2 and 5% carry 3 bags.
• Let us use the symbol B to represent the number
of bags. Then B={0, 1, 2, 3}. Also P(B=0) = 0.3,
P(B=1) = 0.5, P(B=2) = 0.15, and P(B=3) = 0.05.

SSCE 2193 Engineering Statistics 1A


Discrete Random Variables
Probability Function
• Take note that the total probabilities 0.3 + 0.5 +
0.15 + 0.05 = 1, as it must be.
• The function P(B = b) is called the probability
function of B. Every random discrete variable has
a probability function.
• Actually, a random variable X must have a
probability function to describe the probabilities of
events in X. The value provides us with
information on calculating the probabilities of
each events. This gives us the information on the
distribution of events.
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
• A discrete random
variable with a Step function
probability function is
frequently represented • Then we can represent
as a step function. For X as step function
example, if X = {1, 2, 3,
4, 5} with the  0.1 x  1
probabilities  0.3 x  2
p(X=1)=0.1, 
p( X  x)   0.5 x  3
p(X=2)=0.3, 0.15 x  4
p(X=3)=0.5, 
p(X=4)=0.15, and 0.05 x  5
p(X=5)=0.05.
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
A simpler form
• The function can also • By using a step
be written as function, the
probabilities are
 0.1, 1
shown clearly in
 0.3, 2
 correspondence to the
p( X  x)   0.5, 3 variable.
0.15, 4

0.05, 5

SSCE 2193 Engineering Statistics 1A


Discrete Random Variables
Bar chart for X
• It is instructive to • Bar chart for P().
display the probability
function of a variable in
the form of a bar chart.
For example, if X = {1,
2, 3, 4} and P(X=1)=0.4,
P(X=2)=0.2, P(X=3) =
0.3 and P(X=4)=0.1,
then the bar chart for P()
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
Events in DRV
• Given a DRV X, and events in X, we can
determine the probability of each event.
Such events are usually expressed as sets.
• For example, if X={1, 2, 3, 4} has a
probability function P(X=x) such that
P(X=x) = (6 –x)/14, then P(X<3) =
P(X=1)+P(X=2) = 5/14 + 4/14 = 9/14.

SSCE 2193 Engineering Statistics 1A


Discrete Random Variables
Examples
Ex 1. If X={1, 2, 3, 4} with P(X=1)=0.4,
P(X=2)=0.1, P(X=3)=0.3 and P(X=4)=0.2,
then find
(a) P(X3)
(b) P(0X3).
Solution:
(a) P(X3)=P(X=3)+P(X=4)=0.3+0.2=0.5
(b) P(0X3)= P(X=1)+P(X=2)+P(X=3) =0.8
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
Examples (Contd)
Ex 2: If X={2, 4, 6, 8} with P(X=2)=P(X=4) = 0.1,
P(X=6)=0.6 and P(X=8)=0.2, find
(a) P(X2 > 50)
(b) P(|X – 3|=1}
Solution:
(a) There is only one element of X satisfying X2 >
50, which is 8. Hence P(X2 > 50) = P(X=8) =
0.2.
(b) The set |X – 3|=1 is the same as {2, 4}. So P(|X
– 3|=1) = P(X=2)+P(X=4) = 0.7.
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
About , <,  and >.
• In discrete sets, there frequently are differences
between events Xa and X<a. For example, if the
set X is {1, 2, 3, 4, 5, 6, 7}, then X3 is {1, 2, 3},
but X<3={1, 2}. The same is true between Xb
and X>b.
• In some cases, the sets may be the same: X  2.5
is of course the same as X<2.5. This is because of
the nature of the set itself. Care must be taken to
interpret the sets properly in evaluating
probabilities.
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
Examples (Contd)
Ex 3: The variable X={1, 2, 3, 4, 5, 6} has its
probability function P() such that P(X=1)=
P(X=6)=1/12; P(X=2) =P(X=5)= 1/6. If
P(X=3)=P(X=4), find
(a) P(X=3);
(b) P(X<3).
Solution:
(a) P(X=3) = (1 – 2/12 –2/6)/2 = ¼.
(b) P(X<3) = P(X=1)+P(X=2) = 1/12+1/6 = ¼.

SSCE 2193 Engineering Statistics 1A


Discrete Random Variables
Examples (Contd)
Ex 4: The random variable K={-1, -2, 0, 1, 2, 3} has a
probability function P() with P(K=-1)=p(K=3) = m,
P(K=-2, P(K=2) = 2m, and P(K=0)=P(K=1)= 4m. Find
(a) The value of m.
(b) P(K>0)
(c) P(|K|>2)
Solution:
(a) m+2m+4m+4m+2m+m = 1. So m=1/14.
(b) P(K>1) = P(K=2 or 3) = 2/14+4/14=6/14
(c) P(|K|>2) = P(K=3) = 4/14.
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
DRVs from problems
• Many DRVs are developed based on problems
involving probabilities of events.
• Example: There are three ladies and five men
applying for four positions in a company, and they
are equally qualified for the jobs. Let L represent
the number of ladies selected. Then L={0, 1, 2, 3},
corresponding to none, 1, 2 or 3 ladies who
succeed. We can calculate the probabilities for all
the values of L below. (Note: it will be clearer if
you use a tree diagram to assist you).

SSCE 2193 Engineering Statistics 1A


Discrete Random Variables
DRVs from problems (contd)
• P(L=0)=5/8×4/7×3/6×2/5 = 120/1680
• P(L=1)=3/8×5/7×4/6×3/5+ 5/8×3/7×4/6×3/5 +
5/8×4/7×3/6×3/5 + 5/8×4/7×3/6×3/5 = 720/1680
• P(L=2)=3/8×2/7×5/6×4/5+ 3/8×5/7×2/6×4/5
3/8×5/7×4/6×2/5+ 5/8×3/7×2/6×4/5+
5/8×3/7×4/6×2/5 + 5/8×4/7×3/6×2/5 = 720/1680
• P(L=3)=3/8×2/7×1/6×5/5+ 3/8×2/7×5/6×1/5+
3/8×5/7×2/6×1/5 + 5/8×3/7×2/6×1/5 = 120/1680

SSCE 2193 Engineering Statistics 1A


Discrete Random Variables
Examples (Contd)
Ex 5: A word is to be formed from one or
more letters of the word CARE without
repetition. Let X represents the number of
letters of the word.
(a) What are the values of X?
(b) What are the probabilities of each value of
X?
Solution:
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
Ex 5 (Solution)
(a) The possible words are {C, A, R, E, CA,
CR, …}. There are 4 words of a single
letter, 12 words of two letters, 24 words
each of three and four letters. Hence there
are a total of 64 results. X= {1, 2, 3, 4}.
(b) P(X=1)=4/64,
P(X=2)=12/64,
P(X=3)=P(X=4)=24/64.
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
Probabilities by formula
• While it is necessary to use individual
probability for each element in a DRV, this is
only practical if the set of element is small.
For a large set, finding the number for each
case may become too tedious.
• In practice, we find that the probability of an
event can usually be prescribed by using a
formula.

SSCE 2193 Engineering Statistics 1A


Discrete Random Variables
Formulae for Probabilities
Ex 6. Given that X={0, 1, 2, 3, 4, 5} and a function
P(X=x)= (6–x)/21,
(i) Show that X is a DRV with P(X=x) as the
probability function.
(ii) Determine P(X<3)
Solution:
(i) Condition I: P(X=x)>0 for all x;
Condition II: P(X=x)=(6+5+4+3+2+1)/21=1.
Hence X is DRV.
(ii) P(X<3)=P(X=0)+P(X=1)+P(X=2)=15/21.
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
Examples (Contd)
Ex 7: X={1, 2, 3, 4, 5} with P(X=x)= (6-i)2
/55. Find
(a) P(X>3);
(b) P(X3).
Solution:
(a) P(X>3) = P(X=4)+P(X=5) = 4/55+1/55 =
5/55.
(b) P(X3) = P(X=3)+P(X=4)+P(X=5) =
9/55+4/55+1/55 = 14/55.
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
Examples (Contd)
Ex 8: The probability function P() of the variable X
= {1, 2, 3, …, 12} is defined as P(X=x)=m(13–
x). Find
(a) The value of m.
(b) P(|x–3|  2)
Solution: (a) P(X=x) = 1  12m+11m+…+1m =
78m = 1 m=1/78.
(b) P(|x–3|  2)=P(X=1)+P(X=2)+P(X=3)+P(X=4) +
P(X=5)=(12+11+10+9+8)/78 = 50/78.

SSCE 2193 Engineering Statistics 1A


Discrete Random Variables
Expectation
• Given a random variable X with a probability
function P(X=x), we define the expectation of X,
E(X) as xP(X=x).
• The expectation, also called the expected value,
of a variable X is just the mean of X.
• Actually E(X) is just a function of X. We can
generalise the function definition to other
variables such as E(2X), E(eX) and so on. We shall
come to these and some others later on.
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
Expectations:
Examples
Ex 9: If X = {1, 2, 3} and P(X=1) = 0.5,
P(X=2) = 0.3 and P(X=3) = 0.2, find
E(X).
Solution:
E(X) = 1P(X=1) + 2P(X=2) +
3P(X=3)
= 10.5 + 20.3 + 30.2 = 1.7.

SSCE 2193 Engineering Statistics 1A


Discrete Random Variables
Examples
(Continued)
Ex 10: If Y = {0, 1, 2, 3} and P(Y=0) = ½, P(Y=1) =
¼, P(Y=2) = P(Y=3) =1/8, find E(Y) and E(5Y).
Solution:
E(Y) = 0P(Y=0) + 1P(Y=1) + 2P(Y=2) +
3P(Y=3) = 0½ + 1¼+ 21/8 + 31/8 = 7/8.
E(5Y) = 50P(Y=0) + 51P(Y=1) + 5 2P(Y=2)
+ 53P(Y=3)
= 0½ + 5¼+ 101/8 + 151/8 = 35/8.
We note that E(5Y)=5E(Y).
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
Examples
(Continued)
Ex 11. If Z = {1, 2, 4} and P(Z=1) = 0.6, P(Z=2) =
0.3 and P(Z=4) = 0.1, find E(Z) and E(Z2).
Solution:
E(Z) = 1P(Z=1) + 2P(Z=2) + 4P(Z=4)
= 10.6 + 20.3 + 40.1 = 1.6.
E(Z2) = 12P(Y=1) + 22P(Z=2) + 42P(Z=4)
= 10.6+ 40.3 + 160.1 = 3.4.

SSCE 2193 Engineering Statistics 1A


Discrete Random Variables
Examples
(Continued)
Ex 12. If X = {1, 2, 3} and P(X=x) =x2/m, find
E(X), E(X2) and E(X3).
Solution:
We first need to find m. We note that
P(X=1)+P(X=2)+P(X=3)
= 12/m + 22/m + 32/m = 14/m = 1  m = 14.
So E(X) = 1P(X=1) + 2P(X=2) + 3P(X=3)
= 11/14 + 24/14 + 39/14 = 36/14;
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
Ex 12 (contd)
E(X2) = 12P(X=1) + 22P(X=2) +
32P(X=3)
= 11/14 + 44/14 + 99/14 = 98/14; and
E(X3) = 13P(X=1) + 23P(X=2) +
33P(X=3)
= 11/14 + 84/14 + 279/14 = 376/14.

SSCE 2193 Engineering Statistics 1A


Discrete Random Variables
Variance
• The variance V(X) of a discrete variable X
is defined as E(X2) – [E(X)]2.
• The variance is always positive.
• The square root of the variance of X is
called the standard deviation  of X, i.e.
V(X) = . Because of this, we also
represent the variance as 2.

SSCE 2193 Engineering Statistics 1A


Discrete Random Variables
Variance: Example
Ex 13. X = {-1, 0, 1} with the probability function p, such
that P(X=-1)=0.6, P(X=0)=0.3 and P(X=1)=0.1. Find the
mean and standard deviation of X.
Solution: Mean = E(X) = xP(X=x)
= –1P(X= –1) + 0P(X=0) + 1P(X=1)
= –10.6 + 00.3 + 10.1 = –0.5.
E(X2) = x2P(X=x)
= (–1)2P(X= –1) + 02P(X=0) + 12P(X=1)
= 10.6 + 00.3 + 10.1 = 0.7.
V(X) = E(X2) – [E(X)]2 = 0.7 – (–0.5)2 = 0.45.
Hence the standard deviation = 0.45 = 0.6708.
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
Examples
Ex 14. X = {0, 1, 2, 3, 4} with the probability function p,
such that P(X=x)=(x2+1)/k. Find the value of k. Hence
determine the values of the expectation and the variance of
X.
Solution: We first need to find the value of k.
By definition, P(X=0)+ P(X=1)+ P(X=2)+ P(X=3)+
P(X=4) = 1/k + 4/k + 9/k + 16/k + 25/k = 1.  k = 55.
Hence E(X) = xP(X=x)
= 01/55+14/55+29/55+316/55+425/55 =170/55.
E(X2) = x2P(X=x)
= 01/55+14/55+49/55+916/55+1625/55 =584/55.
V(X) = E(X2) – [E(X)]2 =584/55 – (170/55)2 = 1.0645.
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
Relation with
frequency distribution
• Actually, the random variable is a summary of frequency
distribution. Consider this: suppose in a check on 200
saloon cars, we find 65 which are driver-only, 57 with one
passenger, 43 with two, 23 with three and 12 with four
passengers, then the frequency distribution is recorded like
this:
Number of People 1 2 3 4 5
Number of cars 65 57 43 23 12
The mean = (1×65+ 2×57+ 3×43+ 4×23+ 5×12)/200
= 460/200 = 2.3;
SD = ((12×65+ 22×57+ 32×43+ 42×23+ 52×12)/200 – 2.32)
= ((1348/200 – 2.32) = 1.45 = 1.20.
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
As Random Variable
• Using X to represent the number of people (including the
driver) in a car, X = {1, 2, 3, 4, 5}, and the probabilities are
X 1 2 3 4 5
P(X=x) 0.325 0.285 0.215 0.115 0.06
E(X)=1×0.325+2×0.285+3×0.215+4×0.115+ 5×0.06
= 2.3.
Var(X) = 12×0.325+22×0.285+32×0.215+42×0.115+ 52×0.06 –
2.32 = 1.45.
This gives the same value of the mean and the variance using
the distribution table.

SSCE 2193 Engineering Statistics 1A


Discrete Random Variables
Cumulative
Distribution Function
• Given random variable X, it is usually more common to give
the probability in the form of P(Xx). This means the sum of
probabilities of all values of X less than or equal to x.
• For example, if X = {1, 2, 3, 4}, then
P(X1) = P(X=1);
P(X2) = P(X=1)+P(X=2);
P(X3) = P(X=1)+P(X=2)+P(X=3);
P(X4) = P(X=1)+P(X=2)+P(X=3)+P(X=4).
The function P(Xx) is designated as F(X), called the
cumulative distributive function of X.
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
Cumulative distribution
function (CDF)
Given X = {0, 1, 2, 3}, such • There is one thing
that P(X=0)=0.2, P(X=1)= special about the
0.3, P(X=2)=0.4, P(X=3) property of F(X):
=0.1, the CDF is F(X) where it is defined for
F(x) = 0 if x <0; all values of x
= 0.2 if 0x<1; from - to .
= 0.5 if 1x<2; Because of that,
= 0.9 if 2x<3; we describe it
=1 if x3. using inequalities.

SSCE 2193 Engineering Statistics 1A


Discrete Random Variables
CDF as step
function
• The CDF of X can be CDF for X = {0, 1, 2, 3},
represented as we did P(X=0)=0.2,
for the probability P(X=1)=0.3,
function P(). However, P(X=2)=0.4,
it is more frequently
shown in the form of a P(X=3)=0.1.
step function, as
shown on the right.

SSCE 2193 Engineering Statistics 1A


Discrete Random Variables
Graphical
representation
• The graph of F(X) is a • Graph of the CDF
line graph extended
from - to . The line
will begin from 0, keep
climbing, until reaching
1.
• Note that the graph is
continuous except for
some jumps.

SSCE 2193 Engineering Statistics 1A


Discrete Random Variables
Probabilities of
variables
• Many problems in DRV test your knowledge
about probabilities. In particular, as most events in
real life are relative, so many events are actually
related. In mot cases, we are interested in
probabilities of an event in relation to another.
• In other words, we need to look at conditional
probability, i.e. probability of an event when
another event is know to be true.
• The next two problems look at such cases.
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
Problem 1
• A random variable X={0, 1, 2, 3, 4, 5} is
defined with a probability function
P(X=x) where P(0)=P(5)=0.3,
P(X=1)=P(X=4)=0.15, and
P(X=2)=P(X=3)=0.05. Evaluate
(i) P(X>1);
(ii) P(X3|X>1);
(iii) P(X2|1X4).
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
Problem 1 (Solution)
(i) We can calculate P(X>1) by summing
P(X=2), etc. An alternative is to obtain it
as 1–P(X1)=1–(P(X=0)+P(X=1))=1–
0.45=0.55.
(ii) P(X3|X>1)=P(X3X>1|P(X>1)= P(1<
X3|X>1) =0.25/0.55 = 0.4545
(iii) P(X2|1X4) = P(X21X4|1X4)
=P(1X2|1X4) = 0.2/0.4 = 0.5.

SSCE 2193 Engineering Statistics 1A


Discrete Random Variables
Problems 2
• The variable Y={0, 1, 2, 3, 5, 6, 7, 8} has
a function P defined as P(Y=y)=|y–4|/m.
If Y is a DRV with P as the probability
function, determine the value of m.
Hence, evaluate
(i) P(Y>5.5|Y>4);
(ii) P(Y<7|Y>4);
(iii) P(Y2>40|Y>4)
SSCE 2193 Engineering Statistics 1A
Discrete Random Variables
Problems 2
(Solution)
If P is the probability function, then P(Y=y)=1.
Hence (4+3+2+1+1+2+3+4)/m=1  m=20.
(i) Y>4={5, 6, 7, 8} P(Y>4)=10/20, and
Y>5.5Y>4 = {6, 7, 8}
P(Y>5.5Y>4)=9/20. Hence
P(Y>5.5|Y>4)=9/10.
(ii) Y<7Y>4={5, 6}P(Y<7Y>4)=3/20. Hence
P(Y<7|Y>4)=3/10.
(iii) P(Y2>40|Y>4)=P({7,8})/P(Y>4)=7/10.

SSCE 2193 Engineering Statistics 1A


Discrete Random Variables

You might also like