Question: Questions: Upload an R script with your work in the proper format: Keep your answer in order, using hash symbols (#) to indicate the question
Questions:
- Upload an R script with your work in the proper format:
- Keep your answer in order, using hash symbols (#) to indicate the question (for example the first line could start with #Q1)
- Relevant results obtained in R should be added to this R script also using hash symbols
- Make sure your code runs properly and without error before uploading your solutions
- Consider the following situations.
- Box A contains one ticket marked "0" and nine marked "1."A ticket is drawn at random and if it shows "1" you win. Use R to create box A and then simulate 1000 draws from it, with replacement, and report the number of times you win. In addition, based on the theory you've learned, what is the (absolute) chance error?
- Box B contains ten tickets marked "0" and ninety marked "1." A ticket is drawn at random and if it shows "1" you win. Use R to create box B and then simulate 1000 draws from it, with replacement, and report the number of times you win. In addition, based on the theory you've learned, what is the (absolute) chance error?
- Ten draws are made at random, with replacement, from box A. If the sum of the draws equals 10, you win. Use R to simulate the sum of ten draws 1000 times and report the number of times you win (i.e., the number of times the sum of the draws equals 10). Also, comment whether or not the number of wins here is about the same as the number of wins in parts A and B.
- There are five finalists in a contest: Aubrey, Brooke, Chloe, Diana, and Emma, each represented with the initials A, B, C, D, and E or the numbers 1, 2, 3, 4, and 5, respectively. The results will be announced first announcing the runner-up and then the winner.
- Let's use R to represent this situation. Construct a box that contains the initials and/or the numbers representing the finalists. Then, randomly draw two tickets without replacement, the first representing the runner-up and the second the winner. Report your results showing your output and then who won, using the full names appropriately.
- Run a simulation of this contest and the results (runner-up and winner), but this time with 80,000 replications, and store your results in a matrix (as we did in 3.3). Observe that the matrix will have two rows and 80,000 columns, each column containing first the runner-up and then the winner (do not report this big matrix in your results, simply the code).
- Using the matrix found in B and logical operators (as we did in 3.3), determine and report the percentage number of times that Chloe is the winner. Is this percentage close to the corresponding chance (based on theory)? Comment and report the (percent) chance error.
- Use the matrix found in B and logical operators (as we did in 3.3) to determine the percentage number of times that Chloe will be the winner if Emma was the runner-up. Is this percentage close to the corresponding chance (based on theory)? Comment and report the (percent) chance error.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
