Answered step by step
Verified Expert Solution
Link Copied!

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

********************************************

image text in transcribed

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

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

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899

More Books

Students also viewed these Databases questions