Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

title: Homework 5 output: pdf_document --begin{center} textit{Due May 13, 2016 before 11:59 PM via upload to CCLE} end{center} section{Swirl Package} textbf{Problem 1.} - Start swirl

title: "Homework 5" output: pdf_document --\\begin{center} \\textit{Due May 13, 2016 before 11:59 PM via upload to CCLE} \\end{center} \\section{Swirl Package} \\textbf{Problem 1.} - Start swirl and complete the lessons using: **swirl()** - Do the following lessons: a) Do **10: simulation** lesson. What command was used to create my_pois variable? Explain what that command does. b) Do **15: Base Graphics** lesson. What command was used to plot cars with a subtitle of `My Plot Subtitle`? \\section{Scatter Plot} \\textbf{Problem 2.} a) Construct a scatter plot matrix using the built in dataset swiss and give it a title. b) Construct a scatter plot of Examination (x) and Ferility (y) using swiss. Add vertical and horizontal lines to represent the mean x and the y values to the graph. Appropriately title and label the graph. \\section{Line Plot} \\textbf{Problem 3.} Using the built in dataset airquality, please reproduce the following plot, which shows the temperature for each month on each day. \\section{Simulation} \\textbf{Problem 4.} Do not use a for loop for any of these questions. You must show your code in order to get credit. a) Let $U_1$,$U_2$,$U_3$ all come from a uniform(0,1) distribution. Let $M=max(U1,U2,U3)$. Estimate the probability $\\mathbb{P}(M > 0.75)$ using monte carlo simulation. b) Let $X_1,\\ldots,X_n$ be Poisson random variables with parameter $\\lambda=0.5$ where $n=21$. Estimate the probability that the sample mean is greater than the sample median using monte carlo simulation. c) Let $X_1,\\ldots,X_{100}$ be exponential random variables with rate $\\lambda=2$. Plot the histogram of $\\bar{X}$ and overlay normal density to the histogram. \\textbf{Problem 5} Write a function pi3(n) that approximates $\\pi$ as a function of n, by simulating random points in the square with vertices (-1,-1), (-1,1), (1,1), and (1,-1), seeing what fraction of them are in the unit circle [the circle with radius 1 centered at the origin], and then converting this fraction into an estimate of $\\pi$. Evaluate pi3(10^j) for $j = 0,1,2\\ldots,6$. For $j=6$, plot your simulated points, using different plotting symbols and colors for simulated points inside and outside the unit circle. Don't forget to use set.seed. (To get square axes use par(pty="s"))

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Algebra 1

Authors: Mary P. Dolciani, Richard A. Swanson

(McDougal Littell High School Math)

9780395535899, 0395535891

More Books

Students also viewed these Mathematics questions