You are on page 1of 41

Chapter 2

Elementary probability theory


2.1 Introduction
The probability theory is a mathematical modeling of the phenomena of chance or
randomness. Such phenomena are characterized by the fact that their future
behavior is not predictable in a deterministic fashion.
The theory of probability originated from the game of chance and gambling. The
study of probability dates back to the 17th century and the work of two
mathematicians Blaise Pascal (1623-1662) and Pierre de Fermat (1601-1665).
 Sample Space and events
In our everyday life we very often deal with the situations whose outcome cannot
forecast. We call such situations random experiments.
An event is any collection (subset) of outcomes contained in the sample space S. An
event is said to be simple if it consists of exactly one outcome and compound if it
consists of more than one outcome.
1. The complement of an event A, denoted by A‘, is the set of all outcomes in S
that are not contained in A.
2. The intersection of two events A and B, denoted by A and B read ―A and B,‖ is
the event consisting of all outcomes that are in both A and B.
3. The union of two events A and B, denoted by A [ B and read ―A or B,‖ is the
event consisting of all outcomes that are either in A or in B or in both events (so
that the union includes outcomes for which both A and B occur as well as
outcomes for which exactly one occurs)—that is, all outcomes in at least one of
the events.
Since an event is a set, we can combine events to form new events using the various
set operations.
i) A  B is the event that occurs if and only if A occurs or B occurs (or both).
Discrete mathematics and combinatorics Page 1
ii) A  B is the event that occurs if and only if A occurs and B occurs.
iii) A' , the complement of A, is the event that occurs if and only if A does not
occur.
 Random experiment
Random experiment is an experiment which can be repeated any number of times
under the same conditions, but does not give unique results i.e. for each trial the
result will not be known in advance.
Example: If we toss a coin it is impossible to forecast whether the head will come
up or tail. Thus tossing a coin is a random experiment.
 Sample space
The set S of all possible outcomes of a given random experiment is called a
sample space. Every element of the sample space S is called a sample point.
Example: When a coin is tossed, there are two sample points Head (H) and Tail
(T). Then the sample space is S= {H, T} and S  2 .
Example: An urn contains 4 balls of different colors. The colors are red, yellow,
black and white. Two balls are simultaneously taken out of the urn. Describe the
sample space of this experiment.
Solution: The sample space is S= {RY, RB, RW, YB, YW, BW} where R, Y, B and
W stand for red, yellow, black and white colors respectively.
Events
Any subset of sample space S is called an event.
Note: The entire sample space S and the empty set  are events since they are
subsets of S.  is sometimes is called the impossible event.
Two events A and B are called mutually exclusive if they are disjoint, i.e., if
A  B   . In other words, A and B are mutually exclusive if and only if the can not

occur simultaneously.

Discrete mathematics and combinatorics Page 2


Example 2.2.4
1. When we toss a coin, either head or tail can be up, but both can not be up at a
time, hence the outcome of getting a head (H) and tail (T) are mutually
exclusive events.
2. When we throw a die the outcome of getting 1, 2, 3,…, 6 are mutually exclusive
events.
The probability of an event
In this section, we will restrict ourselves to experiment that have finitely many,
equally likely outcomes.
2.3.1 Definitions of probability
 Mathematically definitions of probability
The probability of an event E, which is a subset of a finite sample space S of
E
equally outcomes, is denoted by P(E ) is defined as P( E ) 
S

Example: If at least one child in a family of three children is a boy, what is the
probability that all three are boys?
Solution: The sample space is S= {BBB, BBG, BGB, GBB, GGB, GBG, BGG}
where B represents a boy and G represents a girl.
Hence S  7 and since E is the event that all the three are boys, E  1 .

E 1
Therefore P( E )  P( BBB )   .
S 7

N.B The probability of an impossible event is zero.


Example: Two dice are thrown simultaneously. Find the probability of getting
(i) The same number on both dice,
(ii) An even number as the sum,
(iii) A prime number as the sum,
(iv) A multiple of ‗3‘ as the sum,
Discrete mathematics and combinatorics Page 3
(v) A total of at least 0,
(vi) A doublet of even numbers,
(vii) A multiple of ‗2‘ on one dice and a multiple of ‗3‘ on the other dice.
Sol.: Here: S = { (1,1), (1,2)…, (1,6), (2,1), (2,2), … (2,6), (3,1), (3,2)… (3,6),
..,(5,1), (5,2), … (5,6), (6,1,), (6,2), -…- (6,6) } |S|= 6 x 6 = 36
(i) Let E1 = Event of getting same number on both side:
E1= { (1,1), (2,2), (3,3), (4,4), (5,5), (6,6) }; |E1| = 6
P(E1) = |E1|/|S| = 6/36 = 1/6
(ii) Let E2 = Event of getting an even number as the sum.
E2 = { (1,1), (1,3), (1,5), (2,2), (2,4), (2,6), (3,1), (3,3), (3,5), (4,2), (4,4), (4,6),
(5,1), (5,5), (6,2), (6,4), (6,6) } |E2|= 18 hence P(E2) = |E2|/|S| = 18/36 = 1/2
(iii) Let E3 = Event of getting a prime number as the sum..
E3 = { (1,1), (1,2), (1,4), (1,6), (2,1), (2,3), (2,5), (3,2), (3,4), (4,1), (4,3), (5,2),
(5,6), (6,1), (6,5),} |E3|= 15 P(E2) = |E3| / |S| = 15/36 = 5/12
(iv) Let E4 = Event of getting a multiple of ‗3‘ as the sum.
E4 = { (1,2), (1,5), (2,1), (2,4), (3,3), (3,6), (4,2), (4,5), (5,1), (5,4),(6,3), (6,6),}
|E4|= 12 P(E4) = |E4|/|S| = 12/36 = 1/3
(v) Let E5 = Event of getting a total of at least 10. E5 = { (4,6), (5,5), (5,6), (6,4),
(6,5), (6,6), } |E5|= 6 P(E5) = |E5|/|S| = 6/36 = 1/6
(vi) Let E6 = Event of getting a doublet of even numbers. E6 = { (2,2), (4,4),
(6,6), } |E6|= 3 P(E6) = |E6|/ |S| = 3/36 = 1/12
(vii) Let E7 = Even of getting a multiple of ‗2‖ on one dice and a multiple of ‗3‘
on the other dice.
E7 = { (2,3), (2,6), (4,3), (4,6), (6,3), (3,2), (3,4), (3,6), (6,2), (6,4) } |E7|= 11
P(E7) = |E7| / |S| = 11/36|E3|= 15 P(E2) = |E3| / |S| = 15/36 = 5/12
 Statistical or empirical definitions of probability

Discrete mathematics and combinatorics Page 4


m
If in n trials, an event E happen m times, then P( E )  lim
n
( ) i.e. the limit of the
n
number of times E occurs divided by the number of times the experiment is
performed.
Axiomatic definitions of probability
Let S be a sample space. Let  be the collections of all subsets of S. Then the
functions P :   [0,1] is called a probability functions if
 
i) P( E)  0 for all E   ii) P(S) =1 iii) P( Ei )   P( Ei ) whenever, E1 , E 2 ,…
i 1 i 1

are disjoint events which is to say that Ei  E j   whenever i  j .


THEOREM: The probability function P defined on the class of all events in a
finite probability space has the following properties:
a) For every event , 1.
b)
c) If events A and B are mutually exclusive, then

Theorem 7.3: Consider the empty set and any events A and B. Then:
i)
ii)
iii)

AXIOM: 1 For any event


COMPLEMENT RUL: For any event A, ̅ where ̅ is the
compliment of A.
PROPOSITION: For any event .
Example: Suppose a student is selected at random from 100 students where 30 are
taking mathematics,20 are taking chemistry, and 10 are taking mathematics and
chemistry. Find the probability p that the student is taking mathematics or
chemistry.
Theorems on probabilities
Theorem 2.3.3
Prove the probability of an impossible event is zero, i.e. P( )  0

Discrete mathematics and combinatorics Page 5


Proof: Impossible event contains no sample point. The sample space S and the
impossible event  are mutually exclusive events.
Thus, S    S  P(S   )  P(S )
 P(S )  P( )  P(S )  P( )  0 . This completes the proof.

Theorem: 2.3.4 The probability of the complement event A' of A is


P( A' )  1  P( A)

Proof: Clearly A and A' are disjoint events. Thus P( A  A' )  P( A)  P( A' )
Now A  A'  S  P( A  A' )  P(S )
 P( A)  P( A' )  1 since, P(S )  1  P( A' )  1  P( A)

This completes the proof.


ADDITION RULE
For any events A and B,  

2.3.6 Additions theorem of probability


If A and B are any two events, then P( A  B)  P( A)  P( B)  P( A  B)
Proof: Consider the following Venn diagram given bellow
Clearly A and A'  B are disjoint sets and their unions is A  B
Now A  B  A  ( A'  B)
 P( A'  B)  P( B)  P( A  B) …………………………………………………….(1)

Putting in (1): P( A  B)  P( A)  P( B)  P( A  B) Hence, this completes the proof.


Example: 2.3.7 A card is taken from a pack of cards. Find the probability that
it is either spade or an ace.
Solution: Let A and B denote the events of drawing a spade card and an ace
13 4 1
card, respectively, so that P( A)  , P( B)  , P( A  B)  . Therefore the
52 52 52
probability that the card drawn is either a spade or an ace is given by
P( A  B)  P( A)  P( B)  P( A  B)

Discrete mathematics and combinatorics Page 6


13 4 1 4
   
52 52 52 13
2.4 Conditional Probability
Definition: 2.4.1 If A and B be events in a sample space S with P( B)  0 . The
conditional probability of A given B denoted by P( A \ B) and defined as
P( A  B)
P( A \ B)  , in other words, it is the probability of the occurrence of A
P( B)

when the event B has already happened.


Example: 2.4.2 A die is thrown twice. If A is the event in which 1 occurs on
the first throw, B is the event of getting a sum of less than 4 then find, P( A \ B) .
Solution: The event A  {(1,1), (1,2), (1,3), (1,4), (1,5), (1,6)} , the condition is imposed on
A that 1 must be in the first throw whatever the second place.
The event B is such that sum of the digits in each pair must be less than 4 hence
B  {(1,1), (1,2), (2,1)}.

Since A  B  {(1,1), (1,2)} , we see that P( A  B)  2 36 and P( B)  3 36 .


P( A  B) 2 36 2
Hence, P( A \ B)    .
P( B) 3 36 3

Example: 2.4.3 A box contains 4 bad and 6 good tubes. Two are drawn out
from the box at a time. One is tested and found to be good. What is the
probability that the other one is also good?
Solution: Let A be the event that one tube is good and B be the event that the
other tube is good.
C (6,2) 1
Now P( A  B)  P(both tubes are good )   and P( A)  6 10  3 5 thus,
C (10,2) 3

P( A  B) 1 3 5
P( B \ A)   
P( A) 35 9

 Multiplication law of probability

Discrete mathematics and combinatorics Page 7


If A and B are events in a sample space S with P( B)  0 then by definition of
P( A  B)
conditional probability, P( A \ B) 
P( B)

P( A  B)
This implies P( A  B)  P( B) . P( A \ B) and P( B \ A)  , with P( A)  0 gives
P( A)

P( A  B)  P( A) . P( B \ A)

Where P( A \ B) represents the conditional probability of A given B and P( B \ A)


represents the conditional probability of B given A .
The multiplication law of probability gives us a formula for the probability that
events A and B both occur. It can easily be extended to three or more events
A1 , A2 , ... , An ; that is,
P( A1  A2 , ... , An )  P( A1 ) . P( A2 \ A1 ) . P( A3 \ A1  A2 ).....P( An \ A1  A2  ....  An )
Example: 2.4.5
An urn contains ten balls of which 3 are black and 7 white. The following game is
played. At each trial a ball is selected at random its color noted, and it is replaced
along with two additional balls of the same color. What is the probability that a
white ball is selected in each of the first three trials?
Solution: Let Ai denote the event that a white ball is selected on the ith trials.
P( A1  A2  A3 )  P( A1 ) . P( A2 \ A1 ) . P( A3 \ A1  A2 )

C (7,1) C (9,1) C (11,1)


 . .  0.4125
C (10,1) C (12,1) C (14,1)

Activity: 2.5
A lot contains 12 items of which 4 are defective. Three items are drawn at random
from the lot one after the other. Find the probability that all the three are no
defective.

Discrete mathematics and combinatorics Page 8


2.5 Independent events
Events A and B in the probability space S are said to be independent if the
occurrence of one of them does not influence the occurrence of the other. More
specifically, A is independent of B if P( A) is the same as P( A \ B) . Now substituting
P( A) for P( A \ B) in the multiplication law of probability P( A  B)  P( B) . P( A \ B)

yields P( A  B)  P( A) . P( B) .
We formally use the above equation as our definition of independence
Definition: 2.5.1 Events A and B are said to be independent if and only if
P( A  B)  P( B) . P( A) ; otherwise they are dependent.

Theorem 1: The events A and B are independent if P(A ∩ B) = P(A) P(B).

Proof: From the definition of an independent event, we have


. Here, P(B) ≠ 0.

Theorem2: For two events A and B such that If A is


independent of B, then B is independent of A.

Proof: If A is independent of B, we have

…………………………………………………………………………………(1)

P(B|A) = P(A ∩ B) / P(A) = [P(A) P(B)] ⁄ P(A) = P(B) [from I]

So B is also independent of A.

Discrete mathematics and combinatorics Page 9


Example: let A and B be independent events with and

Find a) , b) c)

SOLUTION: we know that


since (A, B is independent). Thus we know that

( ) . Implying that . Also since A and B are independent

. Further . So

( )( )

Example: 2.5.2The events A and B are independent with P( A)  0.5 and


P( B)  0.8 . Find the probability that neither of the event occurs.

Solution: Since A and B are independent events we have


P( A  B)  P( A) . P( B)  0.4

Thus the probability that neither of the events occur is P( A'B' )  P(( A  B)' )
 1  P( A  B)

 1  [ P( A)  P( B)  P( A  B)]  1  [0.5  0.8  0.4]  0.1

Example: 2.5.3 Let P( A  B)  5 6 , P( A  B)  1 3 , P( B' )  1 2 . Are events A and B are

independent? Explain.
Solution: First let us find P( A ) and P( B) . Now P( B)  1  P( B' )  1  1 2  1 2 and
P( A )  P( A  B)  P( A  B)  P( B)  5 6  1 3  1 2 2 3

Now P( A ) . P( B)  2 3.1 2  1 3  P( A  B)

Discrete mathematics and combinatorics Page 10


Hence P( A  B)  P( A) . P( B) , thus A and B are independent events.
Probabilities can safely be added for events A and B that cannot both happen, i..e.
are mutually exclusive events
Example: Two dice are thrown together. Let A be the event ‗getting 6 on the first
die and B be the event getting 2 on the second die then show that the events A and
B independent.

Theorem 3: If A and B are independent events, then the events A and B‘ are also
independent.

Proof: The events A and B are independent, so, P(A ∩ B) = P(A) P(B).

From the Venn diagram, we see that the events A ∩ B and A ∩ B‘ are mutually
exclusive and together they form the event A.

Discrete mathematics and combinatorics Page 11


Mutually Independent Events

Three events A, B, and C are mutually independent if

Example: Let A and B are two independent events such that P(A) = 0.2 and P(B) =
0.8. Find P(A and B), P(A or B), P(B not A), and P(neither A nor B).

Solution: Given P(A) = 0.2 and P(B) = 0.8 and events A and B are independent of
each other. P(A and B) = P( A ∩ B) = P(A) P(B) = 0.2 × 0.8 = 0.16.

P(A or B) = P(A B) = P(A) + P(B) – P(A ∩ B) = 0.2 + 0.8 – 0.16 = 0.84.

P(B not A) = P(B ∩ A‘) = P(B) – P(A ∩ B) = 0.8 – 0.16 = 0.64.

And P(neither A nor B) = P(A‘ ∩ B‘) = 1 – P(A B) = 1 – 0.84 = 0.16.

1. A die is thrown. If A is the event of getting a multiple of 2, B is the event of getting


an odd number and C is the event of getting an even number. Check the
independence of A and B and that of A and C.

Solution: The sample space, S = {1, 2, 3, 4, 5, 6}. A = {2, 4, 6}, B = {1, 3, 5}, C=
{2, 4, 6}.

Discrete mathematics and combinatorics Page 12


Events A and B are not independent.

Events A and C are not independent.

2. The probability of a person speaking truth is 5⁄7 and of another person is 4⁄9.
What is the probability they will contradict each other?

Solution: Let the events A: person 1 speaks the truth, B: person 2 speaks the truth.

P(A) = 5⁄7 and P(B) = 4⁄9. P(A‘) = 1 – (5⁄7) = 2⁄7 and P(B‘) = 1 – (4⁄9) = 5⁄9.

The events A and B are independent of each other. The two persons will contradict
each other if either of the two speaks a lie when the other speaks the truth. There are
two possible cases.

 Case 1: Person 1 speaks truth and person 2 tells a lie. The event is A ∩ B‘.

 Case 2: Person 1 tells a lie and person 2 speaks the truth. The event is A‘ ∩ B.

The required probability =

Discrete mathematics and combinatorics Page 13


2.6 Bernoulli trials and the binomial distribution

Suppose that an experiment can have only two possible outcomes. For instance,
when a bit is generated at a random, the possible outcomes are 0 and 1. When a
coin is tossed, the possible outcomes are heads and tails. Each performance of an
experiment with two possible outcomes is called a Bernoulli trial, after James
Bernoulli, who made important contributions to probability theory. In general, a
possible outcome of a Bernoulli trial is called a success or a failure. If p is the
probability of a success and q is the probability of a failure, it follows that p  q  1
A binomial experiment consists of a fixed number of Bernoulli trials. The notation
B(n, p) will be used to denote a binomial experiment with n trials and probability
p of successes.
Frequently, we are interested in the number of successes in a binomial experiment
with and not in the order in which they occur. The following theorem is applies

Theorem: 2.6.1 The probability of exactly k success in a binomial experiment


B(n, p) is given by P(k )  P( k successes)  C (n, k ) p k q nk

Proof: The sample space of the n repeated trials consists of all n-tuples
(t1 , t 2 ,..., t n ) , where t i  S (for success) or t i  F (for failure) for i  1, 2, ... , n . Since
the n trials are independent, the probability of each outcome of n trials consisting
of k success and n  k failures. Now let A be the event of exactly k successes.
Then A consists of all n-tuples of which k components are S and n  k
components are F . The number of such n-tuples in the event is equal to the
numbers of ways that k letters S can be distributed among the n components of an

Discrete mathematics and combinatorics Page 14


n-tuple; hence A consists of C (n, k ) sample points. The probability of each point in
k nk
A is p k q nk ; Hence, P( A)  P( k successes)  C (n, k ) p q .

In particular, the probability of no successes is


P(0)  C (n,0) p 0 q n  q n . Thus the probability of one or more successes is 1  q n
Example: 2.6.2
A fair coin is tossed three times; call heads a success. This is a binomial
experiment with n  6 and p  q  1 2 . Now
a) The probability that exactly two heads occurs (i.e., k  2 ) is
P(2)  C (6,2)(1 2) 2 (1 2) 4  15 64

b) The probability of getting at least four heads (i.e. k  4, 5, or 6 ) is


P(4)  P(5)  P(6)  C (6,4)(1 2) 4 (1 2) 2  C (6,5)(1 2) 5 (1 2)

 C (6,5)(1 2) 6 (1 2) 0

 15 64  6 64  1 64

 11 64

c) The probability of getting no heads (i.e., all failures) is q 6  (1 2) 6  1 64 , so


the probability of one or more heads is 1  q n  1  1 64  63 64 .

Example: Suppose A and B are events with P(A) = 0.6, P(B) = 0.3, and
P(A ∩ B) = 0.2. Find the probability that:
(a) A does not occur; (c) A or B occurs;
(b) B does not occur; (d) Neither A nor B occurs.

Solution:
(a)
(b)
(c) By the Addition Principle, P(A or B) = P(A B) = P(A) + P(B) − P(A ∩ B)
= 0.6 + 0.3 − 0.2 = 0.7

Discrete mathematics and combinatorics Page 15


(d) Recall (DE Morgan‘s Law) that neither A nor B is the complement of
A B. Thus: P(neither A nor B) = P( ) = 1 − P(A B) = 1 − 0.7 = 0.3
Example: 2.6.3
What is the probability that exactly eight 0 bits are generated when 10 bits are
generated with the probability that a 0 bit generated is 0.9, the probability that a 1
bit generated is 0.1, and the bits are generated independently?
Solution: By the above theorem, the probability that exactly eight 0 bits are
generated is P(8)  C(10,8)(0.9) 8 (0.1) 2  0.1937102445.
( p  q) n  p n  C (n,1) p n1q  C (n,2) p n2 q 2  ...  q n
n
  C (n, k ) p k q n k
k 0

n
And note that  C (n, k ) p k q nk  ( p  q) n  1 , that is, the sum of the
k 0

Probabilities that there are k successes with n independent Bernoulli trials,


for k  0,1, 2, ..., n equals to 1.

Activity: 2.7
1. Suppose 20% of the items produced by a factory are defective. Suppose four
items are chosen at random. Find the probability that:
a) two are defective; b) three are defective; c) non is defective.
2. Team A has probability 2 3 of winning whenever it plays. Suppose A plays four
games. Find the probability p that A wins more than half of its games.
2.7 Random variables and expectation
Many problems are concerned with a numerical value associated with the
outcome of an experiment. For instance, we may want to know the probability that
there are nine 1 bits generated when 10 bits are randomly generated, or we may
want to know the probability that a coin comes up tails when it is tossed 20 times.
To study problems of this type we introduce the concept of a random variable.
Discrete mathematics and combinatorics Page 16
2.7.1 Random variables
Definition: 2.7.1.1
A random variable X is a function from the sample space of an experiment to the
set of real numbers. That is, a random variable is a rule that assigns a numerical
value to each outcome in a sample space S.
Remark: Note that a random variable is a function. It is not a variable.

Properties of a Random Variable

 It only takes the real value.

 If X is a random variable and C is a constant, then CX is also a random


variable.

 If X1 and X2 are two random variables, then X1 + X2 and X1 X2 are also random.

 For any constants C1 and C2, C1X1 + C2X2 is also random.

 |X| is a random variable

Example: Suppose that a coin is tossed three times. Let X (t ) be the number of
heads that appear when t the outcome is. Then the random variable X (t ) takes on
the following values:
X ( HHH )  3 X (HHT )  X (HTH )  X (THH )  2

X (TTH )  X (THT )  X ( HTT )  1 X (TTT )  0

Types of Random Variable

A random variable can be categorized into two types.

Discrete Random Variable

Discrete mathematics and combinatorics Page 17


As the name suggests, this variable is not connected or continuous. A variable which
can only assume a countable number of real values i.e., the value of the discrete
random sample is discrete in nature. The value of the random variable depends on
chance. In other words, a real-valued function defined on a discrete sample space is
a discrete random variable.

The number of calls a person gets in a day, the number of items sold by a company,
the number of items manufactured, number of accidents, number of gifts received on
birthday etc. are some of the discrete random variables.

Continuous Random variable

A variable which assumes infinite values of the sample space is a continuous random
variable. It can take all possible values between certain limits. It can also take
integral as well as fractional values. The height, weight, age of a person, the distance
between two cities etc. are some of the continuous random variables.

Activity: 2.8

1. Let X be the sum of the numbers that appears when a pair of dices is rolled.
What are the values of this random variable for the 36 possible outcomes
(i, j ) , where i and j are the numbers that appear on the first die and the

second die, respectively, when these two dice are rolled.


2.7.2 Expected values
Many questions can be formulated in terms of the value we expect a random
variable to take, or more precisely, the average value of a random variable
when an experiment is performed a large number of times. Questions of this

Discrete mathematics and combinatorics Page 18


kind include: how many heads are expected to appear when a coin is tossed 100
times? To study such questions we introduce the concept of the expected value
of a random variable.
Definition: 2.7.2.1 The expected value (or expectation) of the random variable
X (t ) on the sample space S is equal to E ( X )   P(t ). X (t ) .
tS

Note that when the sample space S has n elements S  {x1 , x2 , ... , xn } ,

E ( X )  i 1 P( xi ). X ( xi )
n

Remark: We are concerned only with random variable with finite expected
values here.
Example: A fair coin is tossed three times. Let S be the sample space of the
eight possible outcomes, let X be the random variable that assigns to an
outcome the number of heads in this outcome. What is the expected value of X ?
Solution: In example 2.7.1.2 above we listed the values of X for the eight
possible out comes when a coin is tossed three times. Since the coin is fair and
the events are independent, the probability of each outcome is 1 8 .
Consequently,
E (X )  1 8[ X ( HHH )  X (HHT )  X (HTH )  X (THH )  X (TTH ) 

X (THT )  X (HTT )  X (TTT ) ]

 1 8[3  2  2  2  1  1  1  0]

 12 8  3 2

Theorem: 2.7.2.4 If X and Y are random variables on a space S and


a and b are real numbers, then a) E( X  Y )  E( X )  E(Y ) b)
E(aX  b)  aE( X )  b

Furthermore, if X i , i  1, 2, ..., n are random variables on S , then


E ( X 1  X 2  ....  X n )  E ( X 1 )  E ( X 2 )  ...  E ( X n ) .

Discrete mathematics and combinatorics Page 19


Proof:
a) the first result follows directly from the definition of expected value, since
E ( X  Y )   P(t ).[ X (t )  Y (t )]
tS

 [ P(t ). X (t )  P(t ).Y (t )]   P(t ). X (t )   P(t ).Y (t )


tS tS tS

 E ( X )  E (Y )

b) E (aX  b)   P(t ).(aX  b)(t )   P(t ).(aX (t )  b)


tS tS

  aP(t ). X (t )  bP(t )  a P(t ). X (t )  b P(t )


tS tS tS

 aE ( X )  b , since,  P(t )  1 .
tS

The case with n random variables follows easily using mathematical induction
from the case of two random variables which is proved in part (a) above, or we
can prove as follow. E( X 1  X 2  ....  X n )   P(t ).[ X 1  X 2  ...  X n ](t )
tS

  P(t ).[ X 1 (t )  X 2 (t )  ...  X n (t )]


tS

  P(t ). X 1 (t )  P(t ). X 2 (t )  ...  P(t ). X n (t )


tS

  P(t ). X 1 (t )   P(t ). X 2 (t )  ...   P(t ). X n (t )


tS tS tS

 E ( X 1 )  E ( X 2 )  ...  E ( X n ) , which completes the proof.

The above theorem can be useful for computing expected values, since many
random variables are sums of simpler random variables.
Example: Using the above theorem, find the expected values of the sum of the
numbers that appear when a pair of dice is rolled.
Solution: Let X 1 and X 2 be the random variables with X 1 (i, j)  i and X 2 (i, j )  j so
that X 1 is the number appearing on the first die and X 2 is the number appearing on
the second die. Now we see that

Discrete mathematics and combinatorics Page 20


6
E ( X 1 )   P(t ). X 1 (t )
t 1

 P(1).X 1 (t )  P(2).X 1 (2)  P(3).X 1 (3)  P(4). X 1 (4)  P(5). X 1 (5)  P(6). X 1 (6)

 1 6[1  2  3  4  5  6] , since P(1)  P(2)  .....  P(6)  1 6

 21 6  7 2

But we observe that E( X 2 )  E( X 1 )  7 2 since E ( X 2 ) is also equals


1 6[1  2  3  4  5  6] .

Now the sum of two numbers that appear when the two dice are rolled is the sum
X 1  X 2 . Thus by the above theorem, the expected value of the sum is

E( X 1  X 2 )  E( X 1 )  E( X 2 )  7 2  7 2  7

Activity: 2.10
Using the above theorem show that the expected value of the number of successes
when n Bernoulli trials are proved, where P is the probability of successes on
each trial, is equal to nP .
We have already discussed independent events. We will now define what it
means for two random variables to be independent.
2.7.3. Independent Random Variables
Definition: 2.7.3.7 The random variable X and Y on a sample space S are
independent if P[ X (t )  r1 and Y (t )  r2 ] = P[ X (t )  r1 ]. P[Y (t )  r2 ] or in words, if the
probability that X (t )  r1 and Y (t )  r2 equals the product of the probabilities that
X (t )  r1 and Y (t )  r2 , for all real numbers r1 and r2 .

Example: Are the random variables X 1 and X 2 from the above Example 2.7.3.5
independent?
Solution: Let S  {1, 2, 3, 4, 5, 6} , and let i  S and j  S . Since there are 36 possible
outcomes when the pair of dice is rolled and each is equally likely, we have
P[ X 1 (t )  i and X 2 (t )  j ]  1 36 . Furthermore, P[ X 1 (t )  i]  1 6 and P[ X 2 (t )  1 6] ,

Discrete mathematics and combinatorics Page 21


since the probability that i appears on the first die and the probability that j
appears on the second die are both 1 6 . It follows that
P[ X 1 (t )  i and X 2 (t )  j ]  1 36  (1 6).(1 6) = P[ X 1 (t )  i].P[ X 2 (t )  j ] so X 1 and X 2 are

independent.
Example: Show that the random variables X 1 and X  X 1  X 2 , where X 1 and X 2 are
defined in Example2.7.3.5 are not independent.
Solution: Note that P[ X 1 (t )  1 and X (t )  12]  0 , since X 1 (t )  1 means the number of
appearing on the first die is 1, which implies that the sum of the numbers on the
two dice equal 12. On the other hand, P[ X 1 (t )  1]  1 6 and P[ X (t )  12]  1 36 . Hence
P[ X 1 (t )  1 and X (t )  12]  P[ X 1 (t )  1].P[ X (t )  12] . This counter example shows that

X 1 and X 2 are not independent.

Theorem: 2.7.3.9 If X and Y are independent variables on a sample space S , then


E( X .Y )  E( X ).E(Y ) , that is, the expected values of the product of two independent

variables is the product of their expected values.


Proof: From the definition of expected value and since X and Y are independent
random variables, it follows that
E ( X .Y )   P(t ).[( X .Y )(t )]
tS

  P(t ).( X (t ).Y (t )


tS

 
r1X ( S ), r2 Y ( S )
r1r2 .P[ X (t )  r1 and Y (t )  r2 ]

 
r1X ( S ), r2 Y ( S )
r1r2 .P[ X (t )  r1 ].P[Y (t )  r2 ]

(  r .P[ X (t )  r ]) . (  r .P[Y (t )  r ] )
1
r1X ( S )
1
r2 Y ( S )
2 2

 E ( X ).E (Y ) .

This completes the proof.

Discrete mathematics and combinatorics Page 22


Exercise
1. In tossing 3 coins at a time, find the probability of getting
a) at most one head b) at least one head c) exactly 2 heads.
2. A coin is tossed twice. If the second throw results in tail a die is thrown.
Describe the sample space for this experiment.
3. Describe the sample space when both the experiment carried out .

4. An unbiased coin is tossed twice. If A is the event: both head or tail have
occurred and B is the event: at most one tail is observed, find P( A) , P(B) ,
P( A \ B) and P( B \ A) .

5. If P( A)  1 3 , P( B)  3 4 , P( A  B)  11 12 , then find P( A \ B) and P( B \ A) .


6. What is the conditional probability that exactly four heads appear when a fair
coin is tossed five times, given that the first outcome is a head?
7. What is the expected value of the sum of the numbers of that appear when a
pair of fair dice is rolled?
8. Two events A and B are such that P(A) = 0.5, P(B) = 0.3 and P(A ∩ B) = 0.1.
Calculate
(a) P(A|B); (b) P(B|A); (c) P(A|A B); (d) P(A|A ∩ B); (e) P(A ∩ B|A B)
9. Suppose 30% of the women in a class received an A on the test and 25% of the
men received an A. The class is 60% women. Given that a person chosen at
random received an A, what is the probability this person is a women?
10.Suppose you roll two standard, fair, 6-sided dice. What is the probability that
the sum is at least 9 given that you rolled at least one 6?

11.There are 1000 students in a high school. Among the 1000 students, 800
students have a laptop, and 300 students have a tablet. 150 students have both

Discrete mathematics and combinatorics Page 23


devices. What is the probability that a randomly selected student has a laptop,
given that he or she has a tablet?

Example: What is the probability of getting a diamond or a queen from a well-


shuffled deck of 52 cards?

Practice Problems:

1. A die is cast 6 times. What is the probability that each throw will return a prime
number? A) 1/ 32 B) 1/1296 C) 1/64 D) 1/1666
2. A coin is flipped six times. What is the probability of getting a head each time?

A) 1/64 B) 1/1296 C) 1/ 32 D) 1/1666

3. In the roll of a die, what is the probability of getting a prime number?


4. An event can happen in 999 ways. For a trial in this event to have a probability of
99%, what is the number of favourable events?

A) 990 B) 978 C) 998 D) 989

5. Form a group of 20 players, a keeper is chosen. If 5 of the players are keepers,


what is the probability that the player chosen will be a keeper?

A) 25% B) 65% C) 99% D) 14%

6. One multiple choice question carries 10 marks in some exam. There are a total of
3 such questions. What is the probability that a candidate who is choosing the
options at random will get all the answers right?

Discrete mathematics and combinatorics Page 24


A) 2 % B) 4% C) 6% D) 33%

Mutually exclusive events:

Mutually exclusive events are those where the occurrence of one indicates the non-
occurrence of the other or when two events cannot occur at the same time, they are
considered mutually exclusive.

Note: For a mutually exclusive event, P(A and B) = 0.


Example 1: What is the probability of getting a 2 or a 5 when a die is rolled?
Solution:
Taking the individual probabilities of each number, getting a 2 is 1/6 and so is
getting a 5.

Applying the formula of compound probability,

Probability of getting a 2 or a 5, P(2 or 5) = P(2) + P(5) – P(2 and 5)


=> 1/6 + 1/6 – 0= 2/6 = 1/3.

Example 2: Consider the example of finding the probability of selecting a black


card or a 6 from a deck of 52 cards.
Solution: We need to find out P(B or 6)
Probability of selecting a black card = 26/52

Probability of selecting a 6 = 4/52

Probability of selecting both a black card and a 6 = 2/52

P(B or 6) = P(B) + P(6) – P(B and 6)

= 26/52 + 4/52 – 2/52

Discrete mathematics and combinatorics Page 25


= 28/52

= 7/13.

Independent and Dependent Events

Independent Event

When multiple events occur, if the outcome of one event DOES NOT affect the
outcome of the other events, they are called independent events.
Say, a die is rolled twice. The outcome of the first roll doesn‘t affect the second
outcome. These two are independent events.

Example 1: Say, a coin is tossed twice. What is the probability of getting two
consecutive tails ?

Probability of getting a tail in one toss = 1/2

The coin is tossed twice. So 1/2 * 1/2 = 1/4 is the answer.

Here‘s the verification of the above answer with the help of sample space.

When a coin is tossed twice, the sample space is {(H,H), (H,T), (T,H), (T,T)}.

Our desired event is (T,T) whose occurrence is only once out of four possible
outcomes and hence, our answer is 1/4.

Example 2: Consider another example where a pack contains 4 blue, 2 red and 3
black pens. If a pen is drawn at random from the pack, replaced and the process
repeated 2 more times, What is the probability of drawing 2 blue pens and 1 black
pen?
Solution
Here, total number of pens = 9
Discrete mathematics and combinatorics Page 26
Probability of drawing 1 blue pen = 4/9
Probability of drawing another blue pen = 4/9
Probability of drawing 1 black pen = 3/9
Probability of drawing 2 blue pens and 1 black pen = 4/9 * 4/9 * 3/9 = 48/729 =
16/243

Dependent Events

When two events occur, if the outcome of one event affects the outcome of the
other, they are called dependent events.

Consider the aforementioned example of drawing a pen from a pack, with a slight
difference.

Example 1: A pack contains 4 blue, 2 red and 3 black pens. If 2 pens are drawn at
random from the pack, NOT replaced and then another pen is drawn. What is the
probability of drawing 2 blue pens and 1 black pen?
Solution:
Probability of drawing 1 blue pen = 4/9
Probability of drawing another blue pen = 3/8
Probability of drawing 1 black pen = 3/7
Probability of drawing 2 blue pens and 1 black pen = 4/9 * 3/8 * 3/7 = 1/14

Let‘s consider another example:

Example 2: What is the probability of drawing a king and a queen consecutively


from a deck of 52 cards, without replacement.
Probability of drawing a king = 4/52 = 1/13

After drawing one card, the number of cards are 51.

Discrete mathematics and combinatorics Page 27


Probability of drawing a queen = 4/51.

Now, the probability of drawing a king and queen consecutively is 1/13 * 4/51 =
4/663

Conditional probability

Conditional probability is calculating the probability of an event given that


another event has already occured .

The formula for conditional probability P(A|B), read as P(A given B) is

P(A|B) = P (A and B) / P(B)


Consider the following example:

Example: In a class, 40% of the students study math and science. 60% of the
students study math. What is the probability of a student studying science given
he/she is already studying math?
Solution
P(M and S) = 0.40

P(M) = 0.60

P(S|M) = P(M and S)/P(S) = 0.40/0.60 = 2/3 = 0.67

Complement of an event

A complement of an event A can be stated as that which does NOT contain the
occurrence of A.

A complement of an event is denoted as P(Ac) or P(A‘).

P(Ac) = 1 – P(A) or it can be stated, P(A)+P(Ac) = 1

Discrete mathematics and combinatorics Page 28


For example, if A is the event of getting a head in coin toss, Ac is not getting a head
i.e., getting a tail.

if A is the event of getting an even number in a die roll, Ac is the event of NOT
getting an even number i.e., getting an odd number.

if A is the event of randomly choosing a number in the range of -3 to 3, Ac is the


event of choosing every number that is NOT negative i.e., 0,1,2 & 3 (0 is neither
positive or negative).

Consider the following example:

Example: A single coin is tossed 5 times. What is the probability of getting at least
one head?
Solution:
Consider solving this using complement.

Probability of getting no head = P(all tails) = 1/32

P(at least one head) = 1 – P(all tails) = 1 – 1/32 = 31/32.

Sample Probability questions with solutions

Probability Example 1

What is the probability of the occurrence of a number that is odd or less than 5
when a fair die is rolled.

Solution
Let the event of the occurrence of a number that is odd be ‗A‘ and the event of the
occurrence of a number that is less than 5 be ‗B‘. We need to find P(A or B).
Discrete mathematics and combinatorics Page 29
P(A) = 3/6 (odd numbers = 1,3 and 5)

P(B) = 4/6 (numbers less than 5 = 1,2,3 and 4)

P(A and B) = 2/6 (numbers that are both odd and less than 5 = 1 and 3)

Now, P(A or B) = P(A) + P(B) – P(A or B)

= 3/6 + 4/6 – 2/6

P(A or B) = 5/6.

Probability Example 2

A box contains 4 chocobars and 4 ice creams. Tom eats 3 of them one after
another. What is the probability of sequentially choosing 2 chocobars and 1
icecream?

Solution
Probability of choosing 1 chocobar = 4/8 = 1/2

After taking out 1 chocobar, the total number is 7.

Probability of choosing 2nd chocobar = 3/7

Probability of choosing 1 icecream out of a total of 6 = 4/6 = 2/3

So the final probability of choosing 2 chocobars and 1 icecream = 1/2 * 3/7 * 2/3
= 1/7

Probability Example 3

When two dice are rolled, find the probability of getting a greater number on the
first die than the one on the second, given that the sum should equal 8.

Discrete mathematics and combinatorics Page 30


Solution
Let the event of getting a greater number on the first die be G.

There are 5 ways to get a sum of 8 when two dice are rolled = {(2,6),(3,5),(4,4),
(5,3),(6,2)}.

And there are two ways where the number on the first die is greater than the one
on the second given that the sum should equal 8, G = {(5,3), (6,2)}.

Therefore, P(Sum equals 8) = 5/36 and P(G) = 2/36.

Now, P(G|sum equals 8) = P(G and sum equals 8)/P(sum equals 8)

= (2/36)/(5/36)

= 2/5

Example: A bag contains blue and red balls. Two balls are drawn randomly
without replacement. The probability of selecting a blue and then a red ball is 0.2.
The probability of selecting a blue ball in the first draw is 0.5. What is the
probability of drawing a red ball, given that the first ball drawn was blue?
a) 0.4 b) 0.2 c) 0.1 d) 0.5

Example: A die is rolled thrice. What is the probability that the sum of the rolls is
at least 5?
a) 1/216 b) 1/6 c) 3/216 d) 212/216

Example: In class X, 20% of the students are boys and 80% of them are girls. The
probability that boys passed in mathematics is 0.5 and the probability that girls
passed in mathematics is 0.10. One student is selected at random. What is the
probability that the selected student is passed in mathematics?

Discrete mathematics and combinatorics Page 31


Solution:

Let X denote the event that boy is selected,

Y denote the event that girl is selected and

Z denotes the event that the selected student is passed in mathematics.

P(X) = P(boy is selected) = 20/100 = 1/5

P(Y) = P(girl is selected) = 80/100 = 4/5

P(Z/X) = P(selected boy passed in mathematics) = 0.5

P(Z/Y) = P(selected girl passed in mathematics) = 0.10

P(selected student is passed in mathematics) = P(boy is selected and he is passed


in mathematics or girl is selected and she is passed in mathematics)

So, required probability is

P(X ∩ Z) + P(Y ∩ Z) = P(X) ∙ P(Z/X) + P(Y) ∙ P(Z/Y)


= (1/5) × 0.5 + (4/5) × 0.1
= 0.10 + 0.08
= 0.18

Therefore, P(selected student is passed in mathematics) = 0.18

The event ‗E' and the event ‗not E' are called complementary event of the latter
event. If E occurs, its compliment is E which does not occur.

Discrete mathematics and combinatorics Page 32


Compliment of an event is denoted by E‘ or E or Ec.

For example:

1. When a coin is tossed, getting ‗head‘ and getting ‗tail‘ are complimentary event
of each other.

2. When two coins are tossed, getting ‗at least one head‘ and getting ‗no head‘ are
complimentary event of each other.

3. When a die is thrown:

● Getting ‗even face‘ and ‗odd face‘ are complimentary event of each other.

● Getting ‗multiple of 2‘ and getting ‗not multiple of 2‘ are complement event of


the latter event.

●Getting ‗divisible by 3‘ and getting ‗not divisible by 3‘ are complement event of


the latter event

Example: A bag contains red and what balls. The probability of getting a red ball
from the bag of balls is 1/6. What is the probability of not getting a red ball?

Solution:

The probability of getting a red ball from the bag of balls is 1/6.

Therefore, the probability of not getting a red ball

P(ball is not red) = 1 – 1/6 = 5/6

Therefore, the probability of not getting a red ball is 5/6.

Discrete mathematics and combinatorics Page 33


2. In a box, contains blue and green marbles. The probability of getting a green
marble from the box of marbles is 3/7. What is the probability of getting a blue
marble?

Solution:

Let E1 be the event of getting a green marble and

E2 be the event of getting a blue marble

E2 is the probability of getting a blue marble which is also the same as the
probability of not getting a green marble, Since we know that the marble are either
green or blue.

Therefore, P(not getting a blue marble)

= P(E2) = 1 - P(E1)

= 1 – 3/7

= 4/7.

Therefore, the probability of getting a blue marble is 4/7.

Example: In a laptop shop there are 16 defective laptops out of 200 laptops. If
one laptop is taken out at random from this laptop shop, what is the probability
that it is a non defective laptop?

Solution: The total number of laptops in laptop shop = 200,

Discrete mathematics and combinatorics Page 34


The number of defective laptops = 16,

Let E1be the event of getting a defective laptops and


E2 be the event of getting a non defective laptops

P(A) = The probability of getting a defective laptop

= 16/200

= 0.08

Therefore, the probability of getting a non -defective laptop = 1 – P(A) = 1 – 0.08


= 0.92.

Example: The probability that it will rain in the evening 0.84. What is the
probability that it will not rain in the evening?

Solution: Let E be the event that it will rain in the evening.

Then, (not E) is the event it will rain in the evening.

Then, P(E) = 0.84

Now, P(E) + P(not E) = 1

P(not E) = 1 - P(E)

P(not E) = 1 - 0.84

P(not E) = 0.16

Therefore, the probability that it will not rain in the evening = P(not E) = 0.16

Discrete mathematics and combinatorics Page 35


Example: If three coins are tossed simultaneously at random, find the probability
of: (i) getting three heads, (ii) getting two heads, (iii) getting one head,

(iv) getting no head

Example: When 3 unbiased coins are tossed once. What is the probability of:

(i) getting all heads (ii) getting two heads (iii) getting one head

(iv) getting at least 1 head (v) getting at least 2 heads (vi) getting atmost 2 heads

b) Conditional probability of some event A, given the occurrence of some other


event B:

c) Probability of two independent events:

P(A∩B) = P(A)P(B)

d) Probability of two mutually exclusive events:

P(AUB) = P(A) + P(B)

e) Binomial probability expression:

Discrete mathematics and combinatorics Page 36


Let an event A occur with probability P. The probability of k occurrences of the
event A in n tries equals:

f) Hyper geometric probability expression:

Let V of N elements have a property p; derived from that, N-V elements do not
have the property p.
Probability of k of n randomly selected elements having the property p equals::

Example: There are 18 tickets marked with numbers 1 to 18. What‗s the
probability of selecting a ticket having the following property:

a) even number
b) number divisible by 3
c) prime number
d) number divisible by 6

Discrete mathematics and combinatorics Page 37


Solution:

Example: Determine the probability of 3 of 5 born children being sons if the


probability of a children to be a boy equals P(A) = 0,51.

Solution:
Binomial probability expression.
n = 5, k = 3, P = 0,51

The probability equals 31,8 %.

Discrete mathematics and combinatorics Page 38


Exercise
1. Find the probability of getting a sum of 5 or 7 in toss of two dice.
2. If a fair coin is tossed three times, then find
A) The probability of a tail not showing at all is
B) The probability of exactly two heads is
C) The probability of at least one head is
D) The probability of exactly one head is
3. A bag contains 3 white and 4 black balls. If two balls are drawn at random,
then find the probability that one of them is white and the other is black.
4. From a box which contains five black pens and three red pens what is the
probability to draw at least two black pens if three pens are drawn at
random?
5. A and B are events such that

Then find .
6. Consider the example of finding the probability of selecting a black card or
a 6 from a deck of 52 cards. What is the probability of selecting a black card
and a number 6? A) B) C) D) E)

7. If four persons are chosen randomly from a group of 10 persons of which six
are male, to form a committee then find
a) the probability that the committee consists of all female
b) the probability that the committee consists of all male
c) the probability that the committee consists of equal number of each sex
d) the probability that the committee consists of at least three male
8. If two dice are thrown then,

Discrete mathematics and combinatorics Page 39


A) What is the probability that the sum of numbers appearing on the upper
face of the dice is 7?
B) What is the probability to see even number on the upper face of both
dice?
C) What is the Probability to see a number less than 3 on the upper face of
both dice?
D) What is the Probability to see a number greater than on the upper face of
both dice?
Exercise
1. If and , thenfind .

2. You are given that A and B are two events such that ,

and then, find P(A).

3. Determine the probability of 3 of 5 born children being sons if the probability


of a children to be a boy equals P(A) = 0,51.
4. There are 18 tickets marked with numbers 1 to 18. What‗s the probability of
selecting a ticket having the following property:
b. even number c) number divisible by 3 d) prime number
c. number divisible by 6
5. Suppose that the chance that a student earns a grade ‗‘A‘‘ in mathematics
course is 40% and the chance that the student is assigned an ‗‘A‘‘ in
engineering is 70%. If these events are independent, then find the following
i. The probability that the student receive an ‗‘A‘‘ in both math and
engineering.
ii. The probability that the student receive an ‗‘A‘‘ in neither.
iii. The probability that the student receives exactly one A.

Discrete mathematics and combinatorics Page 40


6. A bag contains 30 balls numbered from 1 to 30.One ball is drawn at random.
Find the probability that the number of the ball drawn will be a multiple of
a) 5 or 7 b) 3 or 7

Discrete mathematics and combinatorics Page 41

You might also like