virtualgate's picture

Introduction to Probability and Conditional Probability

Introduction to Probability and Some basic definitions.

Let's start with the basics:

What is the probability ?

Informally, the probability is all about representing your chances of success or failure with the help of mathematics.  It is a mathematical measure of degree randomness.

Some important terms:

Random Experiment:-

When we perform any task, we actually know all the outcomes but we don't know what outcome will come in advance. for example: 

When we toss an unbiased coin, we know either head or tail will show up but we don't know what comes when? This is called a random experiment.


Sample Space: Set of all possible outcomes of an experiment. Example:

1.When you toss a coin 

Sample Space will be {head, tail}  

2. When you roll a dice

SS= {1,2,3,4,5,6}

Note: Sample space is a set. It means you can't repeat things inside a sample space.


Events: Subset of sample space is called Events. Example:

1. When you toss a coin getting ahead is or getting a tail is a subset of Sample Space.

2. On rolling a dice "getting even no " is an event.


Mutually Exclusive events:

Two Events E1 and E2 are said to be mutually exclusive if 

E1 ∩ E2 = Ø


Independent Events: Two events are said to be independent if happening of one event doesn't affect another event. Example:

When you toss 2 coins getting head on the first coin is not going to affect getting anything on the second coin. So Both are independent events.


Some Rules:-

For each event E in a sample Space S, we assign a number P(E) Such that

1. 0 <= P(E) <= 1

2. P(S)= 1 = P(E) + P(Ec)

3. For any sequence of events E1, E2 ......En  that are mutually events then

P(E1∪ E2 ∪ E3 ∪...... ∪ En) = P(E1) + P(E2) + P(E3) +......... P(En)


Probability of happening of an event E is=

Total number of favorable outcome  / Total number of possible outcomes


P(E) = favourable outcome  / possible outcomes

  • Probability of an impossible event is always O
  • Probability of a certain event is always 1.



1.On tossing a coin find the probability of getting a head.


When you toss a coin Possible sample space is 

S= {H, T}

P(getting a head ) = 1 / 2

P (getting a tail )    = 1 /2



Contributor's Info

Conditional Probability

Conditional probability : 
let's say there are two events A and B and we know that Event A has already occurred then what is the probability of occurring if B?

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

For example: 

When we roll a dice what is the probability of getting a prime number when it is already known that an even no is shown up?


let's say A is an event of getting an even no and B is an event of getting a prime number So

Method 1:-

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

Sample space = {1,2,3,4,5,6}


P(A)= 3/6 =1/2

for B Sample space is = {2,4,6}

So E(B)= {2}

P(B)= 1/3

Method 2:

P(A)= 1/2

E(A ∩ B) = {2}

P( E∩ B) = 1/6


P(B/A) = (1/6) / 1/2 = 1/3 


We will see more example of conditional probabilities.






Contributor's Info

Example on Conditional Probablility | MIT Assignment

Most mornings, Victor checks the weather report before deciding whether to carry an umbrella. If the forecast is “rain,” the probability of actually having rain that day is 80%. On the other hand, if the forecast is “no rain,” the probability of it actually raining is equal to 10%. During fall and winter the forecast is “rain” 70% of the time and during summer and spring it is 20%.


A) One day, Victor missed the forecast and it rained. What is the probability that the forecast was “rain” if it was during the winter? What is the probability that the forecast was “rain” if it was during the summer?

The tree representation during the winter can be drawn as the following:

Let A be the event that the forecast was “Rain,”

let B be the event that it rained, and let p be the probability that the forecast says “Rain.”

If it is in the winter, p = 0.7 and

\(P(A|B) = \frac{P(B|A)P(A)}{P(B)} = \frac{(0.8)(0.7)}{(0.8)(0.7)+(0.1)(0.3)}=\frac{56}{59}\)


Similarly, if it is in the summer, p = 0.2 and

\(P(A|B) = \frac{P(B|A)P(A)}{P(B)} = \frac{(0.8)(0.2)}{(0.8)(0.2)+(0.1)(0.8)}=\frac{2}{3}\)

Conditional Probability Example1

A family has two children. It is already known that one of them is boy, find the probability that both the children are a boy.

Sample space = {BB, BG, GB, GG}

let's say that A is an event that one of them is boy 

So E(A)= {BB,BG,GB}

      P(A) = 3/4

now let us say B is an event for the second boy for this possible sample space will be 

 S= {BG, GB, BB } we are neglecting  BB because it is already given that there is at least one boy

So P(B/ A)=  1/3

Conditional Probability Example 2

Let three unbiased coins are tossed and E is the event of getting at least 2 head and F  be the event of getting at least 1 tail.

What is P(F/ E)



Sample space for E ={HHT, HHH, THH, HTH}

P(E)= 4/8 =1/2

Now For F sample space is {HHT, HHH, THH, HTH} because already E has happened and we have to find F when E has occurred

So P(F/E) =  3/4


Method 2:

P(E)= 4/8=1/2

Sample space for (E∩F)={HHT, THH, HTH}

P(E∩F) = 3/8

SO P(F/E)= P(E∩F) / P(E) = (3/8) /(1/2) = 3/4

Example on Discrete Unifrom Probability | MIT Assignment

You flip a fair coin 3 times, determine the probability of the below events. Assume all sequences are equally likely.

A) Three heads: HHH

B) The sequence head, tail, head: HTH

C) Any sequence with 2 heads and 1 tail

D) Any sequence where the number of heads is greater than or equal to the number of tails

Since all outcomes are equally likely we apply the discrete uniform probability law to solve the problem. To solve for any event we simply count the number of elements in the event and divide by the total number of elements in the sample space.

There are 2 possible outcomes for each flip, and 3 flips. Thus there are 23 = 8 elements (or sequences) in the sample space.

A) Any sequence has probability of 1/8. Therefore P({H, H, H}) = 1/8 .

B) This is still a single sequence, thus P({H, T, H}) = 1/8 .

C) The event of interest has 3 unique sequences, thus P({HHT, HTH, THH}) = 3/8 .

D) The sequences where there are more heads than tails are


4 unique sequences gives us P(A) = 1/2 .

Examples on Conditional Probability

Ambikesh can either take biology or math in his class 12. If he takes biology, then he will get 'A' grade with probability 3/4 because his girlfriend is ready to teach him and if he takes math he will get 'A' grade with probability 1/3.

He decided to choose the stream by flipping the coin . What is the probability that

1.  he will get 'A' in biology.

2. he will get 'A' in Maths.


To get 'A' in Biology he needs to take Biology stream first.

P(Biology)= P(Maths) = 1/2  and 

P(getting 'A' / Biology) = 3/4

P(getting 'A'/ Maths) = 1/3


P(Grade 'A' ∩ Biology) = P(Biology) * P(getting 'A' / Biology)  // from conditional probabilty formula

                                                =  (1/2)* (3/4 )

                                                =  3/8


P(Grade 'A' ∩  Maths) = (1/2) * (1/3 )

                                           =   1/6


Example on Probablity - 2 | MIT Assignment

The hats of n persons are thrown into a box. The persons then pick up their hats at random (i.e., so that every assignment of the hats to the persons is equally likely). What is the probability that

(a) every person gets his or her hat back?

(b) the first m persons who picked hats get their own hats back?


Consider the sample space of all possible hat assignments.

It has n! elements (n hat selections for the first person, after that n − 1 for the second, etc.), with every single element event equally likely (hence having probability 1/n!).

The question is to calculate the probability of a single-element event, so the answer is 1/n!



consider the same sample space and probability as in the solution of (A).

The probability of an event with (n−m)! elements (this is how many ways there are to distribute the remaining n − m hats after the first m are assigned to their owners) is (n − m)!/n!

Example on Probability | MIT Assignment

Bob has a peculiar four sided die.When he rolls the dice, the probability of any particular outcome is proportional to the sum of the results of each die. All outcomes that result in a particular sum are equally likely.

A) What is the probability of the sum being even?

B) What is the probability of Bob rolling a 2 and a 3, in any order?

The easiest way to solve this problem is to make a table of some sort, similar to the one below.

Die 1 Die 2 Sum P(Sum)
1 1 2 2p
1 2 3 3p
1 3 4 4p
1 4 5 5p
2 1 3 3p
2 2 4 4p
2 3 5 5p
2 4 6 6p
3 1 4 4p
3 2 5 5p
3 3 6 6p
3 4 7 7p
4 1 5 5p
4 2 6 6p
4 3 7 7p
4 4 8 8p
    Total 80p


P(All outcomes) = 80p (Total from the table)

=> p = \(1 \over 80\)

A) P(Even Sum) = ( 2p + 4p + 4p + 6p+ 4p + 6p + 6p + 8p )= 40p = \({1 \over 2}\)

B) P(Rolling a 2 and a 3) = P(2,3) + P(3,2)  = 5p + 5p = 10p =  \(1 \over 8\)

Section 3.2 Example 2a Sheldon Ross on Conditional Probability

A student is taking a one-hour-time-limit makeup examination. Suppose the probability that the student will finish the exam in less than x hours is x/2, for all \(0 \leq x \leq 1\).Then, given that the student is still working after .75 hour, what is the conditional
probability that the full hour is used?

Let Lx denote the event that the student finishes the exam in less than x hours, \(0 \leq x \leq 1\), and let F be the event that the student uses the full hour. Because F is the event that the student is not finished in less than 1 hour

\(P(F) = P(L_1^c) = 1 - P(L_1) = 1 - \frac{1}{2} = 0.5\)


Now, the event that the student is still working at time .75 is the complement of the event L.75, so the desired probability is obtained from

\(P(F \ | \ L_.75^c ) = \frac{P(FL_.75^c)}{P(L_.75^c)} = \frac{P(F)}{1 - P(L_.75)} = \frac{.5}{.625} = .8\)

∴ Desired Probability = 0.8


Section 2.5 Exampla 5a Sheldon Ross

If two dice are rolled, what is the probability that the sum of the upturned faces will
equal 7?

Total possible outcomes = 36.

Favourable outcome = 6  [ as (1,6) , (2,5), (3,4), (4,3), (5,2), (6,1) are favourable ]

∴ \(P = \frac{6}{36 } = \frac{1}{6}\)




  • This quiz contains 5 questions on the topic of Conditional Probability and Binomial distribution
  • Lean well before you attempt the quiz
  • You can attempt the quiz an unlimited number of times.

Difficulty Level:  intermediate