ML and AI: Module 1:
Probability distributions
Madhusoodanan M.R
GEC Thrissur
Probability distributions
Binomial distribution
• A binomial distribution can be thought of as simply the probability of a
SUCCESS or FAILURE outcome in an experiment or survey that is
repeated multiple times.
• The binomial is a type of distribution that has two possible outcomes .
For example, a coin toss has only two possible outcomes: heads or tails
and taking a test could have two possible outcomes: pass or fail.
Binomial distribution
Properties of binomial distribution
• Discrete values: The binomial distribution only takes on integer
values. This means that the number of successes in a given number
of trials can only be an integer, such as 0, 1, 2, etc.
• Two possible outcomes: The binomial distribution assumes that
each trial has only two possible outcomes: success or failure. The
probability of success on each trial is constant across all trials.
• Fixed number of trials: The binomial distribution assumes a fixed
number of independent trials.
• Independence of trials: The trials are independent; the outcome of
one trial does not affect the outcome of other trials. This means that
the probability of success is the same for each trial.
• The formula is
b(x; n, P) = nCx * Px * (1 – P)n – x
b = binomial probability
x = total number of “successes” (pass or fail, heads or tails etc.)
P = probability of a success on an individual trial
n = number of trials
• Probability of a given number of successes: The binomial
distribution allows you to calculate the probability of a given
number of successes in a given number of trials. For example,
you can use the binomial distribution to calculate the probability
of getting 5 heads in 10 coin flips.
• Mean and variance: The binomial distribution has a mean
equal to the number of trials multiplied by the probability of
success on each trial (n.p) and a variance equal to the number
of trials multiplied by the probability of success on each trial
multiplied by the probability of failure on each trial or n.p.(1-p).
Shape of binomial distribution
Example
• A coin is tossed 10 times. What is the probability of getting
exactly 6 heads?
• b(x; n, P) =nCx Px (1 – P)n – x
The number of trials (n) is 10
The odds of success (“tossing a heads”) is 0.5 (So 1-p = 0.5)
x=6
• P(x=6) = 10C6 * 0.5^6 * 0.5^4 = 210 * 0.015625 * 0.0625 =
0.205078125
Example
A coin that is fair in nature is tossed n number of times. The probability of the occurrence of
a head six times is the same as the probability that a head comes 8 times, then find the
value of n.
Solution:
The probability that head occurs 6 times = nC6 (½)6 (½)n-6
Similarly, the probability that head occurs 8 times = nC8 (½)8 (½)n-8
Given that, the probability of the occurrence of a head six times is the same as the
probability that a head comes 8 times,
(i.e) nC6 (½)6 (½)n-6 = nC8 (½)8 (½)n-8
nC (½)n = nC (½)n
6 8
nC = nC
6 8
6 = n-8
n= 14.
Therefore, the value of n is 14.
Moment generating function for binomial distribution
Moment generating function of Binomial
distribution: To get mean
Moment generating function of Binomial
distribution: to get variance
Poisson distribution
• A Poisson distribution is a discrete probability distribution. It gives
the probability of an event happening a certain number of times (k)
within a given interval of time or space.
• The Poisson distribution has only one parameter, λ (lambda), which is
the mean number of events.
• Poisson distribution can be used to predict or explain the number of
events occurring within a given interval of time or space.
• The mean of a Poisson distribution is λ.
• The variance of a Poisson distribution is also λ.
Poison distribution: example
Poisson distribution
• A probability model which can be used when the outcome of an
experiment is a random variable taking on positive integer values and
where the only information available is a measurement of its average
value.
• This has widespread applications, for example in analyzing traffic
flow, in fault prediction on electric cables and in the prediction of
randomly occurring accidents.
Conditions for Poisson distribution
[Link] events happen at random and independently. That is, the
probability of one event doesn’t affect the probability of another
event.
2. The mean number of events occurring within a given interval of time
or space. This number is called λ (lambda), and it is assumed to be
constant.
Example for Poisson distribution
• The hourly number of customers arriving at a bank
• The daily number of accidents on a particular stretch
• of highway
• The hourly number of accesses to a particular web server
• The number of typos in a book
• Monthly demands for a particular product
Poisson distribution
• Let X be the discrete random variable that represents the number of
events observed over a given time period. Let λ be the expected
value (average) of X. If X follows a Poisson distribution, then the
probability of observing k events over the time period is.
Poisson: Example 1
Question: Mass-produced needles are packed in boxes of 1000. It is believed that 1
needle in 2000 on average is substandard. What is the probability that a box
contains 2 or more defectives?
Poisson: example 2
Question 2: In the manufacture of glassware, bubbles can occur in the
glass which reduces the status of the glassware to that of a ‘second’. If,
on average, one in every 1000 items produced has a bubble, calculate
the probability that exactly six items in a batch of three thousand are
seconds.
Sol:
Poisson distribution: A special case of
Binomial distribution
• It is an approximation to the binomial distribution X B(n,p) in the
case where n is large and p is small.
• So, when , n is large , p is small and np = λ (λ constant), we can use
Poisson distribution instead of Binomial distribution.
• As λ increases, the distribution looks more and more similar to
a normal distribution. In fact, when λ is 10 or greater, a normal
distribution is a good approximation of the Poisson distribution.
Poisson and Binomial-comparison
Question: A machine which is known to produce 1% defective
components is used for a production run of 40 components. What is
the probability that two defective items are produced?
Sol. Essentially we are assuming that X B(40,0.01) and are asking for
P(X = 2). We use both the binomial distribution and its Poisson
approximation for comparison.
Normal distribution
• The normal distribution is a continuous
probability distribution that is symmetrical
around its mean, most of the observations cluster
around the central peak, and the probabilities for
values further away from the mean taper off
equally in both directions.
• Extreme values in both tails of the distribution
are similarly unlikely.
• While the normal distribution is symmetrical, not
all symmetrical distributions are normal. For
example, the Student’s t, Cauchy, and logistic
distributions are symmetric.
Normal distribution
• It is the most important probability
distribution in statistics because it
accurately describes the distribution of
values for many natural phenomena.
• For example, height data are normally
distributed. Height data of 14 year old
girls is shown in the graph. It follows
normal distribution.
Normal distribution
• A random variable X is said to have the normal distribution with parameters μ
and if its density function is given by:
the normal distribution is characterized by a mean μ and a standard deviation σ .
Normal distribution
• Increasing the mean shifts the density curve to the right.
Increasing the standard deviation flattens the density curve.