Question

Describe how random numbers can be used to simulate the roll of a die. How can...

Describe how random numbers can be used to simulate the roll of a die. How can two dice be simulated using this function? How can three dice be simulated using this function?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: If you have any queries related to the answer please do comment. I would be very happy to resolve all your queries.

We can use random number to find a random integer between 1 and 6.

So, the number returned by function will be considered the result of dice

For simulating 2 dice is

We will use it like a=func(); b=func(); where a is for first dice and b is for second dice

We will use it like a=func(); b=func(); c=func(); where a is for first dice and b is for second dice and c for third dice

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
Describe how random numbers can be used to simulate the roll of a die. How can...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a C PROGRAM that will simulate rolling a die. When rolling a die, one will...

    Write a C PROGRAM that will simulate rolling a die. When rolling a die, one will get a die face value of 1-6. We can use rand function and math ceiling function to get a random number of 1-6 generated. The program will simulating rolling 5 dice simultaneously and store their face values into an array of size 5. The program will keep rolling the dice and print the following: 1. All face values in one line 2. If any...

  • Generate a sub/function to simulate the roll of a single die. It should return a random...

    Generate a sub/function to simulate the roll of a single die. It should return a random number between 1 and the maximum number of faces on that die. Allow the user to specify different number of faces.                                                                                                                                                              20 pts Generate a sub/function to determine the number of years it takes to double your money if you invest it, given a user specified interest rate. See attached spread sheet for examples.                                    20 pts Example results (starting at $1) 1.5%          48 yrs          ...

  • Let U have a U(0,1) distribution. describe how to simulate the outcome of a roll with...

    Let U have a U(0,1) distribution. describe how to simulate the outcome of a roll with a die using U. Define Y as follows: round 6U + 1 down to the nearest integer. What the popssible outcomes of Y and their probabilities?

  • This problem investigates how you can use random numbers to simulate a computer dice game write a function called twooice that simulates the rolling of two sik-sided dice. The function takes no input...

    This problem investigates how you can use random numbers to simulate a computer dice game write a function called twooice that simulates the rolling of two sik-sided dice. The function takes no inputs. Instead, it generates two random integers between 1 and 6, and output their sum. You may submit your work as many times as you want Try to get 100%) Your Function MATLAB Documentation Reset Code to call your function C Reset 1s-tuoDice ss-twoDice This problem investigates how...

  • Use a random number generator to simulate the roll of a fair die 100 times. Let...

    Use a random number generator to simulate the roll of a fair die 100 times. Let the number face up on the die represent the variable X A. Build a relative frequency table of the outcomes of the variable X. X Freq Rel. Freq B. Use the relative frequency distribution from part c to estimate the probability of an even number face up, then find the actual probability using the probability distribution and comment on the difference in values.

  • Create a Dice Game: PYTHON This game is between two people. They will roll a pair...

    Create a Dice Game: PYTHON This game is between two people. They will roll a pair of dice each 10 times. Each roll will be added to a total, and after 10 rolls the player with the highest total will be the Winner! You will use the RANDOM class RANDRANGE to create a random number from 1 to 6. You'll need a function for "rollDice" to roll a pair of dice and return a total of the dice. You must...

  • ( Java Programming ) Write an application to simulate the rolling of two dice. The application...

    ( Java Programming ) Write an application to simulate the rolling of two dice. The application should use an object of class Random once to roll the first die and again to roll the second die. The sum of the two values should then be calculated. Each die can show an integer value from 1 to 6, so the sum of the values will vary from 2 to 12, with 7 being the most frequent sum, and 2 and 12...

  • How to write python code that is a dice rolling function that generates random numbers. The...

    How to write python code that is a dice rolling function that generates random numbers. The dice rolling function takes two arguments: the first argument is the number of sides on the dice and the second argument is the number of dice. The function returns the sum of the random dice rolls. For example, if I call roll dice(6,2) it might return 7, which is the sum of randomly chosen numbers 4 and 3. It somewhere along the lines of:...

  • PYTHON: Dice Rolling Write a script that takes input for the number of dice to roll...

    PYTHON: Dice Rolling Write a script that takes input for the number of dice to roll and for the number of sides for the dice. Roll that many n-sided dice and store the values an array. Take the number of sides of the dice and the number of dice as typed inputs from the user. Output should be a comma separated list of the die numbers with no spaces like this: 6,4,1,3,1 Write a script that will simulate the roll...

  • Write a program that calls the random number generator two times to simulate rolling a pair...

    Write a program that calls the random number generator two times to simulate rolling a pair of dice. It should store the two numbers into variables. It will then determine if the dice roll is a winner (doubles OR add up to 7). Remember to add two includes and also to seed the random number generator to the clock. This will roll two dice and add them together. Doubles, or a total of 7 - YOU ARE A WINNER!!! First...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT