Showing posts with label practice problems. Show all posts
Showing posts with label practice problems. Show all posts

Tuesday, September 15, 2015

Notes for September 15th and 17th

Link to a post about the shared birthday problem.

Link to a post about the Game Show problem, a.k.a. the Monty Hall problem. (many topics discussed, this topic at the bottom of the post.)

Probability of r successes in n dependent trials using sampling without replacement, which is like drawing cards from a deck.

A new use for independent probability: Missing a rare side effect. Let us consider a drug company running tests on a new drug. The tests are designed to check the drug's effectiveness in comparison to other drugs on the market, but they are also designed to see if the subjects experience side effects. If you've ever listened to a drug commerical on TV, you know that some side effects can be quite dangerous.  If the probability of a side effect is p and the size of the sample is n, the expected value for the frequency is np.

Example: Let's say the drug company is testing a new drug on 500 subjects. Let's also stipulate there is a fairly rare side effect that we should see in 1% of the population, so p = .01.  500 * .01 = 5, so the expected value of people with the side effect in the sample is 5. Since the expected value is a whole number, this means the most likely number people with the side effect is 5.  Let's do the binomial distribution for 4, 5 and 6, rounding to four places after the decimal.

Probability of exactly 4 people out of 500 having the side effect:

500 nCr 4 * .01 ^ 4 * .99 * 496 = .1760 or 17.6%

Probability of exactly 5 people out of 500 having the side effect:

500 nCr 5 * .01 ^ 5 * .99 * 495 = .1764 or 17.64%

Probability of exactly 6 people out of 500 having the side effect:

500 nCr 6 * .01 ^6 * .99 * 494 = .1470 or 14.70%

As we can see, the odds of 5 out of 500 are slightly greater than 4 out of 500, and about 3% more than 6 out of 500. No other outcome is more likely than 5 out of 500.

Here's a different question: what are the chances of 0 out of 500? The reason to ask this is if the trial misses the side effect completely and drug goes to market, the company could face a lot of lawsuits they didn't expect when the side effect starts showing up in the much larger sample of patients taking the drug.

Probability of 0 people out of 500 having the side effect:
500 nCr 0 * .01 ^0 * .99 * 500 = .0066 or 00.66%

(Note: when we have "n choose 0" the answer is always 1, and likewise any non zero number raised to the power of 0 is one.  For this problem only, we can just type in the last term (1 - p)^n

Because the sample was large enough and the side effect was not all that rare, the odds of a sample missing this side effect are relatively low. But what if the side effect were rarer, say 1 in 400, which is the decimal .0025.  This changes the numbers, of course. The expected value is now 500 * .025 = 1.25, which means the most likely event should be either 1 person or maybe 2 people showing the side effect. Let's look at 0, 1 and 2 people having the side effect.

Probability of exactly 0 people out of 500 having the side effect:
500 nCr 0 * .0025 ^ 0 * .9975 * 500 = .2861 or 28.61%

Probability of exactly 1 person out of 500 having the side effect:
500 nCr 1 * .0025 ^ 1 * .9975 * 499 = .3585 or 35.85%

Probability of exactly 2 people out of 500 having the side effect:
500 nCr 2 * .0025 ^ 2 * .9975 * 498 = .2242 or 22.42%

So the most likely event is to have one person showing the side effect, which will happen about 36% of the time. But the next most likely event is not 2 out of 500 but 0 out of 500, which happens over 28% of the time. 1 in 400 people showing a side effect might not seem that high, but a successful drug can be given to hundreds of thousands of patients, possibly more, and having 1 in every 400 showing a very bad side effect could get very expensive for the company.

Here are some practice problems. Assume the sample size is n = 1000 and we are interested in 0 people showing the side effect. Round the answers to the nearest tenth of a percent.

a) the side effect shows up in 1 in 500 patients

b) the side effect shows up in 1 in 1,000 patients

c) the side effect shows up in 1 in 1,500 patients

Answers in the comments.

Friday, January 24, 2014

More practice:
The five number summary with outlier test with a set with positive and negative values

This data set is the scoring differences in the Western Conference of the NBA as of Friday, 24 January.

7.9 7.3 5.8 5.4 5.0 4.2 4.0 3.2 1.3 0.4 -0.7 -2.2 -2.4 -5.2 -6.7

Answers are in the comments.

Notes for 23 January 2014

Five number summary, IQR and outlier thresholds

Consider the number of wins for each team in the National League at the end of the 2014 season. In order, the list looks like this. n = 15 and the five numbers are in bold.

97, 96, 94, 92, 90, 86, 81, 76, 76, 74, 74, 74, 73, 66, 62

The five number summary is as follows.

High: 97
Q3 : 92
Q2 : 76
Q1 : 74
Low: 62

Now we check to see if any of the numbers are outliers.

IQR = 92 - 74 = 18
Q3 + 1.5*IQR = 92 + 27 = 119 (no data higher than this, so no high outliers)
Q1 - 1.5*IQR = 74 - 27 = 47 (no data lower than this, so no low outliers)

Here is the data for the American League.

 97, 96, 93, 92, 91, 86, 85, 85, 78, 74, 71, 66, 63, 51

The five number summary is as follows.

High: 97
Q3 : 92
Q2 : 85
Q1 : 71
Low: 51

Now we check to see if any of the numbers are outliers.

IQR = 92 - 71 = 21
Q3 + 1.5*IQR = 92 + 31.5 = 123.5 (no data higher than this, so no high outliers)
Q1 - 1.5*IQR = 71 - 31.5 = 39.5 (no data lower than this, so no low outliers)


The number that looks out of place is the 51, the number of wins for the Houston Astros, by far the worst team in the major leagues. But even though they won eleven less games than the next worst team, the data is so spread out that their very bad year doesn't count as a low outlier.

Stem and leaf format

Here are the numbers for both leagues in a stem and leaf format. Because these are all two digit numbers, the stem is the tens places and the leaves are the one places.

National League
9 | 02467
8 | 16
7 | 344467
6 | 26

American League
9 | 122367
8 | 556
7 | 148
6 | 36
5 | 1

The National league has one clump of good teams over 90 and a clump of slightly less than average teams between 73 and 77 wins. The American League had six teams with more than 90 wins and the rest of the league is split fairly evenly in the 80s, 70s and 60s, with just Houston with 59 wins or less.

Frequencies and relative frequencies


 The frequency of a value is how many times it shows up on the list and is denoted by either an F is the set is a population or f if the set is a sample. We can also combine values as follows, looking at the data from the American League.

f(92) = 2
f(over 90) = 6
f(70 to 79) = 3

Frequencies are always whole numbers, either zero or positive integers.

Relative frequencies are numbers between 0 and 1 and are sometimes called proportions or probablilites. Sometimes the word percentages is used, but that should only be used if the number is represented with a percent sign.  In a population, we use the lowercase letter p and in a sample, the symbol is called p-hat. Let's take the relative frequencies for the f statistics above, writing them as fractions, decimals and percents.

p-hat(92) = 2/15 = .13333... or approximately 13.3%
p-hat(over 90) = 6/15 = .4 = 40%
p-hat(70 to 79) = 3/15 = .2 = 20%


Practice for five number summary.

Practice for frequency and relative frequency
 Here are the National League wins again. Find the following frequencies and relative frequencies, writing the relative frequencies as fractions, decimals and percentages. Round the decimals to the nearest thousandth and the percentages to the nearest tenth of a percent. For example, 2/15 would be .133 to the nearest thousandth and 13.3% to the nearest tenth of a percent.


97, 96, 94, 92, 90, 86, 81, 76, 76, 74, 74, 74, 73, 66, 62

f(74) = _________

p-hat(74) = _________

f(between 70 and 79) = _________
p-hat(between 70 and 79) = _________

f(over 90) = _________
p-hat(over 90) = _________

Answers to the frequency and relative frequency question in the comments.

Monday, October 25, 2010

More on hypothesis testing

True false questions about hypothesis testing.
The basic facts about hypothesis testing.


Practice problems

In testing for psychic powers, researchers use a deck with five different shapes, as shown in the picture on the left. If the deck is re-shuffled every time, the probability of guessing correctly by pure chance is 1/5 or p = .2 written in decimal. The test would be one tailed high, and we use the z-score table, so the threshold for 95% confidence is = 1.645 and the threshold for 99% confidence is z = 2.325.

Questions:

1. If a subject gets 3 out of 10 correct in a psychic test, are we 95% confident the subject shows psychic powers?

2. If a subject gets 4 out of 10 correct in a psychic test, are we 95% confident the subject shows psychic powers? Are we 99% confident?

3. If a subject gets 5 out of 10 correct in a psychic test, are we 95% confident the subject shows psychic powers? Are we 99% confident?

4. If a subject gets 30 out of 100 correct in a psychic test, are we 95% confident the subject shows psychic powers? Are we 99% confident?

5. If n = 100 and p = .2 in a high one tailed test, find the minimum number of correct answers for rejecting H0 to the 95% confidence level and the 90% confidence level.

Answers in the first comment.

Bonus questions

We have a sample with n = 40, x-bar = 172.5 and sx = 119.5.

1. What is the one tailed low threshold for 95% confidence?

2. What is the one tailed high threshold for 99% confidence?

3. If H0 is mux = 200, are we 95% confident we can reject this for HA: mux < 200?

4. If H0 is mux = 100, are we 99% confident we can reject this for HA: mux > 100?

Answers in second comment.

Saturday, October 9, 2010

Practice problems for confidence of victory and confidence intervals

Links to earlier posts about confidence of victory.

Data from recent polls.

Boxer vs. Fiorina U.S. Senate (CA)
Date: 10/2
Boxer: 49%
Fiorina: 44%
n = 448

Brown vs. Whitman Governor (CA)
Brown: 50%
Whitman: 43%
n = 448

For both of these polls:
1) Find the 95% confidence interval for both candidates
2) Since the two top candidate poll over 90% total, do the confidence of victory, rounding to the nearest 5% if the value is under 90% and to the nearest 1% if the value of over 90%.

Answers in the comments.

Tuesday, September 28, 2010

Practice problems for homework 5

Contingency problem practice.

Bayesian contingency practice.

Frequency and relative frequency.

Using RANDI(1,10) on the TI-30XIIs a number of times, I get these frequencies. Find n and the relative frequencies, written as exact decimals.

f(1) = 7
f(2) = 7
f(3) = 6
f(4) = 6
f(5) = 3
f(6) = 2
f(7) = 5
f(8) = 5
f(9) = 6
f(10) = 3

Answers to last part in comments.

Sunday, September 12, 2010

Practice problems for homework 3

For pregnancies, assume mux = 280.6 days and sigmax = 9.7 days.

a. What is the z-score for 273 days?
b. What is the proportion that corresponds to 273 days?
c. What is the z-score for 288 days?
d. What is the proportion that corresponds to 288 days?
e. What proportion of pregnancies last between 273 to 288 days?





With the Central Limit Theorem, we need to know the average and standard deviation of a population and the average and size of a sample, x-bar and n, respectively. This gives us a z-score which corresponds to a proportion.

f. What is the z-score for 273 days for a sample where n = 8?
g. What is the proportion that corresponds to 273 days for a sample where n = 8?
h. What is the z-score for 288 days for a sample where n = 8?
i. What is the proportion that corresponds to 288 days for a sample where n = 8?
j. What proportion of pregnancies last between 273 to 288 days for a sample where n = 8?

Consider the following data set.

17, 19, 19, 18, 19, 19, 15, 20, 20, 20, 20, 14, 18, 20, 19, 20, 18, 19, 20, 16

Find the frequencies and relative frequencies for each value.

Answers in the comments.

Tuesday, September 7, 2010

Practice problems for homework 2

Find the following statistics following set of data. Round all answers to two place after the decimal, except the proportions, which are given on the table to four places after the decimal

z(x) = (x - x-bar)/sx

17.41, 18.22, 19.17, 17.87, 18.15, 17.86, 18.12, 17.97, 18.46, 18.14

x-bar = ______

sx = _______

z(high) = _____ Proportion associated = ______

z(low) = _____ Proportion associated = _______

For the following movie studios, find the average opening weekend for the movies that were in the total opening weekend receipts for the same films. Round the answers to the nearest million dollars.

Average opening weekend for Fox: _________

Total opening weekend for Fox: ___________


Average opening weekend for WB: _________

Total opening weekend for WB: ___________


Average opening weekend for BV: _________

Total opening weekend for BV: ___________


Answers in the comments.

Sunday, August 29, 2010

Practice problems for homework 1

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) Here is a list of numbers. It is the number of wins by teams in the American League at the end of the 2008 regular season.

97, 95, 89, 86, 68, 89, 88, 81, 75, 74, 100, 79, 75, 61


a) Make a stem and leaf plot for the data.
b) Find the five number summary
c) Find IQR and the high and low outlier thresholds
d) Is there any outlying data?
e) find the average, rounded to the nearest tenth.

Answers in the comments.

Monday, July 27, 2009

correlation practice

Did the price of silver correlate well to the price of gold in 2007?

Here are twelve values, each pair taken from a Friday in each month from January to December. The x value is silver and the y value is gold, both in dollars.

Jan 13.45 652.90
Feb 14.49 682.90
Mar 13.03 655.20
Apr 14.01 684.80
May 12.90 654.90
Jun 13.19 654.50
Jul 12.86 664.10
Aug 12.02 673.20
Sep 12.77 715.00
Oct 14.17 783.50
Nov 14.69 808.80
Dec 14.76 838.80

1) What is rx,y? Is it above the 95% confidence level for n = 12? What about the 99% confidence level?

2) If rx,y surpasses either, find the coefficients a and b in the equation yp = ax + b.

3) If rx,y surpasses either, find the month with the lowest absolute residual and the highest absolute residual, which is to say |yp - y| for all twelve months.

Answers in the comments.

rank correlation practice

Here is a list of 27 industrialized nations are their ranks, first in infant mortality and second in life expectancy. Being ranked 1st is best and 27th is worst in both situations. Use your calculator to see if the rank correlation for these two rankings has a high enough correlation coefficient for us to be 95% confident of correlation or even 99% confident. Either positive correlation or negative correlation can be used.

countries infant mortality life expectancy

Australia_____ 18 4
Austria_______ 15 16
Belgium_______ 16 19
Canada________ 22 5
Denmark_______ 14 23
Finland_______ 7 21
France________ 6 6
Germany_______ 9 18
Greece________ 24 15
Hong Kong_____ 4 3
Iceland_______ 5 10
Ireland_______ 23 24
Israel________ 12 9
Italy_________ 26 12
Japan_________ 3 1
Netherlands___ 17 17
New Zealand___ 21 11
Norway________ 8 14
Portugal______ 19 25
Singapore_____ 1 2
South Korea___ 13 22
Spain_________ 11 13
Sweden________ 2 7
Switzerland___ 10 8
Taiwan________ 25 27
United Kingdom 20 20
United States
_ 27 26

Answers in the comments.

Friday, July 24, 2009

Practice problems for confidence interval for sigma_x, the standard deviation for the population


We have learned the methods for finding confidence intervals for proportions and averages of populations given similar statistics from samples. There is also a method for estimating the standard deviation of a population and giving a confidence level to that interval.

Let's say we took a sample of 28 scores and got a standard deviation of sx = 16.689, rounded to three places after the decimal. The degrees of freedom is n-1, which in this case is 27. Let's look at the Chi square table at the line that corresponds to d.f. = 27.

____0.995__0.99___0.975__0.95___0.90___||_0.10___0.05___0.025__0.01___0.005
27__11.808 12.879 14.573 16.151 18.114 || 36.741 40.113 43.194 46.963 49.645


The denominators in the formulas shown above are taken from the following columns.

90% confidence: Chi square Big comes from the 0.05 column, Chi square Small comes from the 0.95 column.

95% confidence: Chi square Big comes from the 0.025 column, Chi square Small comes from the 0.975 column.

99% confidence: Chi square Big comes from the 0.005 column, Chi square Small comes from the 0.995 column.

In this example, the formulas would look as follows.

90% confidence interval: sqrt(16.689^2*27/40.113) < sigmax < sqrt(16.689^2*27/16.151)

95% confidence interval: sqrt(16.689^2*27/43.194) < sigmax < sqrt(16.689^2*27/14.573)

99% confidence interval: sqrt(16.689^2*27/49.645) < sigmax < sqrt(16.689^2*27/11.808)

If n-1 is not one of the values in the degrees of freedom chart, use the next lowest number on the list.

Exercise #1: Find the values from the equations listed above, rounded to the nearest thousandth.

Exercise #2: Find the confidence intervals for 90%, 95% and 99% if n = 102 and sigmax = 0.62. Round the answers to two places after the decimal.

Answers in the comments.

Thursday, July 23, 2009

Practice for matched pairs.


Was the price of silver in 2007 significantly different than it was in 2008?

Side by side, we have two lists of prices of silver, the highest price in a given month in 2007, followed by the highest price in that same month in 2008. Take the differences in the prices and find the average and standard deviation. The size of the list is 12, so the degrees of freedom are 11. If we assume we did not know which year showed higher prices when we started this experiment, it make sense to make this a two-tailed test. Just for a change of pace, let us use the 90% confidence level.

Mo.___2007___2008
Jan.__13.45__16.23
Feb.__14.49
__19.81
Mar.__13.34__20.67
Apr.__14.01
__17.74
May___12.90__18.19
Jun.__13.19__17.50
Jul.__12.86__18.84
Aug.
__12.02__15.27
Sep.__12.77__12.62
Oct.
__14.17__11.16
Nov.__14.69__10.26
Dec.
__14.76__10.66

Find the test statistic t, the threshold from Table A-3 and determine if we should reject H0, which in matched pairs tests is always that mu1 = mu2.

Answers in the comments.

Wednesday, July 15, 2009

binomcdp and continuity correction problems

Note: the functions binompdf and binomcdf from the TI-83 and TI-84 are available under slightly different names if you have the Excel spreadsheet program.

TI-83 or TI-84: binompdf(n, p, r) is the same as BINOMDIST(r, n, p, 0) in Excel.

TI-83 or TI-84: binomcdf(n, p, r) is the same as BINOMDIST(r, n, p, 1) in Excel.



Problems:

a) What is the probability of 20 or less successes in 30 independent trials when the probability of success on any one trial is .6?

b) What is the probability of 20 or less successes in 30 independent trials when the probability of success on any one trial is .65?

c) What is the probability of 20 or less successes in 30 independent trials when the probability of success on any one trial is .7?




d) What is the probability of 30 or more successes in 40 independent trials when the probability of success on any one trial is .8?

e) What is the probability of 30 or more successes in 40 independent trials when the probability of success on any one trial is .75?

f) What is the probability of 30 or more successes in 40 independent trials when the probability of success on any one trial is .7?

g) Optional for those with TI-83 calculators or Excel. Find np and nq for each problem and how close the approximations are.

Answers in the comments.

Saturday, July 4, 2009

Practice problems for homework due 7/6

Take the information of this incomplete contingency table with categories left and right in the columns and yes and no in the rows and fill in the rest of the table using the degrees of freedom.


____________left____right_____row totals
Yes___________25________________75
No____________________50_______
col. totals___90_____________________grand total

Use the information from the completed table to find the following probabilities, both as fractions and as percents rounded to the nearest tenth of a percent.

p-hat(Yes) =

p-hat(Left) =
p-hat(Left and Yes) =

p-hat(Left or Yes) =

p-hat(Left, given Yes) =

p-hat(Yes, given Left) =

State the following complementary sets without using the word NOT, using the categories from above.

NOT (Left) =

NOT (Left or Yes) =

NOT(Right and Yes) =

Answers in the comments.

Tuesday, June 30, 2009

Practice problems for 6/30


The idea behind z-scores is that we can compare data from completely different numerical data sets by changing the scale to be the distance away from the average, with the new yardstick being the standard deviation. We can take z-scores and the first two pages of the notes to see how common a particular z-score is.

Example: let mux = 63.6 and sigmax = 2.5, which are the average and standard deviation for heights in inches of females.

1) What is the z-score for 67 inches? What percentage of the female population is greater than 67 inches tall?

2) What is the z-score for 64 inches? What percentage of the female population is less than 64 inches tall?


Going the other direction, we have the third page of the notes, which gives z-scores to three decimals that correspond to percentiles in the population. To find the raw score that corresponds to that percentile, use the formulas shown at the left.

3) To the nearest tenth of an inch, what is the height that corresponds to the 96th percentile in U.S. women's heights?

4) To the nearest tenth of an inch, what is the height that corresponds to the 24th percentile in U.S. women's heights?


Answer in the comments.