Showing posts with label conditional probabilities. Show all posts
Showing posts with label conditional probabilities. Show all posts

Thursday, February 20, 2014

Notes for February 18 and 20


A probability is a number between 0 and 1, inclusive, and is represent by p(event) if part of a sample or p-hat(event) if part of a population.

A probability space or event space is a list of what we call the simple events. The list follows two rules.

1. Every simple event is mutually exclusive from every other simple event, which means the cannot both happen simultaneously. For example, if I flip one coin, it cannot land "heads" and "tails" simultaneously.

2. When we add up the probabilities of all the simple events, the sum is 1. What this means is the simple events (sometimes called simple outcomes).

There are ways to create new probabilities from a set of simple events. The first methods we will discuss are AND, OR and NOT. Let's start with the most basic, NOT.

p(NOT x) is the probability that the event x will not happen. It is sometimes written as q(x) instead. It is always true that

p(x) + p(NOT x) = p(x) + q(x) = 1

Example #1: If we flip a coin, we have two possibilities, heads and tails. We usually assume that p(heads) = .5 and p(tails) = .5, but that doesn't have to be true. What is true in this cases with a categorical variable that has only two legitimate values is that p(NOT heads) = q(heads) = p(tails), and the sum is 1. This means if p(heads) = .51, then q(heads) = 1 - .51 = .49.

If we roll a six-sided die, we have six possible outcomes, a 1, a 2, a 3, a 4, a 5 or a 6. The probability for not rolling a 1 is  

p(NOT 1) = p(2) + p(3) + p(4) + p(5) + p(6)

Because these are simple events, we don't have to worry about overlap. And again, instead of calling it p(NOT 1), we can call it q(1).

If two events A and B are mutually exclusive, then

p(A OR B) = p(A) + p(B)

If they are not mutually exclusive, that means p(A AND B) does not equal zero, and the rule for finding OR changes to   

p(A OR B) = p(A) + p(B) - p(A AND B)

This is most easily explained with a contingency table. Let's say we have two variables for a game, one called Result (which is either a win or a loss) and Setting (which is either home or away). The easiest way to represent this situation is a contingency table, like the one below listing wins and losses for the Warriors so far this season, broken into home record and away record.

___H || A|| Total
W |16||15|| 31
L |10||12|| 22
  |26||27|| 53 = grand total

p(Home) = 26/53, which rounded to the nearest thousandth is .491
p(Away) = 27/53, which rounded to the nearest thousandth is .509. Notice that p(Home) = q(Away) and vice versa.
p(Wins) = 31/53, which rounded to the nearest thousandth is .585
p(Losses) = 22/53, which rounded to the nearest thousandth is .415. Notice that p(Wins) = q(Losses) and vice versa.

p(Wins AND Home) = 16/53, which rounded to the nearest thousandth is .302. What this represents is the number of home wins divided by the total number of games.

p(Wins OR Home) is the probability that a game picked at random is either a home game or a win. We will get this by adding all the wins to all the home games, but we have to subtract the home wins, because they were counted twice.

p(Wins OR Home) = 31/53 + 26/53 - 16/53 = 41/53 or .774 rounded to the nearest thousandth.


Besides AND, OR and NOT, we have the qualifier GIVEN. In a contingency table, this means we only look at the number is a single row or column.

p(Wins GIVEN Home) = 16/26 or .615 rounded to the nearest thousandth.

p(Home GIVEN Wins) = 16/31 or .516 rounded to the nearest thousandth.

Notice that p(Wins) = .585 but p(Wins GIVEN Home) = .615. When these numbers are different, we say that the two categories Wins and Home are dependent. If they were the same, we would say the categories are independent. A contingency table that was independent might look like this


___H || A|| Total
W |16|| 8|| 24
L |10|| 5|| 15
  |26||13|| 39 = grand total

Now, p(Wins) = p(Wins GIVEN Home) = p(Wins GIVEN Away). This hypothetical win-loss record is at the same proportion whether on the road or at home.

Binomial distribution of an independent variable


If I say someone is a 70% free throw shooter, is every free throw attempt independent of what happened before? Often, we set up such an experiment assuming independence just to make our work simpler, but the human factor is involved, so in reality it's very likely to be dependent. Some people get frustrated after a few misses and will do worse. Others will learn from the mistakes of a few misses and figure out what they are doing wrong and make improvements. A player might be having a bad day for some reason, or might instead have excellent concentration or just really good luck that day. But again, these kinds of experiments are often set up as though each free throw trial is independent of what came before.

Let's look at flipping coins. A list of all possible events is called the event space. Here are some examples of event spaces.

Event space for flipping one coin
Heads (H)
Tails (T)

ways to get one head = 1
ways to get no heads = 1

Event space for flipping two coins
HH
HT
TH
TT

ways to get two heads = 1
ways to get one head = 2
ways to get no heads = 1

Event space for flipping three coins
HHH
HHT
HTH
HTT
THH
THT
TTH
TTT

ways to get three heads = 1
ways to get two heads = 3
ways to get one head = 3
ways to get no heads = 1


The list of numbers of ways to get r successes in n trials is often written in the pattern of the picture shown here, and this pattern is called Pascal's Triangle, at least in most of the world. The Italians call it Tartaglia's Triangle and the Chinese call it Yanghui's Triangle. None of these people actually invented it or claimed to have invented it. It's been around since before the time of Christ, and it has been studied all around the world.

While it is very common to see it presented in the form here as an equilateral triangle, it can also be presented where the first numbers in each row are lined up straight as follows

1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
... etc.

It is standard to start counting the top row as row 0, and the left most column as column 0. For example, the 6 we see in the middle of the last row I typed in is row 4, column 2. Instead of having a copy of Pascal's Triangle around, our calculators have these numbers available. On Texas Instruments calculators, the function is under the probability menu. On the TI-30XIIs, the way to get that 6 is to type

4 [prb][right arrow]2[enter]

The calculator will read

4 nCr 2
6

All scientific calculators should have this function available, but all of them are slightly different. The TI-89 writes it as nCr(4,2) and Casio calculators write it as 4 C 2. I will pronounce it "4 choose 2", and when I type on the blog, I will type C(4,2). When I write it on the board or on tests, I will put a 4 on top of a 2 and surround both numbers with a large parentheses. These numbers are called the binomial coefficients.


The formula for finding the probability for exactly r successes in n independent trials where the probability of success on any single trial is p is shown here. In some books, they don't use the letter q, instead replacing it with (1-p). Likewise, sometimes w is replaced with (n-r). I use the extra letters and include the relationships between them. The letters r and w stand for right and wrong. The letter p and q are standard in probability texts for the probability of a success or a failure.

Let's do an example. You are given a four question multiple choice test, each question having five possible answers. The test is given in a language you do not read, so all you can do is guess. Each question is independent from the others, meaning that if C is the right answer to the first question, it's also possibly the answer to the second. The probability p of a correct guess is 1 chance in 5, or .2, The probability of failure q is 1-.2 = .8, and of course p + q = 1.

Probability of no correct answers = C(4,0)*.2^0*.8^4 = .4096
Probability of exactly one correct answer = C(4,1)*.2^1*.8^3 = .4096
Probability of exactly two correct answers = C(4,2)*.2^2*.8^2 = .1536
Probability of exactly three correct answers = C(4,3)*.2^3*.8^1 = .0256
Probability of four correct answers = C(4,4)*.2^4*.8^0 = .0016

The expected value of correct answers is n*p, so in this case it's 4*.2 = .8, which isn't possible. You can't get a fraction of correct answers on a multiple choice test. The expected value in this case says that over the long run, a test like this should average .8 right answers out of four. As we can see, the most likely thing to happen is actually a tie for first, where getting either no answers right or one answer right both have a probability of about 41%. If you need to get three answers right to pass the test, the odds are less than 3% to get either three or four right, and the odds of getting everything right by chance is a very slim 16 chances in 10,000.

If you have a TI-83 or TI-84, there is a function under the distribution menu called binompdf(n,p,r). All you have to is enter the function, then the three values in the order given, separated by commas.

The function for three right in four trials with probability .2 at each trial is binompdf(4, .2, 3), which as we see above is .0256.


Practice problem.
The test is changed. There are now five multiple choice questions and four choices for each, but it is still given in a language you do not read.

Round the probabilities to four places after the decimal.

1. What is the expected value?

2. What is the probability of no correct answers?

3. What is the probability of exactly one correct answer?

4. What is the probability of exactly two correct answers?

5. What is the probability of exactly three correct answers?

6. What is the probability of exactly four correct answers?

7. What is the probability of five correct answers?

Answers in the comments.
  

Tuesday, May 5, 2009

Class notes for 5/4, part 3: Bayesian probability and double testing

If a trait is very rare, only a very accurate test gives us useful information. For example, if a trait shows up in only 1 in 10,000 people but the test for the trait has an error rate of 1 in 1,000, we should expect about 10 false positives for every true positive. Here is the completed table for that situation.

________don't___have____row total

test + ____9,999__999______10,998__

test - _9,989,001___1_____9,989,002__

col.___9,999,000_1,000______10,000,000 grand total

In a situation such as this, testing positive twice could give us useful information, as testing positive once has an error rate of about 90.9%. We have to assume the errors are random and not deterministic. For example, if a test for a chemical compound in opium also catches a similar compound found in poppy seed bagels, testing twice won't get rid of the errors. Assuming just random errors here is what we do.

Step 1: The top row of the first contingency table is the column total/grand total row of the second contingency table. What this does is takes the numbers from the people who tested positive the first time and makes them the totals for those who will be tested twice.

________don't___have____row total

test + __________________________

test - __________________________

col._______9,999__999_____10,998 grand total

Step 2: Multiply error rate by have column total to find the number who have that test negative. Round to the nearest whole number. (We didn't have to round before, but now we do.)
999*1/1000 = .999 ~= 1, this means test positive and have is 998.

________don't___have____row total

test + ___________998____________

test - _____________1____________

col._______9,999__999_____10,998 grand total

Step 3: Multiply error rate by don't have column total to find the errors. 9,999*1/1000 = 9.999 ~= 10. That means the test negative in that column is 9,999 - 10 = 9,989.

________don't___have____row total

test + _______10__998____________

test - _____9,989____1____________

col._______9,999__999_____10,998 grand total

Step 4: row totals

________don't___have____row total

test + _______10__998_____1,008___

test - _____9,989____1_____9,990___

col._______9,999__999_____10,998 grand total

Step 5: Find the error rate for testing positive twice. 10/1,008 = .0099... or about 1%.

Of the ten million people tested, we would send letters to 1,008 telling them they tested positive twice. Of those people, ten don't have the trait and are getting false information, but 998 are getting the right information. In the first test, there was someone with the trait who tested negative, and the same is true in the second test, so there are two people with the trait who did not get two positive test results. While this isn't a perfect situation, it's much better than the over 90% error rate we got for positive tests the first time through.

Class notes for 5/4, part 2: Bayesian probability

Earlier in the term, we created contingency tables from reading data sets and filling in the positions of the table, then finding the row totals, column totals and the grand total. We then learned about conditional probability, where we find that p(left, given female) might not equal p(left, given male) or p(left). If these probabilities are not equal, we call them dependent, because it depends on if we are looking a the whole population or some specific sub-population. If they are all equal, the probabilities are independent.

In Bayesian probability, we will be building a contingency table "backwards". Instead of filling in each value in the table then finding row totals, column totals and grand total, we will start with a trait in the population and a test for that trait. We will make a 2x2 contingency table, where the columns deal with having the trait on not and the rows refer to testing positive of testing negative. If the test has an error rate, as is often the case, some people are going to get incorrect information. What we will see is that the overall error rate can sometimes be quite different for the error rate for those who test positive and the error rate for those who test negative.

Let's say there is a genetic trait in the population that shows up in 25% of subjects, which we will write as 1 in 4. The test for the trait has a 2% error rate, so it is 1 in 50.

Step 1: The grand total is the product of the denominators of the fractions.

In our case, 4*50 = 200


________don't___have____row total

test + __________________________

test - __________________________

col._____________________200 grand total

Step 2: Multiply the grand total by the trait proportion to find the column totals.

Since 25% of the population has the trait, 25% of 200 = 50 subjects have the trait in our idealized sample. By subtraction, 150 don't have the trait.


________don't___have____row total

test + __________________________

test - __________________________

col._____150_____50______200 grand total

Step 3: Fill in the "have the trait" column by multiplying the error rate by the column total to fill in the mistaken position, and fill in the rest by subtracting.

In our case, the error rate is 1 in 50. This means for the people who have the trait, 1 person will test negative, while the other 49 will correctly test positive.

________don't___have____row total

test + ___________49______________

test - ____________1______________

col._____150_____50______200 grand total

Step 4: Fill in the "don't have the trait" column using the same method.

3 of the 150 will get the wrong information, which in their case will be a positive test. The other 147 will get the right information, a negative test result.

________don't___have____row total

test + ____3______49______________

test - ___147______1_______________

col._____150_____50______200 grand total

Step 5: Fill in the row totals.

________don't___have____row total

test + ____3______49______52______

test - ___147______1______148______

col._____150_____50______200 grand total

The error numbers are marked in bold and blue for the next step.

Step 6: Find the error rates given test positive and test negative.
p(error) = (3+1)/200 = 1/50 = .02, which was the advertised error rate.
p(error, given test positive) = 3/52 ~= .058, much higher than .02
p(error, given test negative) = 1/148 ~= .0068, much lower than .02

Unless the trait shows up in 50% of the population, we expect to get differences between the error rates for test positive and test negative. Whichever is the smaller part of the population should see a higher error rate. Just how significant the differences are in the error rates between the two test groups depends on the size of the error rate to the trait rate. A 99% accurate test sounds good, but if the trait is very rare, we might well get more false positives than true positives.

Friday, February 13, 2009

Class notes for 2/11


Venn diagrams and contingency tables: In other classes you have taken, you may have seen Venn diagrams. The idea is to represent the ideas of sets and subsets and intersections of subsets pictorially. In this picture, the rectangle represents the whole set of things we are considering, known as the universe, while the two circles represent subsets A and B. This splits the rectangle into four parts, colored in the picture in white, yellow, gray and blue. Here are the color combinations that represent some of the sets we discuss in probability.

A = yellow and gray
not A = white and blue
B = gray and blue
not B = white and yellow
A and B = gray
A or B = yellow, gray and blue
not (A and B) = not A or not B = white, yellow and blue
not (A or B) = not A and not B = white

When a variable has only two values, like gender can be male or female or left-right handedness can be left or right, then "not male" is the same as "female", or "not left" is the same as "right". Many variables have more than two values, so "not 20-29" is easier to write than "19 & under or 30-39 or 40-49 or 50 & over". There are problems often associated with Venn diagrams and figuring out how many subjects are in certain subsets that are easier to solve using contingency tables than using Venn diagrams. Here is an example.

In both data sets combined, there are 80 subjects. There are a total of 6 left handed subjects, 30 males. 4 of the males are left handed. How many females are right handed?

How to solve it: Since the total is 80, 30 males means 50 females and 6 left handers means 74 righthanders. This means we know the row and column totals of a contingency table.

_____|__M_|__F_|_total
R____|____|____|_74
L____|____|____|__6
total|_30_|_50_|_80 grand total

Because we had the grand total and the total number of males, we get the total number of females by subtracting. We call this is degrees of freedom. Once we have the total, and we know that two numbers add up to that total, being given any single value means you can figure out the other value, so there is only one degree of freedom. If instead we were dealing with age groups, where we have five values, then we would have four degrees of freedom, meaning if you knew the frequencies of four values, you could add those up and subtract the total from the size of the whole set to find the fifth frequency that wasn't given.

Once we have all the row and column totals in a 2x2 contingency table, we only need one value inside the box to get all the other three, so once again, we have one degree of freedom. There are four left handed males, which means a 4 is put in row 2, column 1, as follows:


_____|__M_|__F_|_total
R____|____|____|_74
L____|__4_|____|__6
total|_30_|_50_|_80 grand total

Using subtraction, we can fill in the rest of the values.

_____|__M_|__F_|_total
R____|_26_|_48_|_74
L____|__4_|__2_|__6
total|_30_|_50_|_80 grand total

This means there are 48 right handed females, which is what we were asked. We also know there are 2 female lefties and 26 male righties, though those questions were not asked.

Conditional probability: Besides asking for p-hat(females), p-hat(male and right) or p-hat(left or female), we have the idea of p-hat(female, given left), which means if we count only the left handed subjects, how many of them are female. If you have the information in contingency table form, what changes in such a question is the denominator of the fraction, which is a row total or a column total instead of the grand total. Here are three examples.

p-hat(female and left) = 2/80 = .025 = 2.5%
p-hat(female, given left) = 2/6 = .333... ~ 33.3%
p-hat(left, given female) = 2/50 = .04 = 4.0%

[Note: I will use ~ to mean approximately equal when typing on the blog.]

There is a formula for conditional probability if you don't have the information in contingency table form.

p(A, given B) = p(A and B)/p(B)

Practice problems:

In a sample of 42 people, there are 4 left handed people. 19 people gave the answer of 3 on a scale from 1 to 5 for difficulty of the class. 2 of the left handed people gave the answer 3 to the difficulty question. Find the following probabilities, rounded to the nearest tenth of a percent.

p-hat(left and difficulty 3) =
p-hat(right or difficulty 3) =
p-hat(right, given difficulty 3) =
p-hat(difficulty 3, given right) =

Answer in the comments.

Tuesday, February 10, 2009

Class notes for 2/9

We are now dealing with proportions, and the formulas are as follows:

Population: p = F/N

Sample: p-hat = f/n

We often want to compare one proportion to another, either two from the same sample or comparable proportions from different samples, or the sample proportion to the population proportion. Because of this, it is better to write the numbers as decimals or in scales based on powers of 10.

Scales based on powers of 10: The most famous scale base on powers of ten in percentage, which really means "per 100". It is much more common to see "53% of the people agree with the president's plan" than ".53 of the people..." or "53 out of every 100 people...". Technically, all those phrases are saying the same thing, but percentage is the most popular.

One of the places where decimals are used for proportions is in the sports pages. A batting average in baseball (hits/at bats) is given as a percent to three decimal place, and likewise winning proportions (win/total games) are written as .xxx. If a batter has 27 hits in 92 at-bats, the batting average 27/92 = .293478261... is shortened to .293 and pronounced "two ninety three". Likewise, a team who has won 17 games and lost 5 will have a winning proportion of 17/22 = .77272727... = .773, and often stated as "team has a winning percentage of seven seventy three." Technically, this is a mistake, because "percentage" means out or 100. The correct word from the dictionary, which no one ever uses, is "permillage", which means out of 1,000. The team in question would have a winning percentage of 77, and a winning permillage of 773.

In both of the cases from the sports pages, the greater number of place after the decimal is used to break ties. For example, a team with 14 wins and 4 losses is at .778, which is better than 17 wins and 5 losses, while 20 wins and 6 losses is at .769, so is slightly worse.

To get a number based on a power of 10 scale, you take the proportion and multiply by the power of ten, so it is either p*scale or p-hat*scale, depending on population or sample. Besides greater precision for breaking ties, sometimes we need greater precision because the proportions are so small.

When I ask a class what is the legal limit for blood alcohol while driving, invariably someone will say "point oh eight" and most people will agree. But .08 is wrong. .08 = 8%, and the correct answer is .08% = .0008. I don't blame the students. The number is badly represented and it is an easy mistake to make. Let's take a look at the number on other scales of 10.

.08 out of 100 is the same as
.8 out of 1,000 0r
8 out of 10,000 or
80 out of 100,000

80 parts out of 100,000 is a tiny proportion. To give an idea, ounce of pure alcohol mixed into ten gallons of blood would give you 78 parts out of 100,000, and most people have between a half gallon and a gallon and a half of blood in their body, between 4 and 12 pints. The amount of alcohol in a person's blood stream that is over the legal limit is about the same amount of alcohol as found in a capful of mouthwash used after brushing your teeth.

We will be dealing with much smaller proportions later in the class, where there are things that can be hazardous to your health at ranges measure in parts per billion, but for now, we will look at the per 100,000 scale for another type of statistic, measurements of mortality rates.

Here are the number of homicides in some local cities in 2007.

Oakland: 124 homicides
Richmond: 28 homicides
San Francisco: 98 homicides

Clearly, comparing these numbers is misleading, because we know these cities have very different numbers of citizens, so the standard way to measure these statistics is the per 100,000 population scale, which we find by the formula

f/n* scale

which in this case is

(# of homicides)/(city population) * 100,000

Oakland's population in 2007 is estimated at 415,000, Richmond at 106,000 and San Francisco at 825,000, so the murder rates on this standard scale are as follows

Oakland: 124/415000 * 100000 = 29.9
Richmond: 28/106000 * 100000 = 26.4
San Francisco: 98/825000 * 100000 = 11.9

So even though more people were murdered in San Francisco than in Richmond in 2007, the murder rate in Richmond was over twice as high, because Richmond has barely 1/8 of the population of San Francisco. (note: The trends for the three cities this decade are going in different directions. Oakland's murder rate is on the rise, while Richmond's is falling and San Francisco's has stayed about the same.)

Calculating proportions (probabilities): There are times when we will need to find new proportions from information previously calculated, either adding and subtracting old numbers or multiplying or dividing. It's best to use the fractional forms of the data when available, then round the answers after using the exact numbers instead of using answers that might have been rounded. Every time you use a rounded answer in a calculation, there is a change to increase the rounding error even more.

The words "proportions" and "probabilities" will be used interchangeably in the rest of this post.

Contingency tables and compound probabilities: Let's take the data from data set #2 regarding gender and left/right handedness and turn it into a contingency table.


___R__L_
M__9__3_
F_29__1_

What these numbers represent is there are 9 right-handed males, 3 left-handed males, 29 right-handed females and 1 left-handed females. We will now add the row totals, the column totals and the grand total, which will be marked in red.


___R__L_
M__9__3_ 12
F_29__1_ 30
__38__4_ 42
=grand total



This gives us the following probabilities.  We assume this is a sample so these values are p-hat.

p-hat(female) = 30/42
p-hat(male) = 12/42
p-hat(left) = 4/42
p-hat(right) = 38/42

We can also combine values from different variables as follows.

p-hat(female and left) = 1/42
p-hat(female and right) = 29/42
p-hat(male and left) = 3/42
p-hat(male and right) = 9/42

When we use the conjunction "and", we take the number of subjects that would answer yes to being both female and left handed, for example, and divide by the size of the data set. This means a single entry from the contingency table divided by the grand total.

The conjunction "or" means we want all the subjects that are in the combination or a row and a column together, but being careful that we did not count anyone twice. We use the principle of inclusion and exclusion when calculating this, which is as follows.

p(A or B) = p(A) + p(B) - p(A and B)

The rule is the same whether we are dealing with p or p-hat.

The reason we subtract is as follows. If I count all the women in the set, and then all the left handed people in the set and add those together, any left handed women were counted twice, so we subtract the total of left handed women to get count correct.

p-hat(female) = 30/42
p-hat(left) = 4/42
p-hat(female and left) = 1/42

p-hat(female or left) = 30/42 + 4/42 - 1/42 = 33/42

Another way to combine proportions is the conjunction "given". The idea of p(female, given left) means how many females are there in the subset of left handed people while p(left, given female) means how many left-handers are there among the women. The formula for this is

p-hat(A, given B) = p(A and B)/p(B)

In a contingency table, the easiest way to calculate this is to find the place in the table that tells us how many people are in the row and column that correspond to A and B, then divide by the row or column total that corresponds to B. Here are the eight different values we have for the given probabilities.

p-hat(female, given left) = 1/4
p-hat(female, given right) = 29/38
p-hat(male, given left) = 3/4
p-hat(male, given right) = 9/38
p-hat(left, given female) = 1/30
p-hat(right given, female) = 29/30
p-hat(left given, male) = 3/12 = 1/4
p-hat(right given, male) = 9/12 = 3/4

Complementary events and their probabilities: The complement of a subset is all the elements that are in the whole set but not in the subset. In a variable with two values, the complement of one value is simply the other value, so the complement of lefthanders is righthanders, and the complement of men is women. In a variable with more than one value, the complement of a value is all the other values. The complement of the 20-29 value in age group would be the subjects 19 and under combined with the subjects 30 and over. Since we are using the words "and", "or" and "given" as our conjunctions, the word used for complement in such a setting is "not".

If we know p(A), the easiest way to calculate the probability of the complement is

p(not A) = 1 - p(A).

In some books and in my notes, the probability of the complementary event will be denoted by the letter q, defined by the equation p + q = 1, or q = 1 - p.

Again, the rules for p and q are the same for p-hat and q-hat.

Here are some complements of the some of ideas we have defined using the conjunctions.

female complement = male
male complement = female
left complement = right
right complement = left

female and left complement = male or right
male and left complement = female or right

female, given left complement = male, given left
male, given left complement = female, given left
female, given right complement = male, given right
male, given right complement = female, given right


Practice problems: (answers given in comments)

1) Here are the homicide numbers for Oakland, Richmond and San Francisco from earlier in this century.

Oakland: 96 homicides, 399,000 population
Richmond: 40 homicides, 99,000 population
San Francisco: 96 homicides, 775,000 population

Find the murder rates from these years, rounded to the nearest tenth per 100,000 population and rank them from lowest (1st) to highest (3rd).

2) Find the complements of the following sets and the probabilities for the set and the complement rounded to the nearest tenth of a percent. (If it rounds exactly to a percent, you can write the answer as 42% instead of 42.0%, to give an example.)

a) left, given female
b) left and female
c) left or female
d) female, given left