Transcript Lecture 6: Normal distribution, central limit theorem
Stats for Engineers Lecture 6 Answers for Question sheet 1 are now online http://cosmologist.info/teaching/STAT/ Answers for Question sheet 2 should be available Friday evening
Summary From Last Time
π(β1.5 < π < β0.7)
Continuous Random Variables
Probability Density Function (PDF) π(π₯) π π β€ π β€ π = π π π π₯ β² ππ₯β² β ββ π π₯ ππ₯ = 1 π(π₯)
Exponential distribution
π π¦ = ππ βππ¦ , 0, π¦ > 0 π¦ < 0 Probability density for separation of random independent events with constant rate π
Normal/Gaussian distribution
π π π₯ = 1 2ππ 2 π β π₯βπ 2 2π2 (ββ < π₯ < β) π: mean π: standard deviation
Normal distribution
Question from Derek Bruff
Consider the continuous random variable X = the weight in pounds of a randomly selected new born baby. Suppose that X can be modelled with a normal distribution with mean ΞΌ = 7.57 and standard deviation π = 1.06. If the standard deviation were π = 1.26 instead, how would that change the graph of the pdf of X?
1.
2.
3.
4.
5.
6.
The graph would be narrower and have a greater maximum value.
The graph would be narrower and have a lesser maximum value.
The graph would be narrower and have the same maximum value.
The graph would be wider and have a greater maximum value.
The graph would be wider and have a lesser maximum value.
The graph would be wider and have the same maximum value.
12% 1 3% 2 0% 3 0% 4 5 3% 6
π β ββ π π₯ ππ₯ = 1
82%
π π < π < π = π π π π₯ ππ₯ BUT: for normal distribution cannot integrate analytically.
Instead use tables for standard Normal distribution: π π§ = 1 2π π βπ§ 2 2 If π βΌ π π, π 2 , then π = πβπ π βΌ π(0,1)
Why does this work?
Change of variable
The probability for X in a range ππ₯ around π₯ is for a distribution π(π₯) π π₯ ππ₯.
The probability should be the same if it is written in terms of another variable π¦ = π¦(π₯) . Hence π π₯ ππ₯ = π π¦ ππ¦ is given by π(π₯) β π π¦ = π π₯ ππ₯ ππ¦ .
i.e. change π₯ to π§ = π₯βπ π β π₯ = π + ππ§ β ππ₯ ππ§ = π β π π§ = π π₯ ππ₯ ππ§ = = π 2 2 1 2ππ 2 π β π₯βπ 2π 2 2 Γ π = 1 2π π βπ§ 2 2 ππ₯ N(0, 1) - standard Normal distribution
Use Normal tables for π = π(π < π§) [also called Ξ¦(π§) ] π§ Q z = π π β€ π§ = ββ π π₯ ππ₯ π = πβπ π βΌ π(0,1) πΈ π§
Outside of exams this is probably best evaluated using a computer package (e.g. Maple, Mathematica, Matlab, Excel); for historical reasons you still have to use tables.
0 β€ π β€ 3.59
πΈ z
Example :
If
Z
~ N(0, 1): (a) π π β€ 1.22 = Q 1.22
= 0.8
888
(b) π π > β0.5
= π π β€ 0.5
= Q(0.5) = 0.6915.
=
(c) π π β€ β1.0
= π(π β₯ 1.0) = 1 β π(π < 1.0) = 1 β Q 1.0 = 1 β 0.8413
= 0.1587
=
Symmetries
If π βΌ π(0,1) , which of the following is NOT the same as π(π < 0.7) ?
60%
1.
2.
3.
4.
1 β π(π > 0.7) π(π > β0.7) 1 β π(π > β0.7) 1 β π(π < β0.7)
10% 13% 1 2 3 17% 4
Symmetries
If π βΌ π(0,1) , which of the following is NOT the same as π(π < 0.7) ?
1 β π π > 0.7
π(π > β0.7) 1 β π(π > β0.7) 1 β π(π < β0.7) οΌ = οΌ = = οΌ
(d) π 0.5 < π < 1.5
= π π < 1.5 β π(π < 0.5) = Q 1.5 β Q(0.5) = 0.9332 β0.6915
= 0.2417
= β
(e) π π < 1.356
Between Q 1.35 = 0.9115
and Q 1.36 = 0.9131
Using interpolation Q 1.356 = A π 1.35 + B π(1.36) Fraction of distance between 1.35 and 1.36: π΅ = 1.356 β 1.35
1.36 β 1.35
= 0.6
π΄ = 1 β π΅ = 0.4
Q 1.356 = 0.4π 1.35 + 0.6π(1.36) =0.9125
(f) 0.8 = π π β€ π = Q(π) What is π ?
Use table in reverse: π§ between 0.84 and 0.85
Interpolating as before π = π΄ Γ 0.084 + π΅ Γ 0.085
0.8β0.7995
π΅ = 0.8023β0.7995
= 0.1
8 π΄ = 1 β π΅ = 0.8
2 β π = 0.82 Γ 0.084 + 0.18 Γ 0.085
β 0.0842
.
1. 0.0618
2. 0.9382
3. 0.1236
4. 0.0735
Using Normal tables
The error π (in Celsius) on a cheap digital thermometer has a normal distribution, with π βΌ π 0,1 .
What is the probability that a given temperature measurement is too cold by more than 1.54
β C?
43% 36% 19% 1.
2.
3.
2% 4.
Using Normal tables
The error π (in Celsius) on a cheap digital thermometer has a normal distribution, with π βΌ π 0,1 .
That is the probability that a given temperature measurement is too cold by more than 1.54
β C?
Answer
: Want π π < β1.54
= π(π > 1.54) = 1 β π(π < 1.54) = 1 β Q(1.54) = 1 β 0.9382 = 0.0618
=
(g) Finding a range of values within which π lies with probability 0.95: The answer is not unique; but suppose we want an interval which is symmetric about zero i.e. between βπ and π .
0.95
So π is where Q π = 0.975
0.025+0.95
βπ 0.025
π 0.05/2=0.025
0.975
π
Use table in reverse: Q π = 0.975
β π = 1.96
95% of the probability is in the range β1.96 < π < 1.96
In general 95% of the probability lies within 1.96π of the mean π P=0.025
P=0.025
The range π Β± 1.96π is called a 95%
confidence interval
.
Question from Derek Bruff
Normal distribution
If π has a Normal distribution with mean π = 20 and standard deviation π = 4 , which of the following could be a graph of the pdf of π ?
1.
2.
3.
4.
45% 20% 32% 1 2 2% 3 4
1.
Normal distribution
If π has a Normal distribution with mean π = 20 and standard deviation π = 4 , which of the following could be a graph of the pdf of π ?
2.
3.
4.
Too wide Correct Wrong mean i.e. Mean at π = 20 , 95% inside (5% outside) of π Β± 2π, i.e. 20 Β± 8 Too narrow
Example : Manufacturing variability
The outside diameter, X mm, of a copper pipe is N(15.00, 0.02
2 ) and the fittings for joining the pipe have inside diameter Y mm, where Y ~ N(15.07, 0.022
2 ).
(i) Find the probability that X exceeds 14.99 mm.
(ii) Within what range will X lie with probability 0.95?
(iii) Find the probability that a randomly chosen pipe fits into a randomly chosen fitting (i.e. X < Y).
Y X
Example : Manufacturing variability
The outside diameter, X mm, of a copper pipe is N(15.00, 0.02
2 ) and the fittings for joining the pipe have inside diameter Y mm, where Y ~ N(15.07, 0.022
2 ).
(i) Find the probability that X exceeds 14.99 mm.
Answer
: π βΌ π π, π 2 = π(15.0, 0.02
2 ) π π > 14.99 = π π > 14.99 β 15.0
0.02
= π π > β0.5
= π π < 0.5 = π(0.5) β 0.6915
Reminder: π β π π = π
Example : Manufacturing variability
The outside diameter, X mm, of a copper pipe is N(15.00, 0.02
2 ) and the fittings for joining the pipe have inside diameter Y mm, where Y ~ N(15.07, 0.022
2 ).
(ii) Within what range will X lie with probability 0.95?
Answer
From previous example π β1.96 < π < 1.96 = 0.95
i.e. π lies in π Β± 1.96π with probability 0.95
β π = 15 Β± 1.96 Γ 0.02
β 14.96mm < π < 15.04mm
1. 0.025
2. 0.05
3. 0.95
4. 0.975
Where is the probability
We found 95% of the probability lies within 14.96mm < π < 15.04mm
What is the probability that π > 15.04mm?
P=0.025
71% 1.
14% 2.
4% 3.
11% 4.
P=0.025
Example : Manufacturing variability
The outside diameter, X mm, of a copper pipe is N(15.00, 0.02
2 ) and the fittings for joining the pipe have inside diameter Y mm, where Y ~ N(15.07, 0.022
2 ).
(iii) Find the probability that a randomly chosen pipe fits into a randomly chosen fitting (i.e. X < Y).
Answer
For π < π we want π(π β π > 0 ). To answer this we need to know the distribution of π β π , where π have (different) Normal distributions and π both
Distribution of the sum of Normal variates
Means and variances of independent random variables just add. If π 1 , π 2 , β¦ , π π π π π , , π π 2 are independent and each have a normal distribution π π βΌ β π π 1 +π 2 = π π 1 + π π 2 π 2 π 1 +π 2 = π 2 π 1 + π 2 π 2 Etc.
A special property of the Normal distribution is that the distribution of the sum of Normal variates is also a Normal distribution. [stated without proof] If π 1 , π 2 , β¦ , π π are constants then: π 1 π 1 + π 2 π 2 + β― π π π π βΌ π(π 1 π 1 + β― + π π π π , π 1 2 π 2 + π 2 2 π 2 + β― + π 2 π π 2 )
E.g.
π 1 + π 2 βΌ π(π 1 + π 2 , π 1 2 + π 2 2 ) π 1 β π 2 βΌ π(π 1 β π 2 , π 1 2 + π 2 2 )
Example : Manufacturing variability
The outside diameter, X mm, of a copper pipe is N(15.00, 0.02
2 ) and the fittings for joining the pipe have inside diameter Y mm, where Y ~ N(15.07, 0.022
2 ).
(iii) Find the probability that a randomly chosen pipe fits into a randomly chosen fitting (i.e. X < Y).
Answer
For π < π we want π(π β π > 0 ). π β π βΌ π π π β π π , π π 2 + π π 2 = π 15.07 β 15,0.02
2 + 0.022
2 = π(0.07,0.000884) Hence π π β π > 0 = π π > 0β0.07
0.0.000884
= π π > β2.35
= π π < 2.35
= β 0.991
Which of the following would make a random pipe more likely to fit into a random fitting?
The outside diameter, X mm, of a copper pipe is N(15.00, 0.02
2 ) and the fittings for joining the pipe have inside diameter Y mm, where Y ~ N(15.07, 0.022
2 ).
Y X
1. Decreasing mean of Y 2. Increasing the variance of X 3. Decreasing the variance of X 4. Increasing the variance of Y
55% 16% 14% 16% 1 2 3 4
Which of the following would make a random pipe more likely to fit into a random fitting?
The outside diameter, X mm, of a copper pipe is N(15.00, 0.02
2 ) and the fittings for joining the pipe have inside diameter Y mm, where Y ~ N(15.07, 0.022
2 ).
Y
Answer
Common sense. Or use π = π β π βΌ π π π β π π , π π 2 + π 2 π π π < π = π π > 0 = π π > 0 β π π π π = π π < π π π π Larger probability if π π larger (bigger average gap between pipe and fitting) π π smaller (less fluctuation in gap size) π π 2 = π π 2 + π π 2 , so π π is smaller if variance of π is decreased X
Normal approximations
Central Limit Theorem: If π 1 , π 2 same distribution, which has mean sum π π=1 π π β¦ are independent random variables with the π and variance π 2 tends to the distribution π(ππ, ππ 2 ) as (both finite), then the π β β .
Hence: The sample mean π π(π, π 2 π )
.
= 1 π π π=1 π π is distributed approximately as For the approximation to be good, n has to be bigger than 30 or more for skewed distributions, but can be quite small for simple symmetric distributions. The approximation tends to have much better fractional accuracy near the peak than in the tails: donβt rely on the approximation to estimate the probability of very rare events.
It often also works for the sum of non-independent random variables, i.e. the sum tends to a normal distribution (but the variance is harder to calculate)
Example
: Average of n samples from a uniform distribution:
Example:
The mean weight of people in England is ΞΌ=72.4kg, with standard deviation π = 15kg.
The London Eye at capacity holds 800 people at once.
What is the distribution of the weight of the passengers at any random time when the Eye is full?
Answer:
The total weight π of passengers is the sum of Assuming independent: π = 800 individual weights.
β by the central limit theorem π βΌ π(ππ, ππ 2 ) π = 15Kg, π = 800 β π βΌ π 800 Γ 72.4kg, 800 Γ 15 2 kg 2 = π(58000kg, 180000kg 2 ) i.e. Normal with π π = 58000Kg , π π = 180000Kg = 424Kg [usual caveat: people visiting the Eye unlikely to actually have independent weights, e.g. families, school trips, etc.]
Course Feedback Which best describes your experience of the lectures so far?
1.
2.
3.
4.
5.
6.
7.
8.
Too slow Speed OK, but struggling to understand many things Speed OK, I can understand most things A bit fast, I can only just keep up Too fast, I donβt have time to take notes though I still follow most of it Too fast, I feel completely lost most of the time I switch off and learn on my own from the notes and doing the questions I canβt hear the lectures well enough (e.g. speech too fast to understand or other people talking) Stopped prematurely, not many answers
31% 38% 13% 13% 6% 0% 1 2 3 4 5 0% 6 7 0% 8
Course Feedback What do you think of clickers?
1.
2.
3.
4.
5.
I think they are a good thing, help me learn and make lectures more interesting I enjoy the questions, but donβt think they help me learn I think they are a waste of time I think they are a good idea, but better questions would make them more useful I think they are a good idea, but need longer to answer questions
65% 1 7% 2 2% 3 14% 12% 4 5
Course Feedback How did you find the question sheets so far?
1.
2.
3.
4.
5.
Challenging but I managed most of it OK Mostly fairly easy Had difficulty, but workshops helped me to understand Had difficulty and workshops were very little help Iβve not tried them
47% 20% 14% 16% 1 4% 2 3 4 5
Normal approximation to the Binomial
If π βΌ π΅(π, π) and π π ππ, ππ 1 β π .
is large and ππ is not too near 0 or 1, then π is approximately 1 π = 2 π = 10 1 π = 2 π = 50
p=0.5
p=0.5
Approximating a range of possible results from a Binomial distribution e.g
. π(6 or fewer heads tossing a coin 10 times) = π(π β€ 6) if π βΌ π΅(10,0.5) π π β€ 6 = π π = 0 + π π = 1 + β― + π π = 6 = 0.8281
6.5
π β β ββ π₯βπ 2π 2 2ππ 2 2 = Q 6.5 β π π β Q 1.5
2.5
= Q 0.9487 = 0.8286
π = ππ = 5 π 2 = ππ 1 β π = 2.5
[not always so accurate at such low π !]
If π βΌ π(π, π 2 ) what is the best approximation for π(3 or more heads when tossing a coin 10 times) ?
i.e. If π βΌ π΅(10,0.5) , π = 5 , π 2 = ππ 1 β π = 2.5
, what is the best approximation for π(π β₯ 3) ?
1.
2.
3.
π(π > 2.5) π(π > 3) π(π > 3.5)
60% 13% 27% 1 2 3
Quality control example
:
The manufacturing of computer chips produces 10% defective chips. 200 chips are randomly selected from a large production batch. What is the probability that fewer than 15 are defective?
Answer
: mean ππ = 200 Γ 0.1 = 20 variance ππ 1 β π = 200 Γ 0.1 Γ 0.9 = 18 . So if π is the number of defective chips, approximately π βΌ π 20,18 .
Hence π π < 15 β π π < 14.5 β 20 18 = π π < β1.296 = 1 β π π < 1.296
= 1 β [0.9015 + 0.6 Γ 0.9032 β 0.9015 ] β 0.097
This compares to the exact Binomial answer 14 π=0 πΆ π π π π 1 β π πβπ β 0.093
. The Binomial answer is easy to calculate on a computer, but the Normal approximation is much easier if you have to do it by hand. The Normal approximation is about right, but not accurate.