Download - En505 engineering statistics student notes

Transcript
Page 1: En505 engineering statistics student notes

EN505 Engineering StatisticsFernando Tovia, Ph.D.

1 RANDOM VARIABLES AND PROBABILITY

1.1 Random Variables

Definition 1.1 A random experiment is an experiment such that the outcome cannot be predicted in advance with absolute precision.Definition 1.2 The set of all possible outcomes of a random experiment is called the sample space. The sample space is denoted by Ω. An element of the sample space is denoted by ω.Example 1.1 Construct the sample space for each of the following random experiments:1. flip a coin2. toss a die3. flip a coin twice

Definition 1.3 A subset of Ω is called an event. Events are denoted by italicized, capital letters.Example 1.2 Consider the random experiment consisting of tossing a die. Describe the following events.

1. A = the event that 2 appears

2. B = the event that an even number appears

3. C = the event that an odd number appears

4. D = the event that a number appears

5. E = the event that no number appears

The particular set that we are interested in depends on the problem being considered. However, a good thing to do when beginning any probability modeling problem is to clearly define all the events of interest.One graphical method of describing events defined on a sample space is the Venn diagram. The representation of an event using a Venn diagram is given in Figure 1.1 Note that the rectangle corresponds to the sample space, and the shaded region corresponds to the event of interest.

Figure 1.1 Venn Diagram for Event A

1

Page 2: En505 engineering statistics student notes

Definition 1.4 Let A and B be two event defined on a sample space Ω. A is a subset of B, denoted by A B, if an only if (iff), ω A, ω B. (Figure 1.2)

Figure 1.2 Venn Diagram for A BDefinition 1.5 Let A be an event defined on a sample space Ω. ω Ac iff ω A. Ac is called the complement of A. (Figure 1.3)

Figure 1.3 Venn Diagram for Ac

Definition 1.6 Let A and B be two events defined on the sample space Ω. ω A B iff ω A or ω B (or both). A B is called the union of A and B (see Figure 1.4).

Figure 1.4 Venn Diagram for A B

Let {A1, A2, …} be a collection of events defined on a sample space.

iff some j = 1, 2, … ω Aj

is called the union of {A1, A2, …}

Definition 1.7 Let A and B be two events defined on the sample space Ω. ω A B iff ω A and ω B. A B is called the intersection of A and B (see Figure 1.5).

Figure 1.5 Venn Diagram for Let {A1, A2, …} be a collection of events defined on a sample space.

iff ω A j = 1, 2, …

is called the intersection of {A1, A2, …}

Example 1.3 (example 1.2 continued) 1. Bc = C

2

Page 3: En505 engineering statistics student notes

2. B C = D

3. A B = B

Theorem 1.1 Properties of ComplementsLet A be an event defined on a sample space Ω. Then

(a)(b)

Theorem 1.2 Properties of the UnionsLet A, B, C be events defined on a sample space Ω. Then(a)(b)(c) (d)(e)Example Prove Theorem 1.2 (c)

Theorem 1.3 Properties of the IntersectionLet A, B, and C be events defined on the sample space Ω. Then(a)(b)(c) (d)(e)

Example 1.6 Prove theorem 1.3 (b)

3

Page 4: En505 engineering statistics student notes

Theorem 1.4 Distribution of Union and IntersectionLet A, B and C be events defined in the sample space Ω. Then

(a) A ∩ (B C) = (A ∩ B) (A∩C)

(b) A (B ∩ C) = (A B) ∩ (A C)

Theorem 1.5 DeMorgan’s LawLet A, B and C be events defined in the sample space Ω. Then

(a) (A B)c = Ac ∩ Bc

(b) (A ∩ B) c = Ac Bc

Definition 1.8 Let A and B be two events defined in the sample space Ω. A and B are said to be mutually exclusive or disjoint iff A ∩ B = Ø (Figure 1.6). A collection of events {A1, A2, … }, defined on a sample space Ω, is said to be disjoint iff every pair of events in the collection is mutually exclusive.

Figure 1.6 Venn Diagram for Mutually Exclusive EventsDefinition 1.9 A collection of events {A1, A2, …, An} defined on a sample space Ω, is said to be a partition (Figure 1.7) of Ω iff

(a) the collection is disjoint

(b)

Figure 1.7 Venn Diagram for a PartitionExample 1.7 (Example 1.2 continued) Using the defined event, identify:

(a) a set of mutually exclusive events

(b) a partition of the sample space

4

Page 5: En505 engineering statistics student notes

Definition 1.10 A collection of events, F, defined on a sample space Ω, is said to be a field iff

(a) Ω F,

(b) if A Ω F, then Ac F, then

F,

We use fields to represent all the events that we are interested in study. To construct a field:

1. we start with Ω

2. Ø is inserted by implication (Definition 1.10 (b)

3. we then add the events of interest

4. we then add complements and unions

Example 1.8 Suppose we perform a random experiment which consists of observing the type of shirt worn by the next person entering a room. Suppose we are interested in the following events.

L = the shirt that has long sleevesS = the shirt has short sleevesN = the shirt has no sleeves

Assuming that {L, S, N} is a partition of Ω, construct an appropriate field

Theorem 1.6 Intersection are in FieldsLet F be a field of events defined in the sample space Ω. Then if A1, A2, … , An F, then

F

Example 1.9 Prove that if A, B F, then A ∩ B F.

5

Page 6: En505 engineering statistics student notes

Any meaningful expression containing events of interest, , ∩, and c can be shown to be in the field.Definition 1.11 Consider a set of elements, such as S = {a, b, c}. A permutation of the elements is an ordered sequence of elements. The number of permutations of n different elements is n! where

n! = n x (n-1) x (n-2) x …x 2 x 1Example 1.10 List all the permutations of the elements S

Definition 1.12 The number of permutations of subsets of r elements selected from a set of n different elements is

Another counting problem of interest is the number of subsets of r elements that can be selected from a set of n elements. Here the order is not important, and are called combinations.Definition 1.13 The number of combinations, subsets of size r that can be selected from a set of n elements, is denoted as

Example 1.11 The EN505 class has 13 students. If teams of 2 students can be selected, how many different teams are possible?

1.2 Probability

Probability is used to quantify the likelihood, or chance, that an outcome of a random experiment will occur.

Definition 1.14 A random variable is a real-valued function defined on a sample space. Random variables are typically denoted by italicized capital letters. Specific values taken on by a random variable are typically denoted by italicized, lower-case letters.

Definition 1.15 A random variable that can take on a countable number of values is said to be a discrete random variable.

Definition 1.16 A random variable that can take on an uncountable number of values is said to be a continuous random variable.

6

Page 7: En505 engineering statistics student notes

Definition 1.17 The set of possible values for a random variable is referred as a range of a random variable. Example 1.12 Consider the following experiments of random variables, define the random variable, identify the range for each random variable, and classify it as discrete or continuous.

1. flip a coin

2. toss a die until a 6 appears

3. quality inspection of a shipment of manufactured items.

4. arrival of customer to a bank

Definition 1.18 Let Ω be the random space for some random experiment. For any event defined on Ω, Pr(·) is a function which assigns a number to the event. Pr(A) is called the probability of event A provided the following conditions hold:

(a)

(b)

(c)

Probability is used to quantify the likelihood, or chance, that an event will occur within the sample space.

7

Page 8: En505 engineering statistics student notes

Whenever a sample consists of N possible outcomes , the probability of each outcome is 1/N

Theorem 1.7 Probability Computational RulesLet A and B events defined on a sample space Ω, and let {A1, A2, …, An} be a collection of events defined on Ω. Then

(a)

(b)

(c)

(d)

(e)

(f)

Corollary 1.1 Union of Three or More EventsLet A, B, C and D be events defined on a sample space Ω. Then,

and

Example 1.11 Let A, B and C be events defined on a sample space Ω Pr(A) = 0.30Pr(Bc) = 0.60Pr(C) = 0.20Pr(A B) = 0.50Pr(A and C are mutually exclusive

Compute the following probabilities

(a) Pr(B)

8

Page 9: En505 engineering statistics student notes

(b)

(c)

(d)

(e)

(f)

(g)

1.3 Independence

Two events are independent if any one of the following equivalent statements is true

9

Page 10: En505 engineering statistics student notes

(1) P(A|B) = P(A)

(2) P(B|A) = P(B)

(3)

Example 2.29 (book work in class)

1.4 Conditional Probability

Definition 1.19. Let A and B events define on a sample space Ω B ≠ Ø. We refer to Pr(A|B) as the conditional probability of event given the occurrence of event B, where

B) = probability of not A given B

10

Page 11: En505 engineering statistics student notes

note that Pr(A|Bc) ≠ 1-Pr(A|B)

Example 1.12A semiconductor manufacturing facility is controlled in a manner such that 2% of manufactured chips are subjected to high levels of contamination. If a chip is subjected to high levels of contamination, there is a 12% chance that it will fail testing. What is the probability that a chip is subjected to high levels of contamination and fails upon tests?

c =

f =

Pr(High c level) =

Pr(Fail | high c level) =

Pr(F∩C) =

Example 1.13 An air quality test is designed to detect the presence of two molecules (molecule 1 and molecule 2). 17% of all samples contain both molecules, and 48% of all samples contain molecule 1. If a sample contains molecule 1, what is the probability that it also contains molecule 2?

M1 = molecule 1M2 = molecule 2

Pr(M1∩M2) =

Pr(M1) =

Pr(M2|M1) =

Theorem 1.8 Properties of Conditional Probability

Let A and B be non-empty event defined on a sample space Ω. Then

(a) If A and B are mutually exclusive then Pr(A|B) = 0

(b) If A then Pr(A|B)>=Pr(A)

11

Page 12: En505 engineering statistics student notes

(c) If B then Pr(A|B) =1

Theorem 1.9 Law of Total Probability – Part 1

Let A and B be events defined on a sample space Ω A ≠ Ø, B ≠ Ø, Bc ≠ Ø. Then

Example 1.15 A certain machine’s performance can be characterized by the quality of a key component. 94% of machines with a defective key component will fail. Whereas only 1% of machines with a non-defective key component will fail. 4% of machines have a defective key component. What is the probability that the machine will fail?

F = failD = defective

Pr(D) =

Pr(F|D) =

Pr(F|Dc) =

Pr(F) =

Theorem 1.11 Bayes’ Theorem – Part 1

Let A and B be events defined on a sample space Ω A ≠ Ø, B ≠ Ø, Bc ≠ Ø. Then

Example 1.15 (Example 1.14 continues) Suppose the machine fails. What is the probability that the key component was defective?

Pr(D|F) =

12

Page 13: En505 engineering statistics student notes

Theorem 1.12 Law of Total Probability – Part 2

Let A be a non-empty event defined on a sample space Ω, and let {B1, B2, …, Bn}be a partition of Ω Bj ≠ Ø j =1, 2, …, n. Then

Theorem 1.13 Bayes’ Theorem – Part 2

Let A be a non-empty event defined on a sample space Ω, and let {B1, B2, …, Bn}be a partition of Ω Bj ≠ Ø j =1, 2, …, n. Then

13

Page 14: En505 engineering statistics student notes

14

Page 15: En505 engineering statistics student notes

2 DISCRETE RANDOM VARIABLES AND PROBABILITY

DISTRIBUTIONS

A discrete random is a random variable that can take on at most countable number of values.

Definition 2.1 Let X be a discrete random variable having cumulative distribution function F. Let x1, x2 , ... denote the possible values of X. Then f(x) is the probability mass function (pmf) of X, if

a) f(x) = P(X = x)

b) f(xj) > 0, j = 1, 2, …

c) f(x) = 0, if x = xj, j = 1, 2,

d)

Definition 2.2 The cumulative distribution function of a discrete random variable X, is

denoted by F(X), and is given by

F(X) =

And satisfies the following properties

a) F(X) = P(X ≤ x) =

b) 0 ≤ F( X ) ≤ 1

c) if x ≤ y then F( X ) ≤ F( Y )

Example 2.1 Suppose X is a discrete random variable having pmf f and cmf F, wheref(1) = 0.1, f(2) = 0.4, f(3) = 0.2, f(4) = 0.3.

1. Construct the cumulative distribution function of X.

15

Page 16: En505 engineering statistics student notes

2. Compute Pr(X ≤ 2).

3. Compute Pr(X < 4).

4. Compute Pr(X ≥ 2).

Definition 2.3 The mean or expected value of X, denoted as µ or E(X), is

The variance of X, denoted by Var (X) and given by

The standard deviation of X is

Definition 2.4 Let X be a discrete random variable with a probability mass function f(x). The expected value of X is denoted by E(X) and given by

2.1 Discrete Distributions

2.1.1 Discrete Uniform Distribution

Suppose a random experiment has a finite set of equally likely outcomes. If X is a random variable such that there is one-to-one correspondence between the outcomes and the set of integers {a, a + 1, … , b}, then X is a discrete uniform random variable having parameters a and b.Notation

Range

Probability Mass Function

16

Page 17: En505 engineering statistics student notes

Parameters

Mean

Variance.

Example 2.2 Let X ~ DU(1, 6).

1. Compute Pr(X = 2).

2. Compute Pr(X > 4)

2.1.2 The Bernoulli Random Variable

Consider a random experiment that either “succeeds” or “fails”. If the probability of success is p, and we let X = 0 if the experiment fails and X = 1 if it succeeds, then X is a Bernoulli random variable with probability p. Such a random experiment is referred to as a Bernoulli trial.

Notation

Range

Probability Mass Function

Parameter

17

Page 18: En505 engineering statistics student notes

Mean

Variance

2.1.3 The Binomial Distribution

The binomial distribution denotes the number of success in n independent Bernoulli trials with probability p of success on each trial.Notation

Range

Probability Mass Function

Cumulative Distribution Function

Parameters

Mean

Variance

Comments if n = 1, then X ~ Bernoulli(p)

18

Page 19: En505 engineering statistics student notes

Example 2.3 Each sample of air has a 10% chance of containing a particular rare molecule.

1. Find the probability that in the next 18 samples, exactly 2 contains the rare molecule.

2. Determine the probability that at least four samples contain the rare molecule

3. Determine the probability that there will be at least one sample with the rare molecule but less than four?

2.1.4 The Negative Binomial Random Variable

The negative binomial random variable denotes the number of trials until the kth

success in a sequence of independent Bernoulli trials with probability p of success on each trial.

Notation

Range

Probability Mass Function

19

Page 20: En505 engineering statistics student notes

Cumulative Distribution Function

Parameters

Mean

Variance

Example 2.4 A high-performance aircraft contains three identical computers. Only one is used to operate the aircraft; the other two are spares that can be activated in case the primary system fails. During one hour of operation, the probability of a failure in the primary computer is 0.0005.

1. Assuming that each hour represents an independent trial, what is the mean time to failure of all the three components?

3. What is the probability that all three computers fail within a 5-hour flight?

20

Page 21: En505 engineering statistics student notes

Comments: If k = 1, then X ~ geom(p), i.e. X is a geometric random variable having a probability of success p

2.1.5 The Geometric Distribution

In a series of independent Bernoulli trials, with constant probability p of a success, let the random variable X denote the number of trials until the first success. Then X has a geometric distribution.

Notation

Range

Probability Mass Function

Cumulative Distribution Function

Parameters

Mean

Variance

Example 2.3 Consider a sequence of independent Bernoulli trials with a probability of success p = 0.2 for each trial.

(a) What is the expected number of trials to obtain the first success?

21

Page 22: En505 engineering statistics student notes

(b) After the eight successes occurs, what is the expected number of trials to obtain the ninth success?

2.1.6 The Hypergeometric Random Variable

Consider a population consisting of N members, K of which are denoted as successes. Consider a random experiment during which n members are selected random from the population, and let X denote the number of successes in the random sample. If the members in the sample are selected from the population without replacement, then X is a hypergeometric random variable having parameters N, k and n.

Notation

Range

Probability mass function

Parameters

22

Page 23: En505 engineering statistics student notes

Comments If the sample is taken from the population with replacement, then X~bin(n,K/N). Therefore, if n<<N, we can use the approximation bin(n,K/N) ≈ HG(N, K, n).

Example 2.4 Suppose a shipment of 5000 batteries is received, 150 of them being defective. A sample of 100 is taken from the shipment without replacement. Let X denote the number of defective batteries in the sample.

1. What kind of random variable is X, and what is the range of X?

2. Compute Pr(X = 5).

3. Approximate Pr(X = 5) using the binomial approximation to the hypergeometric.

2.1.7 The Poisson Random Variable

The Poisson random variable denotes the number of events that occurs in an interval of length t when events occur at a constant average rate λ.Notation

23

Page 24: En505 engineering statistics student notes

Probability Mass Function

Cumulative Distribution Function

Parameters

CommentsThe Poisson random variable X equals the number of counts in the time interval t. The counts in each subinterval is independent of other subinterval.

If np>5 or (1-p) > 5, then we can use the approximation, Poisson ≈ bin (n, p).

Mean

Variance

It is important to use consistent units in the calculations of probabilities, means, and variances involving Poisson random variable.

Example 2.5 Contamination is a problem in the manufacture of optical storage disks. The number of particles of contamination that occur on an optical disk has a Poisson

24

Page 25: En505 engineering statistics student notes

distribution, and the average number of particles per centimeter squared of media surface is 0.1. The area of a disk under study is 100 squared centimeters.

a) Find the probability that 12 particles occur in the area of a disk under study.

b) Find the probability that zero particles occur in the area of the disk under the study.

c) Find the probability that 12 or fewer particles occur in the area of a disk

under study.

2.1.8 Poisson Process

Up to this time in the course, we have discussed the assignment of probabilities to events and random variables, and by manipulating these probabilities we can analyze “snap-shots” of systems behavior at certain point in the time, or under certain conditions. Now, we are going to study one of the most commonly recognized continuous-time stochastic processes that allow us to study important aspects of systems behavior over a time interval t.

Definition 2.5 Let {N(t), t≥ 0} be a counting process. Then, {N(t), t≥ 0}is said to be a Poisson process having rate λ, λ > 0, iff

a.

25

Page 26: En505 engineering statistics student notes

start counting from zero

b.The number of outcomes occurring in one time or (specific region) is independent of the number that occurs in any other disjoint time interval or region space, which can be interpreted that the Poisson process has no memory.

c. the number of events in any interval (s, s + t) is a Poisson random variable with mean λt.

d. The probability that more that more than one outcome will occur at the same time is negligible.

This is denoted by N(t) ~ PP(λ), which λ refers to the average rate at which events occur.The part (c) of the definition implies that

1)

2)

4)

Note that in order to be a Poisson proves the average event occurrence MUST BE CONSTANT over time, otherwise the Poisson process would be an inappropriate model. Also note, that t can be interpreted as the specific “time”, “distance”, “area”, “volume” of interest.

Example 2.6 Customers arrive to a facility according to a Poisson process with rate λ = 120 customer per hour. Suppose we begin observing the facility at some point in time.

a) What is the probability that 8 customers arrive during a 5-minute interval?

26

Page 27: En505 engineering statistics student notes

b) On average, how many customers will arrive during a 3.2-minute interval?

c) What is the probability that more than 2 customers arrive during a 1-minute interval?

d) What is the probability that 4 customers arrive during the interval that begins 3.3 minutes after we start observing and ends 6.7 minutes after we start observing?

e) On average, how many customers will arrive during the interval that begins 16 minutes after we start observing and ends 17.8 minutes after we start observing?

f) What is the probability that 7 customers arrive during the first 12.2 minutes we observe, given that 5 customers arrive during the first 8 minutes?

27

Page 28: En505 engineering statistics student notes

g) If 3 customers arrive during the first 1.2 minutes of our observation period, on average, how many customers will arrive during the first 3.7 minutes?

h) If 1 customer arrives during the first 6 seconds or our observations, what is the probability that 2 customers arrive during the interval that begins 12 seconds after we observing and ends 30 seconds after we start observing?

i) If 5 customers arrive during the first 30 seconds of our observations, on average, how many customers will arrive during the interval that begins 1 minute after we start observing and ends 3 minutes after we start observing?

28

Page 29: En505 engineering statistics student notes

j) If 3 customers arrive during the interval that starts 1 minute after we start observing and ends 2.2 minutes after we start observing, on average, how many customers will arrive during the first 3.7 minutes?

Example 2.7 (Binomial approximation)In a manufacturing process where glass products are produced, defects or bubbles occur, occasionally rendering the piece undesirable for marketing. It is known that, on average, 1 in every 1000 of these items produced has one or more bubbles. What is the probability that a random sample of 8000 will yield fewer than 7 items possessing bubbles?

29

Page 30: En505 engineering statistics student notes

3 CONTINUOUS RANDOM VARIABLES AND

PROBABILITY DISTRIBUTIONS

As stated earlier, a continuous random variable is a random variable that can take on an uncountable number of values. Definition 3.1 The probability density function of a continuous random variable X is a nonnegative function f(x) defined real x for any set A of real numbers

Theorem 3.1 Integral of a Density FunctionThe function f is a density function iff

All probability computations for a continuous random variable can be answered using the density function.Theorem3.2 Probability Computational Rules for Continuous Random VariablesLet X be a continuous random variable having cumulative distribution function F and probability density function f. Then

(a)

(b)

(c)

30

Page 31: En505 engineering statistics student notes

(d)

(e)

The mean or expected value of X, denoted as µ or E(X), is

The variance of X, denoted by Var (X) and given by

Example 3.1 Consider a continuous random variable X having the following density function where c is a constant

1. What is the value of c?

2. Construct the cumulative distribution function of X.

31

Page 32: En505 engineering statistics student notes

3. Compute Pr(0.2< X ≤ 0.8) =

4. Compute Pr(X >0.5) =

Part (d) of Theorem 1.3.2 states that the probability density function is the derivative of the cumulative distribution function. Altough this is true, it does not provide adequate intuition as to the interpretation of the density function. For a discrete random variable, the probability mass function actually assigned probabilities to the possible values of the random variables. Theorem 1.3.2 (b) states that the probability of any specific value for a continuous random variable is 0. The probability density function is not the probability of a specific value. It is, however, the relative likelihood ((as compared to other possible values) that the random variable will be near a certain value.Continuous random variables are typically specified in terms of the form of their probability density functions. In addition, some continuous random variables have been widely-used in probability modeling. We will consider some of these more commonly-used random variables, including:

1. the uniform random variable,

2. the exponential random variable,

3. the gamma random variable,

4. the Weibull random variable,

5. the normal random variable,

6. the lognormal random variable,

7. the beta random variable,

3.1 The Uniform Continuous Random Variable

Notation

Range

Probability Density Function

32

Page 33: En505 engineering statistics student notes

Cumulative Distribution Function

Parameters

Mean

Variance

Comments As its name implies, the uniform random variable is used to represent quantities that occur randomly over some interval of the real line.An observation of a U(0,1) random variable is referred to as a random number.Example 3.2 Verify that the equation for the cumulative distribution of the uniform random variable is correct.

Example 3.3 The magnitude (measured in N) of a load applied to a steel beam is believed to be a U(2000, 5000) random variable. What is the probability that the load exceeds 4200 N?

33

Page 34: En505 engineering statistics student notes

3.2 The exponential Random

The random variable X that equal the distance (time) between successive counts of a Poisson process with mean λ (rate, events per time unit, i.e. arrivals per hour, failures per day, etc.) has an exponential distribution with parameter λ.

Notation

Range

Probability Density Function

Cumulative Distribution Function

Parameters

Mean

Variance

Comments λ is called the rate of the exponential distribution.

34

Page 35: En505 engineering statistics student notes

Example 3.4 In a large computer network, user log-ons to the system can be modeled as a Poisson process with a mean of 25 logs-on per hour. What is the probability that there are no log-ons in an interval of 6 minutes?

What is the probability that the time until the next log-on is between 2 and 3 minutes? Upon converting all units to hours,

Determine the interval of time that the probability that no log-on occurs in the interval is 0.90. Te question asks for the length of time x such that Pr(X>x) = 0.90.

What is the mean time until the next log-on?

What is the standard deviation of the time until the next log-on?

35

Page 36: En505 engineering statistics student notes

Theorem 3.3 The Memoryless Property of the Exponential DistributionLet X be a continuous random variable. The X is an exponential random variable iff

Theorem 3.4 The Conditional Form of the Memoryless PrpertyLet X be a continuous random variable. Then X is an exponential random variable iff

Furthermore, no other continuous random variable possesses this property.There are several implications of the memoryless property of the exponential random variable.

First, if the exponential random variable is used to model the lifetime of a

device, then at every point in time until it fails, the device is as good as

new (from a probabilistic standpoint).

If the exponential random variable is used to model an arrival time, then at

every point in time until the arrival occurs, it is as just began “waiting” for

the arrival.

Example 3.5 Suppose that the life length of a component is an exponential random variable with rate 0.0001. Note that time units are hours. Determine the following.

a) What is the probability that the component lasts more than 2000 hours?

b) Given that the component lasts at least 1000 hours, what is the probability that

it lasts more than 2000 hours?

36

Page 37: En505 engineering statistics student notes

Theorem 3.5 Expectation under the Memoryless PropertyLet X be an exponential random variable. Then

Example 3.6 (Example 3.5 continued)a) Given that the component lasts at least 1000 hours, what is the

expected value of its life length?

b) Given that the component has survived 1000 hours, on average, how much

longer will it survive?

3.3 The Normal Distribution

Notation

Range

Probability Density Function

Cumulative Distribution Function no closed form expressionParameters

37

Page 38: En505 engineering statistics student notes

Mean

Variance

Comments

Standard Normal Random VariableIf µ = 0 and σ = 1, then X is referred as the standard normal random variable. The standard random normal variable is often denoted by Z.

The cumulative distribution of the standard normal random variable is denoted as

Appendix A Table I provides cumulative probabilities for a standard random variable. For example, assume that Z is a standard normal random variable. Appendix A Table I provides probabilities of the form Pr(Z≤ 1.53). Find in the column z 1.5 and find in the row 0.03, then Pr(Z≤ 1.53) = 0.93699.

The same value can be obtained in Excel, type function icon (fx), statistical, NORMSDIST(z), enter 1.53, and Excel will give you the result in the cell =NORMSDIST(1.53) = 0.936992The function

Is denoted a probability from Appendix A Table I. It is the cumulative distribution function of a standard normal random variable. (see figure 4-13 page 124 from the Montgomery book).

Example 3.7 (Example 4-12Montgomery)

Some useful results concerning a normal distribution are summarized in Fig 4-1413.(textbook). For any random variable

38

Page 39: En505 engineering statistics student notes

1)

2)

3)

4)

If X ~ N(µ,σ2), then (X -µ)/ σ ~N(0,1), which is known as the z-transformation. That is, Z is a standard normal random variable.Suppose X is a normal random variable with mean µ and standard deviation σ. Then,

39

Page 40: En505 engineering statistics student notes

Example 3.8 One key characteristic of a certain type of drive shaft is its diameter, and the diameter is a normal distributed random variable having µ = 5 cm and σ = 0.08 cm.a) What is the probability that the diameter of a given drive shaft is between 4.9 and

5.05 cm?

b) What diameter is exceeded by 90% of drive shafts?

c) Provide tolerances, symmetric about the mean, that capture 99% of drive shafts.

40

Page 41: En505 engineering statistics student notes

Example 3.9 The diameter of a shaft in an optical storage drive is normally distributed with mean 0.2508 inch and standard deviation 0.0005 inch. The specifications on the shaft are ±0.0015 inch. What proportion of shafts conforms to specifications?

3.3.1 Normal Approximation to the Binomial and Poisson Distributions

Binomial Approximation

If X is a binomial random variable with parameter n and p

Is approximately a standard random variable. To approximate a binomial probability with a normal distribution a correction (continuity) factor is apllied.

41

Page 42: En505 engineering statistics student notes

The approximation is good for np > 5 and n(1-p) > 5.

Poisson ApproximationIf X is a Poisson random variable with E(X) = λ and V(X) = λ,

is approximately a standard random variable. The approximation is good for λ > 5.

Example 3.10The manufacturing of semiconductor chips produces 2% defective chips. Assume that chips are independent and that a lot contains 1000 chips.

a) Approximate the probability that more than 25 chips are defective.

b) Approximate the probability that between 20 and 30 chips are defective

42

Page 43: En505 engineering statistics student notes

3.4 Lognormal Distribution

Variables in the system sometimes follow an exponential relationship, where the exponent is a random variable, say W, X = exp(W). If W has a normal distribution then the distribution of X is called a lognormal distribution. Notation

Range

Probability density function

Cumulative Distribution Function no closed form expressionParameters

Comments If Y ~ N(µ, σ2) and X = eY, then X ~ LN((µ, σ2)The lognormal random variable is often used to represent elapsed times, especially equipment repair times, and material properties.

Mean

Variance

43

Page 44: En505 engineering statistics student notes

Example 3.11 A wood floor system can be evaluated in one way by measuring its modulus of elasticity (MOE) measured in 106 psi. One particular type of system is such that its MOE is a lognormal random variable having µ = 0.375 and σ = 0.25.

1. What is the probability that a system’s MOE is less than 2?

2. Find the value of MOE that is exceeded by only 1% of the systems?

3.5 The Weibull Distribution

The Weibull distribution is often used to model the time until failure of many different physical systems. It is used in Reliability time-dependent failures models, where the failure distribution may be used to model both increasing and decreasing failure rates.Notation

44

Page 45: En505 engineering statistics student notes

Range

Probability Density Function

Cumulative Distribution Function

Parameters

Mean

Variance

Comments If β = 1, then X ~ expon(1/η)The Weibull random variable is most often used to represent elapsed time, especially time to failure of a unit of equipment.

Example 3.12 The time to failure of a power supply is a Weibull random variable having β = 2.0 and η = 1000.0 hours. The manufacturer sells a warranty such that only 5% of the power supplies fail before the warranty expires. What is the time period of the warranty?

45

Page 46: En505 engineering statistics student notes

4 JOINT PROBABILITY DISTRIBUTIONS

Up to this point we have considered issues related to a single random variable. Now we are going to consider situations in which we have two or more random variables that we are interested in studying.

4.1 Two or more discrete random variables

Definition 4.1 The function f(x, y) is a joint probability distribution or probability mass function of discrete random variables X and Y if1.

2.

3.

Example 4.1 Let X denote the number of times a certain numerical control machine will malfunction: 1, 2 or 3 times on a given day. Let Y denote the number of times a technician is called on an emergency call. Their joint probability distribution is given as

a) Find P(X<3, Y = 1)

b) Find the probability that the technician is called at least 2 times and the machine fails no more than 1 time.

46

Page 47: En505 engineering statistics student notes

c) Find P(X>Y)

When studying joint probability distribution we are also interested in the probability distributions of each variable individually, which is referred as the marginal probability distribution.

Theorem 4.1 Let X and Y be discrete random variables having joint probability mass functions f(x, y). Let denote the possible values of X, and let denote the

possible values of Y. Let denote the marginal probability mass function of X, and

let denote the (marginal) probability mass function of Y. Then,

47

Page 48: En505 engineering statistics student notes

Example 4.2 Let X and Y be discrete random variables such that f(1, 1) = 1/9 f(1, 2) = 1/6 f(1, 3) = 1/8f(2, 1) = 1/18 f(2, 2) = 1/9 f(2, 3) = 1/9f(3, 1) = 1/9 f(3, 2) = 1/9 f(3, 3) = 1/6

Find the marginal probability mass function of X and Y

48

Page 49: En505 engineering statistics student notes

Definition 4.2 The function f(x, y) is a joint probability density function of continuous random variables X and Y if1.

2.

3.

Example 4.3 A candy company distributes boxes of chocolates with a mixture of creams, toffees, and nuts coated in both light and dark chocolates. For a randomly selected box, let X and Y, respectively, be the proportions of the light and dark chocolates that are creams and suppose that joint density function is

a) verify condition 2

49

Page 50: En505 engineering statistics student notes

c) Find

Theorem 4.2 Marginal Probability Density FunctionLet X and Y be continuous random variables having probability density function f(x, y). le. Let denote the marginal probability density function of X, and let denote the (marginal) probability density function of Y. Then,

50

Page 51: En505 engineering statistics student notes

Example 4.4 Let X and Y be continuous random variables such that

f(x, y) = 0.75 e-0.3y

Find the marginal probability density function of X and Y.

Theorem 4.3 The Law of the Unconscious Statistician

Let X and Y be discrete (continuous) random variables having joint probability mass (density) function f(x,y). Let x1, x2, … denote the possible values of X, and let y1, y2, … denote the possible values of Y. Let g(X,Y) be a real-valued function. Then

51

Page 52: En505 engineering statistics student notes

Example 4.5 Suppose X and Y are discrete random variables having joint probability mass function f(x,y). Let x1, x2, … denote the possible values of X, and let y1, y2, … denote the possible values of Y. What is E(X+Y)?

52

Page 53: En505 engineering statistics student notes

Theorem 4.4 Expectation of a Sum of Random VariablesLet X1, X2, …, Xn be random variables, and let a1, a2, …an be constants. Then

Example 4.6 What is the E(3X – 2Y + 4)?

Theorem 4.5 Independent Discrete Random Variables Let X and Y be random variables having joint probability mass function f(x, y). Let fx(x) denote the marginal probability mass function of X, and let fy(y) denote the marginal probability mass function of Y. Then X and Y are said to be independent iff

53

Page 54: En505 engineering statistics student notes

Theorem 4.6 Independent Continuous Random Variables Let X and Y be random variables having joint probability density function f(x, y). Let fx(x) denote the marginal probability density function of X, and let fy(y) denote the marginal probability density function of Y. Then X and Y are said to be independent iff

Example 4.6 Consider example 4.2. Are X and Y independents?

Example 4.7 Consider example 4.4. Are X and Y independent?

Definition 4.3 Let X and Y be random variables. The covariance of X and Y is denoted as Cov(X,Y) and given by

54

Page 55: En505 engineering statistics student notes

A positive covariance indicates that X tends to increase (decrease) as Y increases (decreases). A negative covariance indicates that X tends to decrease (increase) as Y increases (decreases).

Example 4.8 Example 4.2 continued. Find the covariance of X and Y.

Theorem 4.7 Covariance of Independent Random VariablesLet X and Y be random variables. If X and Y are independent, then

Cov(X, Y) = 0.

Theorem 4.8 Variance of the Sum of Random VariablesLet X1, X2, … , XN be random variables. Then

Theorem 4.9 Variance of the Sum of Independent Random VariablesLet X1, X2, … , XN be independent random variables. Then

55

Page 56: En505 engineering statistics student notes

Definition 4.4 Let X and Y be two random variables. The correlation between X and Y is denoted by ρxy and given by

Note that correlation and covariance have the same interpretation regarding the relationship between the two variables. However, correlation does not have units and is restricted to the range (-1, 1). Therefore, the magnitude of the correlation provides some idea of the strength of the relationship between the two random variables.

56

Page 57: En505 engineering statistics student notes

5 RANDOM SAMPLES, STATISTICS AND THE CENTRAL

LIMIT THEOREM

Definition 5.1 Independent random variables X1, X2, … ,Xn are called a random sample.A randomly selected sample means that if a sample of n objects is selected, each subset of size n is equally likely to be selected. If the number of objects in the population is much larger than n, the random variables X1, X2, … ,Xn that represents the observations from the sample can be shown to be approximately independent random variables with the same distribution.

Definition 5.2 A statistic is a function of the random variables in a random sample. Given the data, we calculate statistics all the time, such as the sample mean and the sample standard deviation S. Each statistic has a distribution and it is the distribution that determines how well it estimates a quantity such as μ.

We begin our discussions by focusing on a single random variable, X. To perform any meaningful statistical analysis regarding X, we must have data.

Let X be some random variable of interest. A random sample on X consists of n observations on X: x1, x2, … , xn. We assume that these observations are independent and identically distributed. The value of n is referred to as the sample size.

Definition 5.3 Descriptive statistics refers to the process of collecting data on a random variable and computing meaningful quantities (statistics) that characterize the underlying probability distribution of the random variable.

There are three points of interest regarding this definition. Performing any type of statistical analysis requires that we collect data on one or

more random variables. A statistic is nothing more than a numerical quantity computed using collected

data. If we knew the probability distribution which governed the random variable of

interest, collecting data would be unnecessary.

Types of Descriptive Statistics

1. measures of central tendency sample mean (sample average) sample median sample mode (discrete random variables only)

2. measures of variability

57

Page 58: En505 engineering statistics student notes

sample range sample variance sample standard deviation sample quartiles

Microsoft Excel has a Descriptive Statistics tool within its Data Analysis ToolPak.

Computing the Sample Mean

Most of your calculators have a built-in method for entering data and computing the sample mean.

Note the sample mean is a point estimate of the true mean of X. In other words,

Computing the Sample Median

To compute the sample median, we first rank the data in ascending order and re-number it: x(1), x(2), …. , x(n).

The sample median corresponds to the value that has 50% of the data above it and 50% of the data below it.

Computing the Sample Mode

The sample mode is the most frequently occurring value in the sample. It is typically only of interest in sample data from a discrete random variable, because sample data on a continuous random variable often does not have any repeated values.

Compute the Sample Range

58

Page 59: En505 engineering statistics student notes

Computing the Sample Variance

Why do we divide by n 1? We divide by n 1 because we have n 1 degrees of freedom. This refers to the fact that if we know the sample mean and n 1 of the data values, we can compute the remaining data point.

Note that the sample variance is a point estimate of the true variance. In other words,

Computing the Sample Standard Deviation

Note that the sample standard deviation is a point estimate of the true standard deviation.

Theorem 5.1. If X1, X2, … ,Xn is a random sample of size n taken from a population with

mean μ and variance σ2, μ and variance σ2, and if is the sample mean, the limiting form

of the distribution of

as n→∞, is the standard normal distribution.

59

Page 60: En505 engineering statistics student notes

5.1 Populations and Random Samples

The field of statistical inference consists of those methods used to draw

conclusions about a population. These methods utilize the information contained in a

random sample of observations from the population.

Statistical inference may be divided into two major areas:

parameter estimation hypothesis testing

Both of these areas require a random sample of observations from one or more populations, therefore, we will begin our discussions by addressing the concepts of random sampling.

Definition 5.4 A population consists of the totality of the observations with which we are concerned.

We almost always use a random variable/probability distribution to model the

behavior of a population.

Definition 5.5 The number of observations in the population is called the size of the population.

Populations may be finite or infinite. However, we can typically assume the

population is infinite.

In some cases, a population is conceptual. For example, the population of items

to be manufactured is a conceptual population.

Definition 5.6 A sample is a subset of observations selected from a population.

We model these observations using random variables.

If our inferences are to be statistically valid, then the sample must be

representative of the entire population. In other words, we want to ensure that we

take a random sample.

Definition 5.7 The random variables X1, X2, … , Xn are a random sample of size n if X1, X2, … , Xn are independent and identically distributed.

60

Page 61: En505 engineering statistics student notes

After the data has been collected, the numerical values of the observations are denoted as x1, x2, … , xn.

The next step in statistical inference is to use the collected data to compute one or more statistics of interest.

5.2 Point Estimates

Definition 5.8 A statistic, , is any function of the observations in a random sample.

In parameter estimation, statistics are used to estimate quantities of interest.

The measures of central tendency and variability we considered in “Descriptive

Statistics” are all statistics.

Definition 5.9 A point estimate of some population parameter is a single numerical value of a statistic .

Estimation problems occur frequently in engineering. The quantities that we will focus on are:

the mean of a population the standard deviation of a population the proportion p of items in a population that belong to a class of interest – p is the

probability of success for a Bernoulli trialThe point estimates that we use are:

5.3Sampling Distributions

A statistic is a function of the observations in the random sample. These observations are random variables, therefore, the statistic itself is a random variable. All random variables have probability distributions.

Definition 5.10 The probability distribution of a statistic is called a sampling distribution.

61

Page 62: En505 engineering statistics student notes

The sampling distribution of a statistic depends on the probability distribution which governs the entire population, the size of the random sample, and the method of sample selection.

Theorem 5.3 The Sampling Distribution of the Mean If X1, X2, … , Xn are IID N(,2) random variables, then the sample mean is a

normal random variable having mean and variance .Thus, if we are sampling from a normal population then the sampling distribution of the mean is normal. But what if we are not sampling from a normal population?

Theorem 5.4 The Central Limit Theorem

If X1, X2, … , Xn is a random sample of size n taken from a population with mean and variance 2, then as n ,

is a standard normal random variable.

The quality of the normal approximation depends on the true probability distribution governing the population and the sample size.

For most cases of practical interest, n 30 ensures a relatively good approximation.

If n < 30, then the underlying probability distribution must not be severely non-normal.

Example 5.1 A plastics company produces cylindrical tubes for various industrial applications. One of their production processes is such that the diameter of a tube is normally distributed with a mean of 1 inch and a standard deviation of 0.02 inch.

(a) What is the probability that a single tube has a diameter of more than 1.015 inches?

X = diameter of a tube (measured in inches) ~ N( )

(b) What is the probability that the average diameter of five tubes is more than 1.015 inches?

n = = average diameter ~ N( )

62

Page 63: En505 engineering statistics student notes

(c) What is the probability that the average diameter of 25 tubes is more than 1.015 inches?

n = = average diameter ~ N( )

Example 5.2 The life length of an electronic component, T, is exponentially distributed with a mean of 10,000 hours.

(a) What is the probability that a single component lasts more than 7500 hours?

(b) What is the probability that the average life length for 200 components is more than 9500 hours?

E(T) = hours

T = hours

Note that .

63

Page 64: En505 engineering statistics student notes

(c) What is the probability that the average life length for 10 components is more than 9500 hours?

n is too small to use the CLT approximation

Note that .

If we had tried to use the CLT:

Now consider the case in which we are interested in studying two independent populations. Let the first population have mean 1 and standard deviation 1, and let the second population have mean 2 and standard deviation 2.If we are interested in comparing the two means, then the obvious point estimate of interest is

.

What is the sampling distribution of this statistic?

Theorem 5.4 The Sampling Distribution of the Difference in Two Means

If we have two independent populations with means 1 and 2 and standard deviations 1 and 2, and if a random sample of size n1 is taken from the first population

64

Page 65: En505 engineering statistics student notes

and a random sample of size n2 is taken from the second population, then the sampling distribution of

is standard normal as n1 and n2 . If the two populations are normal, then the sampling distribution of Z is exactly standard normal.

Again, the approximation is relatively accurate if n1 30 and n2 30.

Example 5.3 The life length of batteries produced by Battery Manufacturer A is a continuous random variable having a mean of 1500 hours and a standard deviation of 100 hours. The life length of batteries produced by Battery Manufacturer B is a continuous random variable having a mean of 1400 hours and a standard deviation of 200 hours.

(a) Suppose 50 batteries of each type are tested. What is the probability that Battery Manufacturer A’s sample average life length exceeds Battery Manufacturer B’s by more than 75 hours?

(b) How would your answer change if only 12 batteries of each type were tested?

There is not enough information to answer the question. If we assume normality,

then we could proceed.

5.4 Confidence Intervals

A point estimate provides only a single number for drawing conclusions about a parameter. And if another random sample were selected, this point estimate would almost certainly be different. In fact, this difference could be drastic.

65

Page 66: En505 engineering statistics student notes

For this reason, a point estimate typically does not supply adequate information to an engineer. In such cases, it may be possible and useful to construct a confidence interval which expresses the degree of uncertainty associated with a point estimate.

Definition 5.11 If is the parameter of interest, then the point estimate and sampling distribution of can be used to identify a 100(1 )% confidence interval on . This interval is of the form:

L and U are called the lower-confidence limit and upper-confidence limit. If L and U are constructed properly, then

.The quantity (1 ) is called the confidence coefficient.

The confidence coefficient is a measure of the accuracy of the confidence interval. For example, if a 90% confidence interval is constructed, then the probability that the true value of is contained in the interval is 0.9.

The length of the confidence interval is a measure of the precision of the point estimate. A general rule of thumb is that increasing the sample size improves the precision of a point estimate.

Confidence intervals are closely related to hypothesis testing. Therefore, we will address confidence intervals within the context of hypothesis testing.

66

Page 67: En505 engineering statistics student notes

6 FORMULATING STATISTICAL HYPOTHESES

For many engineering problems, a decision must be made as to whether a particular statement about a population parameter is true or false. In other words, we must either accept the statement as being true or reject the statement as being false.

Example 6.1 Consider the following statements regarding the population of engineering students at the Philadelphia University.

1. The average GPA is 3.0.

2. The standard deviation of age is 5 years.

3. 30% are afraid to fly

4. The average age of mothers is the same as the average age of fathers.

Definition 6.1 A statistical hypothesis is a statement about the parameters of one or more populations.

It is worthwhile to note that a statistical hypothesis is a statement about the

underlying probability distributions, not the sample data.

Example 6.2 (Ex. 6,1 continued) Convert each of the statements into a statistical hypothesis.

1.

2.

3.

4.

To perform a test of hypotheses, we must have a contradictory statement about the parameters of interest.

Example 6.3 Consider the following contradictory statements.

1. No, it’s more than that.

2. No, it’s not.

3. No, it’s less than that.

4. No, fathers are older.

67

Page 68: En505 engineering statistics student notes

The result of our original statement and our contradictory statement is a set of two hypotheses.

Example 6.4 (Ex. 6.1 continued) Combine the two statements for each of the examples.

1.

2.

3.

4.

Our original statement is referred to as the null hypothesis (H0).

The value specified in the null hypothesis may be a previously established value

(in which case we are trying to detect changes to that value), a theoretical value

(in which case we are trying to verify the theory), or a design specification (in

which case we are trying to determine if the specification has been met).

The contradictory statement (H1) is referred to as the alternative hypothesis.

Note that an alternative hypothesis can be one-sided (1, 3, 4) or two-sided (2).

The decision as to whether the alternative hypothesis should be one-sided or two-

sided depends on the problem of interest.

Type I Error

Rejecting the null hypothesis H0 when it is true

For example, the true mean of example 2.4.1 is 3.0. However, for the randomly selected sample we could observe that the test statistic falls into the critical region. Therefore, we could reject the null hypothesis in favor of the alternative hypothesis H1.

68

Page 69: En505 engineering statistics student notes

Type II ErrorFailing to reject the null hypothesis when it is false.

6.1 Performing a Hypothesis Test

Definition 6.2 A procedure leading to a decision about a particular null and

alternative hypothesis is called a hypothesis test.

Hypothesis testing involves the use of sample data on the population(s) of interest.

If the sample data is consistent with a hypothesis, then we “accept” that hypothesis and conclude that the corresponding statement about the population is true.

We “reject” the other hypothesis, and conclude that the corresponding statement is false. However, the truth or falsity of the statements can never be known with certainty, so we need to define our procedure so that we limit the probability of making an erroneous decision.

The burden of proof is placed upon the alternative hypothesis.

Basic Hypothesis Testing Procedure

A random sample is collected on the population(s) of interest, a test statistic is computed based on the sample data, and the test statistic is used to make the decision to either accept (some people say “fail to reject”) or reject the null hypothesis.

Example 6.5 A manufactured product is used in such a way that its most important dimension is its width. Let X denote the width of a manufactured product. Suppose historical data suggests that X is a normal random variable having = 4 cm. However, the mean can change due to fluctuations in the manufacturing process. Therefore, we wish to perform the following hypothesis test.

H0: H1:

The following procedure has been proposed.

Inspect a random sample of 25 products. Measure the width of each product. If the sample mean is less than 188 cm or more than 192 cm, reject H0.

69

Page 70: En505 engineering statistics student notes

For the proposed procedure, identify the following:

(a) sample size

(b) test statistic

(c) critical region

(d) acceptance region

Is the procedure defined in Ex. 6.5 a good procedure? Since we are only taking a random sample, we cannot guarantee that the results of the hypothesis test will lead to us making the correct decision. Therefore, the question “Is this a good procedure?” can be broken down into two additional questions.

1. If the null hypothesis is true, what is the probability that we accept H0?2. If the null hypothesis is not true, what is the probability that we accept H0?

Example 6.6 (Ex. 6.5 continued) If the null hypothesis is true, what is the probability that we accept H0?

note assumptions

70

Page 71: En505 engineering statistics student notes

Therefore, if the null hypothesis is true, then there is a 98.76% chance that we will make the correct decision. However, that also means that there is a 1.24% chance that we will make the incorrect decision (reject H0 when H0 is true).

Such a mistake is called a Type I error, or a false positive. = P(Type I error) = level of significance In our example, = 0.0124. When constructing a hypothesis test, we get to

specify .

If the null hypothesis is not true (i.e. the alternative hypothesis is true), then accepting H0 would be a mistake.

Accepting H0 when H0 is false is called a Type II error, or a false negative.

Unfortunately, we can’t answer this question (find a value for ) in general. Since the alternative hypothesis is 190 cm, there are an uncountable number of situations in which the alternative hypothesis is true.

We must identify specific situations of interest and analyze each one individually.

Example 6.7 (Ex. 6.5 continued) Find the probability of a Type II error when = 189 cm and = 193 cm.

For = 189 cm:

71

Page 72: En505 engineering statistics student notes

For = 193 cm:

Note that as moves away from the hypothesized value (190 cm), decreases.If we experiment with other sample sizes and critical/acceptance regions, we will see that the values of and can change significantly. However, there are some general “truths” for hypothesis testing.

1. We can explicitly control (given that the underlying assumptions are true).2. Type I and Type II error are inversely related.3. Increasing the sample size is the only way to simultaneously reduce and .4. We can only control for one specific situation.

Since we can explicitly control , the probability of a Type I error, rejecting H0 is a strong conclusion. However, we can only control Type II errors in a very limited fashion. Therefore, accepting H0 is a weak conclusion. In fact, many statisticians use the terminology, “fail to reject H0” as opposed to “accept H0.”

Since “reject H0” is a strong conclusion, we should put the statement about which it is important to make a strong conclusion in the alternative hypothesis.

Example 6.8 How would the procedure change if we wished to perform the following hypothesis test?

H0: 190 cmH1: < 190 cm

Proposed hypothesis testing procedure: Inspect a random sample of 25 observations on the width of a product. If the sample mean is less than 188 cm, reject H0.

72

Page 73: En505 engineering statistics student notes

6.1.1 Generic Hypothesis Testing Procedure

All hypothesis have a common procedure. The textbook identifies eight steps in this procedure.

1. From the problem context and assumptions, identify the parameter of interest.2. State the null hypothesis, H0.3. Specify an appropriate alternative hypothesis, H1.4. Choose a significance level .5. State an appropriate test statistic.6. State the critical region for that statistic.7. Collect a random sample of observations on the random variable (or from the

population) of interest, and compute the test statistic.8. Compare the test statistic value to the critical region and decided whether or not to

reject H0.

6.2 Performing Hypothesis Tests on when is Known

In this section, we consider making inferences about the mean of a single population where the population standard deviation is known.

We will assume that a random sample X1, X2, … , Xn has been taken from the population.

We will also assume that either the population is normal or the conditions of the Central Limit Theorem apply.

Suppose we wish to perform the following hypothesis test.

It is somewhat obvious that inferences regarding would be based on the value of the sample mean. However, it is usually more convenient to standardize the sample mean. Using what we know about the sampling distribution of the mean, it is reasonable to conclude that the test statistic will be

73

Page 74: En505 engineering statistics student notes

If the null hypothesis is true, then the test statistic is a standard normal random variable. Therefore, we only reject the null hypothesis if the value of Z0 is unusual for an observation on a standard normal random variable.

Specifically, we reject H0 if:

where is the specified level of significance. The acceptance region is therefore

Obviously, the acceptance and critical regions can be converted to expressions in terms of

the sample mean.

Reject H0 if > a or < b where

Example 6.9 Let X denote the GPA of an engineering student at the Philadelphia University. It is widely known that, for this population, = 0.5. The population mean is not widely known, however, it is commonly believed that the average GPA is 3.0. We wish to test this hypothesis using a sample of size 25 and a level of significance of 0.05.

(a) Identify the null and alternative hypotheses.

74

Page 75: En505 engineering statistics student notes

(b) List any required assumptions.

(c) Identify the test statistic and the critical region.

Reject H0 if

(d) Suppose 25 students are sampled and the sample average GPA is 3.18. State and interpret the conclusion of the test.

Z0 =

(e) What is the probability of a Type I error for this test?

(f) How would the results change if we had used = 0.10?

Critical region changes.

75

Page 76: En505 engineering statistics student notes

We may also modify this procedure if the test is one-sided. This modification only

requires a change in the critical/acceptance regions. If the alternative hypothesis is

then a negative value of Z0 would not indicate a need to reject H0. Therefore, we

only reject H0 if

Likewise, if the alternative hypothesis is

Example 6.10 The Glass Bottle Company (GBC) manufactures brown glass beverage containers that are sold to breweries. One of the key characteristics of these bottles is their volume. GBC knows that the standard deviation of volume is 0.08 oz. They wish to ensure that the mean volume is not more than 12.2 oz using a sample size of 30 and a level of significance of 0.01.

(a) Identify the null and alternative hypotheses.

(b) Identify the test statistic and the critical region.

76

Page 77: En505 engineering statistics student notes

(c) Suppose 30 bottles are measured and the sample mean is 12.23. State and interpret the conclusion of the test.

6.2.1 Computing P-Values

We have already seen that the choice of the value for the level of significance can

impact the conclusions derived form a test of hypotheses. As a result, we may be

interested in answering the question: How close did we come to making the opposite

conclusion? We answer this question using an equivalent decision approach that can be

used as an alternative to the critical/acceptance regions. This approach is called the P-

value approach.

Definition 6.3 The P-value for a hypothesis test is the smallest level of significance that would lead to rejection of the null hypothesis.How we compute the P-value depends on the form of the alternative hypothesis.

We reject H0 if

Example 6.11 (Ex. 6.9 continued) Compute the P-value for the test.

77

Page 78: En505 engineering statistics student notes

Note when = 0.05,

But, when = 0.10,

Example 612 (Ex. 6.10 continued) Compute the P-value for the test.

Since = 0.01, P >

6.2.2 Type II Error

In hypothesis testing, we get to specify the probability of a Type I error (). However,

the probability of a Type II error () depends on the choice of sample size (n).

Consider first the case in which the alternative hypothesis is H1: 0.

Before we can proceed, we must be more specific about “H0 is false”. We will

accomplish this by saying:

where 0.

78

Page 79: En505 engineering statistics student notes

If the alternative hypothesis is H1: > 0, then

.

If the alternative hypothesis is H1: < 0.

.

Example 6.13 (Ex. 6.10 continued) Let X denote the GPA of an engineering student at the Philadelphia University. It is widely known that, for this population, = 0.5. The population mean is not widely known, however, it is commonly believed that the average GPA is 3.0. We wish to test this hypothesis using a sample of size 25 and a level of significance of 0.05. In Example 16.5, we formulated this hypothesis test as

The corresponding test statistic and critical region are given by

79

Page 80: En505 engineering statistics student notes

(a) If = 3.2, what is the Type II error probability for this test?

= 0 =

(b) If = 2.68, what is the Type II error probability for this test?

= 0 =

(c) If = 2.68, what is the power of the test?

power =

(d) If = 3.32, what is the power of the test?

power = 0.8925

Example 6.14 (Ex. 6.11 continued) The Glass Bottle Company (GBC) manufactures brown glass beverage containers that are sold to breweries. One of the key characteristics of these bottles is their volume. GBC knows that the standard deviation of volume is 0.08 oz. They wish to ensure that the mean volume is not more than 12.2 oz using a

80

Page 81: En505 engineering statistics student notes

sample size of 30 and a level of significance of 0.01. Example 16.6, we formulated this hypothesis test as

H0: 12.2H1: > 12.2

The corresponding test statistic and critical region are given by

Reject H0 if

(a) If = 12.27 oz, what is the Type II error probability for this test?

= 0 = 0.07

(b) If = 12.15 oz, what is the Type II error probability for this test?

This is a poor question. If = 12.15 oz, then “technically” the null hypothesis is true. If we are truly concerned with detecting this, we should have used a two-sided alternative hypothesis.

6.2.3 Choosing the Sample Size

The expressions for allow the determination of an appropriate sample size. To choose

the proper sample size for our test, we must specify a value of for a specified value of

.

81

Page 82: En505 engineering statistics student notes

For the case in which H1: 0, the symmetry of the test allows us to always specify a

positive value of . If we specify a relatively small value of ( 0.1), then the lower

side of the equation becomes negligible. So, the equation for reduces to:

This yields:

For both cases in which the alternative hypothesis is one-sided:

Example 6.14 (Ex. 6.10 continued) Let X denote the GPA of an engineering student at the Philadelphia University. It is widely known that, for this population, = 0.5. The population mean is not widely known, however, it is commonly believed that the average GPA is 3.0. We wish to test this hypothesis using a sample of size n and a level of significance of 0.05. In Example 16.5, we formulated this hypothesis test as

H0: = 3.0H1: 3.0

The corresponding test statistic and critical region are given by

82

Page 83: En505 engineering statistics student notes

(a) If we want = 0.10 at = 3.2, what sample size should we use?

= 0.2

n = 66

(b) If we want = 0.10 at = 3.25, what sample size should we use?

= 0.25

n = 43

(c) If we want = 0.05 at = 3.2, what sample size should we use?

= 0.2

n = 82

Example 6.15 (Ex. 6.11 continued) The Glass Bottle Company (GBC) manufactures brown glass beverage containers that are sold to breweries. One of the key characteristics of these bottles is their volume. GBC knows that the standard deviation of volume is 0.08 oz. They wish to ensure that the mean volume is not more than 12.2 oz using a sample size of n and a level of significance of 0.01. Example 16.6, we formulated this hypothesis test as

83

Page 84: En505 engineering statistics student notes

The corresponding test statistic and critical region are given by

If we wish to have a test power of 0.95 at = 12.25 oz, what is the required sample size for this test?

6.2.4 Choosing the Sample Size

The expressions for allow the determination of an appropriate sample size. To choose

the proper sample size for our test, we must specify a value of for a specified value of

.

For the case in which H1: 0, the symmetry of the test allows us to always specify a

positive value of . If we specify a relatively small value of ( 0.1), then the lower

side of the equation becomes negligible. So, the equation for reduces to:

This yields:

84

Page 85: En505 engineering statistics student notes

For both cases in which the alternative hypothesis is one-sided:

Example 6.14 (Ex. 6.10 continued) Let X denote the GPA of an engineering student at the Philadelphia University. It is widely known that, for this population, = 0.5. The population mean is not widely known, however, it is commonly believed that the average GPA is 3.0. We wish to test this hypothesis using a sample of size n and a level of significance of 0.05. In Example 16.5, we formulated this hypothesis test as

H0: = 3.0H1: 3.0

The corresponding test statistic and critical region are given by

Reject H0 if Z0 < Z/2 = Z0.025 = 1.96 or if Z0 > Z/2 = 1.96

(a) If we want = 0.10 at = 3.2, what sample size should we use?

= 0.2

n = 66

(b) If we want = 0.10 at = 3.25, what sample size should we use?

= 0.25

n = 43

(c) If we want = 0.05 at = 3.2, what sample size should we use?

= 0.2

85

Page 86: En505 engineering statistics student notes

n = 82

Example 6.15 (Ex. 6.11 continued) The Glass Bottle Company (GBC) manufactures brown glass beverage containers that are sold to breweries. One of the key characteristics of these bottles is their volume. GBC knows that the standard deviation of volume is 0.08 oz. They wish to ensure that the mean volume is not more than 12.2 oz using a sample size of n and a level of significance of 0.01. Example 16.6, we formulated this hypothesis test as

H0: 12.2H1: > 12.2

The corresponding test statistic and critical region are given by

Reject H0 if Z0 > Z = Z0.01 = 2.3263

If we wish to have a test power of 0.95 at = 12.25 oz, what is the required sample size for this test?

= 0.05

= 0.05

n = 41

6.3 Statistical Significance

A hypothesis test is a test for statistical significance. When we reject H0, we are

stating that the data indicates a statistically significant difference between the true mean

and the hypothesized value of the mean. When we accept H0, then we are stating that

there is not a statistically significant difference. Statistical difference and practical

86

Page 87: En505 engineering statistics student notes

significance are not the same. This is especially important to recognize when the sample

size is large.

6.3.1 Introduction to Confidence Intervals

As we have previously discussed, the sample mean is the most often used point

estimate for the population mean. However, we also pointed out that two different

samples would most likely result in two different sample means. Therefore, we define

confidence intervals as a means of quantifying the uncertainty in our point estimate.

If is the parameter of interest, then the point estimate and sampling distribution of can be used to identify a 100(1 )% confidence interval on . This interval is of the form:

L U.

L and U are called the lower-confidence limit and upper-confidence limit.

If L and U are constructed properly, then

P(L U) = 1 .

The quantity (1 ) is called the confidence coefficient. The confidence coefficient is a measure of the accuracy of the confidence interval. For example, if a 90% confidence interval is constructed, then the probability that the true value of is contained in the interval is 0.9.

The length of the confidence interval is a measure of the precision of the point

estimate. A general rule of thumb is that increasing the sample size improves the

precision of a point estimate.

6.3.2 Confidence Interval on when is Known

We can use what we have learned to construct a 100(1 )% confidence interval

on the mean, assuming that (a) the population standard deviation is known, and (b) the

population is normally distributed (or the conditions of the Central Limit Theorem

apply).

87

Page 88: En505 engineering statistics student notes

Such a confidence interval is called a two-sided confidence interval. We can also

construct one-sided confidence intervals for the same set of assumptions ( known,

normal population or Central Limit Theorem conditions apply).

The 100(1 )% upper-confidence interval is given by

and the 100(1 )% lower-confidence interval is given by

.

Example 6.16 Let X denote the GPA of an engineering student at the Philadelphia University. It is widely known that, for this population, = 0.5. The population mean is not widely known, however, we have a collected a sample of size 25 from the population. The resulting sample mean was 3.18.

(a) What assumptions, if any, are required to use this data to construct a confidence interval on the mean GPA?

GPA is normally distributed.

(b) Construct a 95% confidence interval on and interpret its meaning.

(c) Construct a 99% confidence interval on and compare it to the confidence interval obtained in part (b).

88

Page 89: En505 engineering statistics student notes

more accurate, but less precise

(d) Construct a 95% upper-confidence interval on and interpret its meaning.

(e) Construct a 95% lower-confidence interval on and interpret its meaning.

(f) Combine the two confidence intervals obtained in parts (d) and (e). Is this confidence interval superior to the one constructed in part (b)?

No, it is only a 90% confidence interval.

6.3.3 Choosing the Sample Size for a Confidence Interval on when is Known

The percentage of a confidence interval is a measure of the accuracy of the

confidence interval.

The half-width of the confidence interval, E, is a measure of the precision of the

confidence interval. For a two-sided confidence interval, E = (U – L)/2. For an upper-

confidence interval, E = U and for a lower-confidence interval, E = L.

For a given level of accuracy (), we can control the precision of the confidence

interval using the sample size. For the two-sided confidence interval on , we specify a

value of E and note that:

89

Page 90: En505 engineering statistics student notes

.

Then, we can solve for n.

For the one-sided confidence intervals:

.

Example 6.17 (Ex. 6.16 continued)

(a) If we wish to construct a 95% confidence interval on that has a half-width of 0.1, how many students should we survey?

n = 97

(b) If we wish to construct a 95% upper-confidence interval on that has a half-width of 0.1, how many students should we survey?

n = 68

(c) If we wish to construct a 90% confidence interval on that has a half-width of 0.1, how many students should we survey?

n = 68

90

Page 91: En505 engineering statistics student notes

6.3.4 Using Confidence Intervals to Perform Hypothesis Tests on when

is Known

Thus far, we have considered two methods of evaluating hypothesis tests: critical

regions and P-values. A third, equivalent method is to use a confidence interval.

1. Specify: o, , n

2. If H1: o, construct a 100(1 )% confidence interval on .If H1: > o, construct a 100(1 )% lower-confidence interval on .If H1: < o, construct a 100(1 )% upper-confidence interval on .

3. Reject H0 is o is not contained in that confidence interval.

Example 6.17 (Ex. 6.10 continued) Let X denote the GPA of an engineering student at the Philadelphia University. It is widely known that, for this population, = 0.5. The population mean is not widely known, however, it is commonly believed that the average GPA is 3.0. We wish to test this hypothesis using a sample of size 25 and a level of significance of 0.05.

From Ex. 6.10:

H0: = 3.0H1: 3.0

Suppose the sample mean is 3.18. Use a confidence interval to evaluate the hypothesis test.

= 0.05, H1:

95% confidence interval

From Ex. 6.16:

3.0 is in the confidence interval

fail to reject H0

Example 6.18 (Ex. 6.11 continued) The Glass Bottle Company (GBC) manufactures brown glass beverage containers that are sold to breweries. One of the key characteristics

91

Page 92: En505 engineering statistics student notes

of these bottles is their volume. GBC knows that the standard deviation of volume is 0.08 oz. They wish to ensure that the mean volume is not more than 12.2 oz using a sample size of 30 and a level of significance of 0.01.

From Ex. 3.2.2:

H0: 12.2H1: > 12.2

Suppose the sample mean is 12.23. Use a confidence interval to evaluate the hypothesis test.

= 0.01, H1: >

99% lower-confidence interval

12.1960

12.2 is in the confidence interval

fail to reject H0

6.4 Hypothesis Test on μ and σ unkown

What if is Unknown?

Suppose we are interested in studying the mean of a population, but we do not

know the value of the population standard deviation?

We can use the procedures defined in section 2.3 and replace with S, provided that the sample size is large (n 30).

When the sample size is small and is unknown, then we must assume that the population is normally distributed.

The t Distribution

Suppose we wish to perform the following hypothesis test.

H0: = 0

92

Page 93: En505 engineering statistics student notes

H1: 0

Suppose we have collected a random sample of size n and that we have used this

sample data to compute the sample mean and the sample standard deviation S.

If were known then we would compute the test statistic:

.

Therefore, a logical approach is to replace with S. The resulting test statistic is:

.

Before we can proceed, we should analyze the sampling distribution of this test statistic.

Theorem 6.1 The t Distribution

Let X1, X2, … , Xn be a random sample from a normal population having mean .

The quantity

has a t distribution with n – 1 degrees of freedom.

While we won’t discuss the details of the t distribution, it is important to recognize

two points regarding the t probability density function.

First, it is symmetric about 0. Second, as the number of degrees of freedom increases, the t distribution

approaches the standard normal distribution. This explains why it is OK to use the procedures from section 2.3 when n 30 (at 29 degrees of freedom there is little difference between t and Z).

Example 6.19 Suppose T has a t distribution with 7 degrees of freedom. Find the following:

(a) P(T > 2.365)

Excel function TDIST(x, degrees of freedom, 1 or 2 tails)=P(2.3625, 7, 1) = 0.025

93

Page 94: En505 engineering statistics student notes

Note Excel gives you the value P(X>x)

(b) P(T > 1.415)

0.10

(c) P(T < 3.499)

P(T > 3.499) = 0.005

(d) P(T > 2.8) = 1 – Pt (T<2.88) = 0.9867

(e) the value a such that P(T >a) = 0.05

a = t0.05,7 = 1.895

(f) the value of a such that P(T > a) = 0.01

a = t0.01,7 = 2.998

(g) the value of a such that P(T < a) = 0.9975

a = t0.0025,7 = 4.029

The Critical Region

If the null hypothesis is true, then T0 has a t distribution with n 1 degrees of

freedom. Therefore, we reject H0 if

T0 > t/2,n-1 or T0 < t/2,n-1.

If the alternative hypothesis is H1: > 0, then we reject H0 if T0 > t,n-1. If the alternative hypothesis is H1: < 0, then we reject H0 if T0 < t,n-1.

Example 6.20 Let X denote the age of an Engineering Statistics student at the Philadelphia University. Suppose we wish to test the hypothesis that the mean age is 21.0 years using a sample of size 14 and a level of significance of 0.05.

(a) State the null and alternative hypothesis.

H0: = 21H1: 21

94

Page 95: En505 engineering statistics student notes

(b) What assumptions are required before we can proceed with this test of hypotheses?

Age is normally distributed.

(c) How could we test the validity of this assumption?

Probability plot of the data.

(d) What would have to be done to avoid making this assumption?

Survey at least 16 more students (n 30).

(e) Identify the test statistic and acceptance region for this test.

Fail to reject H0 if t/2,n-1 T0 t/2,n-1

Fail to reject H0 if 2.160 T0 2.160

NOTE: In Excel ® the function is TINV(probability, degrees of freedom)

Probability: is the associated probability with a two-sided t-distribution

(f) Suppose the sample mean is 22.67 years and the sample standard deviation is 4.08 years. State and interpret the conclusion for this test.

Fail to reject H0 and conclude that = 21.

(g) What would be required to solve this problem using a Z-test instead of a t-test?

n 30 or known

Example 6.21 A construction company purchases shear pins for use in several of their projects. These pins are supposed to have a mean tensile strength of at least 500 psi, but destructive testing is required to measure the tensile strength of a pin. Therefore, a sample of 12 pins are evaluated and used to verify that the tensile strength is acceptable using a level of significance of 0.10.

(a) State the null and alternative hypothesis.

H0:

95

Page 96: En505 engineering statistics student notes

H1:

(b) Identify the test statistic and critical region for this test.

Reject H0 if.

Reject H0 if.

Note in Excel use TINV(2*(0.1),11) because it is one-sided test and excel return two-sided test.

(c) Suppose the sample mean is 491.3 psi and the sample standard deviation is 13.2 psi. State and interpret the conclusion for this test.

P-Values

As before, we can use P-values to draw conclusions regarding a t-test.

H1: 0 P = 2

H1: > 0 P = P(tn-1 > T0)

H1: < 0 P = P(tn-1 < T0)

We reject H0 if P < .

Example 6.22 (Ex. 6.20 continued) Perform the hypothesis test using a P-value.

96

Page 97: En505 engineering statistics student notes

Example 6.23 (Ex. 6.21 continued) Perform the hypothesis test using a P-value.

Type II Errors and Sample Size

Unfortunately, we cannot construct an expression for for these tests, and as a result, we

cannot construct expressions for computing an appropriate sample size. Some cases have

been analyzed numerically, and the corresponding OC curves are in your text – Charts

VII(e), VII(f), VII(g) and VII(h).

The value on the horizontal axis is

.

Note that the value in the denominator must be our best guess for . Example 6.24 (Ex. 6.20 continued)

(a) If the true population mean is 22.0 years and the true population standard deviation is 1.5 years, then what is the probability of a Type II error?

Chart V (a)

(b) Suppose the true population standard deviation is 1.25 years and we wish to have a power of 0.9 when the true population mean is 22.5 years. What sample size should we use?

97

Page 98: En505 engineering statistics student notes

Confidence Intervals

As before, we can also use the sample data to construct a 100(1)% confidence

interval on the population mean.

The 100(1 )% upper-confidence interval is given by

and the 100(1 )% lower-confidence interval is given by

.

We can then use these confidence intervals to perform the hypothesis test.

Specify: 0, , n

If H1: 0, construct a 100(1 )% confidence interval on .If H1: > 0, construct a 100(1 )% lower-confidence interval on .If H1: < 0, construct a 100(1 )% upper-confidence interval on .

Reject H0 is 0 is not contained in that confidence interval.

Example 6.25 (Ex. 6.20 continued) Perform the hypothesis test using an appropriate confidence interval.

= 0.05, H1:

95% confidence interval

Example 6.26 (Ex. 6.21 continued) Perform the hypothesis test using an appropriate

confidence interval.

= 0.10, H1: <

98

Page 99: En505 engineering statistics student notes

Therefore, with a 90% confidence interval (90% of the times ) the mean will fall 496.49, therefore 500 is not in the confidence interval

Z-Tests versus t-Tests

Even if we know the population standard deviation, we can use the t-test instead

of the Z-test. The reason we don’t do this is:

A Z-test is more powerful than the corresponding t-test. A confidence interval based on Z is tighter than the corresponding confidence

interval based on t.

6.5 Inference on the Variance of a Normal Population

The Chi-Square Distribution

Sometimes it is of interest to perform a hypothesis test on the population standard

deviation. For example, we may wish to test the value of prior to testing .

Assumptions

population is normally distributed (cannot make use of the Central Limit Theorem)

Potential Tests

Test Statistic

99

Page 100: En505 engineering statistics student notes

Theorem 3.5.1 The Chi-Square Distribution

Let X1, X2, … , Xn be a random sample from a normal population. The quantity

has a chi-square distribution with n – 1 degrees of freedom.

A table of probabilities for the chi-square distribution is provided in the Appendix of your text.

Note that the chi-square distribution is not symmetric. In fact, the range of the chi-square random variable is (0,).

Example 6.27 Suppose Y has a chi-square distribution with 13 degrees of freedom. Find the following:

(a)

(b) P(Y < 5.89) =

(c) P(Y > 0)

(d) the value a such that P(Y >a) = 0.005

In Excel CHIINV( probability, degrees of freedom )

(e) the value of a such that P(Y < a) = 0.01

Performing the Test

Critical Regions

H1:

H1:

100

Page 101: En505 engineering statistics student notes

H1:

P-Values

H1:

H1:

H1:

OC Function and Sample Size

must use Charts VII(i, j, k, l, m, n) with

Confidence Intervals

two-sided

upper

lower

Example 6.28 In an effort to improve their quality, the Glass Bottle Company (GBC) has completed a variance reduction initiative. As a result of this initiative, GBC now believes that the standard deviation of the volume of their brown glass bottles is 0.05 oz. They wish to test this hypothesis using a sample of size 20 and a level of significance of 0.05.

(a) State any required assumptions.

Volume is normally distributed.

(b) What if further testing revealed that this assumption was invalid?

You would be stuck.

(c) State the null and alternative hypotheses, the test statistic and critical region.

101

Page 102: En505 engineering statistics student notes

H0: H1:

(d) Suppose the sample standard deviation is 0.065 oz. State and interpret the conclusion of the test.

(e) Construct a 95% confidence interval on the population standard deviation.

Example 6.29 Let X denote the age of an Engineering Statistics student at the Philadelphia University and consider the following hypothesis test.

H0: H1:

We wish to perform this test using a level of significance of 0.05.

(a) Suppose we wish to detect a true standard deviation of 6.0 years with probability 0.95. What sample size should we use?

power of the test = 0.95

Chart VII(k) n = 15

(b) If this sample size is used, what is the probability of a Type II error if = 4.5 years?

102

Page 103: En505 engineering statistics student notes

(c) Suppose this sample size is used and S = 4.4025 years. Use a P-value to

determine the conclusion resulting from the test.

6.6 Population Proportions

Sometimes we wish to perform a hypothesis test on a population proportion p.

Examples of population proportions are:

proportion of registered voters that favor term limits proportion of manufactured items that are defective probability of winning a game probability of successfully completing a mission

The general definition of p is the proportion of members of the population that

belong to the class of interest. In some cases, p corresponds to the probability of success

for a Bernoulli trial.

Testing Population Proportions

Assumptions population is very large (or infinite)

Potential Tests

Test StatisticFor a random sample of size n, we compute X = the number of members

sampled that belong to the class of interest or X = the number of successes.

103

Page 104: En505 engineering statistics student notes

Note that we are going to take advantage of the normal approximation to the

binomial. Therefore, all of our results are “approximate”, and the larger n is, the better

the approximation is.

Critical Regions

H1: p p0

H1: p > p0 H1: p < p0

P-Values

H1: p p0

H1: p > p0

H1: p < p0

OC Function

H1: p p0

H1: p > p0

H1: p < p0

Choice of Sample Size

two-sided test

104

Page 105: En505 engineering statistics student notes

one-sided test

Confidence Intervals

Recall .

two-sided

upper

lower

Reject H0 if p0 is not in the confidence interval.

Choice of Sample Size for Confidence Intervals

two-sided

one-sided

Example 6.30 A beverage producer purchases their brown glass bottles from GBC. However, they purchase their caps from another supplier. Prior to using a shipment of these caps in their bottling process, they inspect 500 of them. Each inspected cap is classified as defective or non-defective. The producer has agreed with their supplier that the true proportion defective should not exceed 0.04. They wish to use the inspection data to perform an appropriate test using a level of significance of 0.10.

(a) State the null and alternative hypotheses, the test statistic and the critical region.

H0: p = 0.04H1: p > 0.04

105

Page 106: En505 engineering statistics student notes

(b) For a particular shipment, suppose that 27 of the inspected caps are defective. State and interpret the conclusion of the test.

Z0 = 1.5975

.

(c) Compute the P-value for the test.

(d) What is the power of the test when p = 0.08?

(e) If the producer wishes to have a Type II error probability of 0.05 when p = 0.1, then what sample size should they use?

Example 6.31 Let p denote the proportion of engineering students at the Philadelphia University that are afraid to fly.

(a) Suppose we wish to construct a 95% confidence interval on p such that the error in our point estimate is 15% or less. What sample size should we use?

(b) Suppose this sample size is used and 9 of the surveyed students are afraid to fly. Construct a point estimate of p.

(c) Construct a 95% confidence interval on p.

106

Page 107: En505 engineering statistics student notes

(d) Use this confidence interval to evaluate the following hypothesis test.

H0: p = 0.3H1: p 0.3

0.3 is in the confidence interval fail to reject H0

(e) What is the level of significance for the test evaluated in part (d)?

0.05 (95% confidence interval)

107

Page 108: En505 engineering statistics student notes

7 DECISION MAKING FOR TWO SAMPLES

Comparing Two PopulationsIn many cases, we wish to use hypothesis testing to compare two populations. We denote these as Population 1 and Population 2, and we use the population numbers as subscripts on parameters, statistics, and sample sizes.

Population 1

parameter of interest: 1, 1 or p1

sample size: n1

statistic of interest: , S1 or Population 2

parameter of interest: 2, 2 or p2

sample size: n2

statistic of interest: , S2 or

7.1 Comparing Two Population Means, Variance Known

Assumptions

the two populations are independent 1 and 2 are known the populations are normally distributed (or the conditions of the Central Limit Theorem hold)

Parameter of Interest1 2

Point Estimate

Potential Tests

H0: 1 2 = 0 H0: 1 2 0 H0: 1 2 0

108

Page 109: En505 engineering statistics student notes

Test Statistic

Critical Region

H1: 1 2 0 Reject H0 if Z0 > Z/2 or if Z0 < Z/2

H1: 1 2 > 0 Reject H0 if Z0 > Z

H1: 1 2 < 0 Reject H0 if Z0 < Z

P-ValuesH1: 1 2 0

H1: 1 2 > 0

H1: 1 2 < 0

OC Function = 1 2

H1:1 2 0

H1: 1 2 > 0

H1: 1 2 < 0

Choice of Sample Size

n = n1 = n2

two-sided test

109

Page 110: En505 engineering statistics student notes

one-sided test

Using OC Curves for Computing and Sample Size

H1: 1 2 0 use Charts VII(a) and VII(b)H1: 1 2 > 0 use Charts VII(c) and VII(d)H1: 1 2 < 0 use Charts VII(c) and VII(d)

Confidence Intervalstwo-sided

upper

lower

Note: Fail to reject if zero (0) is within the confidence interval

Choice of Sample Size for Confidence Intervals

two-sided

one-sided

110

Page 111: En505 engineering statistics student notes

Examples

Example 7.1 An automobile manufacturer wishes to purchase its batteries from an outside supplier. The key quality characteristic of these batteries is voltage. Two suppliers are competing for the manufacturer’s business (Supplier 1 and Supplier 2). Both suppliers have normally distributed voltage and a standard deviation in voltage of 0.15 v. Therefore, the manufacturer only needs to compare their means. The QC director has decided to make this comparison using a two-sample hypothesis test and a level of significance of 0.05.

(a) State the null and alternative hypothesis.

H0: 1 2 = 0H1: 1 2 0

(b) Identify the test statistic.

(c) What sample size should be used if the manufacturer wishes to detect a difference of 0.25 volts with probability 0.9?

(d) Identify the critical region.

Reject H0 if Z0 > 1.96 or if Z0 < 1.96

(e) If the sample size prescribed in part (c) is used and the resulting sample means are and , then what is the conclusion resulting from the test?

111

Page 112: En505 engineering statistics student notes

Fail to reject H0 and conclude that 1 2 = 0.

(f) Find the P-value for this test.

(g) What is the Type II error probability for this test if 1 2 = 0.15?

= P(3.96 Z 0.04) = 0.4840

(h) Construct a 95% confidence interval on 1 2.

0.067 1 2 0.227

(i) If we wanted the confidence interval in part (h) to have a half-width of 0.05 volts or less, how many additional batteries would have to be tested?

Example 7.2 Let X1 denote the GPA of a female engineering student at the Philadelphia University, and let X2 denote the GPA of a male engineering student at the Philadelphia University. It is common knowledge that 1 = 2 = 0.5. A female student has made the dangerous claim that females are better engineering students than males, and she wishes to support this claim with GPA data on 8 female and 12 male engineering students. The results of this data collection are and .

(a) Formulate an appropriate hypothesis test.

112

Page 113: En505 engineering statistics student notes

H0: 1 2 = 0H1: 1 2 > 0

(b) What assumption(s), if any, do we need to make to proceed with this hypothesis

test?

GPA is normally distributed. The two populations are independent.

(c) Does the data support the female student’s claim? Demonstrate that all three

hypothesis testing approaches yield the same result. Use a level of significance of

0.10.

Critical Region

Reject H0 if Z0 > Z = 1.282

P-Value (smallest level of significance)

Confidence Interval

90% lower-confidence interval

7.2 Inference on the Means of Two Populations, Variances

Unknown

If the population variances are unknown but the sample sizes exceed 30, then we can use the two-sample Z-test (lecture 20), replacing 1 with S1 and 2 with S2. Otherwise, we must use one of three two-sample t-tests.

113

Page 114: En505 engineering statistics student notes

7.2.1 Variances Unknown but Equal

Assumptions

the two populations are independent 1 and 2 are unknown, but = 1 = 2

the populations are normally distributed

Parameter of Interest

1 2

Point Estimate

Potential Tests

H0: 1 2 = 0 H0: 1 2 = 0 H0: 1 2 = 0

H1: 1 2 0 H1: 1 2 > 0 H1: 1 2 < 0

Test Statistic

The pooled estimator of σ2, denoted by is defined by

Critical Region = n1 + n2 2H1: 1 2 0 Reject H0 if T0 > t/2, or if T0 < t/2,

H1: 1 2 > 0 Reject H0 if T0 > t,

H1: 1 2 < 0 Reject H0 if T0 < t,

P-Values

114

Page 115: En505 engineering statistics student notes

H1: 1 2 0

H1: 1 2 > 0 P = P(t > T0)

H1: 1 2 < 0 P = P(t < T0)

Using OC Curves for Computing and Sample Size

= 1 2

n = n1 = n2

sample sizes on the OC curves are actually 2n 1

two-sided test use Charts VII(e) and VII(f)one-sided test use Charts VII(g) and VII(h)

Confidence Intervalstwo-sided

upper

lower

Example 7.3 A bridge construction firm purchases their shear pins from an outside supplier. The key characteristic of these pins is their tensile strength. Currently, the firm purchases their pins from Supplier 1. Recently, a sales representative from Supplier 2 visited the firm. Supplier 2 claimed that, although their pins have the same standard deviation as Supplier 1, their mean tensile strength is larger. As a result of this

115

Page 116: En505 engineering statistics student notes

visit, the construction firm has asked you to test this claim using 15 of each supplier’s pins and a level of significance of 0.01.

(a) State the null and alternative hypotheses.

(b) State any assumptions that are required to perform this test.

Tensile strength is normally distributed.

(c) Identify the test statistic and the critical region.

The results of the test were:

psi S1 = 98.8 psi psi S2 = 103.4 psi

(d) Estimate the two suppliers’ standard deviation.

Sp = 101.1 psi

(e) State the conclusion resulting from the test and find the P-value for the test.

116

Page 117: En505 engineering statistics student notes

(f) What is the power of the test if Supplier 2’s mean tensile strength is 100 psi more than Supplier 1?

(g) If we wish to detect a superiority (for Supplier 2) of 150 psi with probability 0.90, then what sample size should we have used?

(h) Construct a 99% confidence interval that is relevant to this problem.

7.2.2 Variances Unknown and Unequal

Assumptions

the two populations are independent 1 and 2 are unknown and not believed to be equal the populations are normally distributed

Parameter of Interest1 2

Point Estimate

117

Page 118: En505 engineering statistics student notes

Potential Tests

Test Statistic

When the null hypothesis is true, this statistic has approximately a t distribution. Therefore, all the methods in this section are approximate.

Critical Region

(round down)

H1: 1 2 0 Reject H0 if T0 > t/2, or if T0 < t/2,

H1: 1 2 > 0 Reject H0 if T0 > t,

H1: 1 2 < 0 Reject H0 if T0 < t,

P-ValuesH1: 1 2 0

H1: 1 2 > 0 P = P(t > T0)H1: 1 2 < 0 P = P(t < T0)

Confidence Intervalstwo-sided

upper

118

Page 119: En505 engineering statistics student notes

lower

Example 7.4 The bridge construction firm purchases another type of shear pin from an outside supplier. Currently, the firm purchases their pins from Supplier A. Recently, a sales representative from Supplier B visited the firm. Supplier B claimed that their mean tensile strength is larger. As a result of this visit, the construction firm has asked you to test this claim using 23 of each supplier’s pins and a level of significance of 0.05.

(a) State the null and alternative hypotheses.

H0: A B = 0H1: A B < 0

(b) Identify the test statistic and the critical region.

Reject H0 if T0 < t0.05,

The results of the test were:

psi SA = 37.3 psi psi SB = 52.8 psi

(c) State the conclusion resulting from the test and find the P-value for the test.

119

Page 120: En505 engineering statistics student notes

(d) Construct a 95% confidence interval that is relevant to this problem.

7.3 Pairs of Observations, the Paired t- Test

A special case of the two-sample t-tests occurs when the observations of the two populations of interest are collected in pairs.

An automobile manufacturer wishes to compare the mean tread wear for front axle tires as compared to rear axle tires. Tires are installed on 10 cars and they are driven under defined experimental conditions. The resulting observations would be:

(X11, X21) (total wear on front tires of car 1, total wear on rear tires of car 1)(X12, X22) (total wear on front tires of car 2, total wear on rear tires of car 2)

We only use this approach when we believe that pairing the observations results in a large positive correlation between the observations within each pair. If we don’t believe this to be true, then we are better off using the tests from the previous two sections.

7.3.1 The Paired t-Test

Let (X11, X21), (X12, X22), … , (X1n, X2n) be a set of n paired observations. Define the differences between each pair of observations as

Dj = X1j X2j j = 1, 2, … n.

Having computed the difference for each pair, we then compute the average of the differences, , and the standard deviation of the differences SD.

Assumptions

the Dj’s are iid normal random variables

Parameter of Interest

D = 1 2

Point Estimate

120

Page 121: En505 engineering statistics student notes

Potential Tests

H0: 1 2 = 0 H0: 1 2 = 0 H0: 1 2 = 0

H1: 1 2 0 H1: 1 2 > 0 H1: 1 2 < 0

Test Statistic

Critical Region

H1: 1 2 0 Reject H0 if T0 > t/2,n-1 or if T0 < t/2,n-1

H1: 1 2 > 0 Reject H0 if T0 > t,n-1

H1: 1 2 < 0 Reject H0 if T0 < t,n-1

P-Values

H1: 1 2 0

H1: 1 2 > 0 P = P(tn-1 > T0)

H1: 1 2 < 0 P = P(tn-1 < T0)

Confidence Intervals

two-sided

upper

lower

121

Page 122: En505 engineering statistics student notes

Example 7.5 A consumer ratings magazine has developed a test to compare the mean life length of two brands of batteries. Five electronic toys were used to make the comparison. Two of each type of toy were purchased, and one toy of each type was powered by each type of battery (Type 1 and Type 2). The resulting durations of toy usage are given below.

Toy Battery Type 1 Battery Type 21 52.6 hr 61.4 hr2 103.4 hr 112.8 hr3 68.2 hr 67.1 hr4 88.4 hr 92.3 hr5 111.6 hr 121.5 hr

(a) State the null and alternative hypotheses.

H0: 1 2 = 0H1: 1 2 0

(b) State any assumptions that you are making.

Dj = X1j X2j, j = 1, 2, … , 5

D1, D2, … , D5 are iid normal random variables.

(c) Identify the test statistic and the critical region (use = 0.05).

Reject H0 if T0 > t/2,n-1 = 2.776 or if T0 < t/2,n-1 = 2.776

(d) State the conclusion resulting from the test and find the P-value for the test.

122

Page 123: En505 engineering statistics student notes

Reject H0 and conclude that 1 2 0.

(e) Construct a 95% confidence interval that is relevant to this problem.

7.4 Inference on the Ratio of Variances of Two Normal

Populations

7.4.1 The F Distribution

One of the most useful distributions in statistics is the F distribution. Let W and Y be two independent random each one with u and v number of degrees of freedom respectively. Then the ratio of two

has the probability density function

123

Page 124: En505 engineering statistics student notes

Then, the ratio is said to follow the F distribution with u degrees of freedom in the numerator and v number of degrees of freedom in the denominator.

Theorem 7.1 The F Distribution

Consider two independent normal populations having standard deviations 1 and 2 respectively. Suppose a random sample of size n1 is taken from the first population, and let S1 denote the sample standard deviation. Suppose a random sample of size n2 is taken from the second population, and let S2 denote the sample standard deviation. Then:

has an F distribution with n1 1 numerator degrees of freedom and n2 1 denominator degrees of freedom.

Example 7.6 Suppose W has an F distribution with 8 numerator degrees of freedom and 13 denominator degrees of freedom.

(a) P(W > 1.49) =

Note that Excel and the tables give you the P(W > x)

(b) P(W < 2.77) =

(c) P(W > 0) = 1

(e) Find w such that P(W > w) = 0.025

(f) Find w such that P(W < w) = 0.99 P(W >w) = 1-0.99 = 0.01

w = f0.01,8,13 = FINV(0.01, 8, 13) = 4.30208 =

Note that

7.4.2 Hypothesis Testing on the Ratio of Two Variances

Suppose we wish to compare the standard deviations of two populations.

124

Page 125: En505 engineering statistics student notes

Assumptions the two populations are independent the populations are normally distributedParameter of Interest

Point Estimate

Potential Tests

H0: H0: H0:

H1: H1: H1:

Test Statistic

If the null hypothesis is true, then the test statistics has an F distribution.

Performing the Test

Critical Region

H1: Reject H0 if or if

H1: Reject H0 if

H1: Reject H0 if

P-Values

H1:

H1:

H1:

125

Page 126: En505 engineering statistics student notes

Using OC Curves for Computing and Sample Size

n = n1 = n2

two-sided test use Charts VII (o) and VII (p)one-sided test use Charts VII (q) and VII (r)

Use for H1: .

Confidence Intervals

two-sided

upper

lower

Reject H0 if 1 is not in the confidence interval.

Example 7.7 A company which manufactures aircraft is studying the purchase of the glass used to make the windshields for one of its aircraft. Two suppliers, Supplier 1 and Supplier 2, are competing for this business. The characteristic of the glass that is of particular interest is its thickness. It has already been determined that both suppliers have the same mean thickness. However, Supplier 1 claims to have superior performance with respect to variability. The manufacturer wishes to test this claim using a sample of size 10 (for each supplier) and a level of significance of 0.01.(a) State the null and alternative hypothesis, the test statistic, and the critical region.

126

Page 127: En505 engineering statistics student notes

(b) State any required assumptions.

Glass thickness is normally distributed, and the two suppliers are independent.

(c) Suppose S1 = 0.023 in and S2 = 0.028 in. State and interpret the conclusion of this test.

(d) What is the P-value for this test?

Because of the nature of the F distribution tables, I do not recommend using P-values to perform this hypothesis test.

(e) Construct a confidence interval on 1 / 2 that is relevant to this problem.

99% upper confidence interval

(f) What is the power of this test if 1 = 0.252?

127

Page 128: En505 engineering statistics student notes

(g) What sample size should we have used if we want the Type II error probability to be 0.1 when 1 = 0.22?

Example 7.8 Let X1 denote the GPA of a female engineering student at the

Philadelphia University, and let X2 denote the GPA of a male engineering student at the

Philadelphia University. Consider the following hypothesis test.

Suppose we wish to perform this test using a level of significance of 0.05.

(a) If we want the power of the test to be 0.9 when 1 = 3.22, then what sample size should we use?

(b) If this sample size is used, what is the probability of a Type II error when 1 = 2.42?

(c) If this sample size is used, what is the probability of a Type I error?

= 0.05

(d) Identify the test statistic and the critical region for this test.

128

Page 129: En505 engineering statistics student notes

(e) Suppose the test is implemented and S1 = 0.5315 and S2 = 0.5476. State and interpret the conclusion resulting from this test.

(f) Verify that a confidence interval would have lead to the same conclusion.

95% confidence interval

7.5 Performing the Test on Two Population Proportions

Assumptions the two populations are independent and largeNote that all procedures are approximate based on the normal approximation to the binomial.Parameter of Interest

p1 p2

Point Estimate

Potential TestsH0: p1 = p2 H0: p1 = p2 H0: p1 = p2

H1: p1 p2 H1: p1 > p2 H1: p1 < p2

Test Statistic

129

Page 130: En505 engineering statistics student notes

where

Critical Region

H1: p1 p2 Reject H0 if Z0 > Z/2 or if Z0 < Z/2

H1: p1 > p2 Reject H0 if Z0 > Z

H1: p1 < p2 Reject H0 if Z0 < Z

P-Values

H1: p1 p2

H1: p1 > p2 P = P(Z > Z0)H1: p1 < p2 P = P(Z < Z0)

OC Function

q1 = 1 p1

q2 = 1 p2

H1: p1 p2

H1: p1 > p2

H1: p1 < p2

Choice of Sample Sizen = n1 = n2

130

Page 131: En505 engineering statistics student notes

two-sided test

one-sided test

Confidence Intervals

two-sided

upper

lower

Reject H0 if 0 is not in the confidence interval.

Example 7.9 The California legislature is considering a new bill which will affect the citizens of Los Angeles and San Francisco. Newspaper reports have indicated that 80% of the citizens of these cities oppose the provisions of the bill. The legislature has hired an independent firm to determine if, in fact, the proportion is the same for citizens of both cities. Other sources have indicated that the proportion is actually larger for citizens of Los Angeles. The firm intends to use a level of significance of 0.05.

(a) State the null and alternative hypotheses, the test statistic and the critical region.

p1 = proportion of Los Angeles citizens who oppose the billp2 = proportion of San Francisco citizens who oppose the bill

131

Page 132: En505 engineering statistics student notes

(b) If p1 = 0.85 and p2 = 0.75, the firm wishes to have a Type II error probability of 0.10. How many citizens of each city should they survey?

(c) Suppose the sample size identified in part (b) is used and the results are X1 = 228 and X2 = 211. Evaluate the results of the test using a P-value.

.

(d) What is the power of this test if p1 = 0.82 and p2 = 0.78?

132

Page 133: En505 engineering statistics student notes

(e) Construct a confidence interval that is relevant to this problem.

133