You are on page 1of 75

Faculty of Electrical and Electronic Engineering

Semester I, Session 2022/2023

BEE32502
Engineering Statistics

CHAPTER 1:
RANDOM VARIABLES

Mohamad Hairol Jabbar


Department of Electronic Engineering
CHAPTER 1

In this chapter, we will discuss about probability and its functions


for discrete and continuous random variables
CONTENTS
1. Introduction
2. Random variables (RV)
3. Discrete random variables:
i. Probability distribution function (PDF)
ii. Cumulative distribution function (CDF)
iii. Mean, variance and standard deviation
4. Continuous random variables
i. Probability density function (PDF)
ii. Cumulative distribution function (CDF)
iii. Mean, variance and standard deviation
1. INTRODUCTION
STATISTICS AND PROBABILITY
• What do engineers do – solves problems based on
scientific principles by:
– Refining existing products
– Designing new products or processes

Statistics & probability

Source: Applied Statistics and Probability for Engineers, Douglas C.


Montgomery, George C. Runger, 2019
STATISTICS AND PROBABILITY
• Probability – finding the chances of successful
outcomes
• Statistics – scientific application of mathematical
principles to the collection, analysis, and presentation
of data:
– Data is the foundation of all of statistics
REASONING TYPES
• Probabilistic reasoning:
– Suppose I know exactly the proportions of car
makes in Malaysia. Then I can find the probability
that the first car I see in the street is a Proton, know
the population and predict the sample.
• Statistical reasoning:
– Now suppose that I do not know the proportions of
car makes in Malaysia, but would like to estimate
them. I observe a random sample of cars in the
street and then I have an estimate of the
proportions of the population.
STATISTICS IN ENGINEERING
• Manufacturing process – quality control:
– For any industry (food/semiconductor/electrical), to
ensure products produced are within the
specifications.
– Using hypothesis testing method
– E.g.: from a batch of 1000 Smart TV controller
boards manufactured in a production shift, take a
sample of 50 boards and test the hypothesis that on
average, the number boards with incorrect
soldering is less than 5.
STATISTICS IN ENGINEERING
• Manufacturing process – estimating/predicting values:
– For any industry, to predict the values based on
existing data
– Using regression analysis (simple, multiple linear)
– E.g.: stamping machines producing automotive
parts, determine the relationship between operating
hours vs stamping quality/defects
2. RANDOM VARIABLES (RV)
TERMINOLOGY
• Random variables (RV):
– Assumes any of several different values as a result of
some random event or experiment
– Denoted by a capital letter such as X,Y and Z
• Population:
– A group of individuals of items that share one or more
characteristics from which data can be gathered and
analyzed
• Sample:
– A subset of the population
– Elements are selected intentionally as a representation
of the population being studied
TERMINOLOGY
• Sample space:
– The set of all events of an experiment
– Denoted by S
• Sample size:
– The number of items in a sample
• Random sample:
– The sample selected in a way that allows every
member of the population to have the same chance
of being chosen
BASIC CONCEPTS
• Experiment – process by which an observation (or
measurement) is obtained
• Event – an outcome of an experiment:
– When an experiment is performed, a particular event
either happens, or it doesn’t!
• Experiment: record an age
– Event X: person is 30 years old
– Event Y: person is older than 65
• Experiment: toss a die
– Event A: observe an odd number
– Event B: observe a number greater than 2
BASIC CONCEPTS
• Mutually exclusive events:
– When one event occurs, the other cannot, and vice
versa
• Experiment: Toss a die
– A: observe an odd number Not mutually
exclusive
– B: observe a number greater than 2
– C: observe a 6 Mutually
exclusive
– D: observe a 3

B and C?
B and D?
BASIC CONCEPTS
• Simple event:
– An event that cannot be decomposed
– Denoted by E with a subscript
– Each simple event will be assigned a probability,
measuring “how often” it occurs
SIMPLE EVENT, SAMPLE SPACE
• Experiment – tossing a die
• Simple events:

• Sample space:
EVENT, SIMPLE EVENT
• An event is a collection of one or more simple events
• The die toss:
– Event A: an odd number
– Event B: a number > 2
PROBABILITY OF AN EVENT
• The probability of an event A measures “how often” A
will occur → P(A)
• Suppose that an experiment is performed n times. The
relative frequency for an event A is:

• If we let n get infinitely large:


PROBABILITY OF AN EVENT
• P(A) must be between 0 and 1:
– If event A can never occur, P(A) = 0.
– If event A always occurs when the experiment is
performed, P(A) = 1
• The sum of the probabilities for all simple events in S
equals 1
• The probability of an event A is found by adding the
probabilities of all the simple events contained in A
FINDING PROBABILITIES
• Probabilities can be found using:
– Estimates from empirical studies
– Common sense estimates based on equally likely
events.
• Examples:
– Toss a fair coin

– Suppose that 90% of the Malaysia population has


black hair. Then for a person selected at random,
USING SIMPLE EVENTS
• The probability of an event A is equal to the sum of the
probabilities of the simple events contained in A
• If the simple events in an experiment are equally likely,
you can calculate
EXAMPLE 1
• Toss a fair coin twice. What is the probability of
observing at least one head?

1st Coin 2nd Coin Ei P(Ei)

HH HH
HH 1/4 P(at
P(atleast
least11head)
head)
HH
TT HT 1/4 ==P(E
P(E1))++P(E
P(E2))++P(E
P(E3))
HT 1 2 3

==1/4
1/4++1/4
1/4++¼
¼
HH TH
TH 1/4
==3/4
3/4
TT
TT TT
TT 1/4
EXAMPLE 2
• The sample space of throwing a pair of dice is

Event Simple events Probability


Dice add to 3 (1,2), (2,1) 2/36
Dice add to 6 (1,5), (2,4), (3,3), (4,2), (5,1) 5/36
Red die show 1 (1,1), (1,2), (1,3), (1,4), (1,5), (1,6) 6/36
Green die show 1 (1,1), (2,1), (3,1), (4,1), (5,1), (6,1) 6/36
EXAMPLE 3
• An experiment of tossing a fair coin three times. Let X
will be a random variable of getting head. Find the
probability of getting head by using probability
distribution function (PDF) table, graph and equation.
x P(x=0) 1/8
HHH 1/8 3 P(x=1) 3/8
HHT 1/8 2 P(x=2) 3/8
HTH 1/8 2 P(x=3) 1/8
THH 1/8 2
x p(x)
HTT 1/8 1
0 1/8
THT 1/8 1
1 3/8
TTH 1/8 1
2 3/8
TTT 1/8 0
3 1/8
RANDOM VARIABLES TYPES
• Discrete random variables have a countable number of
outcomes
– Examples: Dead/alive, treatment/placebo, dice,
counts
• Continuous random variables have an infinite
continuum of possible values
– Examples: blood pressure, weight, the speed of a
car, the real numbers from 1 to 6
3. DISCRETE RANDOM
VARIABLES
PDF OF DISCRETE RV
• A probability distribution for a discrete random variable
is a complete set of an possible outcomes and their
possibilities of occurring
X, representing Possible values of X
Number of dots appear when tossing a die 1, 2, 3, 4, 5, 6
Number of books in the bag 0, 1, 2, 3, 4, 5
Number of male students in a class 15, 16, 17, 22

Source: umn.edu
PDF OF DISCRETE RV
• Theory 1
– The probability distribution of a discrete random
variable X is described as the function P(X=x) = P(x)
which is satisfied:
EXAMPLE 4
• Consider the table as follows:
x p(x)
0 1/8
• From the table of probability 1 3/8
distribution function, proof that the 2 3/8
distribution is a probability distribution 3 1/8
function of discrete variable then find
the probability of:
EXAMPLE 4 – SOLUTION
• For P(X<2): x p(x)
0 1/8
1 3/8
2 3/8
3 1/8

• For P(X≤2):
EXAMPLE 4 – SOLUTION
• For P(X≥1):
x p(x)
0 1/8
1 3/8
2 3/8
3 1/8
CDF OF DISCRETE RV
• Theory 2
– The CDF of a discrete RV X is described as the
function:

which satisfies F(x) is an


increase function:
which is the maximum
value is 1

which is the minimum


value is 0

Source: umn.edu
CDF OF DISCRETE RV
• Theory 3
– The CDF of a discrete RV X can be calculated by
using the following formulas:
EXAMPLE 5
• Customers purchase a particular make of automobile
with a variety of options. The probability distribution
function of the number of options selected is:
X 7 8 9 10 11 12 13
P(X = x) 0.11 0.10 0.22 0.23 0.12 0.13 0.09

• Find the CDF of X, then by using the CDF, find the


probability:
– Exactly ten number of options was selected
– More than nine number of options was selected
– Between eight and twelve number of options was
selected
EXAMPLE 5 – SOLUTION
• Find the CDF of X: X 7 8 9 10 11 12 13
P(X = x) 0.11 0.10 0.22 0.23 0.12 0.13 0.09
EXAMPLE 5 – SOLUTION
• Probability of exactly ten number of options was
selected: X 7 8 9 10 11 12 13
P(X = x) 0.11 0.10 0.22 0.23 0.12 0.13 0.09
EXAMPLE 5 – SOLUTION
• Probability of more than nine number of options was
selected: X 7 8 9 10 11 12 13
P(X = x) 0.11 0.10 0.22 0.23 0.12 0.13 0.09

• Probability of between eight and twelve number of


options was selected:
EXAMPLE 6
• Suppose X denotes the number of telephone receivers
in a single family residential house. From an
examination of the phone subscription records of 1000
residence in a city, the following probability function of
X is obtained:

• Find the CDF of X, then by using the CDF, calculate


the value of:
EXAMPLE 6 – SOLUTION
• Find the CDF of X:
EXAMPLE 6 – SOLUTION
• Calculate the value of

• Calculate the value of

• Calculate the value of


E, VAR, σ
• All probability distributions are characterized by an
expected value (mean), a variance (standard deviation
squared) and standard deviation
• The expected value of a discrete RV is defined as its
weighted average over all possible outcomes, with the
weight for each outcome being the relative frequency
or probability associated with the outcome
• Theory 4
– Expected value (mean) of discrete RV:
E, VAR, σ
• The variance of a discrete RV is defined as the
weighted average of the squared differences between
each possible outcome and the average value of the
outcomes, with the weights being the probabilities
associated with each of the outcomes
• Theory 5
– Variance of discrete RV:
E, VAR, σ
• Theory 6
– The standard deviation of the probability distribution
of a discrete RV is the square root of the variance:
EXAMPLE 7
• The discrete RV X has range space {1,2,3,4,5} and its
CDF takes the value as follows:

– Tabulate the probability distribution function


– Compute the mean and variance
EXAMPLE 7 – SOLUTION
• Tabulate the probability distribution function:
EXAMPLE 7 – SOLUTION
• Compute the mean and variance:
EXAMPLE 8
• A random variable Y has the following probability
distribution:
y -2 0 2
P(Y = y) k 1-2k k

– Show that Var(Y)=8k


– If given k=1/3, find mean and variance
EXAMPLE 8 – SOLUTION
• Show that Var(Y)=8k:
y -2 0 2
P(Y = y) k 1-2k k
EXAMPLE 8 – SOLUTION
• If given k=1/3, find mean and variance:
y -2 0 2
P(Y = y) k=1/3 1-2k=1/3 k=1/3
EXAMPLE 9
• The following table lists the probability distribution of
the number of student taken course per semester in
science centre:
x 3 4 5 6 7
P(x) 0.37 0.26 0.18 0.11 0.08

• Calculate the mean and standard deviation for this


probability distribution
EXAMPLE 9 – SOLUTION
• Calculate the mean for this probability distribution:

x 3 4 5 6 7
P(x) 0.37 0.26 0.18 0.11 0.08
EXAMPLE 9 – SOLUTION
• Calculate the standard deviation for this probability
distribution:
x 3 4 5 6 7
P(x) 0.37 0.26 0.18 0.11 0.08
EXAMPLE 10
• Let the probability distribution function of X be defined
by:

– Find
– Calculate mean and variance
– Find the value of E(2X-9) and Var(3X+10)
EXAMPLE 10 – SOLUTION
• Find
EXAMPLE 10 – SOLUTION
• Calculate mean and variance
EXAMPLE 10 – SOLUTION
• Calculate mean and variance
EXAMPLE 10 – SOLUTION
• Find the value of E(2X-9)
EXAMPLE 10 – SOLUTION
• Find the value of Var(3X+10)
4. CONTINUOUS RANDOM
VARIABLES (RV)
CONTINUOUS RV
• A random variable that can take any numeric value
within a range of value. The range may be infinite or
bounded at either both ends.

X, representing Possible values of X


The height of the students 150cm <X<170cm
The weight of the students 45kg<X<85kg
The time to complete a quiz 5 minutes to 10 minutes

Source: imperial.ac.uk
PDF FOR CONTINUOUS RV
• Theory 7
– Properties of the PDF of Continuous RV
EXAMPLE 11
• Let X be a continuous RV of X with PDF

• Show that the function is the PDF of X


EXAMPLE 11 – SOLUTION
• Show that the function is the PDF of X
EXAMPLE 12
• The continuous RV of X has the probability density
function:

• Find:
EXAMPLE 12 – SOLUTION
• Find the value of k:
EXAMPLE 12 – SOLUTION
• Find P(0.5<X<1), k=3

• Find P(X>0.25), k=3


CDF OF CONTINUOUS RV
• Theory 8
– The CDF of a continuous RV X is described as the
function

• F(x) is an increase
function:

Source: imperial.ac.uk
CDF OF CONTINUOUS RV
• Calculated by using the following formulas:
EXAMPLE 13
• The continuous RV of X has the probability distribution
function:

• Find the CDF of X. By using it, calculate:


EXAMPLE 13 – SOLUTION
• Find the CDF of X, k=3:
EXAMPLE 13 – SOLUTION
• P(X<0.5):

• P(X≥0.8):

• P(0.5≤X<0.8):
E, VAR, σ
• Theory 9
– Expected value of continuous RV

• Theory 10
– Variance of continuous RV

• Theory 11
– The standard deviation of the probability distribution
of a continuous RV is the square root of the variance
EXAMPLE 14
• Let X be a continuous RV of X with probability density
function (PDF)

• Find the mean and variance of X


EXAMPLE 14 – SOLUTION
• Mean and variance of X:
Q&A

You might also like