Probability& Statistics
CS
Prepared By
Dr/Marwa Yahya
Probability
- Experiment.
- Sample Space.
- Outcome.
- Event.
- Probability.
- Experiment
An experiment is any process of
observation that has an uncertain
outcome.
- Sample Space
The collection of the all outcomes
for an experiment is called
a sample space
A sample space is denoted by S. the
sample space for the example of
inspecting a tennis ball is written as
𝑆 = 𝑔𝑜𝑜𝑑, 𝑑𝑒𝑓𝑒𝑐𝑡𝑖𝑣𝑒 .
The elements of a sample space are
called sample points.
Example (1)
Suppose we randomly select two employees from a
company and observe whether the employee selected
each time is a man or a woman. Write all the outcomes
for this experiment.
Solution
Let us denote the selection of a man by M and that of a
woman by W. There are four final outcomes: MM, MW,
WM, and WW. Hence, the sample space is written as
𝑺 = (𝑴, 𝑴), (𝑴, 𝑾), (𝑾, 𝑴), (𝑾, 𝑾) .
Event is a collection of one or more of the
outcomes for an experiment.
◦ SIMPLE AND COMPOUND EVENTS
An event may be a simple event or a compound
event. We denote an event by using a capital
letter. If the letter 𝐸 denotes a particular event,
then 𝑃(𝐸) denotes the probability that the event 𝐸
will occur.
Simple Event
An event that include one and only one of the (final)
outcomes for an experiment is called a simple event and
is usually denoted by 𝑬𝒊 .
Compound Event
A compound event is a collection of more than one
outcome for an experiment.
CALCULATING PROBABILITY
The probability of an event is a number that
measures the chance, or likelihood, that the
event will occur when the experiment is carried
out. The following are two important properties
of probability.
The probability of an event is greater than or equal to zero
and is less than or equal to one.
- For an impossible event M "the event M never occurs":
𝑷(𝑴) = 𝟎.
- For a sure event C "the event C is certain to occur":
𝑷(𝑪) = 𝟏.
Intuitively, then, the closer that 𝑷(𝑬) is to one, the higher is
the likelihood that the event 𝑨 will occur, and the closer
that 𝑷(𝑬) is to zero, the smaller is the likelihood that the
event 𝑬 will occur.
The sum of the probabilities of all simple events (or final
outcomes) for an experiment, denoted by σ 𝑷(𝑬𝒊 ), is
always 1.
Thus, for an experiment
σ 𝑷 𝑬𝒊 = 𝑷 𝑬𝟏 + 𝑷 𝑬𝟐 + 𝑷 𝑬𝟑 + ⋯ = 𝟏
From this property, for the experiment of one toss
of a coin
𝑷 (𝑯) + 𝑷 (𝑻) = 𝟏
For the experiment of two tosses of a coin
𝑷 (𝑯𝑯) + 𝑷 (𝑯𝑻) + 𝑷 (𝑻𝑯) + 𝑷(𝑻𝑻) = 𝟏
CLASSICAL PROBABILITY RULE
𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑓𝑎𝑣𝑜𝑟𝑎𝑏𝑙𝑒 𝑜𝑢𝑡𝑐𝑜𝑚𝑒𝑠
𝑃 𝐸𝑖 =
𝑇𝑜𝑡𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑜𝑢𝑡𝑐𝑜𝑚𝑒𝑠 𝑓𝑜𝑟 𝑡ℎ𝑒 𝑒𝑥𝑝𝑒𝑟𝑖𝑚𝑒𝑛𝑡
Example (2)
Find the probability of obtaining a head and the
probability of obtaining a tail for one toss of a coin
𝑆 = {𝐻, 𝑇}
𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑓𝑎𝑣𝑜𝑟𝑎𝑏𝑙𝑒 𝑜𝑢𝑡𝑐𝑜𝑚𝑒𝑠 1
𝑃 ℎ𝑒𝑎𝑑 = =
𝑇𝑜𝑡𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑜𝑢𝑡𝑐𝑜𝑚𝑒𝑠 2
𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑓𝑎𝑣𝑜𝑟𝑎𝑏𝑙𝑒 𝑜𝑢𝑡𝑐𝑜𝑚𝑒𝑠 1
𝑃 𝑡𝑎𝑖𝑙 = =
𝑇𝑜𝑡𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑜𝑢𝑡𝑐𝑜𝑚𝑒𝑠 2
Example (3)
- Find the probability of obtaining an even number in one
roll of a die.
Solution
Let A be an even number is observed on the die
𝑺 = {𝟏, 𝟐, 𝟑, 𝟒, 𝟓, 𝟔}
𝑵𝒖𝒎𝒃𝒆𝒓 𝒐𝒇 𝒐𝒖𝒕𝒄𝒐𝒎𝒆𝒔 𝒊𝒏𝒄𝒍𝒖𝒅𝒆𝒅 𝒊𝒏 𝑨 𝟑
𝑷 𝑨 = =
𝑻𝒐𝒕𝒂𝒍 𝒏𝒖𝒎𝒃𝒆𝒓 𝒐𝒇 𝒐𝒖𝒕𝒄𝒐𝒎𝒆𝒔 𝟔
MUTUALLY EXCUSIVE EVENTS
Two events 𝑨 and 𝑩 are mutually exclusive if they
have no sample space outcomes in common. Events
A and B cannot occur together, and thus
𝑷 𝑨 ∩ 𝑩 = 𝟎.
Example (4)
In a sample of 460 persons, 120 own stocks, 155 own bonds, and 225
own neither stocks nor bonds. Of the 120 persons who own stocks
and 155 who bonds, 40 own both stocks and bonds. Suppose one
person is selected at random from these 460 persons.
Let
A = the event that a randomly selected person owns stocks.
B = the event that a randomly selected person owns bonds.
C = the event that a randomly selected person owns neither stocks
nor bonds.
Are events 𝑨 and 𝑩 mutually exclusive? What about events 𝑨 and 𝑪?
What about events 𝑩 and 𝑪?
Solution
- First consider events 𝑨 and 𝑩, if the selected
person is one of the 40 who own both stocks and
bonds, events 𝑨 and 𝑩 both happen.
- Now, consider events A and C. these events don
not have any common outcomes. Hence, events A
and C are mutually exclusive events.
- Similarly, because events B and C do not have any
common outcome, they are also mutually exclusive
events.
SOME RULES FOR COMPUTING PROBABITITES
The intersection of 𝑨 and 𝑩 is the event consisting of the sample
space outcomes belonging to both A and B. the intersection is
denoted by 𝑨 ∩ 𝑩. Furthermore, 𝑷(𝑨 ∩ 𝑩) denotes the probability
that both A and B will simultaneously occur.
The union of 𝑨 and 𝑩 is the event consisting of the sample space
outcomes belonging to either A and B. the union is denoted 𝑨 ∪ 𝑩.
Furthermore, 𝑷(𝑨 ∪ 𝑩) denotes the probability that either A or B
will occur.
General Rule of addition
𝑷 𝑨 𝒐𝒓 𝑩 = 𝑷 𝑨 + 𝑷 𝑩 – 𝑷 𝑨 𝒂𝒏𝒅 𝑩 .
Special Rule of Addition
𝑷 𝑨 𝒐𝒓 𝑩 = 𝑷 𝑨 + 𝑷 𝑩 .
Example (6)
A card is drawn at random from a deck of cards.
What is the probability that
❑ A jack
❑ A spade
❑ A jack or an ace
❑ A jack or a spade
.
Solution
4
❑ P a jack = .
52
13
❑P a spade = .
52
❑ 𝐏 𝐚 𝐣𝐚𝐜𝐤 𝐨𝐫 𝐚𝐧 𝒂𝒄𝒆
= 𝐏 𝐚 𝒋𝒂𝒄𝒌 + 𝐏 𝐚𝐧 𝒂𝒄𝒆 −
𝐏 𝐚 𝐣𝐚𝐜𝐤 𝐚𝐧𝐝 𝐚𝐧 𝒂𝒄𝒆 .
4 4 0 8
P a jack or an ace = + − = .
52 52 52 52
❑ 𝐏 𝐚 𝐣𝐚𝐜𝐤 𝐨𝐫 𝐚 𝐬𝐩𝐚𝐝𝐞 =
𝐏 𝐚 𝐣𝐚𝐜𝐤 + 𝐏 𝐚 𝐬𝐩𝐚𝐝𝐞 − 𝐏(𝐚 𝐣𝐚𝐜𝐤 𝐚𝐧𝐝 𝐚 𝐬𝐩𝐚𝐝𝐞)
4 13 1 16
P a jack or 𝑎 𝑠𝑝𝑎𝑑𝑒 = + − =
52 52 52 52
CONDITIONAL PROBABILITY
Conditional Probability is the probability that an
event will occur given that another event has
already occurred. If A and B are two events, then
the conditional probability of A is written as
𝑷 𝑩ȁ𝑨 ,
are read as "the probability of 𝑩 given that 𝑨 has
already occurred".
Conditional Probability
𝑷 𝑨 𝒂𝒏𝒅 𝑩
𝑷 𝑩ȁ𝑨 =
𝑷(𝑨)
Example (7)
A card is drawn at random from a deck of cards. What
is the probability that it is a jack, given that it is red?
Solution
𝐏(𝐚 𝐣𝐚𝐜𝐤∩𝐚 𝐫𝐞𝐝) 𝟐Τ𝟓𝟐 𝟐
𝐏 𝐚 𝐣𝐚𝐜𝐤ȁ𝐚 𝒓𝒆𝒅 = = = .
𝐏(𝐚 𝐫𝐞𝐝) 𝟐𝟔Τ𝟓𝟐 𝟐𝟔
Example (8)
If you roll two dice. Find the following probabilities
- The sum = 9
- The sum = 5 or 11
- The first die gives an even number and the second die
gives an odd number.
- The first die gives an even number or the second die
gives an odd number.
- Both of the two dice are the same number.
- If the first die shows an even number, what is the
probability that the sum = 8.
Solution
1 2 3 4 5 6
1 (1,1) (1,2) (1,3) (1,4) (1,5) (1,6)
2 (2,1) (2,2) (2,3) (2,4) (2,5) (2,6)
3 (3,1) (3,2) (3,3) (3,4) (3,5) (3,6)
4 (4,1) (4,2) (4,3) (4,4) (4,5) (4,6)
5 (5,1) (5,2) (5,3) (5,4) (5,5) (5,6)
6 (6,1) (6,2) (6,3) (6,4) (6,5) (6,6)
- 𝑷(𝒔𝒖𝒎 = 𝟗) = 𝟒/𝟑𝟔
𝟒 𝟐 𝟔
- P(sum= 5 or 11) = P(B) + P(C) = + =
𝟑𝟔 𝟑𝟔 𝟑𝟔
𝟗
- P(E and O) = 𝑷 𝑬 ∩ 𝑶 =
𝟑𝟔
𝟏𝟖 𝟏𝟖 𝟗 𝟐𝟕
- P(E or O) = 𝑷 𝑬 ∪ 𝑶 = + − =
𝟑𝟔 𝟑𝟔 𝟑𝟔 𝟑𝟔
- 𝑷(𝑩) = 𝟔/𝟑𝟔
𝑷 𝑬 ∩ 𝒔𝒖𝒎 = 𝟖
− 𝑷 𝒔𝒖𝒎 = 𝟖 𝑬 =
𝑷 𝑬
= 𝟑/𝟑𝟔 ÷ 𝟏𝟖/𝟑𝟔 = 𝟑/𝟑𝟔 × 𝟑𝟔/𝟏𝟖 = 𝟑/𝟏𝟖.
Three machines x, y , and z of equal capacities are
producing bullets the probabilities that the
machines produce defectives are 0.1, 0.2, and 0.1
respectively. A bullet is taken at random from a
day’s production and is found to be defective. What
is the probability that it came from machine x?
P(D x ) = 0.1
P(x) = 1 / 3 P(G x ) = 0.9
P(D y ) = 0.2
P(y) = 1 / 3
P(G y ) = 0.8
P(D z ) = 0.1
P(z) = 1 / 3
P(G z ) = 0.9
)𝑫 ∩ 𝒙(𝑷
= )𝑫ہ𝒙(𝑷
)𝑫(𝑷
)𝒙(𝑷 𝒙 .ہ𝑫 𝑷
=
)𝒛(𝑷 𝒛 .ہ𝑫 𝑷 𝒚 . 𝑷 𝒚 +ہ𝑫 𝑷 𝒙 . 𝑷 𝒙 +ہ𝑫 𝑷
𝑫∩𝒙 𝑷
= 𝑫ہ𝒙 𝑷
𝑫 𝑷
𝟏
𝟏 𝟑 × 𝟎.
= 𝟓𝟐 = 𝟎.
𝟏 𝟏 𝟏
× 𝟎. 𝟏 + × 𝟎. 𝟐 + 𝟏 × 𝟎.
𝟑 𝟑 𝟑
THANK You