-This is part 2 of Problem Set 3. I contain open-ended questions that need to be worked...
Question:
-This is part 2 of Problem Set 3. I contain open-ended questions that need to be worked on in R.
- -Upload a Rscript with your work in the proper format:
- a.Keep your answer in order, using hash symbols (#) to indicate the question (for example the first line could start with #Q1)
- b.Results obtained in R should be added to this Rscript also using hash symbols
- c.Make sure your code runs properly and without error before uploading your solutions
- -You can resubmit your work before the deadline if you wish, but only the most recent file will be graded.
Questions:
1. Consider the following three situations.
(i) A box contains one ticket marked “0” and nine marked “1.” A ticket is drawn at random. If it shows “1” you win a panda bear.
(ii) A box contains ten tickets marked “0” and ninety marked “1.” One ticket is drawn at random. If it shows “1” you win the panda.
(iii) A box contains one ticket marked “0” and nine marked “1.” Ten draws are made at random with replacement. If the sum of the draws equals 10, you win the panda.
Make these boxes in R, then draw 100 times from the first two boxes, and 100 sums from the last box. Report how many times you win a panda on each case and comment on your results.
2. A cross involving two genes. Father's: AaBb. Mother's: AaBb and we are interested in determining the structure of these genes in the child. To study this problem and determine chances, construct 2 boxes in R and run a simulation with 50,000 replications
(i) What are the chances for the child's genes to be AABB? Report the theoretical value and the value obtained in R with 4 decimals
(ii) What are the chances for the child's genes to be AABB, if we know that the alleles in the 2nd gene were both recessive, bb? Report the theoretical value and the value obtained in R with 4 decimals
3. There are five finals on a contest, each represented with initials A, B, C, D, and E. The results will be announced first announcing the runner-up and then the winner. Construct a box representing this situation by drawing 2 tickets, the first being the runner up and the second the winner. Run a simulation with 80,000 replications and store your results in a matrix. Obtain the following results
(i) What are the chances that contestant B will be the winner? Report the theoretical value and the value obtained in R with 4 decimals
(ii) What are the chances that contestant B will be the winner if A was the runner-up? Report the theoretical value and the value obtained in R with 4 decimals