You are on page 1of 46

Backward Reasoning..

What is out of the common is usually a


guide rather than a hindrance. In solving a
problem of this sort, the grand thing is to HAIMLC501
be able to reason backward.
Math for AI ML
Distributions
Question 1

Amroz K. Siddiqui

Fr. C. Rodrigues Institute of


Technology, Vashi.

– Sherlock Holmes
– A Study in Scarlet
Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 1 / 30
Outline

1 Distributions
Gamma Distribution
Normal Distribution
t Distribution

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 2 / 30


Distributions Gamma Distribution

Gamma Function

Properties of the gamma function


For any positive real number α
Γ(n) = (n − 1)! for n ∈ N
R∞
Γ(α) = 0 x α−1 e −x dx
R ∞ α−1 −λx
0 x e dx = Γ(α)
λα for λ > 0
Γ(α + 1) = αΓ(α)

Γ( 21 ) = π

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 3 / 30


Distributions Gamma Distribution

Gamma Function

Question 1 a
R∞
Evaluate I = 0 x 7 e −3x dx
Solution:
R∞ Γ(α)
We know that, 0 x α−1 e −λx dx = λα
Put α = 8 and λ = 3
R∞
I = 0 x 7 e −3x dx
Γ(8)
= 38
7!
= 38

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 4 / 30


Distributions Gamma Distribution

Gamma Distribution

Definition
A continuous random variable X is said to have a gamma distribution
with parameters, α > 0 and λ > 0
Written as X ∼ Gamma(α, λ)
if its PDF is given by
(
λα x α−1 e −λx
Γ(α) if x > 0
fX (x) =
0 otherwise

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 5 / 30


Distributions Gamma Distribution

Gamma Distribution

Mean and Variance


Mean
α
E (X ) =
λ
Variance
α
Var (X ) =
λ2

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 6 / 30


Distributions Gamma Distribution

Gamma Distribution

Question 1 b
The sale per day of books in a bookshop is governed by the random
variable X where it follows the Gamma distribution as
X ∼ G (100, 10). Calculate the mean and variance of X
Compute the mean and variance of X where X ∼ G (1024, 16)
A random variable X follows Gamma distribution X ∼ G (α, λ). It’s
mean is 30 and variance is 6. Compute α and λ

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 7 / 30


Distributions Normal Distribution

Normal Distribution

Linear Combination of Normal Distributions


A linear combination (function) of two (or more) normally distributed
random variables is itself normally distributed
X ∼ N(µX , σX2 ) and Y ∼ N(µY , σY2 ), and both are independent.
A linear combination of X and Y is: W = aX + bY , where a, b are
constants
2 )
W ∼ N(µW , σW
2 = a2 σ 2 + b 2 σ 2
µW = aµX + bµY and σW X Y

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 8 / 30


Distributions Normal Distribution

Linear Combination of Normal Distribution

Question 1 c
A florist has two shops, one in Mumbai and another in Navi Mumbai.
Let X and Y denote the number of roses sold daily in the Mumbai
and Navi Mumbai branch, respectively.
Assume that both X and Y are independently normally distributed as
X ∼ N(100, 64) and Y ∼ N(150, 81)
What is the average value of the roses sold in two days in the two
branches and the corresponding variance of sale?

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 9 / 30


Distributions Normal Distribution

Linear Combination of Normal Distribution

Question 1 c
X ∼ N(100, 64) and Y ∼ N(150, 81)
For 2 days sale at both branches: W = 2X + 2Y
E (W ) = E (2X + 2Y ) = 2(100) + 2(150) = 500
Var (W ) = 4Var (X ) + 4Var (Y ) = 4(64) + 4(81) = 580

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 10 / 30


Distributions Normal Distribution

Linear Combination of Normal Distribution

Question 1 c
Continue with a similar example, with
X ∼ N(20, 100) and Y ∼ N(50, 36)
For 3 and 7 days sale at both branches, respectively

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 11 / 30


Distributions Normal Distribution

Standard Normal Distribution

Standard Normal Distribution


Define a new variable, Z , as follows:

X − µX
Z=
σX
If the variable X has a mean µX and a variance σX2 , it can be shown
that the Z variable has a mean value of zero and a variance of 1

Z ∼ N(0, 1)
Such a variable is known as a unit or standardized variable
X ∼ N(µX , σX2 ) =⇒ Z ∼ N(0, 1)

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 12 / 30


Distributions Normal Distribution

Standard Normal Distribution

Question 1 d
It is given that X , the daily sale of bread in a bakery, follows the
normal distribution with a mean of 70 loaves and a variance of 9; that
is, X ∼ N(70, 9).
What is the probability that on any given day the sale of bread is
greater than 75 loaves?

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 13 / 30


Distributions Normal Distribution

Standard Normal Distribution

Question 1 d
X ∼ N(70, 9).
To find P(X > 75), that is to find: P(Z >?) =?
75−70
Z= 3 ≈ 1.67
To find P(Z > 1.67)

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 14 / 30


Distributions Normal Distribution

Standard Normal Distribution Function

Cumulative Distribution Function

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 15 / 30


Distributions Normal Distribution

Standard Normal Distribution Table

Standard Normal Distribution Table

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 16 / 30


Distributions Normal Distribution

Standard Normal Distribution

Question 1 d
X ∼ N(70, 9).
To find P(X > 75), that is to find: P(Z >?) =?
75−70
Z= 3 ≈ 1.67
To find P(Z > 1.67)
P(Z > 1.67) = 1 − 0.9525 = 0.0475

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 17 / 30


Distributions Normal Distribution

Standard Normal Distribution

Question 1 d
Continue with the previous Example, but suppose we now want to
find out the probability of a daily sale of bread of 75 or fewer loaves.

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 18 / 30


Distributions Normal Distribution

Standard Normal Distribution

Question 1 d
Continue with the previous Example, but suppose we now want to
find out the probability of a daily sale of bread of 75 or fewer loaves.
0.9525

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 18 / 30


Distributions Normal Distribution

Standard Normal Distribution

Question 1 d
Continue with the previous Example, but now suppose we want to
find out the probability that the daily sale of bread is between 65 and
75 loaves.

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 19 / 30


Distributions Normal Distribution

Standard Normal Distribution

Question 1 d
Continue with the previous Example, but now suppose we want to
find out the probability that the daily sale of bread is between 65 and
75 loaves.
To compute this probability, we first compute

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 19 / 30


Distributions Normal Distribution

Standard Normal Distribution

Question 1 d
Continue with the previous Example, but now suppose we want to
find out the probability that the daily sale of bread is between 65 and
75 loaves.
To compute this probability, we first compute
65−70 75−70
Z1 = 3 ≈ −1.67 and Z2 = 3 ≈ 1.67

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 19 / 30


Distributions Normal Distribution

Standard Normal Distribution

Question 1 d
Continue with the previous Example, but now suppose we want to
find out the probability that the daily sale of bread is between 65 and
75 loaves.
To compute this probability, we first compute
65−70 75−70
Z1 = 3 ≈ −1.67 and Z2 = 3 ≈ 1.67
P(Z1 ≤ −1.67) = 0.0475 and P(Z2 ≤ 1.67) = 0.9525

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 19 / 30


Distributions Normal Distribution

Standard Normal Distribution

Question 1 d
Continue with the previous Example, but now suppose we want to
find out the probability that the daily sale of bread is between 65 and
75 loaves.
To compute this probability, we first compute
65−70 75−70
Z1 = 3 ≈ −1.67 and Z2 = 3 ≈ 1.67
P(Z1 ≤ −1.67) = 0.0475 and P(Z2 ≤ 1.67) = 0.9525
P(−1.67 ≤ Z ≤ 1.67) = 0.9525 − 0.0475 = 0.9050

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 19 / 30


Distributions Normal Distribution

Random Sample

Random Sample
If X1 , X2 , ..., Xn is a random sample from a normal population with
mean µX and variance σX2 ,
Then the sample mean, X̄ , also follows the normal distribution
The mean µX is same.
σX2
But with variance, n
That is,

σX2
X̄ ∼ N(µX , )
n

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 20 / 30


Distributions Normal Distribution

Random Sample

Standard Error
If we take the (positive) square root of the variance of X̄ , we obtain
σX

n
, which is called the Standard Error (SE) of X̄
The square root of the variance of a random variable of a population
is called the standard deviation
The square root of the variance of a sampling is called the standard
error.

Standard Normal Variable


(X̄ − µX )
Z= σX ∼ N(0, 1)

n

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 21 / 30


Distributions Normal Distribution

Random Sampling from Standard Normal Distribution

Question 1 e
Given mean and variance of a population as 25 and 10000
respectively, a sample of 100 is taken from the population. Compute
the mean and variance of the sample mean X̄ .

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 22 / 30


Distributions Normal Distribution

Random Sampling from Standard Normal Distribution

Question 1 e
Given mean and variance of a population as 25 and 10000
respectively, a sample of 100 is taken from the population. Compute
the mean and variance of the sample mean X̄ .

σX2
X̄ ∼ N(µX , )
n

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 22 / 30


Distributions Normal Distribution

Random Sampling from Standard Normal Distribution

Question 1 e
Given mean and variance of a population as 25 and 10000
respectively, a sample of 100 is taken from the population. Compute
the mean and variance of the sample mean X̄ .

σX2
X̄ ∼ N(µX , )
n
µX̄ = µX = 25

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 22 / 30


Distributions Normal Distribution

Random Sampling from Standard Normal Distribution

Question 1 e
Given mean and variance of a population as 25 and 10000
respectively, a sample of 100 is taken from the population. Compute
the mean and variance of the sample mean X̄ .

σX2
X̄ ∼ N(µX , )
n
µX̄ = µX = 25
σX2 10000
σX̄ = n = 100 = 100

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 22 / 30


Distributions Normal Distribution

Random Sampling from Standard Normal Distribution

Question 1 e
Continue with the previous example and compute the standard error
of the sample mean X̄ .

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 23 / 30


Distributions Normal Distribution

Random Sampling from Standard Normal Distribution

Question 1 e
Continue with the previous example and compute the standard error
of the sample mean X̄ .
σX
SE(X̄ ) = √
n

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 23 / 30


Distributions Normal Distribution

Random Sampling from Standard Normal Distribution

Question 1 e
Continue with the previous example and compute the standard error
of the sample mean X̄ .
σX
SE(X̄ ) = √
n
100
= 10 = 10

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 23 / 30


Distributions t Distribution

t Distribution

t Distribution
Also known as Student’s t-distribution
Suppose we only know µX and estimate σX2 by its sample estimator
P (Xi −X̄ )2
SX2 = n−1
Replacing σX by Sx , that is, replacing the population standard
deviation (s.d.) by the sample s.d., in the above equation , we obtain
a new variable

X̄ − µX
t= √
SX / n

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 24 / 30


Distributions t Distribution

t Distribution

t Distribution
If we draw random samples from a normal population with mean µX
and variance σX2 but replace by its estimator SX2 , the sample mean
follows the t distribution.
A t-distributed r.v. is often designated as tk , where k denotes the d.f.

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 25 / 30


Distributions t Distribution

t Distribution

Properties of t Distribution
The t distribution, like the normal distribution, is symmetric.
The mean of the t distribution, like the standard normal distribution,
is zero, but its variance is k/(k − 2).

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 26 / 30


Distributions t Distribution

t Distribution

Question 1 f
Calculate the variance of
t5
t7
t11
In a period of 16 days the sale of tickets at a railway station averaged
900 tickets with a (sample) s.d. of 23 tickets. What is the probability
of obtaining such a sale given that the true average sale is 895 tickets
a day?

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 27 / 30


Distributions t Distribution

t Distribution

Question 1 f
In a period of 16 days the sale of tickets at a railway station averaged
900 tickets with a (sample) s.d. of 23 tickets. What is the probability
of obtaining such a sale given that the true average sale is 895 tickets
a day?

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 28 / 30


Distributions t Distribution

t Distribution

Question 1 f
In a period of 16 days the sale of tickets at a railway station averaged
900 tickets with a (sample) s.d. of 23 tickets. What is the probability
of obtaining such a sale given that the true average sale is 895 tickets
a day?
We don’t know the true variance.

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 28 / 30


Distributions t Distribution

t Distribution

Question 1 f
In a period of 16 days the sale of tickets at a railway station averaged
900 tickets with a (sample) s.d. of 23 tickets. What is the probability
of obtaining such a sale given that the true average sale is 895 tickets
a day?
We don’t know the true variance.
What do we know?

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 28 / 30


Distributions t Distribution

t Distribution

Question 1 f
In a period of 16 days the sale of tickets at a railway station averaged
900 tickets with a (sample) s.d. of 23 tickets. What is the probability
of obtaining such a sale given that the true average sale is 895 tickets
a day?
We don’t know the true variance.
What do we know?
Size of Sample = n = 16,

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 28 / 30


Distributions t Distribution

t Distribution

Question 1 f
In a period of 16 days the sale of tickets at a railway station averaged
900 tickets with a (sample) s.d. of 23 tickets. What is the probability
of obtaining such a sale given that the true average sale is 895 tickets
a day?
We don’t know the true variance.
What do we know?
Size of Sample = n = 16,
Sample mean = X̄ = 900,

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 28 / 30


Distributions t Distribution

t Distribution

Question 1 f
In a period of 16 days the sale of tickets at a railway station averaged
900 tickets with a (sample) s.d. of 23 tickets. What is the probability
of obtaining such a sale given that the true average sale is 895 tickets
a day?
We don’t know the true variance.
What do we know?
Size of Sample = n = 16,
Sample mean = X̄ = 900,
Population mean = µX = 895

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 28 / 30


Distributions t Distribution

t Distribution

Question 1 f
In a period of 16 days the sale of tickets at a railway station averaged
900 tickets with a (sample) s.d. of 23 tickets. What is the probability
of obtaining such a sale given that the true average sale is 895 tickets
a day?
We don’t know the true variance.
What do we know?
Size of Sample = n = 16,
Sample mean = X̄ = 900,
Population mean = µX = 895
Sample standard deviation = SX = 23

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 28 / 30


Distributions t Distribution

t Distribution

Question 1 f
Size of Sample = n = 16,
Sample mean = X̄ = 900,
Population mean = µX = 895
Sample standard deviation = SX = 23

X̄ − µX
t= √
SX / n

900 − 895
t= = 0.8695
23/4

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 29 / 30


Distributions t Distribution

t Distribution

Amroz K. Siddiqui (University of Mumbai) HAIMLC501: Random Sampling 30 / 30

You might also like