---
title: "HW 6 -- Math 58B"
subtitle: "due Thursday, March 5, 2026"
author: "your name here"
format: pdf
execute:
  warning: false
  message: false
---


```{r}
library(tidyverse)
library(mosaic)
library(praise)
```


### Assignment Summary (Goals)

Lots more practice thinking about how to take good samples, what types of errors get made, what is a p-value, and what is power.


#### Q1. **Tattoos, Part I**

Suppose that you want to test the null hypothesis that one-third of all adults in your county have a tattoo, against a two-sided alternative.  For each of the following parts, create your own example of a sample of 100 people that satisfies the indicated property.  Do this by providing the sample numbers with a tattoo and without a tattoo.  Also report the test statistic and p-value from a one-proportion z-test.^[https://askgoodquestions.blog/]

   a. Use the normal distribution and the following information to calculate a p-value for the appropriate Z-score

> p-value = probability a N(0,1) (standard normal) will be more extreme than the Z score you calculate below.

  i.  Create your own example of a sample of 100 people such that: the two-sided p-value is less than 0.001.
  ii. Create your own example of a sample of 100 people such that: the two-sided p-value is greater than 0.20.


   b. For each of i. and ii. above, explain whether you may have committed a Type 1 or a Type 2 error. (Hint:  you will **not** know whether or not you committed an error, but you **will** know the type of error you may have committed.)



#### Q2. **Tattoos, Part II**

Suppose that you want to estimate the proportion of all adults in your county who have a tattoo. For each of the following parts, create your own example to satisfy the indicated property.  Do this by specifying the sample size and the number of people in the sample with a tattoo.  Also determine the confidence interval.^[https://askgoodquestions.blog/]

   a. Create your own example such that the sample proportion with a tattoo is 0.30, and a 95% confidence interval for the population proportion includes the value 0.35.  (Use the Z interval, not the bootstrap interval.)
   b. Create your own example such that the sample proportion with a tattoo is 0.30, and a 99% confidence interval for the population proportion does not include the value 0.35. (Use the Z interval, not the bootstrap interval.)


#### Q3. **Gettysburg Address**

Consider the activity done in class on the Gettysburg Address by Abraham Lincoln.^[Inv 1.12, ISCAM]  (Click on "Gettysburg": http://www.rossmanchance.com/applets/2021/sampling/OneSample.html?population=gettysburg)

a. For any of the samples (e.g., your sample) taken in class, describe (in words) the:

 - an observational unit
 - a variable
 - the statistic
 - the parameter

   b. After you click on "show sampling options," the applet shows **three** histograms at the bottom. For each of the three histograms (i.e., provide three answers), what is the thing that is varying?  
   c. Suppose that you select a sample of Claremont students by standing in front of the library and approaching 50 students who pass by.  Would this constitute a random sample of Claremont students?  What if you stand in front of the gym and approach 50 students who pass by?  Explain.   
   d. Even though the convenience sampling (at the library) described above is not random, could it nevertheless result in a sample that is representative of the population of Claremont students?  Identify a variable for which you would not be willing to consider such a convenience sample (as described above) to be representative of the population of Claremont students.  Also identify a variable for which you would be willing to consider such a sample (as described above) to be representative of the population of Claremont students.




```{r}
praise()
```



