You are on page 1of 38

INDIAN INSTITUTE OF TECHNOLOGY ROORKEE

CSN-373: Probability Theory for Computer Engineers

Lecture 2: Probability

Dr. Sudip Roy (a.k.a., SR)


Department of Computer Science & Engineering
Outline of Module 1:

● Concept of probability
● Random variables
● Distribution functions: discrete and continuous
● Moments and moment generating functions

2
Probability:

• Probability can be defined as the chance of an event occurring.


• It can be used to quantify what the “odds” are that a specific event will
occur.
• Some examples of how probability is used everyday would be weather
forecasting, “75% chance of snow” or for setting insurance rates.
• Probability is a measure of the likelihood of a random phenomenon or
chance behavior.
• Probability describes the long-term proportion with which a certain
outcome will occur in situations with short-term uncertainty.

3
Probability:

• If we flip a coin 100 times and compute the proportion of heads observed
after each toss of the coin, what will the proportion approach?

The Law of Large Numbers


• As the number of repetitions of a probability experiment increases, the
proportion with which a certain outcome is observed gets closer to the
probability of the outcome.

4
Probability and Counting Rules:

• Sample Spaces and Events


• The Addition Rules for Probability
• The Multiplication Rules and Conditional Probability
• Counting Rules
• Probability and Counting Rules

5
Probability and Counting Rules:

Objectives:
• Determine sample spaces and find the probability of an event, using classical
probability or empirical probability.
• Find the probability of compound events, using the addition rules.
• Find the probability of compound events, using the multiplication rules.
• Find the conditional probability of an event.
• Find the total number of outcomes in a sequence of events, using the
fundamental counting rule.
• Find the number of ways that r objects can be selected from n objects, using the
permutation rule.
• Find the number of ways that r objects can be selected from n objects without
regard to order, using the combination rule.
• Find the probability of an event, using the counting rules.
6
Sample Spaces and Events:

• A probability experiment is a chance process that leads to well-defined results


called outcomes.
• An outcome is the result of a single trial of a probability experiment.
• A sample space (S) is the set of all possible outcomes of a probability
experiment.
• An event (E) consists of outcomes, i.e., a subset of the sample space.
• Simple event, ei is an event with one outcome.
• Compound event consists of two or more outcomes.
• Examples of Sample Spaces:
Experiment Sample Space
Toss a coin Head, Tail
Roll a die 1, 2, 3, 4, 5, 6
Answer a true/false question True, False
Toss two coins HH, HT, TH, TT
7
Example 1:

• A coin is tossed twice. List the elements of the sample space S and list
the elements of the event consisting of at least one head.
S = {HH, TT, HT, TH}
e = {HT, TH, HH}

Tossing a coin:

8
Example 2:

• A die is tossed one time.


(a) List the elements of the sample space S.
S = {1, 2, 3, 4, 5, 6}

(b) List the elements of this event consisting of a number that is


greater than 4.
E = {5, 6}

9
Example 3:

• List the sample space S for the types of outfits that can be
made with a red shirt or blue shirt and 3 different ties.
S = {R1, R2, R3, B1, B2, B3}

10
Example 4: Rolling Two Dice

36 different and unique outcomes:

11
Example 4: Rolling Two Dice

• Find the sample space for rolling two dice.

12
Example 5: Drawing Cards

Find the sample space for drawing one card from an ordinary deck of cards.

Solution:
Since there are 4 suits (hearts, clubs, diamonds, and spades) and 13 cards
for each suit (ace through king), there are 52 outcomes in the sample space.

13
Exercise #1:

• If two dice are rolled one time, find the probability of getting
these results.
a. A sum of 6
b. The sum gets Doubled
c. A sum of 7 or 11
d. A sum greater than 9
e. A sum less than or equal to 4

14
Exercise #1: Solution
a. A sum of 6
Total of 36 outcomes
There are 62 or 36 outcomes.
There are 5 ways to get a sum of 6.
They are (1,5), (2,4), (3,3), (4,2), and (5,1).
5
The probability then is .
36
b. The sum is Doubled
There are six ways to get doubles. They are (1,1), (2,2),
(3,3), (4,4), (5,5), and (6,6).
6 1
The probability is then = .
36 6
15
Exercise #1: Solution

c. A sum of 7 or 11 Total of 36 outcomes


There are six ways to get a sum of 7. They are (1,6), (2,5), (3,4),
(4,3), (5,2), and (6,1).
There are two ways to get a sum of 11. They are (5,6) and (6,5).
8 2
The probability then is = .
36 9

d. A sum of greater than 9


To get a sum greater than nine, one must roll a 10, 11, or 12.
There are six ways to get a 10, 11, or 12. They are (4,6), (5,5),
(6,4), (6,5), (5,6), and (6,6).
6 1
The probability then is = .
36 6
16
Exercise #2: Gender of Children

• Find the sample space for the gender of the children if a


family has three children. Use B for boy and G for girl.
BBB BBG BGB BGG GBB GBG GGB GGG

17
Exercise #2: Gender of Children

• Use a tree diagram to find the sample space for the gender
of three children in a family.
B BBB
B
G BBG
B
B BGB
G
G BGG
B GBB
B
G GBG
G
B GGB
G
G GGG

18
Sample Spaces and Probability:

There are three basic interpretations of probability:

• Classical probability

• Empirical probability

• Subjective probability

19
Classical probability:

• Classical probability uses sample spaces to determine the


numerical probability that an event will happen and assumes
that all outcomes in the sample space are equally likely to
occur.

n(E) # of desired outcomes


P(E) = =
n ( S ) Total # of possible outcomes

20
Exercise #2: Gender of Children

If a family has three children, find the probability that two of the
three children are girls.

Sample Space:
BBB BBG BGB BGG GBB GBG GGB GGG

Three outcomes (BGG, GBG, GGB) have two girls.

The probability of having two of three children being girls is 3/8.

21
Rounding Rule for Probabilities:

Probability Rule 1:
• The probability of any event E is a number (either a fraction
or decimal) between and including 0 and 1.
• This is denoted by 0 ≤ P(E) ≤ 1.
Probability Rule 2:
• If an event E cannot occur (i.e., the event contains no
members in the sample space), its probability is 0.
Probability Rule 3:
• If an event E is certain, then the probability of E is 1.
Probability Rule 4:
• The sum of the probabilities of all the outcomes in the
sample space is 1.

22
Rounding Rule for Probabilities:

• Probabilities should be expressed as reduced fractions or rounded to two


or three decimal places. When the probability of an event is an extremely
small decimal, it is permissible to round the decimal to the first nonzero
digit after the decimal point.
• An unusual event is an event that has a low probability of occurring.
Typically, an event with a probability less than 0.05 is considered as
unusual.
• Probabilities should be expressed as reduced fractions or rounded to
three decimal places.

Because the sum is 1.21 which


is greater than 1

23
Exercise #3:

Solution:

24
Exercise #4:

The age distribution of employees for this college is shown below:

If an employee is selected at random, find the probability that he or she is in the


following age groups
(a) Between 30 and 39 years of age (use 3 decimal places)
P(between 30 and 39) = 32/130 = 0.246 Note: probabilities are written in decimal
form

(b) Under 20 or over 49 years of age


P(under 20 or over 49) = (25 + 10)/130 = 35/130 = 0.269

25
Exercise #5:

Let the sample space be S = {1,2,3,4,5,6,7,8,9,10}


Suppose the outcomes are equally likely.

(a) Compute the probability of the event F = {5, 9}.


P(F) = 2/10 = 0.2
(b) Compute the probability of the event E = "an odd number."
P(E)= 5/10 = 0.5

26
Exercise #6:

Two dice are tossed. Find the probability that the sum of two dice is greater
than 8?

P(sum greater than 8) = 10/36 = 0.278

27
Exercise #7:

If one card is drawn from a deck, find the probability of getting

(a) a club
13/52 = ¼ = 0.25
(b) a 4 and a club
1/52 = 0.019
(c) a 4 or a club
16/52 = 4/13 = 0.308

28
Exercise #8:

Three equally qualified runners, Mark, Bill, and Alan, run a 100-meter sprint,
and the order of finish is recorded.
(a) Give a sample space S.
S = {MBA, MAB, BMA, BAM, AMB, ABM}
(b) What is the probability that Mark will finish last?
2/6 = 1/3 = 0.333

29
Example: Rolling a Die

When a single die is rolled, what is the probability of getting a number less
than 7?

Since all outcomes—1, 2, 3, 4, 5, and 6—are less than 7, the probability is

The event of getting a number less than 7 is certain.

30
Probability of Not Occurring an Event:

• The complement of an event E, denoted by E, is the set of


outcomes in the sample space that are not included in the
outcomes of event E.
P (E) = 1− P (E)

31
Probability and Counting Rules:

• Sample Spaces and Events


• The Addition Rules for Probability
• The Multiplication Rules and Conditional Probability
• Counting Rules
• Probability and Counting Rules

32
Addition Rules for Probability and
Complements:
Objective A: Addition Rue for Disjoint (Mutually Exclusive) Events
Event A and B are disjoint (mutually exclusive) if they have no outcomes in
common.

Addition Rule for Disjoint Events


If and are disjoint events, then P(E or F) = P(E) + P(F)

Example 1 (disjoint since no outcomes in common):


• A standard deck of cards contains 52 cards. One card is randomly
selected from the deck. Compute the probability of randomly selecting a
two or a three from a deck of cards.

33
Addition Rules for Probability and
Complements:
Objective B: General Addition Rule
For any two events E and F, P(E or F) = P(E) + P(F) – P(E and F).

Example 1(not disjoint, common outcome):


• A standard deck of cards contains 52 cards. One card is randomly
selected from the deck. Compute the probability of randomly selecting a
two or club from a deck of cards.

34
Addition Rules for Probability and
Complements:
Objective B: Complement Rule
If E represents any event and Ec represents the complement of E, then
P(Ec) = 1 – P(E).

Example 1: The chance of raining tomorrow is 70%. What is the probability that it will
not rain tomorrow?

Example 2: In a large department store, there are 2 managers, 4 department heads,


16 clerks, and 4 stock persons. If a person is selected at random,

(a) find the probability that the person is a clerk or a manager

(b) find the probability that the person is not a clerk

35
Addition Rules for Probability and
Complements:
Example 3: A probability experiment is conducted in which the sample space of the
experiment is S = {1,2,3,4,5,6,7,8,9,10,11,12}
Let event E = {2,3,5,6,7}, event F = {5,6,7,8}, and event G = {9,11}
(a) List the outcome in E and F. Are E and F mutually exclusive?

(b) Are F and G mutually exclusive? Explain.

(c) List the outcome in E or F. Find P(E or F) by counting the number of outcomes in
E or F.

(d) Determine P(E or F) using the General Addition Rule.

(e) List the outcomes in Ec . Find P(Ec) by counting the number of outcomes in Ec.

(f) Determine P(Ec) using the Complement Rule.

36
Probability and Counting Rules:

• Sample Spaces and Events


• The Addition Rules for Probability
• The Multiplication Rules and Conditional Probability
• Counting Rules
• Probability and Counting Rules

37
Next Class…

38

You might also like