0% found this document useful (0 votes)
17 views83 pages

Probability First 4 Lec

The document discusses the importance of studying statistics, emphasizing its role in data analysis and informed decision-making. It covers key components of statistics, including populations, samples, and basic concepts of probability, along with definitions of events, operations on events, and probability axioms. Additionally, it explains counting techniques, combinations, permutations, and provides examples to illustrate the application of these concepts.

Uploaded by

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

Probability First 4 Lec

The document discusses the importance of studying statistics, emphasizing its role in data analysis and informed decision-making. It covers key components of statistics, including populations, samples, and basic concepts of probability, along with definitions of events, operations on events, and probability axioms. Additionally, it explains counting techniques, combinations, permutations, and provides examples to illustrate the application of these concepts.

Uploaded by

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

Probability and Statistics

Prof. Khalaf S. Sultan

Department of Mathematics
Al-Azhar University, Cairo, Egypt

1
Q: Why we study statistics?
 Statistics is the science of making sense of data and
of how to gather data.

 Reason to study Statistics:


- To be an informed “information consumer”.
- Decision making, including personal decisions.

2
Key Components of statistics
Population and Sample Analysis

Descriptive
Quantitative Variable(s)
Inferences
Categorical Variable(s)
Estimation
Population(s)
Hypotheses Testing
Sample(s)
Parametric Methods
Distributions
Non-Parametric Methods
Population Mean
Sample mean Statistical Models
Population variance
Sample Variance Regression
Population standard deviation
Sample standard Deviation Time series
…..? …..?

3
4
5
Some Basic Concepts

Sets

Some relations and identities of sets

6
Probability
An Experiment: is some procedure (or process) that we do and
it results in an outcome.

A random experiment: is an experiment we do not know its


exact outcome in advance but we know the set of all
possible outcomes.

1 The Sample Space:


Definition 1:
· The set of all possible outcomes of a statistical experiment is
called the sample space and is denoted by S.
· Each outcome (element or member) of the sample space S
is called a sample point.

7
2 Events:

Definition 2:
An event A is a subset of the sample space S. That is A S.
· We say that an event A occurs if the outcome (the result)
of the experiment is an element of A.
· S is an event ( is called the impossible event)
· SS is an event (S is called the sure event)
Example:
Experiment: Selecting a ball from a box containing 6 balls
numbered 1,2,3,4,5 and 6. (or tossing a die)

8
This experiment has 6 possible outcomes
The sample space is S={1,2,3,4,5,6}.
Consider the following events:
E1= getting an even number ={2,4,6}S
E2 = getting a number less than 4={1,2,3}S
E3 = getting 1 or 3={1,3}S
E4 = getting an odd number={1,3,5}S
E5 = getting a negative number={ }= S
E6 = getting a number less than 10 = {1,2,3,4,5,6}=S S
Notation:
•n(S)= no. of outcomes (elements) in S.
•n(E)= no. of outcomes (elements) in the event E.
Example:
Experiment: Selecting 3 items from manufacturing process;
each item is inspected and classified as defective (D) or non-
defective
9 (N).
This experiment has 8 possible outcomes
S={DDD,DDN,DND,DNN,NDD,NDN,NND,NNN}

10
· Consider the following events:
A={at least 2 defectives}= {DDD,DDN,DND,NDD}S
B={at most one defective}={DNN,NDN,NND,NNN}S
C={3 defectives}={DDD}S

11
Some Operations on Events:
Let A and B be two events defined on the sample space S.
Definition 2.3: Complement of The Event A:
· Ac or A' S
· Ac = {x S: xA }
· Ac consists of all points of S that are not
in A.
· Ac occurs if A does not.

Definition 2.4: Intersection: S

· AB =AB={x S: xA and xB}


· AB Consists of all points in both A
and B.
· AB Occurs if both A and B occur
together.

12
Probability and Statistics
Prof. Khalaf S. Sultan

Department of Mathematics
Al-Azhar University, Cairo, Egypt

Probability #02

1
Some Operations on Events:
Let A and B be two events defined on the sample space S.
Definition: Complement of The Event A:
· Ac or A' S
· Ac = {x S : xA }
· Ac consists of all points of S that are not
in A.
· Ac occurs if A does not.

Definition: Intersection: S

· AB =AB={x S : xA and xB}


· AB Consists of all points in both A
and B.
· AB Occurs if both A and B occur
together.

2
Definition: Mutually Exclusive (Disjoint) Events:

Two events A and B are mutually exclusive (or disjoint) if and


only if AB =; that is, A and B have no common elements
(they do not occur together).

AB   AB = 
A and B are not A and B are
mutually mutually
exclusive exclusive
(disjoint)

3
Definition: Union:
• AB = {x S: xA or xB } S

• AB Consists of all outcomes in


A or in B or in both A and B.
• AB Occurs if A occurs,
or B occurs, or both A and B occur.
• That is AB Occurs if at least one of
• A and B occurs.
Counting Sample Points:

There are many counting techniques which can be used to


count the number points in the sample space (or in some
events) without listing each element.
In many cases, we can compute the probability of an event by
using the counting techniques.

4
Combinations: (order is not important)
In many problems, we are interested in the number of ways of
selecting r objects from n objects without regard to order. These
selections are called combinations.
· Notation:
n factorial is denoted by n! and is defined by:
n!= n  (n − 1) (n − 2 )   (2 ) (1) for n = 1, 2, 
0!= 1
Example: 5!= 5  4  3  2  1 = 120
Theorem:
The number of combinations of n distinct objects taken r at a
time is denoted by  n  and is given by:
r
 
n n!
  = ; r = 0, 1, 2, , n
 r  r ! (n − r )!
5
Notes:
n
·   is read as “ n “ choose “ r ”.
 
r
n  n  n n  n 
·   = 1 ,   = 1 ,   = n ,   =  
n 0 1 r  n − r
·  n  = The number of different ways of selecting r objects
r
  from n distinct objects.
n
·   = The number of different ways of dividing n distinct
r
objects into two subsets; one subset contains r
objects and the other contains the rest (n −r) objects.

6
Example:
If we have 10 equal–priority operations and only 4 operating
rooms are available, in how many ways can we choose the 4
patients to be operated on first?
Solution:
n = 10 r = 4
The number of different ways for selecting 4 patients from 10
patients is

10  10! 10! 10  9  8  7  6  5  4  3  2  1


  = = =
 4  4! (10 − 4)! 4!  6! (4  3  2  1)  (6  5  4  3  2  1)
= 210 (different ways)

7
Theorem: Permutations (order is important)

Example: How many permutations for selecting


2 digits from the set {1,3,5}?

8
Probability of an Event:

· To every point (outcome) in the sample space of an


experiment S, we assign a weight (or probability), ranging
from 0 to 1, such that the sum of all weights (probabilities)
equals 1.
· The weight (or probability) of an outcome measures its
likelihood (chance) of occurrence.
· To find the probability of an event A, we sum all
probabilities of the sample points in A. This sum is called the
probability of the event A and is denoted by P(A).
Probability Axioms
The probability of an event A is the sum of the weights
(probabilities) of all sample points in A. Therefore,
1) 0  P( A)  1
2) P(S ) = 1
3) If A and B are disjoint then 9
Example:
A balanced coin is tossed twice. What is the probability that at
least one head occurs?
Solution:
S = {HH, HT, TH, TT}
A = {at least one head occurs}= {HH, HT, TH}
Since the coin is balanced, the outcomes are equally likely; i.e.,
all outcomes have the same weight or probability.
Outcome Weight
(Probability)

HH P(HH) = w
HT P(HT) = w 4w =1  w =1/4 = 0.25
TH P(TH) = w P(HH)=P(HT)=P(TH)=P(TT)=0.25
TT P(TT) = w
sum 4w=1

10
The probability that at least one head occurs is:
P(A) = P({at least one head occurs})=P({HH, HT, TH})
= P(HH) + P(HT) + P(TH)
= 0.25+0.25+0.25
= 0.75
Theorem:
If an experiment has n(S)=N equally likely different outcomes,
then the probability of the event A is:

n( A) n( A) no. of outcomes in A
P( A) = = =
n( S ) N no. of outcomes in S

11
Example:
A mixture of candies consists of 6 mints, 4 toffees, and 3
chocolates. If a person makes a random selection of one of
these candies, find the probability of getting:
(a) a mint
(b) a toffee or chocolate.
Solution:
Define the following events:
M = {getting a mint}
T = {getting a toffee}
C = {getting a chocolate}
Experiment: selecting a candy at random from 13 candies
n(S) = no. of outcomes of the experiment of selecting a candy.
= no. of different ways of selecting a candy from 13 candies.
13
=   = 13
1 12
The outcomes of the experiment are equally likely because
the selection is made at random.
(a) M = {getting a mint}
n(M) = no. of different ways of selecting a mint candy
from 6 mint candies
 6
=   = 6
1 n(M ) 6
P(M )= P({getting a mint})= =
n(S ) 13
(b) TC = {getting a toffee or chocolate}
n(TC) = no. of different ways of selecting a toffee
or a chocolate candy
= no. of different ways of selecting a toffee
candy + no. of different ways of selecting a
chocolate candy
 4   3
=   +   = 4 + 3 = 7
 1  1
13
= no. of different ways of selecting a candy
from 7 candies
7
=   = 7
1 n(T  C ) 7
P(TC )= P({getting a toffee or chocolate})= =
n(S ) 13

14
Additive Rules:

Theorem 1:
If A and B are any two events, then:
P(AB)= P(A) + P(B) − P(AB)
Proof:
?

15
Corollary 1:
If A and B are mutually exclusive (disjoint) events, then:
P(AB)= P(A) + P(B)
Corollary 2:
If A1, A2, …, An are n mutually exclusive (disjoint) events, then:
P(A1 A2 … A n)= P(A1) + P(A2) +… + P(An)
 n  n
P  Ai  =  P ( Ai )
 i =1  i =1

16
17
18
Theorem 3

Proof:

19
Note: Two event Problems:
Total area= P(S)=1.
In Venn diagrams, consider
the probability of an event A as
the area of the region
corresponding to the event A.
* Total area= P(S)=1

Examples: Total area= P(S)=1


P(A)= P(AB)+ P(ABC)
P(AB)= P(A) + P(ACB)
P(AB)= P(A) + P(B) − P(AB)
P(ABC)= P(A) − P(AB)
P(ACBC)= 1 − P(AB)
etc.,

20
Example:
The probability that Mohamed passes Mathematics is 2/3, and
the probability that he passes English is 4/9. If the probability
that he passes both courses is 1/4,
what is the probability that he will:
(a) pass at least one course?
(b) pass Mathematics and fail English?
(c) fail both courses?
Solution:
Define the events:
M={Mohamed passes Mathematics}
E={Mohamed passes English}
We know that P(M)=2/3, P(E)=4/9, and P(ME)=1/4.
(a) Probability of passing at least one course is:
P(ME)= P(M) + P(E) − P(ME)

21
(a) Probability of passing at least one course is:
P(ME)= P(M) + P(E) − P(ME)
2 4 1 31
= + − =
3 9 4 36

(b) Probability of passing Mathematics and failing English is:


P(MEC)= P(M) − P(ME)
2 1 5
= − =
3 4 12
(c) Probability of failing both courses is:
P(MCEC)= 1 − P(ME)
31 35
= 1− =
Theorem 36 36
If A and AC are complementary events, then:
P(A) + P(AC) = 1  P(AC) = 1 − P(A)

22
Example
The probability that Mohamed passes Mathematics is 2/3, and
the probability that he passes English is 4/9. If the probability
that he passes both courses is 1/4, what is the probability that
he will:
(a) pass at least one course?
(b) pass Mathematics and fail English?
(c) fail both courses?
Solution:
Define the events: M={Mohamed passes Mathematics}
E={Mohamed passes English}
We know that P(M)=2/3, P(E)=4/9, and P(ME)=1/4.
(a) Probability of passing at least one course is:
P(ME)= P(M) + P(E) − P(ME)
2 4 1 31
= + − =
3 9 4 36
23
(b) Probability of passing Mathematics and failing English is:
P(MEC)= P(M) − P(ME)
2 1 5
= − =
3 4 12
(c) Probability of failing both courses is:
P(MCEC)= 1 − P(ME)
31 5
= 1− =
36 36
Theorem 2.12:
If A and AC are complementary events, then:
P(A) + P(AC) = 1  P(AC) = 1 − P(A)
Conditional Probability:
The probability of occurring an event A when it is known that
some event B has occurred is called the conditional
probability of A given B and is denoted P(A|B).
24
Definition
The conditional probability of the
event A given the event B is defined by:
P( A  B )
P( A | B ) = ; P(B )  0
P(B )
Notes:
P( A  B )
1. P( A | B ) = = P(S)=Total area=1
P (B )
n ( A  B ) / n (S ) n ( A  B )
= = ; for equally likely outcomes case
n ( B ) / n (S ) n( B )
P( A  B )
2. P(B | A) =
P ( A)
3. P( A  B ) = P( A) P(B | A)
(Multiplicative Rule)
= P(B ) P( A | B )

25
Example:
339 physicians are classified as given in the table below. A
physician is to be selected at random.

(1) Find the probability that:


(a) the selected physician is aged 40 – 49
(b) the selected physician smokes occasionally
(c) the selected physician is aged 40 – 49 and smokes
occasionally

(2) Find the probability that the selected physician is aged


40 – 49 given that the physician smokes occasionally.

26
Smoking Habit
Daily Occasionally Not at all
(B1) (B2) (B3) Total
Age 20 - 29 (A1) 31 9 7 47

30 - 39 (A2) 110 30 49 189

40 - 49 (A3) 29 21 29 79

50+ (A4) 6 0 18 24

Total 176 60 103 339

27
Solution:
n(S) = 339 equally likely outcomes.
Define the following events:
A3 = the selected physician is aged 40 – 49
B2 = the selected physician smokes occasionally
A3  B2 = the selected physician is aged 40 – 49 and smokes
occasionally
(1) (a) A3 = the selected physician is aged 40 – 49
n( A3 ) 79
P( A3 ) = = = 0.2330
n(S ) 339
(b) B2 = the selected physician smokes occasionally
n(B2 ) 60
P(B2 ) = = = 0.1770
n(S ) 339
(c) A3  B2 = the selected physician is aged 40 – 49 and
smokes occasionally.
n( A3  B2 ) 21
P( A3  B2 ) = = = 0.06195
n(S ) 339 28
(2) A3|B2 = the selected physician is aged 40 – 49 given that the
physician smokes occasionally
n (A 3  B2 ) 21
(i)P(A 3 | B2 ) = = = 0.35
n (B2 ) 60
P(A 3  B2 ) 0.06195
(ii)P(A 3 | B2 ) = = = 0.35
P(B2 ) 0.1770
21
(iii) We can use the restricted table directly: P( A3 | B2 ) = = 0.35
60
Notice that P(A3|B2)=0.35 > P(A3)=0.233.
The conditional probability does not equal unconditional
probability; i.e., P(A3|B2)  P(A3) ! What does this mean?

29
Note:
· P(A|B) = P(A) means that knowing B has no effect on the
probability of occurrence of A. In this case A is independent of B.
· P(A|B) > P(A) means that knowing B increases the probability
of occurrence of A.
· P(A|B) < P(A) means that knowing B decreases the probability
of occurrence of A.
Independent Events:
Definition
Two events A and B are independent if and only if P(A|B)=P(A)
and P(B|A)=P(B). Otherwise A and B are dependent.
Example:
In the previous example, we found that P(A3|B2)  P(A3).
Therefore, the events A3 and B2 are dependent, i.e., they are
not independent. Also, we can verify that P(B2| A3)  P(B2).
30
Multiplicative Rule:
Theorem
If P(A)  0 and P(B)  0, then:
P(AB) = P(A) P(B|A)
= P(B) P(A|B)
Example
Suppose we have a fuse box containing 20 fuses of which 5 are
defective (D) and 15 are non-defective (N). If 2 fuses are
selected at random and removed from the box in succession
without replacing the first, what is the probability that both fuses
are defective?
Solution:
Define the following events:
A = {the first fuse is defective}
B = {the second fuse is defective}
AB={the first fuse is defective and the second fuse is
defective} = {both fuses are defective} 31
We need to calculate P(AB).
5
P(A) = 20
4
P(B|A) =
19
P(AB) = P(A) P(B|A)
5 4
=  = 0.052632
20 19

First Selection Second Selection: given that


the first is defective (D)

32
Theorem
Two events A and B are independent if and only if
P(AB)= P(A) P(B)
*(Multiplicative Rule for independent events)
Note:
Two events A and B are independent if one of the following
conditions is satisfied:
(i) P(A|B)=P(A)
 (ii) P(B|A)=P(B)
 (iii) P(AB)= P(A) P(B)
Theorem 2.15: (k=3)
· If A1, A2, A3 are 3 events, then:
P(A1 A2 A3)= P(A1) P(A2| A1) P(A3| A1 A2)
· If A1, A2, A3 are 3 independent events, then:
P(A1 A2 A3)= P(A1) P(A2) P(A3)
33
Example cards are drawn in succession, without replacement,
from an ordinary deck of playing cards. Fined P(A1  A2 A3),
where the events A1, A2 , and A3 are defined as follows:
A1 = {the 1-st card is a red ace}
A2 = {the 2-nd card is a 10 or a jack}
A3 = {the 3-rd card is a number greater than 3 but less than 7}

Solution:
P(A1) = 2/52
P(A2 |A1) = 8/51
P(A3| A1 A2) = 12/50
P(A1 A2 A3)
= P(A1) P(A2| A1) P(A3| A1 A2)
2 8 12 192
=   = = 0.0014479
52 51 50 132600
34
Example
Suppose we have a fuse box containing 20 fuses of
which 5 are defective (D) and 15 are non-defective (N). If
3fuses are selected at random and removed from the
box in succession without replacing the first, what is the
probability that the all three fuses are defective?

Solution:
• Define the following events:
• A1 = {the first fuse is defective}
• A2= {the second fuse is defective}
• A3= {the third fuse is defective}
• A1A2  A3 = {The all three fuses are defective}

35
We need to calculate P(A1A2 A3).

P(A1) = 5/20

P(A2|A1) =4/19

P(A3|A2  A1) =3/18

P(A1A2 A3) = P(A1) P(A2 |A1) P(A3 |A1 A2)

=(5/20)(4/19)(3/18)=0.0088

36
Probability and Statistics
Prof. Khalaf S. Sultan

Department of Mathematics
Al-Azhar University, Cairo, Egypt

Probability #02

1
Bayes' Rule:
Definition:
The events A1, A2,…, and An constitute a partition of the sample
space S if:
n
❖ A
i =1
i = A1  A 2  ...  A n = S

❖ Ai Aj = ,  i j
Theorem : (Total Probability)
If the events A1, A2,…, and An constitute
a partition of the sample space S
such that P(Ak)0 for k=1, 2, …, n,
then for any event B:
n
P(B) =  P(Ak ) P(B | A k )
k =1
n
=  P(Ak B)
k =1 2
Example:
Three machines A1, A2, and A3 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?

3
Solution:
Define the following events:
B = {the selected product is defective}
A1 = {the selected product is made by machine A1}
A2 = {the selected product is made by machine A2}
A3 = {the selected product is made by machine A3}
20 1
P(A1) = = 0.2; P(B | A1) = = 0.01
100 100
30 4
P(A2) = = 0.3; P(B | A2) = = 0.04
100 100
50 7
P(A3) = = 0.5; P(B | A3) = = 0.07
100 100
3
P(B) =  P(Ak ) P(B | A k )
k =1
= P(A1) P(B|A1) + P(A2) P(B|A2) + P(A3) P(B|A3)
= 0.20.01 + 0.30.04 + 0.50.07
= 0.002 + 0.012 + 0.035
= 0.049 4
Question:
If it is known that the selected product is defective, what is the
probability that it is made by machine A1?
Answer:
P(A1  B) 0.2  0.01 0.002
P(A1 | B) = = = = 0.0408
P(B) 0.049 0.049
This rule is called Bayes' rule.

5
Theorem : (Bayes' rule)
If the events A1,A2,…, and An constitute a partition of the sample
space S such that P(Ak)0 for k=1, 2, …, n, then for any event B
such that P(B)0:
P(Ai B) P(Ai ) P(B | Ai ) P(Ai ) P(B | Ai )
P(Ai | B) = = n
=
 P(A ) P(B | A
P(B) P(B)
k k )
k =1
for i = 1, 2, …, n.

6
Example
In Example 2.38, if it is known that the selected product is
defective, what is the probability that it is made by:
(a) machine A2?
(b) machine A3?

Solution:
P(A2 ) P(B | A 2 ) P(A2 ) P(B | A 2 )
(a )P(A 2 | B) = n
=
 P(A ) P(B | A
P(B)
k k )
k =1

0.3 0.04 0.012


= = = 0.2449
0.049 0.049

7
P(A3 ) P(B | A3 ) P(A3 ) P(B | A 3 )
(b)P(A 3 | B) = n
=
 P(A ) P(B | A
P(B)
k k )
k =1
0.5 0.07 0.035
= = = 0.7142
0.049 0.049

8
Note:
P(A1|B) = 0.0408, P(A2|B) = 0.2449, P(A3|B) = 0.7142
3
▪  P(Ak | B) = 1
k =1
▪ If the selected product was found defective, we should
check machine A3 first, if it is ok, we should check machine
A2, if it is ok, we should check machine A1.

9
Application
An electrical system consists of four components as
illustrated in the Figure

The system works if components A and B work and either


of the components C or D works.

The reliability (probability of working) of each component


is also shown
in the Figure

10
11
Find the probability that

(a) the entire system works


(b) the component C does not work, given that the entire
system works.
Assume that the four components work independently.

Solution

In this configuration of the system, A, B, and the subsystem C


and D constitute a serial circuit system, whereas the subsystem
C and D itself is a parallel circuit
system.
(a) Clearly the probability that the entire system works can be
calculated as follows

12
P [A  B  (C  D )] = P (A )P (B )P (C  D )
= P (A )P (B )[P (C ) + P (D ) − P (C )P (D )]
= (0.9)(0.9)[0.8 + 0.8 − (0.8)(0.8)]
= 0.7776

13
(b) The probability that the component
C does not work, given that the entire system works.

The conditional probability is

P (the system works but C does not work )


P=
P (the system works )
(A  B  C ' D ) (0.9)(0.9)(0.2)(0.8)
= =
P (the system works ) 0.7776
= 0.1667

14
Lecture #4
Random Variables and Probability Distributions

4.1 Concept of a Random Variable:


· In a statistical experiment, it is often very important to
allocate numerical values to the outcomes.

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.
· Assigned numerical values to the outcomes are:

1
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}.
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.
2
Types of Random Variables:
• A random variable X is called a discrete random variable if
its set of possible values is countable, i.e.,
x  {x1, x2, …, xn} or x  {x1, x2, …}

• 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}
• In most practical problems:

✓A discrete random variable represents count data, such as


the number of defectives in a sample of k items.

✓A continuous random variable represents measured data,


such as height.

3
4.2 Discrete Probability Distributions
· A discrete random variable X assumes each of its values
with a certain probability.
Example:
· Experiment: tossing a non-balance coin 2 times
independently.
· H= head , T=tail
· Sample space: S = {HH, HT, TH, TT}
· Suppose P(H)=½P(T)  P(H)=1/3 and P(T)=2/3
· Let X= number of heads
Sample point Probability Value of X
(Outcome) (x)
HH P(HH)=P(H) P(H)=1/31/3 = 1/9 2
HT P(HT)=P(H) P(T)=1/32/3 = 2/9 1
TH P(TH)=P(T) P(H)=2/31/3 = 2/9 1
4
TT P(TT)=P(T) P(T)=2/32/3 = 4/9 0
· The possible values of X are: 0, 1, and 2.
· X is a discrete random variable.
· Define the following events:
Event (X=x) Probability = P(X=x)
(X=0)={TT} P(X=0) = P(TT)=4/9
(X=1)={HT,TH} P(X=1) =P(HT)+P(TH)=2/9+2/9=4/9
(X=2)={HH} P(X=2) = P(HH)= 1/9

· The possible values of X with their probabilities are:


X 0 1 2 Total
P(X=x)=f(x) 4/9 4/9 1/9 1.00

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


(probability distribution) of the discrete random variable X.
5
Definition 3.4:
The function f(x) is a probability function of a discrete random
variable X if, for each possible values x, we have:
1) f(x)  0
2)  f ( x) = 1
all x
3) f(x)= P(X=x)
Note:
P(X  A ) =  f ( x ) =  P( X = x )
all xA all xA
Example:
For the previous example, we have:

X 0 1 2 Total
2
f(x)= P(X=x) 4/9 4/9 1/9  f ( x) = 1
x =0

6
P(X<1) = P(X=0)=4/9
P(X1) = P(X=0) + P(X=1) = 4/9+4/9 = 8/9
P(X0.5) = P(X=1) + P(X=2) = 4/9+1/9 = 5/9
P(X>8) = P() = 0
P(X<10) = P(X=0) + P(X=1) + P(X=2) = P(S) = 1
Example
A shipment of 8 similar computers
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.
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
8 
n(S) =  2  equally likely outcomes 7
 
The possible values of X are: x=0, 1, 2.
Consider the events:
3 5 
(X = 0) = {0D and 2N}  n(X = 0) =     
 0  2
 3  5 
(X = 1) = {1D and 1N}  n(X = 1) =     
 1  1 
3 5
(X = 2) = {2D and 0N}  n(X = 2) =     
 2  0
3 5 
    
n (X = 0)  0   2  10
f ( 0) = P ( X = 0) = = =
n (S) 8  28
 
 2

8
 3  5 
    
n (X = 1) 1  1  15
f (1) = P(X = 1) = = =
n (S) 8  28
 
 2
3  5
    
n (X = 2)  2   0  3
f (2) = P(X = 2) = = =
n (S) 8  28
 
 2
In general, for x=0,1, 2, we have:
3  5 
    
n (X = x )  x   2 − x 
f ( x ) = P(X = x ) = =
n (S) 8 
 
 2
9
The probability distribution of X is:

x 0 1 2 Total
10 15 3
f(x)= P(X=x) 1.00
28 28 28

 3   5 
     
  x   2 − x  ; x = 0, 1, 2
f ( x) = P( X = x) =  8  Hypergeometric
   Distribution
  2
0 ; otherwise

Definition
The cumulative distribution function (CDF), F(x), of a discrete
random variable X with the probability function f(x) is given by:
F(x) = P(X  x ) =  f ( t ) =  P(X = t ); for −<x<
tx tx 10
Example:
Find the CDF of the random variable X with the probability
function:
X 0 1 2
10 15 3
f(x)
28 28 28
Solution:
F(x)=P(Xx) for −<x<
For x<0: F(x)=0
10
For 0x<1: F(x)=P(X=0)=
28
10 15 25
For 1x<2: F(x)=P(X=0)+P(X=1)= + =
28 28 28
10 15 3
For x2: F(x)=P(X=0)+P(X=1)+P(X=2)= + + =1
28 28 28

11
The CDF of the random variable X is:
 0 ; x0
10
 ; 0  x 1
 28
F ( x) = P( X  x) = 
 25 ; 1  x  2
 28
1 ; x2

Note:
F(−0.5) = P(X−0.5)=0
25
F(1.5)=P(X1.5)=F(1) =
28
F(3.8) =P(X3.8)=F(2)= 1
Result:
P(a < X  b) = P(X  b) − P(X  a) = F(b) − F(a)
P(a  X  b) = P(a < X  b) + P(X=a) = F(b) − F(a) + f(a)
P(a < X < b) = P(a < X  b) − P(X=b) = F(b) − F(a) − f(b) 12
Result:
Suppose that the probability function of X is:
x x1 x2 x3 … xn

F(x) f(x1) f(x2) f(x3) … f(xn)

Where x1< x2< … < xn. Then:


F(xi) = f(x1) + f(x2) + … + f(xi) ; i=1, 2, …, n
F(xi) = F(xi −1 ) + f(xi) ; i=2, …, n
f(xi) = F(xi) − F(xi −1 )
Example:
In the previous example, 25 10 15
P(0.5 < X  1.5) = F(1.5) − F(0.5) = − =
28 28 28
25 3
P(1 < X  2) = F(2) − F(1) = 1 − =
28 28
13
4.3. 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.
b
P(a < X < b) =  f(x) dx
a
= area under the curve
of f(x) and over the
interval (a,b)
P(XA) =  f(x) dx
A
= area under the curve
of f(x) and over the
region A
f: R → [0, )
14
Definition
The function f(x) is a probability density function (pdf) for a
continuous random variable X, defined on the set of real
numbers, if:
1. f(x)  0  x R

2. f(x) dx = 1
- b

3. P(a  X  b) =  f(x) dx  a, b R; ab


a
Note:
For a continuous random variable X, we have:
1. f(x)  P(X=x) (in general)
2. P(X=a) = 0 for any aR
3. P(a  X  b)= P(a < X  b)= P(a  X < b)= P(a < X < b)

4. P(XA) =  f(x) dx
A
15
area = P(a  X  b )
1 = xd ) x( f 
−  =aera latoT =  a f ( x ) dx
b

area = P( X  b ) area = P( X  a )
=  b f ( x ) dx =  − f ( x ) dx
 a
16
Example
Suppose that the error in the reaction temperature, in oC, f
controlled laboratory experiment is a continuous rand
variable X having the following probability density function:
1 2
 x ; −1 x  2
f ( x) =  3
0 ; elsewhere

1. Verify that (a) f(x)  0 and (b)  f(x) dx = 1
2. Find P(0<X1) -
Solution:
X = the error in the reaction
temperature in oC.
X is continuous r. v.
1 2
 x ; −1 x  2
f ( x) =  3
0 ; elsewhere
17
1. (a) f(x)  0 because f(x) is a quadratic function.
 −1 2 
1 2
(b) - f(x) dx = - 0 dx + -1 3 x dx + 2 0 dx
2
1 2 1 3 x = 2 
=  x dx =  x 
-1
3  9 x = −1
1
= (8 − (−1)) = 1
9
1 11
2. P(0<X1) =  f(x) dx =  x dx
2
0 03
1 3 x = 1 
= x 
 9 x = 0 
1
= (1 − (0))
9
1
=
9
18
Definition
The cumulative distribution function (CDF), F(x), of a continuous
random variable X with probability density function f(x) is given
by: x

F(x) = P(Xx)=  f(t) dt ; for −<x<


-

Result:
P(a < X  b) = P(X  b) − P(X  a) = F(b) − F(a)

Example:
in Example 3.6,
1.Find the CDF
2.Using the CDF, find P(0<X1).

19
Solution:
1 2
 x ; −1 x  2
f ( x) =  3
0 ; elsewhere

For x< −1:


x x
F(x) =  f(t) dt =  0 dt = 0
- -
For −1x<2:
x −1 x1
F(x) =  f(t) dt =  0 dt +  t 2
dt
- - -13
x
1 2
=  t dt
-1
3
1 3 t = x  1 3 1 3
= t  = ( x − (−1)) = ( x + 1)
9 t = −1 9 9

20
For x2:
x −1 2 x
1 2 2
F(x) =  f(t) dt =  0 dt +  t dt +  0 dt =  t 2 dt = 1
1
- - -1
3 2 3
-1
Therefore, the CDF is:
 0 ; x  −1
 1
F ( x) = P( X  x) =  ( x 3 + 1) ; − 1  x  2
9
 1 ; x  2

2. Using the CDF,


2 1 1
P(0<X1) = F(1) − F(0) = − = 21
9 9 9

You might also like