Lecture 3 - 503 STAT - Bayes & Discrete Distributions

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 73

Bayes' Rule

Definition:
The events , ,…, and constitute a partition of the
sample space if:

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Theorem: (Total Probability)
If the events , ,…, and constitute a partition of the
sample space such that
for
then for any event B:

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Example
Three machines , and make 20%, 30%, and
50%, respectively, of the products. It is
known that 1%, 4%, and 7% of the products
made by each machine, respectively, are
defective. If a finished product is randomly
selected, what is the probability that it is
defective?

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Solution:

Define the following events:


B = {the selected product is defective}
= {the selected product is made by machine }
= {the selected product is made by machine }
= {the selected product is made by machine }

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Another Example: see Example 2.41 page 74

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Question:
If it is known that the selected product is
defective, what is the probability that it is
made by machine ?
Answer:

This rule is called Bayes' rule.


503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Theorem: (Bayes' rule)

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Example

In the previous example, if it is known that


the selected product is defective, what is the
probability that it is made by:
(a) machine ?
(b) machine ?

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Solution:

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Note:
P(|B) = 0.0408, P(|B) = 0.2449, P(|B) = 0.7142
3

∑ 𝑃 ( 𝐴𝑘 / 𝐵 ) =1
𝑘=1

If the selected product was found defective, we


should check machine first, if it is ok, we should
check machine , if it is ok, we should check
machine .
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Another Example: see Example 2.42 page 75

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Chapter 3: Random Variables
and Probability Distributions

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
3.1 Concept of a Random Variable:

In a statistical experiment, it is often very


important to allocate numerical values to the
outcomes.

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Example:
• Experiment: testing two components.

D=defective (‫)معيب‬,
N=non-defective(‫)غير معيب‬
• Sample space: S={DD,DN,ND,NN}
• Let X = number of defective components
when two components are tested.

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Assigned numerical values to the outcomes are:
Sample point Assigned
(Outcome) Numerical Value
(x)
DD 2
DN 1
ND 1
NN 0

Notice that, the set of all possible values of


the random variable X is {0, 1, 2}.
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Definition 3.1:
A random variable X is a function that
associates each element in the sample space
with a real number (i.e., X : S → R.)

Notation:
"X" denotes the random variable .
"x" denotes a value of the random variable X.

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Types of Random Variables:
• A random variable X is called a discrete random
variable if its set of possible values is countable,
i.e.,
∈ {, , …, } or ∈ {, , …}

• A random variable X is called a continuous


random variable if it can take values on a
continuous scale, i.e.,

.x ∈ {x: a < x < b; a, b ∈R}

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
3.2 Discrete Probability Distributions

A discrete random variable X assumes each


of its values with a certain probability.

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Example:
Experiment: tossing a non-balance coin 2
times independently.
• H= head , T=tail
• Sample space: S={HH, HT, TH, TT}
• Suppose P(H)=1/3 and P(T)=2/3

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Let X= number of heads

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
• The possible values of X are: 0, 1, and 2.
• X is a discrete random variable.
• Define the following events:

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
The possible values of X with their probabilities
are:
0
1
2
Total 1

The function f(x)=P(X=x) is called the probability


function (probability distribution) of the discrete
random variable X.
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Definition
The function f(x) is a probability function of a
discrete random variable X if, for each possible
values x, we have:

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Example:
For the previous example, we have:

0
1
2
Total 1

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Note

If X is a discrete random variable then

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Example
A shipment of 8 similar microcomputers to a
retail outlet contains 3 that are defective and 5
are non-defective. If a school makes a random
purchase of 2 of these computers, find the
probability distribution of the number of
defectives.

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Answer
2 Computers 8 Computers

D N

3 5

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Solution:
We need to find the probability distribution
of the random variable: X = the number of
defective computers purchased.
Experiment: selecting 2 computers at
random out of 8

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
In general, for x=0,1, 2, we have:

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
The probability distribution of X can
be given in the following table

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
The probability distribution of X can be
written as a formula as follows:

Hypergeometric Distribution

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Another Example: see Example 3.8 page 84

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Definition 3.5:
The cumulative distribution function
(CDF), F(x), of a discrete random
variable X with the probability function
f(x) is given by:
𝑭 ( 𝒙 )= 𝑷 ( 𝑿 ≤ 𝒙 ) =∑ 𝒇 (𝒕),− ∞<𝒙 <∞
𝒕≤𝒙

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Example:
Find the CDF of the random variable X
with the probability function:

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Solution:

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
The CDF of the random variable X is:

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Note:

F(−0.5) = P(X≤−0.5)=0

F(1.5)=P(X≤1.5)=F(1) =25/28

F(3.8) =P(X≤3.8)=F(2)= 1

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Result:

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Result:

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Example:
In the previous example,

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Continuous Probability Distributions

For any continuous random variable, X,


there exists a non-negative function f(x),
called the probability density function
(p.d.f) through which we can find
probabilities of events expressed in term of
X.
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
For any continuous r. v. X, there exists a function ,
called the density function of X , for which:
(i) The total area under the curve of =1.

𝑓 : ℝ ⟶ [ 0 , ∞¿
𝑓 ( 𝑥)

a b 𝑥

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Definition

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Note:

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Example

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Solution:
X = the error in the reaction temperature in oC.
X is continuous r. v.

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
1. (a) f(x) ≥ 0 because f(x) is a quadratic function.

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Definition
The cumulative distribution function (CDF),
F(x), of a continuous random variable X with
probability density function f(x) is given by:

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Result:

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Example:

In the previous example


1. Find the CDF
2. Using the CDF, find P(0<X≤1).

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Solution:
(1) Finding F(x):

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
2. Using the CDF,

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili
Exercises
(1) 3.6 – 3.9 page 92

(2) 3.18 – 3.20 page 93

(3) On a laboratory assignment, if the equipment is working,


the density function of the observed outcome,X, is

• Determine that renders a valid density function.


• Calculate
• What is the probability that will exceed 0.5?

503 STAT - Probability and Statistics for Engineers and Scientists – Dr. Mansour Shrahili

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy