Answered step by step
Verified Expert Solution
Question
1 Approved Answer
**ORIGINAL CODE** # NOT RUN { require(utils) vals ******************************************** You now understand how to simulate the rolling of two six-sided die and how to obtain
**ORIGINAL CODE**
# NOT RUN { require(utils) vals
********************************************
You now understand how to simulate the rolling of two six-sided die and how to obtain the sum of the two die values. Using the "expand.grid" function in R you calculated the possible outcomes for rolling various combinations of die such as rolling a six-sided die with a four-sided die. In this activity, you will investigate the outcomes of rolling two four-sided die with one big difference. Instead of adding the two die values to obtain their sum you will multiply the two die values to obtain their product. Roll the dice! Modify your die rolling function to return the results of MULTIPLYING the two die values together instead of adding them. Use your new function to roll two FOUR-SIDED die containing only the values 1, 2, 3, and 4. Replicate 10,000 rolls of the four-sided die and plot the results in a histogram. You now understand how to simulate the rolling of two six-sided die and how to obtain the sum of the two die values. Using the "expand.grid" function in R you calculated the possible outcomes for rolling various combinations of die such as rolling a six-sided die with a four-sided die. In this activity, you will investigate the outcomes of rolling two four-sided die with one big difference. Instead of adding the two die values to obtain their sum you will multiply the two die values to obtain their product. Roll the dice! Modify your die rolling function to return the results of MULTIPLYING the two die values together instead of adding them. Use your new function to roll two FOUR-SIDED die containing only the values 1, 2, 3, and 4. Replicate 10,000 rolls of the four-sided die and plot the results in a histogram
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started