0% found this document useful (0 votes)
14 views

Basics of Probability

Uploaded by

Namit Mehta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Basics of Probability

Uploaded by

Namit Mehta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

Foundations for Data

Analytics
Prof. Soumen Manna

Session 01-03
What is Probability?
• It’s a measurement of uncertainty.
Probability in daily life
• Weather Forecasting
Before planning for an outing or a picnic, we always check the weather forecast.
Suppose it says that there is a 60% chance that rain may occur. Do you ever wonder
where this 60% comes from?

Meteorologists use a specific tool and technique to


predict the weather forecast. They look at all the other
historical databases of the day, which have similar
characteristics of temperature, humidity, and pressure, etc.
And determine that on 60 out of 100 similar days in the past,
it had rained.
Probability in daily life
• Insurance

Probability helps in analyzing the best plan of insurance which suits you and your family the most.
For example, if you are an active smoker, and chances of getting lung disease are higher in you. So,
instead of choosing an insurance scheme for your vehicle or house, you may go for your health
insurance first, because the chance of your getting sick is higher. For instance, nowadays people are
getting their mobile phones insured because they know that the chances of their mobile phones
getting damaged or lost are high.
Probability in daily life
• Sports Strategies

In sports, analysis is done with the help


of probabilities to understand the strengths
and weaknesses of a particular team or player.
Analysts use probabilities and odds to predict
team performances and outcomes regarding
team members in games.

A cricket coach assesses a player’s batting and bowling ability by taking his average performance in
previous matches before placing him in the lineup.
Probability in daily life
• Politics

Political analysts are everywhere.


With election results around the corner,
you can be sure that every news channel in
the country will be full of buzz about the winner.
Election officials use historical data to understand
how an area has voted in the past to understand who to vote for this time.
They combine this with current trends and current polls and do a lot of math to arrive at a
conclusion on who will win.
Probability in daily life
• Sales Forecasting

Many marketing companies use probabilities


to predict the probability that they will sell a
certain amount of product on a given day, week,
or month.
This allows companies to estimate how much
inventory they will need. For example, a company
might use a forecasting model that tells them there is a 90% chance of selling at least 100 products
on a given day.
This means they need to make sure they have at least 100 products on hand to sell (or preferably
more) so they don’t run out.
Probability in daily life
Scientific Research and Analysis

Every scientific research is based on probability. Scientists keep possibilities in mind as they
research and try to create new things. Because researchers do not know in advance what
the results of their research will be. If the results were already known, there would be no
need for research. Therefore, feasibility is important in every research.
Foundation

• Random Experiment (E): An experiment or process whose all possible


outcomes are known in advance but we do not know which outcome
will appear in a particular performance of the experiment.

• Sample Space (S): Set of all outcomes related to a random


experiment E. Each element of S is called a sample point.
Foundation
Example 1:

Consider a random experiment E = tossing of a coin. Here we know


beforehand that in each performance of E, either head (H) or tail (T) will
appear. But we do not know which one will certainly appear.
Therefore, E is a random experiment and the corresponding sample
space is S = {H,T}. H and T are called sample point of E.
Foundation
Example 2:

E = Throwing of a dice

S = {1, 2, 3, 4, 5, 6}
Foundation
Example 3:

E = tossing a coin two times

Let E1 = tossing a coin 1 time. Hence, S1 = {H, T}.

Hence, E = E1 X E1 and S = S1 X S1 = {H, T}X{H, T} = {(H,H), (H,T), (T,H),


(T,T)}
Foundation
Example 4:

E = tossing of three different coins

Let 𝐸𝑖 = tossing of coin i-th coin. Hence, 𝑆𝑖 = {H, T}, i = 1, 2, 3.

Therefore, E = 𝐸1 X 𝐸2 X 𝐸3 and S = 𝑆1 X 𝑆2 X 𝑆3 = {H, T}X{H, T} X {H, T} =


{(H,H,H), (H,H,T), (H,T,H), (H,T,T), (T,H,H), (T,H,T), (T,T,H), (T,T,T)}
Foundation
Example 5:

E = tossing a coin and a dice

Let 𝐸1 = tossing of a coin. Hence, 𝑆1 = {H, T}.


Let 𝐸2 = tossing of a dice. Hence, 𝑆2 = {1, 2, 3, 4, 5, 6}.
Therefore, E = 𝐸1 X 𝐸2 and S = 𝑆1 X 𝑆2 = {H, T}X{1, 2, 3, 4, 5, 6} = {(H,1),
(H,2), (H,3), (H,4), (H,5), (H,6), (T,1), (T,2), (T,3), (T,4), (T,5), (T,6)}.
Foundation
Example 6:
E1 = Your final score (integer) in the Mathematics exam out of 100.
S1 = {0, 1, 2, ….., 100 }
E2 = Your final score(integer) in the Statistics exam out of 50
S2 = {0, 1, 2, ….., 50 }

E = your score in mathematics and Statistics Exams.


S = 𝑆1 X 𝑆2 = {0, 1, …, 100}X{0, 1, …, 50} = {(0, 0), (0, 1), (0, 2), …, (0, 50),
(1, 0), (1, 1), (1, 2), …, (1, 50), …,(100, 0), (100, 1), (100, 2), …,(100, 50)}
Foundation
Example 7:
E1 = You draw a ball from a bag containing 5 green and 7 red balls.
S1 = {g1, g2, g3, g4, g5, r1, r2, r3, r4, r5, r6, r7}

E2 = You draw two balls from a bag containing 5 green and 7 red balls.
With replacement
S2 = S1XS1 = {(g1, g1), (g1, g2), …,(g1,r7), …..,(r6,r7), ( r7, r7)}

Without replacement
S2 = S1XS1 = { (g1, g2), …,(g1,r7), …..,(r6,r7), ( r7, r7)}
Foundation
Example 8:
There are buses in every 30 minutes at a bus stop. Let X denotes the
waiting time at the bus stand. Then the sample space of X is
S = [0, 30)
Foundation
Example 9:
At a car park there are 100 vehicles, 60 of which are cars, 30 are vans
and the remainder are lorries. Every vehicle is equally likely to leave.
Let X be the 1st vehicle to leave. Then the sample space of X is

S = {c1,…., c60, v1,…, v30, l1,…,l10}


Foundation
• Event (A): An event A of a random experiment E, is nothing but a subset of
the sample space S. When A = ɸ (nothing), it is called null event and when
A = S (the whole sample space), it is called the certain event.

Example: E= tossing of a coin.


The sample space S = {H,T} contains two elements (sample points).
So, there exist 4 possible subsets (events) of S and they are:
ɸ (null event),
{H} (the head),
{T} (the tail),
and the certain event
{H,T} (either head or tail).
Foundation
Example: E= tossing a coin two times.
Sample space S2 = {HH, TH, HT, TT} contains four elements (sample
points). So, there exist 16 possible subsets (events) of S2 and they some
of them are like:

A = ɸ; ‘nothing’,
A = {HH}; ‘both head’,
A= {TH, HT}; ‘exactly one head’ or ‘exactly one tail’ or ‘both head and
tail’
A = {HH, TH, HT}; ‘at least one head’ or ‘at most one tail’.
Foundation

• Probability(P): The probability P corresponding to a random


experiment E, is a rule that assigns a value between 0 to 1, to each
event A.
Foundation
Properties of probability:

1. 0 ≤ P(A) ≤ 1.

2. P(ɸ) = 0, P(S) = 1.

3. For any two events A and B, P(AUB) = P(A) + P(B) - P(A∩B), where
AUB is read as ‘A union B’ or in common parlance ‘A or B’, and A∩B
is read as ‘A intersection B’, or in common parlance ‘A and B’.

4. P(Ac) = 1 – P(A), where Ac denotes the complement of event A.


Foundation
Properties of probability:

5. If A and B are mutually exclusive events, then P(A∩B) = 0. A ‘mutually


exclusive event’ means that if event A occurs, then event B cannot occur. In
other words, there is no common element between A and B, i.e., A∩B = ɸ,
the null event, and hence P(A∩B) = 0 [property ii]. For example, consider the
events A = head (H), and B = tail (T), in tossing of a coin. They are mutually
exclusive, because if you get the head, you cannot get the tail in any single
toss of a coin, or, in other words they cannot occur together.

6. If A and B are independent events, then P(A∩B) = P(A)*P(B).


‘Independent events’ are those where the outcome of one event does not
affect the outcome of another event. For example, if you are tossing two
coins, the outcome of the first coin will not affect the outcome of the second
coin.
Foundation

• Any question regarding probability of an event, can be classified into


two categories:

Category 1: Probability of each sample point is not given in the


question.

Category 2: Probability of each sample point is given in the question.


Foundation
Category 1: Probability of each sample point is not given in the
question.

• All the questions under this category, you will be given the probability
values of one or more events and you will be asked the probability
value of a related event. You have to use the properties of probability
to solve these questions. For example:

Q. If P(A) =0.3, P(B)= 0.4 and A and B are independent events, find
P(AUB).
Foundation
Category 1:

Q. If P(A) =0.3, P(B)= 0.4 and A and B are independent events, find
P(AUB).

Ans. P(AUB) = P(A) + P(B) - P(A∩B) [property iii]


Or, P(AUB) = P(A) + P(B) - P(A)*P(B) [property vi]
Or, P(AUB) = 0.3 + 0.4 – (0.3)(0.4)
Or, P(AUB) = 0.7 – 0.12 = 0.58.
Foundation
Category 1:
Q. If A and B are two events such that P(A) =0.3, P(B)= 0.4 and the
probability that at least one of them occurs is 0.8, then what is the
probability of both of them to occur?

Ans. Given P(A) =0.3, P(B)= 0.4, and P(AUB) = 0.8.


P(AUB) = P(A) + P(B) - P(A∩B) [property iii]
Or, P(A∩B) = P(AUB) - P(A) - P(B)
Or, P(A∩B) = 0.8 - 0.3 -0.4 = 0.1.
Foundation
Category 1:
Q. If A and B are two events such that P(A) =0.3, P(B)= 0.4 and the
probability that at least one of them occurs is 0.5, then what is the
probability of both of them to occur?

Ans. Given P(A) =0.3, P(B)= 0.4, and P(AUB) = 0.8.


P(AUB) = P(A) + P(B) - P(A∩B) [property iii]
Or, P(A∩B) = -P(AUB) + P(A) + P(B)
Or, P(A∩B) = -0.5 + 0.3 +0.4 = 0.2.
Foundation
• Category 2:
Under this category, probability of each sample point will be given. This
case can be divided into two types, depending on the nature of the
sample space.

• Type 1- Discrete type sample space:

• Type 2- Interval type sample space:


Foundation
• Category 2:

Type 1- Discrete type sample space: Under this type, probability of


each sample point will be given to you and you will be asked to find
probability of an event A. To solve this type of problem, you have to
first identify all the sample points that consists A. Then P(A) is nothing
but the sum of all individual probabilities of the corresponding sample
points of A. If the probability of each sample point is not given to you,
then assume that each sample point has equal probability.
Foundation
• Category 2 Type 1:
Q: Suppose two coins are tossed together. What is the probability of observing
a) both heads?
b) at least one head?

• Ans. Note that the sample space S of this experiment is {HH, TH, HT, TT}. Since the probability of
each sample point is not given in the question, we assume they are equal probable, i.e., 0.25 in
this case.
a) Here our favorable event A consists of only one sample point HH, where both heads occur. Hence,
P(A) = P(HH) = 0.25.
b) Here our favorable event A consists of three sample points HH, TH and HT, because these are the 3
out of 4 possible outcomes where at least one head occur. Therefore, P(A) = P(HH)+P(TH)+P(HT) =
0.75.
Foundation
• Category 2 Type 1:
• Q. Suppose that the probability of occurring x accidents per year in a busy street of Mumbai is
given by
3𝑥
𝑃 𝑥 = 𝑒 −3
𝑥!
What is the probability that there is at least one accident in this year?

Ans. Note that the number of accidents in this year can be any number between 0 to infinity. Here
the sample space S = {0,1, 2, 3,...} and the probability value for each sample point is given. The
favorable event (or the event of interest as asked for in the question) is A = { 1, 2, 3,...}. So,

P(A)= 1 – P(Ac)
= 1 – P(X=0)
3 0
=1- 𝑒 −3
0!
= 1 - e-3
=0.9502
Foundation
• Category 2:

Type 2- Interval type sample space: Under this type, a probability


function will be given for an interval. This probability function is known
as probability density function (pdf). You will be asked to find
probability of an event A, which is also an interval. To find the
probability P(A), you have to integrate the pdf under the interval A.
Foundation
• Category 2 Type 2:
Q. Suppose the pdf of a process x is given by
3
𝑓 𝑥 = 4𝑥 − 2𝑥 2 , 0 < x < 2.
8
Find P(x>1).

Ans. Here the sample space S is the interval (0, 2) and the event A is the
interval (1, 2). Hence,
23
P(A) = P(1<x<2) = ‫׬‬1 8 4𝑥 − 2𝑥 2 𝑑𝑥 = 0.5.
Foundation
Thus, any question regarding finding probability of an event
fundamentally falls into any of these categories and can be solved
accordingly.
Some shortcuts may exist for certain problems. And in many problems,
the fundamental information regarding the probability of each sample
point is given under many jargons.
Your job is to correctly identify it. Sometimes you may find it difficult to
write the favorable event A in subset notation.
I will suggest you to first understand the process E and write down
corresponding the sample space S. Identifying the event A and finding
P(A) will be easy then.
Example
Q1. Two standard dice are rolled together. What is the probability that
both of them will appear the same?

event A = {(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)}.
n(S) = 36, (total no. of sample points)

P(A) = 1/36 + 1/36 + 1/36 + 1/36 + 1/36 + 1/36 = 1/6


Exercise
Q1. Two standard dice are rolled together. What is the probability that
both of them will appear the same?

Related questions:
a) Sum of two dice is 10.
b) Sum of two dice is 13
c) 1st dice is less than the second
Exercise
Q2. Four persons are chosen at random from a group of 3 men, 2
women and 4 children. What is the chance that exactly two of them
will be children?
Foundation
Random Variable: A random variable X is a function from the sample space S (of some known
or unknown random experiment E) to the real number set R (or, subset of R).
For Example,
Let E = tossing of a coin two times
S = {HH, HT, TH, TT}
Let X denotes the ‘number of tails’. Then X is a Random variable.
X transfer:
HH → 0
HT, TH →1
TT → 2
with their probability, i.e., P(X=0) = P(HH)=1/4; P(X=1) = P(HT, TH) = 1/2 ; P(X=1) = P(TT) = 1/4.
You can consider a random variable X as a projection of a random experiment whose sample
space is a subset of the Real number space.
Practice Problems
https://www.hitbullseye.com/Probability-Examples.php

https://www.hitbullseye.com/Probability-Problems.php

https://www.hitbullseye.com/Problems-on-Probability-with-
Solutions.php
End of the class

You might also like