Skip to main content

Probability

This page provides an introduction to Probability. These are my notes from the YouTube Video.

Overview

Probability is a measure of the likelihood or chance that a specific event will occur. It ranges from 0 to 1. Let's understand some of the terminlogies of probabilities as below:

Random Experiment

Random experiment is the experiment whose outcome is known.

Sample Space

Sample space is set of all possible outcomes. For e.g. throwing a dice has sample space as below, and it is denoted by S\text{S}:

S={1,2,3,4,5,6}\text{S} = \{1, 2, 3, 4, 5, 6\}

Event

Event is Subset of sample space, and it is denoted by E\text{E}.

Equally Likely Events

Equally likely events are those who has equal chances of occurence or have equal probability.

P(E1)=P(E2)\text{P(E}_1) = \text{P(E}_2)

Mutually Exclusive Events

Mutually exclusive are those whose simultaneous occurance is impossible. It is also known as Disjoint or Incompatible events.

E1E2=ϕ\text{E}_1 \cap \text{E}_2 = \phi

Mutually Exhaustive Events

Mutually exhaustive events are those whose union is sample space.

E1E2=S\text{E}_1 \cup \text{E}_2 = \text{S}

Classic Probability

If a random experiment has total (m + n)\text{(m + n)} mutually exclusive and equally likely outcomes, out of which m\text{m} favours event E\text{E}, then probability of occurrence of Event E\text{E} is denoted by P(E)\text{P(E)}.

P(E)=favourable outcomestotal outcomes=mm+n\text{P(E)} = \frac{\text{favourable outcomes}}{\text{total outcomes}} = \frac{\text{m}}{\text{m+n}}
info

When outcomes are not equally likely P(E)=Sum of probability of favourable outcomes\text{P(E)} = \text{Sum of probability of favourable outcomes}.

Below are some of the important characterstics of probability:

  • Sum of probabilities of each sample point or probability of sample space =1 = 1.

  • If P(E)=0,\text{P(E)} = 0, then event E\text{E} is impossible event.

  • If P(E)=1,\text{P(E)} = 1, then event E\text{E} is sure event.

  • Probability of non-occurrence of an event is:

E=P(E)=1P(E)\text{E} = \text{P}(\overline{\text{E}}) = 1 - \text{P(E)}
  • Formula for odds in favour of any event is:
E=Number of favourable outcomeNumber of unfavourable outcome\text{E} = \frac{\text{Number of favourable outcome}}{\text{Number of unfavourable outcome}}
  • Formula for odds against event is:
E=Number of unfavourable outcomeNumber of favourable outcome\text{E} = \frac{\text{Number of unfavourable outcome}}{\text{Number of favourable outcome}}

Example 1

A fair dice is rolled, calculate the probability of getting a prime number.

Solution

There are total three prime numbers on the fair dice 2,3,5{2, 3, 5} in a sample set {1,2,3,4,5,6}\{1, 2, 3, 4, 5, 6\} for throwing a dice. So probability of getting a prime number will be:

P(E)=36=12\text{P(E)} = \frac{3}{6} = \frac{1}{2}

Example 2

Two coins are tossed simultaneously, what is the probability of getting at least one head.

Solution

Cases where we will get at least one head when two coins are tossed will be:

  • Case 1: H H
  • Case 2: H T
  • Case 3: T H

So total probability of getting at least one head when two coin are tossed will be:

P(E)=34\text{P(E)} = \frac{3}{4}

Example 3

A dice is rolled, if it shows prime number then a coin is tossed, what is the probability of getting head.

Solution

Let's write the sample set first:

S={(1),(2,H),(2,T),(3,H),(3,T),(4),(5,H),(5,T),(6)}\text{S} = \{ (1), (2, \text{H}), (2, \text{T}), (3, \text{H}), (3, \text{T}), (4), (5, \text{H}), (5, \text{T}), (6) \}

Now, let's write probability of each of the event:

P(1)=16\text{P(1)} = \large\frac{1}{6}

P(2, H)=1612\text{P(2, H)} = \large\frac{1}{6} * \frac{1}{2}

P(2, T)=1612\text{P(2, T)} = \large\frac{1}{6} * \frac{1}{2}

P(3, H)=1612\text{P(3, H)} = \large\frac{1}{6} * \frac{1}{2}

P(3, T)=1612\text{P(3, T)} = \large \frac{1}{6} * \frac{1}{2}

P(4)=16\text{P(4)} = \large\frac{1}{6}

P(5, H)=1612\text{P(5, H)} = \large \frac{1}{6} * \frac{1}{2}

P(5, T)=1612\text{P(5, T)} = \large \frac{1}{6} * \frac{1}{2}

P(6)=16\text{P(6)} = \large\frac{1}{6}

As in this case all the events in the sample space doesn't have equally likely probability, we apply formula below:

P(E)=Sum of probability of favourable outcomes\text{P(E)} = \text{Sum of probability of favourable outcomes}

So probability of getting a head on coin toss after rolling a prime number on a die will be:

P(E)=14\text{P(E)} = \frac{1}{4}

Example 4

An urn contains nine balls of which three are red, four are blue and two are green. Three balls are drawn at random without replacement from the urn. calculate the probability that three balls have different color.

Solution

Number of ways we can draw 33 balls from 99 balls without replacement will be:

9C3^9\text{C}_3

Number of ways we can draw 33 balls from 99 balls and all of them are of different color will be:

3C1    4C1    2C1^3\text{C}_1 \ \ * \ \ ^4\text{C}_1 \ \ * \ \ ^2\text{C}_1

Let's apply classic probability formula as drawing a ball from urn has equal probability. So probability that three balls have different colors will be:

3    4    29C3=27\frac{3 \ \ * \ \ 4 \ \ * \ \ 2}{^9\text{C}_3} = \frac{2}{7}

Example 5

Two numbers are selected randomly from the set S={1,2,3,4,5,6}\text{S} = \{1, 2, 3, 4, 5, 6\} without replacement one by one. Calculate the probability that minimum of the two numbers is less than 44.

Solution

Let's generate the cases for favourable outcomes.

Case 1: Both of them are less than 44.

3C2^3\text{C}2

Case 2: One of them is less than 44.

3C1    3C1^3\text{C}_1 \ \ * \ \ ^3\text{C}_1

So probability that minimum of the two numbers is less than 44 will be:

(3C2  + 3C1    3C1)6C2\frac{(^3\text{C}_2 \ \ + \ ^3\text{C}_1 \ \ * \ \ ^3\text{C}_1)}{^6\text{C}_2}

Example 6

Three boys and two girls stand in a queue. Calculate the probability such that the number of boys ahead of every girl is at least one more than the number of girls ahead of her.

Solution

This problem can't be solved with permutation and combinations as this is not asking you to just arrange 22 boys across 33 girls, but there is a condition attached to it which say number of boys ahead of every girl is at least one.

Let's make cases for favourable outcomes.

  • Case 1: B1B2B3G1G2\text{B}_1\text{B}_2\text{B}_3\text{G}_1\text{G}_2
  • Case 2: B1B2G1G2B3\text{B}_1\text{B}_2\text{G}_1\text{G}_2\text{B}_3
  • Case 3: B1B2G1B3G2\text{B}_1\text{B}_2\text{G}_1\text{B}_3\text{G}_2
  • Case 4: B1G1B2G3B3\text{B}_1\text{G}_1\text{B}_2\text{G}_3\text{B}_3
  • Case 5: B1G1B2B3G2\text{B}_1\text{G}_1\text{B}_2\text{B}_3\text{G}_2

Now, 33 boys can arrange among themself in 3!3! ways and 22 girls can arrange among themself in 2!2! ways, it gives us total number of favourable outcomes as 52!3!5 * 2! * 3!.

So probability such that the number of boys ahead of every girl is at least one more than the number of girls ahead of her will be:

5    2!    3!5!\frac{5 \ \ * \ \ 2! \ \ * \ \ 3!}{5!}

Infinite Trials

In probability theory, infinite trials refer to a situation where an experiment or process is repeated an infinite number of times.

Below are some of the examples of infinite trials:

Example 1

A\text{A} and B\text{B} inorder throws a dice, whoever gets 66 first wins the game, find the probabiliy that A\text{A} wins.

Solution

P(AWins)=P(A)  +  [P(A)P(B)P(A)]  +  [P(A)P(B)P(A)P(B)P(A)]  +  ...\text{P}(\text{AWins}) = \text{P(A)} \ \ + \ \ [\text{P}(\overline{\text{A}}) * \text{P}(\overline{\text{B}}) * \text{P(A)}] \ \ + \ \ [\text{P}(\overline{\text{A}}) * \text{P}(\overline{\text{B}}) * \text{P}(\overline{\text{A}}) * \text{P}(\overline{\text{B}}) * \text{P(A)}] \ \ + \ \ ... \infty

Where,

P(AWins)\text{P}(\text{AWins}) is Probability that A\text{A} wins the game.

P(A)\text{P(A)} is Probability that A\text{A} gets 66.

P(A)\text{P}(\overline{\text{A}}) is Probability that A\text{A} does not gets 66.

P(B)\text{P(B)} is Probability that B\text{B} gets 66.

P(B)\text{P}(\overline{\text{B}}) is Probability that B\text{B} does not gets 66.

Substituting the values in the formula above we get:

P(AWins)=16  +  [565616]  +  [5656565616]  +  ...  \text{P}(\text{AWins}) = \frac{1}{6} \ \ + \ \ [\frac{5}{6} * \frac{5}{6} * \frac{1}{6}] \ \ + \ \ [\frac{5}{6} * \frac{5}{6} * \frac{5}{6} * \frac{5}{6} * \frac{1}{6}] \ \ + \ \ ... \ \ \infty

Simplifying equation above we get:

P(AWins)=16    [1+(56)2+(56)4+  ...  ]\text{P}(\text{AWins}) = \frac{1}{6} \ \ * \ \ [1 + (\frac{5}{6})^{2} + (\frac{5}{6})^{4} + \ \ ... \ \ \infty]

Applying formula for sum of infinte geometric progression we get:

P(AWins)=1611    (56)2\text{P}(\text{AWins}) = \frac{1}{6} * \frac{1}{1 \ \ - \ \ \large(\frac{5}{6})^{2}}

Example 2

The probability of a man hitting a target is 110\large\frac{1}{10}. Calculate the least number of shots required such that probability of man hitting the target at least once is greater than 14\large\frac{1}{4}.

Solution

Since we want to calculate probability of hitting the target atleast one, we apply below formula:

P(Hitting atleast once) = Total probability - P(Hitting never)\text{P(Hitting atleast once) = Total probability - P(Hitting never)} P(Hitting at least once)=1(910)n\text{P(Hitting at least once)} = 1 - (\frac{9}{10})^\text{n}

Now, we want P(Hitting target at least once in n attempts)\text{P(Hitting target at least once in n attempts)} to be >14 > \frac{1}{4}, so we get:

1(910)n>141 - (\frac{9}{10})^\text{n} > \frac{1}{4}

Simplifying the equation further we get:

10n3>9n410^\text{n} * 3 > 9^\text{n} * 4

Now, we can use hit and trial method for value of n\text{n} which satisfy the equation and get n=3\text{n} = 3.

So least number of short required such that probability of man hitting the target at least once is greater than 14\large\frac{1}{4} will be 33.

Example 3

Calculte the minimum number of times a fair coin needs to be tossed, such that probability of getting atleast two heads is atleast 0.960.96?

Solution

Let's say we have to toss the coin n\text{n} times so that probability of getting atleast two heads is atleast 0.960.96.

Since we want to calculate probability of getting at least two heads, we apply below formula:

P(Atleast 2 heads) = Total probability - P(Exactly 0 head) - P(Exactly 1 head)\text{P(Atleast 2 heads) = Total probability - P(Exactly 0 head) - P(Exactly 1 head)}

Now,

P(Exactly 0 head)=  12,  and  P(Exactly 1 head)=  nC1(12)n\text{P(Exactly 0 head)} = \ \ \frac{1}{2}, \ \ \text{and} \ \ \text{P(Exactly 1 head)} = \ \ ^\text{n}\text{C}_1 * (\frac{1}{2})^{\text{n}}
info

Here we have nC1^\text{n}\text{C}_1 because we want exactly 1 head but we still have to select a location of head in n\text{n} attempts.

Substituting the values in the formula we get:

P(Atleast 2 heads)=1(12)n    nC1(12)n\text{P(Atleast 2 heads)} = 1 - (\frac{1}{2})^{\text{n}} \ \ - \ \ ^\text{n}\text{C}_1 * (\frac{1}{2})^{\text{n}}

Now, we want P(Atleast 2 heads)\text{P(Atleast 2 heads)} should be atleast 0.960.96.

1(12)n    nC1(12)n  >  0.961 - (\frac{1}{2})^{\text{n}} \ \ - \ \ ^\text{n}\text{C}_1 * (\frac{1}{2})^{\text{n}} \ \ > \ \ 0.96

By hit and trial method we will get the value of n\text{n} as 88. So minimum number of times a fair coin needs to be tossed will be 88.

Set Theory

Below are some of the important points for set theory related to probability:

  • Probability of A\text{A} and B=P(AB)=P(AB)\text{B} = \text{P}(\text{A} \cap \text{B}) = \text{P(AB)}

  • Probability of A\text{A} or B=P(AB)=P(A + B) = P(A) + P(B)P(AB)\text{B} = \text{P}(\text{A} \cup \text{B}) = \text{P(A + B) = P(A) + P(B)} - \text{P}(\text{A} \cap \text{B})

  • If A\text{A} and B\text{B} are mutually exclusive =P(AB)=0= \text{P}(\text{A} \cap \text{B}) = 0

  • Probability of non-occurance of A=P(A)=1P(A)\text{A} = \text{P}(\overline{\text{A}}) = 1 - \text{P(A)}

Idependent Events

  • If P(AB)=P(A) . P(B)\text{P}(\text{A} \cap \text{B}) = \text{P(A) . P(B)} then A\text{A} and B\text{B} are independent events.

  • If A\text{A} and B\text{B} are independent events then all possible combinations like (A,B)(\overline{\text{A}}, \text{B}) Or (A,B)(\text{A}, \overline{\text{B}}) etc are also independent events.

  • Independent events and mutually exclusive events are two different things.

    • If A\text{A} and B\text{B} are independent events, then P(AB)=P(A) . P(B)\text{P}(\text{A} \cap \text{B}) = \text{P(A) . P(B)}
    • If A\text{A} and B\text{B} are mutually exclusive events, then P(AB)=0\text{P}(\text{A} \cap \text{B}) = 0

Conditional Probability

Conditional probability is the probability of an event occurring, given that another event has already occurred.

P(AB)=P(AB)P(B)\text{P}(\frac{\text{A}}{\text{B}}) = \frac{\text{P}(\text{A} \cap \text{B})}{\text{P(B)}}

It means calculate P(A)\text{P(A)} given P(B)\text{P(B)}, i.e. sample space for calculating P(A)\text{P(A)} is P(B)\text{P(B)} and favourable outcomes are P(AB)\text{P}(\text{A} \cap \text{B}).

Example 1

A unbiased dice is thrown such that event E1\text{E}_1 is an event for getting an odd number and event E2\text{E}_2 is an event for getting a prime number. Find probability of E1\text{E}_1 given E2\text{E}_2.

Solution

Number of possible outcomes for event E1\text{E}_1 is {1,3,5}\{1, 3, 5\}, so P(E1)=36\text{P}(\text{E}_1) = \large\frac{3}{6}.

Number of possible outcomes for event E2\text{E}_2 is {2,3,5}\{2, 3, 5\}, so P(E2)=36\text{P}(\text{E}_2) = \large\frac{3}{6}.

Number of possible outcomes for E1E2\text{E}_1 \cap \text{E}_2 is {3,5}\{3, 5\}, so P(E1E2)=26\text{P}(\text{E}_1 \cap \text{E}_2) = \large\frac{2}{6}.

Applying the formula for conditional probability we get:

P(E1E2)=P(E1E2)P(E2)\text{P}(\frac{\text{E}_1}{\text{E}_2}) = \frac{\text{P}(\text{E}_1 \cap \text{E}_2)}{\text{P}(\text{E}_2)} P(E1E2)=26,  and  P(E2)=36\text{P}(\text{E}_1 \cap \text{E}_2) = \frac{2}{6}, \ \ \text{and} \ \ \text{P}(\text{E}_2) = \frac{3}{6}

So probability of E1\text{E}_1 given E2\text{E}_2 will be:

P(E1E2)=23\text{P}(\frac{\text{E}_1}{\text{E}_2}) = \frac{2}{3}