---
title: "R Problem due Tuesday 10/23"
author: "YOUR NAME"
output:
  pdf_document: default
  word_document: default
---

Acknowledgements: ADD NAMES HERE IF ANYONE ASSISTED YOU.  

**Email knitted pdf file to tleise@amherst.edu by 4pm on the due date.**

## Read Problem 4.58 (which refers to problem 4.40). We will explore the solution to this problem while practicing our writing skills.  

Why are we interested in writing in statistics?   

Writing is not just a product, but also a process through which one discovers what one knows and what one doesn't know and also more fully develops one's understanding, whether the topic is qualitative or quantitative. For this assignment, you are writing first in order to better understand (and test your understanding of) the concepts of expectation and variance that you are working with. Your first audience for this assignment's writing is yourself, as you seek to explain to yourself what the results in 4.40 are, what you need to generate in order to simulate these results, and how your simulated results compare to the computed values.  

Writing is also, of course, a means of communication. In part d., you are writing not just to complete the assignment, but to communicate the results of your simulation and explain how the computed and simulated results compare to an audience who wants to understand what you have to say. Here, you should think of the audience as a classmate, someone who is familiar with the probability concepts but who does not yet fully understand what the results mean, how to simulate them, or (of course) how the simulated and computed results compare.  

Finally, in part e., you are asked to integrate parts a-d, to create a full written solution that ties all the steps of the process and your simulation results together. This shifts the audience from parts a-b(yourself) to more of the classmate audience from part d. Think of yourself as assisting a future Probability student with the problem (4.58) from scratch.


a. You are tasked with simulating the results in 4.40, so first, we should make sure we are clear on what those results are. The first result is the variance of $3X^2-Y$, which can also be written as $V[3X^2-Y]$. Using the dollar signs, you can include LaTeX commands to help format equations within RMarkdown. Basically, values included in between a pair of dollar signs are treated as a mathematical equation, and the ^ symbol is used to do superscripts/exponentiate. Use these commands (similar to the one above) to \textbf{write a few sentences} to report the four results from 4.40 using appropriate notation. Hint: your sentences should report both the numeric values you found and the mathematical equation to practice the notation. 

> ANSWER

b. Now, we turn our attention to the simulation. What do you need to generate in order to simulate the results? Be specific about the number of random variables involved and how many values need to be drawn. (For example, do you need to draw 10 values from the distribution of $X$, a Bin(25, 0.6) RV? If there are several variables, do you need 500 draws from the distribution of one and 100 from the other's distribution?)

> ANSWER




c. Perform the simulation to verify your results. 

> ANSWER

```{r}

```


d. \textbf{Write a few sentences} to compare your simulated results to the results you expected based on your computations. (Hint: If you want your simulated results to *stay* the same during a compile, you need to set a seed!) 

> ANSWER

e. Refer to your responses from parts a-d. Combine your responses (with appropriate editing) to create a full description of your simulation and results for an audience with similar Probability background to you. Be sure you include the components of parts a, b, and d (no need to re-run the simulation) - i.e. you should describe what you are trying to simulate, how the simulation works (which might be more detail than part b!), and how your results compare to what you expected. 

> ANSWER


*Acknowledgement: Ideas and most words about writing are thanks to Kristen Brookes, Senior Writing Associate. Thank you to Prof Amy Wagaman for sharing this R problem for STAT 360.*
