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

Lecture 9

Uploaded by

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

Lecture 9

Uploaded by

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

Data Analytics with Python

Some Special
Distributions
• Discrete
– Binomial
– Poisson
– Hyper geometric
• Continuous
– Uniform
– Exponential
– Normal

2
Binomial
Distribution
• Let us consider the purchase decisions of the next three customers who
enter a store.
• On the basis of past experience, the store manager estimates the
probability that any one customer will make a purchase is .30.
• What is the probability that two of the next three customers will
make a
purchase?

3
Tree diagram for the Martin clothing store
problem

4
Trial
Outcomes

5
Graphical representation of the probability
distribution for the number of customers
making a purchase
x P(x)
0 0.7 x 0.7 x 0.7=0.343

1 0.3x0.7x07+
0.7x0.3x0.7+
0.7x0.7x0.3 = 0.441

2 0.189
3 0.027

6
Binomial Distribution-
Assumtions
• Experiment involves n identical trials
• Each trial has exactly two possible outcomes: success and failure
• Each trial is independent of the previous trials
• p is the probability of a success on any one trial
q = (1-p) is the probability of a failure on any one trial
• p and q are constant throughout the experiment
• X is the number of successes in the n trials

7
Binomial Distribution

• Probability n!
P(X ) X n for 0  X
function

X !n  X p q
n
X
!
• Mean
value n
• Variance and
p
standard  np
2

deviation q np
   
2
q
8
Binomial Table
SELECTED VALUES FROM THE BINOMIAL PROBABILITY TABLE
EXAMPLE: n = 10, x = 3, p = .40; f (3) = .2150

9
Mean and

Variance
Suppose that for the next month the Clothing Store forecasts 1000
customers will enter the store.
• What is the expected number of customers who will make a
purchase?
• The answer is μ = np = (1000)(.3) = 300.
• For the next 1000 customers entering the store, the variance
and standard deviation for the number of customers who will
make a purchase are

10
Poisson
Distribution
• Describes discrete occurrences over a continuum or interval
• A discrete distribution
• Describes rare events
• Each occurrence is independent any other occurrences.
• The number of occurrences in each interval can vary from zero to infinity.
• The expected number of occurrences must hold constant throughout the
experiment.

11
Poisson Distribution:
Applications
• Arrivals at queuing systems
– airports -- people, airplanes, automobiles, baggage
– banks -- people, automobiles, loan applications
– computer file servers -- read and write operations

• Defects in manufactured goods


– number of defects per 1,000 feet of extruded copper wire
– number of blemishes per square foot of painted surface
– number of errors per typed page

12
Poisson Distribution
• Probability function
 e 
X

P( X ) for X  0,1, 2,
 X 3,...
!
where:
  long  run average
e  2. 718282... (the base of natural
logarithms )
Variance Standard deviation


Mean value
 
13
Poisson Distribution: Example

  3.2 customers/4   3.2 customers/4


minutes X = 10 minutes X = 6
customers/8 minutes customers/8 minutes
Adjusted  Adjusted 
=6.4 customers/8 minutes =6.4 customers/8
X 
P(X)  e
X 
P(X)  e
minutes
= =
X! 10 6.4 X ! 6 6.4
P(X 6.4 e  P(X 6.4 e 
=10)= 0.0528 =6)= 0.1586
10! 6!

14
Poisson Probability
Table Example: μ =
10, x = 5; f (5) =
.0378

15
The Hypergeometric
Distribution
• The binomial distribution is applicable when selecting from a
finite population with replacement or from an infinite population
without replacement.

• The hypergeometric distribution is applicable when selecting


from a finite population without replacement.
Hyper Geometric
Distribution
• Sampling without replacement from a finite population

• The number of objects in the population is denoted N.

• Each trial has exactly two possible outcomes, success and failure.

• Trials are not independent

• X is the number of successes in the n trials

• The binomial is an acceptable approximation, if N/10 > n Otherwise it is not.

17
The Hypergeometric Distribution
Example
• Different computers are checked from 10 in the department. 4 of the 10
computers have illegal software loaded.
• What is the probability that 2 of the 3 selected computers have illegal
software loaded?
• So, N = 10, n = 3, k = 4, X = 2

 k  N  k 
  4  
 X
6  n  X    (6 )
P ( X  2 )      2  1 (1
62)0

 N   1 0  0.3

 n   3 
• The probability that 2 of the 3 selected computers have
illegal software loaded is .30, or 30%.
Continuous Probability
Distributions
• A continuous random variable is a variable that can assume any value on
a continuum (can assume an uncountable number of values)
– thickness of an item
– time required to complete a task
– temperature of a solution
– height
• These can potentially take on any value, depending only on the ability to
measure precisely and accurately.
Continuous
Distributions

• Uniform
• Normal
• Exponential
The Uniform
Distribution
• The uniform distribution is a probability distribution that has equal
probabilities for all possible outcomes of the random variable

• Because of its shape it is also called a rectangular distribution


Uniform
Distribution
 1 for ax
b  a b 1
f (x)  
 0 ba
for all other f (x)
 values
Area = 1
a x b
Uniform Distribution: Mean and
Standard Deviation
M e a n
a + b
 =
2

Standard Deviation

ba
 
12
The Uniform
Distribution
Example: Uniform probability distribution over the range 2 ≤ X ≤ 6:

1
f(X) = 6 - 2 for 2 ≤ X ≤ 6
= .25
f(X
) a b 2 6
μ  
.25 2 2
 -4a) 2
(b (6 - 2) 2
σ  
2 6 X  12 12 1 .1547
Uniform Distribution
Example
 1 for 41  x 
f ( x)  47  41 47 1
6
 0 for all other values f 1

( x)

47  41

41
Area = 1 47 x
Uniform Distribution: Mean and
Standard Deviation
M e a n M e an

 = a + b
 =
4 1+ 4 7

88

44
Standard Deviation
2 2
Standard Deviation 2

ba 47  41 6  1.
   
732
12 12

3. 464
Uniform Distribution
Probability

P( x 1  X x ) x x
2 1
2
  ba 45  42 1

2
f (x) 47  41

45  42
P(42  X  45)47
  41 Area
= 0.5
1 2

41
47 x
Example : Uniform
Distribution
• Consider the random variable x representing the flight time of an airplane
traveling from Delhi to Mumbai.
• Suppose the flight time can be any value in the interval from 120 minutes
to 140 minutes.
• Because the random variable x can assume any value in that interval, x is a
continuous rather than a discrete random variable

29
Example : Uniform
Distribution contd….
• Let us assume that sufficient actual flight data are available to conclude
that the probability of a flight time within any 1-minute interval is the
same as the probability of a flight time within any other 1-minute interval
contained in the larger interval from 120 to 140 minutes.
• With every 1-minute interval being equally likely, the random variable x is
said to have a uniform probability distribution.

30
Uniform Probability Distribution for Flight time

31
Probability of a flight time
between 120 and
130 minutes

32
Exponential Probability

Distribution
The exponential probability distribution is useful in describing the time it
takes to complete a task.
• The exponential random variables can be used to describe:

Time required Distance between


Time between
to complete major defects
vehicle
a questionnaire in a highway
arrivals at a
toll booth
Exponential Probability

Distribution
Density Function

1
f ( x )  e 
x /

where:  = mean
e=
2.71828
Exponential Probability
Distribution
• Suppose that x represents the loading time for a truck at loading dock and
follows such a distribution.
• If the mean, or average, loading time is 15 minutes ( μ = 15),
the appropriate probability density function for x is
Exponential Distribution for the
loading Dock Example
Exponential Probability
Distribution
Cumulative
Probabilities
 xo /
P(x  x0 )  1 
e
where:
x0 = some specific value of x
Example: Exponential Probability Distribution

• The time between arrivals of cars at a Petrol pump follows an exponential

probability distribution with a mean time between arrivals of 3 minutes.

• The Petrol pump owner would like to know the probability that the time

between two successive arrivals will be 2 minutes or less.


Example: Petrol Pump
Problem

f(x
)
.4 P(x < 2) = 1 - 2.71828-2/3 = 1 - .5134 = 4866
.3
.2
.1
x
1 2 3 4 5 6 7 8 9 10
Time Between Successive Arrivals (mins.)
Relationship between the Poisson
and Exponential
Distributions
• The Poisson distribution
• provides an appropriate description of the number of occurrences
• per interval

•The exponential distribution provides an appropriate description of the


length of the interval between occurrences
Mean of Poisson and Mean of
Exponential Distributions
• Because the average number of arrivals is 10 cars per hour, the average
time between cars arriving is
42
The Normal Distribution:
Properties
• ‘Bell Shaped’
• Symmetrical f(X)
• Mean, Median and Mode are equal
• Location is characterized by the mean, μ σ
• Spread is characterized by the μ
standard deviation, σ
Mean = Median = Mode
• The random variable has an infinite
theoretical range: - to +
The Normal Distribution:
Density Function
The formula for the normal probability density function is

2
1  1  (X μ) 
f(X) e 2  
 2π
 constant approximated by 2.71828
Where e = the mathematical
π = the mathematical constant approximated by 3.14159
μ = the population mean
σ = the population standard deviation
X = any value of the continuous variable
Chap 6-44
The Normal
Distribution: Shape

By varying the parameters μ and σ, we obtain different normal


distributions

You might also like