+ All Categories
Home > Documents > Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.1 UNIT 1 Part II Mathematical...

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.1 UNIT 1 Part II Mathematical...

Date post: 03-Jan-2016
Category:
Upload: rhoda-miller
View: 213 times
Download: 1 times
Share this document with a friend
93
Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.1 UNIT 1 Part II Mathematical Foundation Random Variables and Discrete Probability Distributions
Transcript

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.1

UNIT 1Part II

Mathematical Foundation

Random Variables andDiscrete Probability

Distributions

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.2

Random Variables…

A random variable is a function or rule that assigns a number to each outcome of an experiment. Basically it is just a symbol that represents the outcome of an experiment.

X = number of heads when the experiment is flipping a coin 20 times.

C = the daily change in a stock price.

R = the number of miles per gallon you get on your auto during a family vacation.

Y = the amount of medication in a blood pressure pill.

V = the speed of an auto registered on a radar detector used on I-20

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.3

Two Types of Random Variables… Discrete Random Variable – usually count data [Number of]

* one that takes on a countable number of values – this means you can sit down and list all possible outcomes without missing any, although it might take you an infinite amount of time.X = values on the roll of two dice: X has to be either 2, 3, 4, …, or 12.Y = number of accidents on the UTA campus during a week: Y has to be 0, 1, 2, 3, 4, 5, 6, 7, 8, ……………”real big number”

Continuous Random Variable – usually measurement data [time, weight, distance, etc]

* one that takes on an uncountable number of values – this means you can never list all possible outcomes even if you had an infinite amount of time.X = time it takes you to drive home from class: X > 0, might be 30.1 minutes measured to the nearest tenth but in reality the actual time is 30.10000001…………………. minutes?)

Exercise: try to list all possible numbers between 0 and 1.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

3 view of probability• Frequentist• Mathematical• Bayesian (knowledge-based)

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Sample space

• A universe of elementary outcomes. In elementary treatments, we pretend that we can come up with sets of equiprobable outcomes (dice, coins, ...). Outcomes are very small.

• An event is a set of those outcomes.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Probability measure

• Every event (=set of outcomes) is assigned a probability, by a function we call a probability measure.

• The probability of every set is between 0 and 1, inclusive.

• The probability of the whole set of outcomes is 1.• If A and B are two event with no common

outcomes, then the probability of their union is the sum of their probabilities.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Cards• Out universe of outcomes is single card pulls.• Events: a red card (1/2); a jack (1/13);

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Other things to remember• The probability that event P will not happen (=event ~P

will happen) is 1-prob(P).• Prob (null outcome) = 0.• p ( A B ) = p(A) + p(B) - p( A B).

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Independence (definition)• Two events A and B are independent if the probability of

AB = probability of A times the probability of B (that is, p(A)* p(B) ).

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Conditional probability

This means: what's the probability of A if I already know B is true?

p(A|B) = p(A and B) / p (B) =

p(A B) / p(B)

Probability of A given B.

p(A) is the prior probability; p(A|B) is called a posterior probability. Once you know B is true, the universe you care about shrinks to B.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Bayes' rule

•prob (A and B) = prob (B and A); so

•prob (A |B) prob (B) = prob (B|A) prob (A)

-- just using the definition of prob (X|Y));

•hence

)(

)()|()|(

Bprob

AprobABprobBAprob

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Bayes’ rule as scientific reasoning• A hypothesis H which is supported by a set of data D

merits our belief to the degree that:

• 1. We believed H before we learned about D;• 2. H predicts data D; and• 3. D is unlikely.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

A random variable• a.k.a. stochastic variable.• A random variable isn't a variable. It's a function. It maps

from the sample space to the real numbers. This is a convenience: it is our way of translating events (whatever they are) to numbers.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Distribution function

• Distribution function:• This is a function that takes a real number x as its

input, and finds all those outcomes in the sample space that map onto x or anything less than x.

• For a die, F(0) = 0; F(1) = 1/6; F(2) = 1/3; F(3) = 1/2; F(4) = 2/3; F(5) = 5/6; and F(6) = F(7) = 1.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

discrete distribution function

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

discrete, continuous• If the set of values that the distribution function takes on is

finite, or countable, then the random variable (which isn't a variable, it's a function) is discete; otherwise it's continuous (also, it ought to be mostly differentiable).

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.17

Probability Distributions…

A probability distribution (density function) is a table, formula, or graph that describes the values of a random variable and the probability associated with these values.

– Discrete Probability Distribution, (this chapter)

X = outcome of rolling one die

– Continuous Probability Distribution

X 1 2 3 4 5 6P(X) 1/6 1/6 1/6 1/6 1/6 1/6

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.18

Discrete Probability Notation…

An upper-case letter will represent the name of the random variable, usually X.

Its lower-case counterpart, x, will represent the value of the random variable.

The probability that the random variable X will equal x is:

P(X = x) or more simply P(x)

X = number of heads in 10 flips of coin

P(X = 5) = P(5) = probability of 5 heads (x) in 10 flips

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.19

Discrete Probability Distributions…

Probabilities, P(x), associated with Discrete random variables have the following properties.

X 1 2 3 4 5 6P(X) 1/6 1/6 1/6 1/6 1/6 1/6

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.20

Developing Discrete Probability DistributionsProbability distributions can be estimated from relative frequencies. Consider the discrete (countable) number of televisions per household (X) from US survey data (Example 7.1)…

1,218 ÷ 101,501 = 0.012

e.g. P(X=4) = P(4) = 0.076 = 7.6%

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.21

Questions you might want answered

E.g. what is the probability there is at least one television but no more than three in any given household?

“at least one television but no more than three”P(1 ≤ X ≤ 3) = P(1) + P(2) + P(3) = .319 + .374 + .191 = .884

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.22

Developing Discrete Probability DistributionsTechniques covered in the Probability Chapter can be used to develop probability distributions, for example, a mutual fund sales person knows that there is 20% chance of closing a sale on each call she makes.

What is the probability distribution of the number of sales if she plans to call three customers?Random Variable = X = # Sales Made in 3 Attempts

Let S denote probability of closing a sale P(S)=.20Thus SC is not closing a sale, and P(SC)=.80

Seems reasonable to assume that sales are independent.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.23

Sample Space: List of all possible outcomesS1S2S3 : P(X = 3) = (.2)*(.2)*(.2) = 0.008 : P(3) = .008

SSSC : P(X = 2) = (.2)*(.2)*(.8) = 0.032

SSCS : P(X = 2) = (.2)*(.8)*(.2) = 0.032 : P(2) = .032+.032+.032

SCSS : P(X = 2) = (.8)*(.2)*(.2) = 0.032 (Additive Law)

SSCSC : P(X = 1) = (.2)*(.8)*(.8) = 0.128

SCSSC : P(X = 1) = (.8)*(.2)*(.8) = 0.128 : P(1) = .128+.128+.128

SCSCS : P(X = 1) = (.8)*(.8)*(.2) = 0.128 (Additive Law)

SCSCSC : P(X = 0) = (.8)*(.8)*(.8) = 0.512 : P(0) = .512

NOTE: P(S1S2S3) = P(S1) * P(S2/S1) * P(S3/S1S2) “Mult. Rule”

= P(S1) * P(S2) * P(S3) “independent?”

= (.2)*(.2)*(.2) = 0.008

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.24

Another Approach: Tree Diagram

Developing a Probability Distribution…

P(S)=.2

P(SC)=.8P(S)=.2

P(S)=.2

P(S)=.2

P(S)=.2

P(SC)=.8

P(SC)=.8

P(SC)=.8

P(SC)=.8

S S S

S S SC

S SC S

S SC SC

SC S S

SC S SC

SC SC S

SC SC SC

P(S)=.2

P(SC)=.8

P(SC)=.8

P(S)=.2

X P(x)3 .23 = .0084 3(.032)=.0965 3(.128)=.3840 .83 = .512

(.2)(.2)(.8)= .032

Sales Call 1

Sales Call 2

Sales Call 3

P(X=2) is illustrated here…

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.25

Final Discrete Probability Distribution

The mean of a discrete random variable is the weighted average of all of its values. The weights are the probabilities. This parameter is also called the expected value of X and is represented by E(X).

The variance is

The standard deviation is

X 0 1 2 3P(x) 0.008 0.096 0.384 0.512

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.26

Computing Mean, Variance, and Std. Dev. for Discrete Random

Variable

Mean = 0*(.008) + 1*(.096) + 2*(.384) + 3*(.512)

= 2.4

Variance = (0-2.4)2*(.008) + (1-2.4)2*(.096)

+ (2-2.4)2*(.384) + (3-2.4)2*(.512)

= .046 + .188 + .061 + .184 = .479

Std. Dev. = SQRT(.479) = .692

We are as smart as the goddess of statistics now, since we know the true mean, variance, and standard deviation of the population.

X 0 1 2 3P(x) 0.008 0.096 0.384 0.512

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Expectation

● The Expectation of a R. V.● Properties of Expectation● Variance● The Mean and the Median● Covariance and Correlation● Conditional Expectation● The Sample Mean

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

• Although the distribution of a random variable is the ‘object’ that contains all the probabilistic information about the r.v., it is often times not easy to ‘see through it’, especially when the number of possible values is too big.

• This is why it is preferable to have a few values that summarize the information given in a distribution.

• The average or mean comes in handy because it gives an idea of where we expect the values of X to be. The mean is the center of the distribution.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Expectation of a Discrete Distribution

• First, if the number of possible values of X is finite (say N) and all these values are equally likely, then each one contributes the same to the average (i.e.

1/N), which givesμ ≡ E[X]:= 1 ∕ N (x1+x2+…+xN)

= ∑i (1 ∕ N ) * xi

• However, if the values of X are not equally likely, then every value must contribute to the average according to its weight

• μ ≡ E[X]:= ∑i pi * xi

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Example

• The expectation of the r.v. distributed as in the table below is:

E[X] = (-3)(0.4)+(-1)(0.1)+(3)(0.2)+(5)(0.3) = -1.2-0.1+0.6+1.5

= 0.8

x -3 -1 3 5

p(x) 0.4 0.1 0.2 0.3

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Another Discrete Example: Binomial b(n,p)• A coin has a probability of 0.4 heads. The number X

of heads in four tosses of this coin is b(4,0.4). The distribution is given below.

• E[X] = 0* 0.1296 + 1* 0.3456 + 2* 0.3456 + 3* 0.1536 + 4* 0.0256 = 0.1600

• Note that 4*(0.4) = 0.16• More generally, we can show that the expected value

of b(n,p) is simply np

x 0 1 2 3 4

p(x) 0.1296 0.3456 0.3456 0.1536 0.0256

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Expectation of a Continuous Distribution For a continuous r.v. X, the mathematical

expectation is defined as the integral: E[X] = -∞∫∞xf(x)dx whenever the latter exists.

Remark: the above integral and hence E[X] exist when -∞∫∞|x|f(x)dx < ∞.

E[X] has several names: mathematical expectation, expectation, mean and first moment.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Expectation of a Function of a R.V.Let Y = r(X) be a function of a random variable X

whose distribution is known. We want to find the expected value of Y.The straightforward method is to find the distribution

of Y, say g(y) and then E[Y] = -∞∫∞yg(y)dy if Y is continuousand E[Y] = ∑y yg(y) if Y is discrete.

Luckily we don’t need to find the distribution of Y:E[Y] = E[r(X)] = -∞∫∞r(x)f(x)dx for continuous and

E[Y] = E[Y] = ∑x r(x)f(x) for discrete X

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Illustration for Previous Slide

• X has the p.f. in the left table.• Y is defined to be X2

• Hence the p.f. of Y is given in the right table.• E[Y] calculated from its distribution is (1)(0.3)+(9)

(0.7) = 3/10 + 63/10 = 66/10 = 6.6• Calculated directly from the p.f. of X,

E[Y] = (-3)2(0.4)+(-1)2(0.1)+(1)2(0.2)+(3)2(0.3)

= 36/10 + 1/10 + 2/10 + 27/10 = 66/10 = 6.6

x -3 -1 1 3

p(x) 0.4 0.1 0.2 0.3

y 1 9

p(y) 0.3 0.7

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Section 4.2

Properties of Expectations

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Section Abstract• We prove some theorems/properties of the mathematical

expectation that are mainly inherited from the integral/summation nature of the expectation.

• These properties simplify the derivation and calculation of some classes of functions

(the results are gathered without proof in the next slide)

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

If Y = aX + b then E[Y] = aE[X] + b.If there is a constant a such that

Pr(X ≥ a) = 1 then E[X] ≥ a. If there is a constant b such that

Pr(X ≤ b) = 1 then E[X] ≤ b. Sum of R.V.: If X1,X2,…,Xn are n random variables

such that each expectation E[Xi] exists thenE[X1+X2+…+Xn] = E[X1] + …+ E[Xn]

Product of R.V.: If X1,X2,…,Xn are n independent random variables such that each expectation E[Xi] exists thenE[i=1ΠnXi] = i=1ΠnE[Xi]

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.38

Laws of Expected Value…”Useful to know”1. E(c) = c

* The expected value of a constant (c) is just the value of the constant.

2. E(X + c) = E(X) + c

* The expected value of a random variable plus a constant is the expected value of the random variable plus the constant

3. E(cX) = cE(X) •The expected value of a constant times a random variable is the constant times the expected value of the random variable.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.39

Laws of Expected Value…”Useful to know”E(c1X1 + c2X2 + c3X3 + c4X4 + c5X5)

= c1E(X1) + c2E(X2) + c3E(X3) + c4E(X4) + c5E(X5)

Example: what is the expected mean weight of a surgical pack containing 5 components [maybe we could weigh the pack to determine if one of the components is missing].

True when random variables are independent!!!

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.40

Laws of Variance…

1. V(c) = 0• The variance of a constant (c) is zero.

2. V(X + c) = V(X)• The variance of a random variable and a constant is just the variance of the random variable.

3. V(cX) = c2V(X) • The variance of a random variable and a constant coefficient is the coefficient squared times the variance of the random variable.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.41

Laws…We can derive laws of expected value and variance for the sum of two independent

random variables as follows…E(X + Y) = E(X) + E(Y)V(X + Y) = V(X) + V(Y) **************************************************************X = weight of right shoes: Mean(X) = .5 lbs and Var(X) = .0004Y = weight of left shoes: Mean(Y) = .5 lbs and Var(Y) = .0004**************************************************************What is the mean and variance of a “Pair” of shoes. P = X +YE(P) = E(X + Y) = E(X) + E(Y) = .5 + .5 = 1.0V(P) = V(X+Y) = V(X) + V(Y) = .0004 + .0004 = .0008

NOTE: WEIGHTS OF RIGHT AND LEFT SHOE INDEPENDENT***************************************************************

? How could you determine the mean and variance of the weight of an automobile after you make all the parts but before you assemble the automobile

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Correlation and Covariance

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Goals for Today• Introduce the statistical concepts of

–Covariance

–Correlation

• Investigate invariance properties• Develop computational formulas

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Covariance• So far, we have been analyzing summary statistics that

describe aspects of a single list of numbers• Frequently, however, we are interested in how variables

behave together

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Smoking and Lung Capacity• Suppose, for example, we wanted to investigate the

relationship between cigarette smoking and lung capacity• We might ask a group of people about their smoking

habits, and measure their lung capacities

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Smoking and Lung Capacity

Cigarettes (X) Lung Capacity (Y)

0 45

5 42

10 33

15 31

20 29

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Smoking and Lung Capacity• With SPSS, we can easily enter these data and produce a scatterplot.

Smoking

3020100-10

Lun

g C

apac

ity

50

40

30

20

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Smoking and Lung Capacity• We can see easily from the graph that as smoking goes up,

lung capacity tends to go down.• The two variables covary in opposite directions.• We now examine two statistics, covariance and

correlation, for quantifying how variables covary.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Covariance• When two variables covary in opposite directions, as

smoking and lung capacity do, values tend to be on opposite sides of the group mean. That is, when smoking is above its group mean, lung capacity tends to be below its group mean.

• Consequently, by averaging the product of deviation scores, we can obtain a measure of how the variables vary together.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

The Sample Covariance• Instead of averaging by dividing by N, we divide

by . The resulting formula is

1N

1

1

1

N

xy i ii

S X X Y YN

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Calculating Covariance

Cigarettes (X)

dX dXdY dYLung

Capacity (Y)

0 10 +9 45

5 5 +6 42

10 0 0 3 33

15 +5 5 31

20 +10 7 29

215

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Calculating Covariance

• So we obtain

1( 215) 53.75

4xyS

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Invariance Properties of Covariance• The covariance is invariant under listwise addition, but not

under listwise multiplication. Hence, it is vulnerable to changes in standard deviation of the variables, and is not scale-invariant.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Invariance Properties of Covariance

If , theni i

i i

L aX b

dl adx

1

1 1

Let ,

1Then

1

1 1

1 1

i i i i

N

LM i ii

N N

i i i i xyi i

L aX b M cY d

S dl dmN

adx cdy ac dx dy acSN N

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Invariance Properties of Covariance• Multiplicative constants come straight through in the

covariance, so covariance is difficult to interpret – it incorporates information about the scale of the variables.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

The (Pearson) Correlation Coefficient

• Like covariance, but uses Z-scores instead of deviations scores. Hence, it is invariant under linear transformation of the raw scores.

1

1

1

N

xy i ii

r zx zyN

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Alternative Formula for the Correlation Coefficient

xyxy

x y

sr

s s

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Computational Formulas -- Covariance

• There is a computational formula for covariance similar to the one for variance. Indeed, the latter is a special case of the former, since variance of a variable is “its covariance with itself.”

1 1

1

1

1

N N

i iNi i

xy i ii

X Ys X Y

N N

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Computational Formula for Correlation• By substituting and rearranging, you obtain a substantial

(and not very transparent) formula for

xyr

2 22 2xy

N XY X Yr

N X X N Y Y

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Computing a correlation

Cigarettes (X)

XY

Lung Capacity (Y)

0 0 0 2025 45

5 25 210 1764 42

10 100 330 1089 33

15 225 465 961 31

20 400 580 841 29

50 750 1585 6680 180

2X 2Y

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Computing a Correlation

2 2

(5)(1585) (50)(180)

(5)(750) 50 (5)(6680) 180

7925 9000

(3750 2500)(33400 32400)

1075.9615

1250 (1000)

xyr

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Particular probability distributions:• Binomial• Gaussian, also known as normal• Poisson

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Binomial distribution

If we run an experiment n times (independently: simultaneous or not, we don't care), and we care only about how many times altogether a particular outcome occurs -- that's a binomial distribution, with 2 parameters: the probability p of that outcome on a single trial, and n the number of trials.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

• If you toss a coin 4 times, what's the probability that you'll get 3 heads?

• If you draw a card 5 times (with replacement), what's the probability that you'll get exactly 1 ace?

• If you generate words randomly, what's the probability that you'll have two the's in the first 10 words?

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

• In general, the answer is

knkknk qpkkn

nqp

k

n

!)!(

!

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.66

Binomial Distribution… 2 parameters [n and p]The binomial distribution is the probability distribution that

results from doing a “binomial experiment”. Binomial experiments have the following properties:

1. Fixed number of trials, represented as n.

2. Each trial has two possible outcomes, a “success” and a “failure”.

3. P(success)=p (and thus: P(failure)=1–p), for all trials.

4. The trials are independent, which means that the outcome of one trial does not affect the outcomes of any other trials.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.67

Success and Failure……are just labels for a binomial experiment, there is no value judgment implied. You may define either one of the 2 possible outcomes as “Success”

For example a coin flip will result in either heads or tails. If we define “heads” as success then necessarily “tails” is considered a failure (inasmuch as we attempting to have the coin lands heads up).

Other potential examples of binomial random variables:– A firecracker pops or fails to pop– A patient get an infection during an operation or does not get an infection

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.68

Binomial Random Variable…The random variable of a binomial experiment is defined as the number of successes, X, in the n trials, where the probability of success on a single trial is p.

E.g. flip a fair coin 10 times…

1) Fixed number of trials n=10

2) Each trial has two possible outcomes {heads (success), tails (failure)}

3) P(success)= 0.50; P(failure)=1–0.50 = 0.50 4) The trials are independent (i.e. the outcome of heads on the first flip will have no impact on subsequent coin flips).

Hence flipping a coin ten times is a binomial experiment since all conditions were met.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.69

Binomial Distribution [formula]

The binomial random variable (# of successes in n trials) can take on values 0, 1, 2, …, n. Thus, its a discrete random variable.

Once we know a random variable is binomial, we can calculate the probability associated with each value of the random variable from the binomial distribution:

x = # successes and n-x = # failures

for x=0, 1, 2, …, n

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.70

Cumulative Probability…“Find the probability that Pat fails the quiz”

If a grade on the quiz is less than 50% (i.e. 5 questions

out of 10), that’s considered a failed quiz.

P(fail quiz) = P(X < 4) = P(0)+P(1)+P(2)+P(3)+P(4)

Called a cumulative probability, that is, P(X ≤ x)

Note: Calculating all these individual probabilities would be tedious and time consuming, however, the Binomial tables at back of book gives you the cumulative probabilities [n=10, p=0.2, x=4]

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.71

Problem Calculate Individual Probabilities and Add Up!P(X ≤ 4) = P(0) + P(1) + P(2) + P(3) + P(4)

We already know P(0) = .1074 and P(2) = .3020. Using the binomial formula to calculate the others:P(1) = .2684 , P(3) = .2013, and P(4) = .0881

Hense P(X ≤ 4) = .1074 + .2684 + … + .0881 = .9672

OR

Use binomial tables at back of book for n=10, p=0.2, and x=4 “Next Slide”

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.72

Binomial Table…

“What is the probability that S fails the quiz”?

i.e. what is P(X ≤ 4), given P(success) = .20 and n=10 ?

P(X ≤ 4) = .967

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.73

Binomial Table…

“What is the probability that S gets no answers correct?”

i.e. what is P(X = 0), given P(success) = .20 and n=10 ?

P(X = 0) = P(X ≤ 0) = .107

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.74

Binomial Table…

“What is the probability that S gets two answers correct?”

i.e. what is P(X = 2), given P(success) = .20 and n=10 ?

P(X = 2) = P(X≤2) – P(X≤1) = .678 – .376 = .302remember, the table shows cumulative probabilities…

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.75

=BINOMDIST() Excel Function…

There is a binomial distribution function in Excel that can also be used to calculate these probabilities. For example:

What is the probability that Pat gets two answers correct?

# successes

# trials

P(success)

True: cumulative prob.False: individual prob.

P(X=2)=.3020

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.76

=BINOMDIST() Excel Function…

There is a binomial distribution function in Excel that can also be used to calculate these probabilities. For example:

What is the probability that Pat fails the quiz?

# successes

# trials

P(success)

cumulative(i.e. P(X≤x)?)

P(X≤4)=.9672

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.77

Binomial Distribution…As you might expect, statisticians have determined formulas for the mean, variance, and standard deviation of a binomial random variable. They are:

Previous example: n=10, p=0.2μ = n*p = 10*0.2 = 2σ2 = n*p*(1-p) = 10*0.2*0.8= 1.6σ = SQRT(1.6) = 1.26

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.78

Ways to Calculate Binomial Probabilities

1. Use the binomial distribution formula [not a good approach unless n is fairly small]

2. Use the binomial tables at the back of most stat books [not real good unless your specific value of “n” and “p” happen to be included in the tables]

3. Approximate the binomial probabilities from some other distributional form (normal) [no need to do this now that we have access to various statistical software that will do it for us]

4. Use Excel stat function “=BINOMDIST(x,n,p,false)” which will return the individual probability. Replace false with true and you will get the sum of the binomial probabilities from 0 up to x.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.79

Problem:

Student (…S..) failed to study for the next exam. S’s exam strategy is to rely on luck for the next quiz. The quiz consists of 10 multiple-choice questions (n=10). Each question has five possible answers, only one of which is correct (p=0.2).S plans to guess the answer to each question.

What is the probability that S gets no answers correct?

P(X=0) = P(0) =

What is the probability that S gets two answers correct?

P(X=2) = P(2) =

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.80

Solution:

n=10, and P(success) = .20

What is the probability that Pat gets no answers correct?

I.e. # success, x, = 0; hence we want to know P(x=0)

S has about an 11% chance of getting no answers correctusing the guessing strategy.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.81

Solution:

n=10, and P(success) = .20

What is the probability that Pat gets two answers correct?

I.e. # success, x, = 2; hence we want to know P(x=2)

S has about a 30% chance of getting exactly two answerscorrect using the guessing strategy.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Normal or Gaussian distribution

• Start off with something simple, like this:

2xe

That's symmetric around the y-axis (negative and positive x treated the same way -- if x = 0, then the value is 1, and it slides to 0 as you go off to infinity,

either positive or negative.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

Gaussian or normal distribution• Well, x's average can be something other than 0: it can be

any old

2)( xe

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

2

2

2

)(

x

e

And its variance (2) can be other than 1

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc.

And then normalize--

so that it all adds up (integrates, really) to 1, we have to divide by a normalizing factor:

2

2

2

)(

2

1

x

e

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.86

Poisson Distribution… 1 parameter [μ]Named for Simeon Poisson, the Poisson distribution is a discrete probability distribution and refers to the number of events (a.k.a. successes) within a specific time period or region of space. For example:

• The number of cars arriving at a service station in 1 hour. (The interval of time is 1 hour.)

• The number of flaws in a bolt of cloth. (The specific region is a bolt of cloth.)

• The number of accidents in 1 day on a particular stretch of highway. (The interval is defined by both time, 1 day, and space, the particular stretch of highway.)

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.87

Poisson Probability Distribution…

The probability that a Poisson random variable assumes a value of x is given by:

Note: μ is the only parameter [tell me μ and I can calculate the probabilities]and e is the natural logarithm base.

FYI:

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.88

Example

The number of typographical errors in new editions of textbooks varies considerably from book to book. After some analysis he concludes that the number of errors is Poisson distributed with a mean of 1.5 typos per 100 pages. The instructor randomly selects 100 pages of a new book. What is the probability that there are no typos?

That is, what is P(X=0) given that = 1.5?

“There is about a 22% chance of finding zero errors”

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.89

Poisson Distribution…

As mentioned on the Poisson experiment slide:

The probability of a success is proportional to the size of the interval

Thus, knowing an error rate of 1.5 typos per 100 pages, we can determine a mean value for a 400 page book as:

=1.5(4) = 6 typos / 400 pages.

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.90

Example …

For a 400 page book, what is the probability that there are

no typos?

P(X=0) =

“there is a very small chance there are no typos”

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.91

Example …

For a 400 page book, what is the probability that there are five or less typos?

P(X≤5) = P(0) + P(1) + … + P(5)

This is rather tedious to solve manually. A better alternative is to refer to Table 2 in Appendix B…

…k=5, =6, and P(X ≤ k) = .446

“there is about a 45% chance there are 5 or less typos”

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.92

Example …

…Excel is an even better alternative:

Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. 7.93

Poisson Practice

The number of infections [X] in a hospital each week has been shown to follow a poisson distribution with mean 3.0 infections per week. Calculate the following probabilities.•P(X = 0) =

•P(X < 4) =

•P(X > 9) =

•If you found 9 infections next week, what would you say??


Recommended