430 likes | 506 Views
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. Continuous Random Variables. Probability Density Function (PDF) .
E N D
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 Continuous Random Variables Probability Density Function (PDF) Exponential distribution Probability density for separation of random independent events with constant rate Normal/Gaussian distribution mean standard deviation
Normal distributionConsider 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? • 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. Question from Derek Bruff
BUT: for normal distribution cannot integrate analytically. Instead use tables for standard Normal distribution: If , then
Why does this work? Change of variable The probability for X in a range around is for a distribution is given by The probability should be the same if it is written in terms of another variable . Hence i.e. change to N(0, 1) - standard Normal distribution
Use Normal tables for [also called ] 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.
Example: If Z ~ N(0, 1): (a) 888
(b) = 0.6915. =
(c) =
SymmetriesIf , which of the following is NOT the same as ? = - = - = -
(d) = 0.2417 =
(e) Between and Using interpolation Fraction of distance between1.35 and 1.36: = 0.6 = 0.4 =0.9125
(f) What is ? Use table in reverse: between 0.84 and 0.85 Interpolating as before 8 2 .
Using Normal tablesThe error (in Celsius) on a cheap digital thermometer has a normal distribution, with What is the probability that a given temperature measurement is too cold by more than C? • 0.0618 • 0.9382 • 0.1236 • 0.0735
Using Normal tablesThe error (in Celsius) on a cheap digital thermometer has a normal distribution, with That is the probability that a given temperature measurement is too cold by more than C? Answer: Want
(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 0.025+0.95 0.025 0.05/2=0.025 0.975
Use table in reverse: 95% of the probability is inthe range
P=0.025 P=0.025 In general 95% of the probability lies within of the mean The range is called a 95% confidence interval.
Question from Derek Bruff Normal distributionIf has a Normal distribution with mean and standard deviation , which of the following could be a graph of the pdf of ? • Too wide • OK • Wrong mean • Too narrow 1. 3. 2. 4.
Normal distributionIf has a Normal distribution with mean and standard deviation , which of the following could be a graph of the pdf of ? 1. 3. 2. 4. Too wide Correct Wrong mean Too narrow i.e. Mean at , 95% inside (5% outside) of i.e.
Example: Manufacturing variability The outside diameter, X mm, of a copper pipe is N(15.00, 0.022) and the fittings for joining the pipe have inside diameter Y mm, where Y ~ N(15.07, 0.0222). (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.022) and the fittings for joining the pipe have inside diameter Y mm, where Y ~ N(15.07, 0.0222). (i) Find the probability that X exceeds 14.99 mm. Answer: Reminder:
Example: Manufacturing variability The outside diameter, X mm, of a copper pipe is N(15.00, 0.022) and the fittings for joining the pipe have inside diameter Y mm, where Y ~ N(15.07, 0.0222). (ii) Within what range will X lie with probability 0.95? Answer From previous example i.e. lies in with probability 0.95
P=0.025 P=0.025 Where is the probabilityWe found 95% of the probability lies withinWhat is the probability that 15.04mm? • 0.025 • 0.05 • 0.95 • 0.975
Example: Manufacturing variability The outside diameter, X mm, of a copper pipe is N(15.00, 0.022) and the fittings for joining the pipe have inside diameter Y mm, where Y ~ N(15.07, 0.0222). (iii) Find the probability that a randomly chosen pipe fits into a randomly chosen fitting (i.e. X < Y). Answer For we want ). To answer this we need to know the distribution of , where and both have (different) Normal distributions
Distribution of the sum of Normal variates Means and variances of independent random variables just add. If are independent and each have a normal distribution 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 are constants then: E.g.
Example: Manufacturing variability The outside diameter, X mm, of a copper pipe is N(15.00, 0.022) and the fittings for joining the pipe have inside diameter Y mm, where Y ~ N(15.07, 0.0222). (iii) Find the probability that a randomly chosen pipe fits into a randomly chosen fitting (i.e. X < Y). Answer For we want ). Hence =
The outside diameter, X mm, of a copper pipe is N(15.00, 0.022) and the fittings for joining the pipe have inside diameter Y mm, where Y ~ N(15.07, 0.0222). Which of the following would make a random pipe more likely to fit into a random fitting? • Decreasing mean of Y • Increasing the variance of X • Decreasing the variance of X • Increasing the variance of Y Y X
The outside diameter, X mm, of a copper pipe is N(15.00, 0.022) and the fittings for joining the pipe have inside diameter Y mm, where Y ~ N(15.07, 0.0222). Which of the following would make a random pipe more likely to fit into a random fitting? Y X Answer Or use Common sense. Larger probability if - larger (bigger average gap between pipe and fitting) - smaller (less fluctuation in gap size) , so is smaller if variance of is decreased
Normal approximations Central Limit Theorem: If are independent random variables with the same distribution, which has mean and variance (both finite), then the sum tends to the distribution as . Hence: The sample mean 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: 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 individual weights.Assuming independent: by the central limit theorem i.e. Normal with , [usual caveat: people visiting the Eye unlikely to actually have independent weights, e.g. families, school trips, etc.]
Course FeedbackWhich best describes your experience of the lectures so far? • 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
Course FeedbackWhat do you think of clickers? • 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
Course FeedbackHow did you find the question sheets so far? • 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
Normal approximation to the Binomial If and is large and is not too near 0 or 1, then is approximately
Approximating a range of possible resultsfrom a Binomial distribution e.g. if [not always so accurateat such low !]
If what is the best approximation for?i.e. If , , , what is the best approximation for ?
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 variance . So if is the number of defective chips, approximately Hence This compares to the exact Binomial answer . 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.