library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
## ✔ ggplot2 3.3.6      ✔ purrr   0.3.4 
## ✔ tibble  3.1.8      ✔ dplyr   1.0.10
## ✔ tidyr   1.2.1      ✔ stringr 1.4.1 
## ✔ readr   2.1.2      ✔ forcats 0.5.2 
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
library(openintro)
## Loading required package: airports
## Loading required package: cherryblossom
## Loading required package: usdata
knitr::include_graphics('/Users/asiadowner/Desktop/Math 217 - Biostat /Knit Images/abstract-banner.png')

HW Questions: 3.2.6, 3.2.7, 3.4.1, 3.4.2, 3.5.4, 3.5.5, 3.6.1, 3.6.3, 3.6.7, 3.6.10

3.2.6

If a woman takes an early pregnancy test, she will either test positive, meaning that the test says she is pregnant, or test negative, meaning that the test says she is not pregnant. Suppose that if a woman really is pregnant, there is a 98% chance that she will test positive. Also, suppose that if a woman really is not pregnant, there is a 99% chance that she will test negative.

a. Suppose that 1,000 women take early pregnancy tests and that 100 of them really are pregnant. What is the probability that a randomly chosen woman from this group will test positive?

.5*.98+.5*.01
## [1] 0.495

There is a 50% chance of testing positive in all outcomes.

.10*.98/.495
## [1] 0.1979798

There is a 20% chance that a randomly chosen woman from this group will test positive.

##b. Suppose that 1,000 women take early pregnancy tests and that 50 of them really are pregnant. What is the probability that a randomly chosen woman from this group will test positive?

.05*.98/.495
## [1] 0.0989899

There is a 10% chance that a randomly chosen woman from this group will test positive.

3.2.7

I don’t understand the difference between this question and the prvious question. I think I’ve answered this above.

3.4.1

Consider the density curve shown in Figure 3.4.5, which represents the distribution of diameters (measured 4.5 feet above the ground) in a population of 30-year-old Douglas fir trees. Areas under the curve are shown in the figure. What percentage of the trees have diameters

(a) between 4 inches and 10 inches?

0.33 + 0.25 + 0.12 = 0.7 or 70%

(b) less than 4 inches?

0.20 + 0.03 = 0.23 or 23%

(c) more than 6 inches?

0.25 + 0.12 + 0.07 = 0.44 or 44%

3.4.2

Consider the diameter of a Douglas fir tree drawn at random from the population that is represented by the density curve shown in Figure 3.4.5. Find

(a) Pr{diameter > 10}

0.03 + 0.20 + 0.33 + 0.25 + 0.12 = 0.93

(b) Pr{diameter < 4}

0.33 + 0.25 + 0.12 + 0.07 = .77

(c) Pr{2 < diameter < 8}

0.20 + 0.33 + 0.25 = .78

3.5.4

Consider a population of the fruitfly Drosophila melanogaster in which 30% of the individuals are black because of a mutation, while 70% of the individuals have the normal gray body color. Suppose three flies are chosen at random from the population; let Y denote the number of black flies out of the three. Then the probability distribution for Y is given by the following table:

(a) Find Pr{Y > 2}

2.189 + 3.027 = .459

(b) Find Pr{Y < 2}

2.189 + 1.441 + 0*.343 = .819

3.5.5

Calculate the mean of the random variable Y from Exercise 3.5.4.

3.027 + 2.189 + 1.441 + 0.343 = 0.9

3.6.1

The seeds of the garden pea (Pisum sativum) are either yellow or green. A certain cross between pea plants produces progeny in the ratio 3 yellow : 1 green. If four randomly chosen progeny of such a cross are examined, what is the probability that (a) three are yellow and one is green?

dbinom(3, size=4, prob=.75) = 0.422

  1. all four are yellow?

dbinom(4, size=4, prob=.75) = 0.316

  1. all four are the same color?

pbinom(4, size=4, prob=.75) = 1

3.6.3

In the United States, 44% of the population has type A blood. Consider taking a sample of size 4. Let Y denote the number of persons in the sample with type A blood. Find (a) Pr{Y = 0}.

dbinom(0, size=4, prob=.44) = 0.98

  1. Pr{Y = 1}.

dbinom(1, size=4, prob=.44) = .309

  1. Pr{Y = 2}.

dbinom(2, size=4, prob=.44)

(d)Pr{0 less than or equal to Y less than or equal 2}.

pbinom(2, size=4, prob=.44) = .772

(e)Pr{0 < Y less than or equal 2}.

1-pbinom(2, size=4, prob=.44) = .228

3.6.7

In Europe, 8% of men are colorblind. Consider taking repeated samples of 20 European men. (a) What is the mean number of colorblind men?

The mean is the number of colorblind men in the sample times the probability of colorblind men (.08) with each sample observations being added to the previous sample observation. I don’t know how to show this in R.

  1. What is the standard deviation of the number of colorblind men?

The standard deviation of colorblind men is the summation of all individual observations (i) minus the mean squared divided by the sample size - 1 degree of freedom.

3.6.10

Neuroblastoma is a rare, serious, but treatable disease. A urine test, the VMA test, has been developed that gives a positive diagnosis in about 70% of cases of neuroblastoma. It has been proposed that this test be used for large-scale screening of children. Assume that 300,000 children are to be tested, of whom 8 have the disease. We are interested in whether or not the test detects the disease in the 8 children who have the disease. Find the probability that

  1. all eight cases will be detected.

dbinom(8, size=300,000, prob=.70) = 1.78

  1. only one case will be missed.

dbinom(1, size=300,000, prob=.70) 9.58

  1. two or more cases will be missed. [Hint: Use parts (a) and (b) to answer part (c).]