Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(2 points) Create a character vector called coin containing two elements 'H' and 'T' (Head and Tail). Set: set . seed(16) Use the sample() function,

image text in transcribed
(2 points) Create a character vector called coin containing two elements 'H' and 'T' (Head and Tail). Set: set . seed(16) Use the sample() function, and a for loop, to generate a randOm sample of size n : 10, 20, ..., 1000 from the coin (you will have to set replace = T ). For each sample, calculate the proportion of heads observed in the sample, and store it in a vector called obs_prop (the vector will be of length 100}. Choose an appropriate function (of base R or of ggplotZ) to plot the vector obs_pr'op and show that, as the sample size increases, the estimated proportion approaches the probability of getting Head, i.e. 0.5

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

Differential Equations For Engineers

Authors: Wei Chau Xie

1st Edition

0511771037, 9780511771033

More Books

Students also viewed these Mathematics questions

Question

LO3 Describe the purpose of equity legislation.

Answered: 1 week ago

Question

LO4 Describe the purpose of privacy legislation.

Answered: 1 week ago