Question: Just need problem 2 Basic Exercises for Using R's sample command (warm-up for simulations) 1. Write a sample command that replicates flipping a fair coin

Just need problem 2
Basic Exercises for Using R's "sample" command (warm-up for simulations) 1. Write a "sample" command that replicates flipping a fair coin 100 times... (a) using string coding "heads" and "tails" (b) using the numerical coding 1 (for heads) and 0 (for tails) For each part, run the code 10 separate times and look at the output. 2. Suppose that we have a biased coin that has a 85% chance of landing on heads on each flip. Write a "sample" command that replicates flipping a fair coin 100 times... (a) using string coding "heads" and "tails" (b) using the numerical coding 1 (for heads) and 0 (for tails) For each part, run the code 10 separate times and look at the output. Suggestion: Use the "prob - ..." optional setting. Look at the R's help on "sample" and/or search google for help on R's sample. (c) Can you do part(s) (a), (b) without using the "prob = ..." optional setting? Basic Exercises for Using R's "sample" command (warm-up for simulations) 1. Write a "sample" command that replicates flipping a fair coin 100 times... (a) using string coding "heads" and "tails" (b) using the numerical coding 1 (for heads) and 0 (for tails) For each part, run the code 10 separate times and look at the output. 2. Suppose that we have a biased coin that has a 85% chance of landing on heads on each flip. Write a "sample" command that replicates flipping a fair coin 100 times... (a) using string coding "heads" and "tails" (b) using the numerical coding 1 (for heads) and 0 (for tails) For each part, run the code 10 separate times and look at the output. Suggestion: Use the "prob - ..." optional setting. Look at the R's help on "sample" and/or search google for help on R's sample. (c) Can you do part(s) (a), (b) without using the "prob = ..." optional setting
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
