Docsity

Probability Theory: Understanding Conditional Probability and Binomial Distributions - Pro, Study notes of Data Analysis & Statistical Methods

Toggle sidebar
bg1
Lecture 14
Nancy Pfenning Stats 1000
Chapter 7: Probability
Last time we established some basic definitions and rules of probability:
Rule 1:
P(AC) = 1 −P(A).
Rule 2:
In general, the probability of one event or another occurring is
P(Aor B) = P(A) + P(B)−P(Aand B)
If the events are mutually exclusive, then P(Aand B) = 0 and so P(Aor B) = P(A) + P(B).
Rule 3:
In general, the probability of one event and another is
P(Aand B) = P(A)P(B|A)
which we can re-express as
P(B|A) = P(Aand B)
P(A)
If the events are independent, P(B|A) = P(B) and so P(Aand B) = P(A)P(B).
This time we utilize these rules to solve some more complicated problems, and discuss why at times
probabilities can be counter-intuitive.
Tree diagrams are often helpful in understanding conditional probability problems.
Example
(Game Show) Suppose a prize is hidden behind one of three doors A, B, or C. after the contestant
picks one of the three, the host reveals one of the remaining two doors, showing no prize. He gives
the guest a chance to switch to the door he or she did not select originally. Is the probability of
winning the prize higher with the “keep” or “switch” strategy? Use a probability tree to calculate
the probability of winning using each strategy.
When events occur in stages, we normally are interested in the probability of the second, given that
the first has occurred. At times, however, we may want to know the probability of an earlier event having
occurred, given that a later event ultimately occurred.
Example
Suppose that the proportion of people infected with AIDS in a large population is .01. If AIDS is
present, a certain medical test is positive with probability .997 (called the sensitivity of the test),
and negative with probability .003. If AIDS is not present, the test is positive with probability
.015, negative with probability .985 (called the specificity fo the test). Does a positive test
mean a person almost certainly has the disease? Let’s figure out the following: if a person tests
positive, what is the probability of having AIDS?
58
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Probability Theory: Understanding Conditional Probability and Binomial Distributions - Pro and more Study notes Data Analysis & Statistical Methods in PDF only on Docsity!

Lecture 14

Nancy Pfenning Stats 1000

Chapter 7: Probability

Last time we established some basic definitions and rules of probability:

Rule 1:

P (AC^ ) = 1 − P (A).

Rule 2:

In general, the probability of one event or another occurring is

P (A or B) = P (A) + P (B) − P (A and B)

If the events are mutually exclusive, then P (A and B) = 0 and so P (A or B) = P (A) + P (B).

Rule 3:

In general, the probability of one event and another is

P (A and B) = P (A)P (B|A)

which we can re-express as

P (B|A) =

P (A and B) P (A)

If the events are independent, P (B|A) = P (B) and so P (A and B) = P (A)P (B). This time we utilize these rules to solve some more complicated problems, and discuss why at times probabilities can be counter-intuitive. Tree diagrams are often helpful in understanding conditional probability problems.

Example

(Game Show) Suppose a prize is hidden behind one of three doors A, B, or C. after the contestant picks one of the three, the host reveals one of the remaining two doors, showing no prize. He gives the guest a chance to switch to the door he or she did not select originally. Is the probability of winning the prize higher with the “keep” or “switch” strategy? Use a probability tree to calculate the probability of winning using each strategy.

When events occur in stages, we normally are interested in the probability of the second, given that the first has occurred. At times, however, we may want to know the probability of an earlier event having occurred, given that a later event ultimately occurred.

Example

Suppose that the proportion of people infected with AIDS in a large population is .01. If AIDS is present, a certain medical test is positive with probability .997 (called the sensitivity of the test), and negative with probability .003. If AIDS is not present, the test is positive with probability .015, negative with probability .985 (called the specificity fo the test). Does a positive test mean a person almost certainly has the disease? Let’s figure out the following: if a person tests positive, what is the probability of having AIDS?

A tree diagram is very helpful for this type of problem. We’ll let A and not A denote the events of having AIDS or not, T and not T denote the events of testing positive or not. First we’ll find the overall probability of testing positive. Either a person has AIDS and tests positive or he/she does not have AIDS and tests positive:

P (T ) = P (A and T ) + P (not A and T ) According to the multiplication rule, it follows that P (T ) = P (A)P (T |A) + P (not A)P (T | not A) = .01(.997) + .99(.015) = .00997 + .01485 =. 02482 Now, we can apply the definition of conditional probability to find the probability we seek (prob- ability of having AIDS, given that a person tested positive):

P (A|T ) =

P (A and T ) P (T )

Thus, even if a person tests positive, he/she is more likely not to have the disease!

. 01 . 99

A

not A

. 997 . 003 . 985 . 015

T

not T

T

not T

P (A and T ) = .01(.997) =. 00997

P (not A and T ) = .99(.015) =. 01485

Most students—and even most physicians—would have expected the probability to be much higher. Conditional probabilities are often misunderstood, and people often are misled by confusion of the inverse: confusing the probability of having the disease, given that you test positive (P (A|T ) = .40), with the probability of testing positive, given that you have the disease (P (T |A) = .997).

Example

What is the chance that at least two people in a class of 50 share the same birthday? In a survey, the average of 52 responses was 23%. Is this intuitive guess close to the actual probability?

Example

Here is an easier example to solve before tackling the previous, more difficult one: What is the chance that at least two people in a group of 3 share the same birthday? [Assume all days to be equally likely, and disregard leapyear.] If we call the students A, B, and C, then at least two can share the same birthday in any of these ways: AB or AC or BC or ABC. They are all mutually exclusive, so by the addition rule, the probability of any one or the other happening is the sum of the four probabilities. Look first at the probability of A and B having the same birthday, and C different. Whatever A’s birthday is, the probability of B having the same birthday is 3651 , and the probability of C’s birthday being different is 364365. So, by the multiplication rule, the probability of B being the same and C being different is 3651 ∗ 364365. Similarly, the probabilities of A and C or B and C being the same are each 3651 ∗ 364365. The probability that A and B and C are all the same is 3651 ∗ 3651. Altogether, the probability is 3651 ∗ 364365 + 3651 ∗ 364365 + 3651 ∗ 364365 + 3651 ∗ 3651 = .0082.

Example

Consider the distribution of the R.V. X, the number of girls in a randomly chosen family with 3 children. This distribution can be found by first examining the sample space of all possible outcomes, with their associated probabilities, then using Rule 2 to specify the probabilities of the events of having 0, 1, 2, or 3 girls:

Sample Space Probability X BBB 18 0 BBG 18 1 BGB 18 1 GBB 18 1 BGG 18 2 GBG 18 2 GGB 18 2 GGG 18 3

Value of X 0 1 2 3 Probability (^18383818)

Note that each probability is between 0 and 1, and together they sum to 1.

  1. What is the probability that a randomly chosen family of 3 children has 2 girls? P (X =
    1. = 38.
  2. What is the probability of having at least 2 girls? P (X ≥ 2) = 38 + 18 = 48 = 12.
  3. What is the probability of having more than 2 girls? P (X > 2) = 18.

Note that for a discrete R.V. like this, whether or not we have strict inequality makes a difference. The probability distribution of a discrete R.V. can be displayed in a probability histogram, which represents all the possible values of a R.V. and their probabilities. Thus, it displays behavior for an entire (possibly abstract) population. The frequency histograms of Chapter 1 displayed behavior of (concrete) sample data values. In a probability histogram, possible values of the R.V. X are marked along the horizontal axis. As long as the possible values of X are in increments of 1, the height of each rectangle will be the same as its area, which equals the probability that the R.V. X takes the value at the rectangle’s base.

Means (Expected Values) and Variances of Random Variables

Sample mean and sample proportion are random variables as long as the sample has been chosen at random. Their distributions are of particular interest, because they will allow us to establish how good an estimate our sample statistics are for the unknown parameters of interest. As we learned in Chapter 2, a distribution may be summarized by telling its center and spread. Now we will focus on the mean as center and variance as spread of a random variable. The mean is simply the average of all the possible values of X, where more probable values are given more weight. We sometimes call it the expected value of X, written E(X). If X is a discrete random variable with possible values x 1 , x 2 , x 3 , · · · occurring with probabilities p 1 , p 2 , p 3 , · · ·, then the mean of X , or equivalently the expected value, is

μ = E(X) = x 1 p 1 + x 2 p 2 + x 3 p 3 + · · · = Σxipi

Example

What is the mean (expected) number of girls in a family of three children?

μ = E(X) = 0(

The average number of girls for a family with 3 children is 1.5.

Example

Use the probability distribution below to find the mean μ of all dice rolls:

Value of X 1 2 3 4 5 6 Probability (^161616161616)

μ = 1( 16 ) + 2( 16 ) + 3( 16 ) + 4( 16 ) + 5( 16 ) + 6( 16 ) = 216 = 3.5.

Example

Use the probability distribution below to find the mean μ of all household sizes X in the U.S.:

Value of X 1 2 3 4 5 6 7 Probability .25 .32 .17 .15 .07 .03.

μ = 1(.25) + 2(.32) + 3(.17) + 4(.15) + 5(.07) + 6(.03) + 7(.01) = 2.6.

Notice that the mean equalled the median (midpoint) in the first two examples because the distributions were perfectly symmetric. Median household size is 2 because 50% of households had 2 people or fewer; mean household size is higher than median because this distribution is right-skewed. To describe spread of a random variable X, we focus first on the variance σ^2 = V (X), then take its square root to find the standard deviation:

σ^2 = V (X) = (x 1 − μ)^2 p 1 + (x 2 − μ)^2 p 2 + (x 3 − μ)^2 p 3 + · · · = Σ(xi − μ)^2 pi

The standard deviation σ of X is the square root of the variance.

Example

Find standard deviation of X = number of girls in a family of 3 children. [Recall that μ = 1.5.]

V ar(X) = (0 − 1 .5)^2 (

) + (1 − 1 .5)^2 (

) + (2 − 1 .5)^2 (

) + (3 − 1 .5)^2 (

σ =

V ar(X) =

You should know how to calculate μ for a discrete random variable, and you will be required to calculate σ in a homework exercise, but not on quizzes or exams.

Binomial Distributions

Our primary goal in this course involves the use of statistics sample mean ¯x or sample proportion pˆ to estimate parameters population mean μ or population proportion p. If we take a simple random sample of size n from a population and observe for each individual the value of some quantitative variable (like height, number of girls, or household size), then we can calculate its sample mean value ¯x, and use it to estimate the unknown population mean μ. On the other hand, if we observe the value of some categorical variable (like gender) to see whether or not each individual has a particular characteristic, we can calculate sample count X, then sample proportion ˆp = X n of units falling into that category, and use ˆp to estimate the unknown p. In this section we will focus on sample count for categorical data.

Example

A recent survey of 1012 Americans found that 516 of them opposed gay marriage. We can set up a R.V. X for the sample count opposing, and say X takes the value 516 for this sample. Or, we can set up a R.V. ˆp = 1012 X for the sample proportion opposing, and say ˆp takes the value 516 1012 =^ .51.

Rule of Thumb: If the population is at least 10 times the sample size, replacement has little effect. In such cases, when taking a simple random sample of size n from a population with proportion p in a certain category, the sample count X in the category of interest is approximately binomial with the same n and p. Most problems for binomial R.V.’s take the form of a question like this: “If X is binomial with a certain n and p given, what is the probability that X equals some value, or lies within some range of values?” To answer such questions, we can

  1. Use the formula P (X = k) =

n k

pk(1 − p)n−k^ for k = 0, · · · , n [not done in this course]; or

  1. use binomial tables [not done in this course]; or
  2. use a calculator or MINITAB [not done in this course]; or
  3. use a normal approximation to find P (X ≤. 5 in) [done later in this chapter] or P (ˆp ≤. 5 in), where ˆp = X n [done in Chapter 9].

Since our normal approximation will be based on a variable having the same mean and standard deviation as the binomial variable of interest X, we first discuss the binomial mean and standard deviation. Earlier we found the mean value of X, the binomial count of girls in a family with three children, by using our formula for means of discrete random variables:

μ = E(X) = 0(

In fact, there is a much simpler way to find a binomial mean. If sample count X of successes is a binomial R.V. for n observations with probability p of success on each observation, then X has mean

μ = np

Example

The number of girls X in a family of 3 children is binomial with n = 3 and p = .5. The mean number of girls is μ = np = 3(.5) = 1.5.

The mean of a binomial R.V. is easy to grasp intuitively: Say the probability of success for each obser- vation is .2 and we make 10 observations. Then on the average we should have 10 ∗ .2 = 2 successes. The spread of a binomial distribution is not so intuitive, so we will not justify our formula for standard deviation:

σ =

np(1 − p)

Example

Standard deviation for number of girls X in a family of 3 children is σ =

.87, a much easier solution method than the one we used previously.

Example

Pick a card from a deck of 52, replace it, pick another. Do this 16 times. Let X be the R.V. for the number of red cards picked. Then X is binomial with n = 16, p = .5. Find the mean and standard deviation of X. μ = np = 16(.5) = 8; σ =

np(1 − p) =

16(.5)(1 − .5) = 2. In this situation, we’d expect on average to get 8 red cards, give or take about 2.

Example

The population of whole numbers from 1 to 20 have a mean of 10.5 and a standard deviation of 5.77. I am interested in the mean and standard deviation of all the numbers chosen “randomly” from 1 to 20 by students. I suspect the mean may be higher than 10.5, since people tend to think larger numbers are more “random” than smaller numbers. I suspect the standard deviation may be less than 5.77, since people may avoid extreme numbers like 1 and 20. First I record what proportion of students chose each number:

Next I calculate mean and standard deviation as follows:

μ = E(X) = 1(.0157) + 2(.0291) + · · · + 20(.0314) = 11. 614

V ar(X) = (1 − 11 .614)^2 (.0157) + (2 − 11 .614)^2 (.0291) + · · · + (20 − 11 .614)^2 (.0314) = 27. 85

σ =

V ar(X) =

As I suspected, the mean of 11.614 is higher than what it would be if students truly picked at random, and the standard deviation is lower. We can say students’ selections averaged 11.614, and they typically deviated from this average by about 5.28.

Exercise: Use the survey data to report the probability distribution of year for the undergraduates in the class (years 1, 2, 3, and 4). [You will need to tally the years and adjust the total to exclude “other” students.] Find the mean, variance, and standard deviation. Use mean and standard deviation in a sentence about the distribution of year in order to tell what is typical for students in the class.

Lecture 16

Last time we talked about a distribution that often applies when we are interested in a single categorical variable: the binomial count X for number of successes in a situation that allows for two possible categories, “success” and “failure”. Next we consider a distribution that arises when we are interested in a single quantitative variable whose possible values constitute a continuum. Unlike discrete R.V.’s, continuous R.V.’s can take all values in an interval of real numbers. The probability distribution of a continuous R.V. X is represented by a density curve. The probability of an event is the area under the curve over the values of X that make up the event: P (a ≤ X ≤ b) equals the area under the curve from a to b. The total area under the curve is 1, so the probability of any event must be between 0 and 1. The mean μ of a continuous R.V. tells its center or “balance point”; the standard deviation σ tells its spread. The simplest continuous random variable is the uniform R.V., which takes any value over an interval with equal probability.

Note that since Table A.1 only shows us the probability of values z being less than a given value z∗, we must either use symmetry or the fact that total area is one to find proportion of values greater than a given value. The above examples give a certain value z∗^ and ask for a probability. The next examples will give us a probability or percentile and ask for the corresponding value z∗. Keep in mind that standard normal values z are of the form 1em. 1em 1em and are shown along the margins. The row is for ones and tenths, the column fine-tunes for the hundredths place. Probabilities below given z values are of the form. 1em 1em 1em 1em and are shown inside the table.

Example

  1. What is the z-score for the 33rd percentile? In other words, the probability is .33 that a standard normal variable Z falls below what value? According to Table A.1, .3300 = P (Z < −.44) so -.44 is the z-score for the 33rd percentile.
  2. What is the 90th percentile of z? .8997 = P (Z < +1.28) so 1.28 is the 90th percentile of Z.
  3. What is the 10th percentile of z? .1003 = P (Z < − 1 .28) so -1.28 is the 10th percentile of Z.
  4. 99% is the probability of Z being greater than what value? The same value for which 1% of the time, Z is less than that value:. 0100 ≈ .0099 = P (Z < − 2 .33) so .99 = P (Z > − 2 .33) and -2.33 has 99% of z-scores above it. Alternatively, we can say .99 = P (Z < +2.33) means .99 = P (Z > − 2 .33).
  5. .48 is the probability of Z being greater than what value? .48 = P (Z < − 0 .05) means .48 = P (Z > +0.05).
  6. .95 is the probability of Z being how far from zero? 1 − 2.^95 = .0250 = P (Z < − 1 .96) = P (Z > +1.96) so .95 is the probability of being within 1.96 of 0 (i.e., approximately within 2 σ of μ where σ is 1 and μ is 0. The Empirical Rule is only roughly accurate.)

Note: by a “percentile”, we mean a value on a scale of 100 that indicates the percent of a distribution that is equal to or below it. Keep this definition in mind when considering the following example.

Example

Researchers recently reported that more than 20 percent of black and Hispanic children, and more than 12 percent of white children, were at or above the 95th percentile for body mass (and thus classified as overweight). Is this possible? Strictly speaking, no; the inconsistency results because doctors referred to the 95th percentile on charts made between 1960 and 1980. There are more overweight children today than there were at that time.

Using Table A.1 for Non-Standard Normal Values

Example

The distribution of heights of young women in the U.S. is normal with mean 65, standard devia- tion 2.7. The distribution of heights of young men in the U.S. is normal with mean 69, standard deviation 3. What percentiles are Jane and Joe in, if Jane is 71 inches and Joe is 75 inches tall? For women, P (X < 71) = P ( X 2 −. 765 < 712 −. 765 ) = P (Z < 2 .22) = .9868. For men, P (X < 75) = P ( X− 3 69 < 75 − 3 69 ) = P (Z < 2) = .9772. Jane is in the 98.68th percentile and Joe is in the 97.72nd percentile.