fbpx

Dice Simulation In Python 3| Online Assignment Help

Write 4 version about the simulates the roll of a pair of dice (two dice) and calculates the probability that various number combinations will be rolled by using the “random”.

Don't use plagiarized sources. Get Your Assignment on
Dice Simulation In Python 3| Online Assignment Help
Just from $13/Page
Order Now

In this lab, you are going to investigate the properties of dice using a computer program. Python provides the “random” library. You can import this and then use:

random randint,

The result will be between (and including) a and b. The exact details can be found at:

You are to design a program that simulates the roll of a pair of dice (two dice) and calculates the probability that various number combinations will be labelled.

Allow the user to enter a number. This is the number of times you will “roll” the dice. You will “roll” the dice in a loop and keep track of the number of times that various rolls occur. When the loop has completed your program should produce a table that shows the value of the roll accompanied by the number of times that It occurred, the percentage of the time that value occurred (number of occurrences divided by the total number of rolls). The final output might look like this:

total. iterations: leo number rolls percent

2                             90

3                               5

.90
.05
4                               5 .05

 

To create the table, you may find it helpful to use string

formatting… https://docs.python.org/3.4/libraryg.html#formatstrings o

Use this program to create a second program that works by randomly choosing a number between 2 and 12 instead of rolling the dice. Update the tables accordingly.

Note that rolling two distinct dice produces very different probabilities for each value than simply randomly getting a number between 2 and 12.

Now work out the probabilities for rolling any particular number and the probability that a randomly selected number will yield a given number between 2 and 12. Do this with pencil and paper.

Make copies of your programs. Using your calculated probabilities update the programs. This time your table should include a few extra columns. Add in the expected value (as per your calculation), a. the difference between the expected and the actual result. Your new table might look like this:

total iterations:

number rolls percent expected difference

2              90               .90                   . 80                         .10

Now produce a document that addresses the following:

  • Provide some sort of proof and explanation as to why rolling two dice is different than rolling a single die that has the numbers from 2 to 12.
  • What happens to the difference between the expected percentage and the actual percentage as the number of iterations increases? Include screenshots of the final output for 100 iterations and the largest number of iterations you ran.
  • If you tried the same experiment with real dice how long might you expect to be working?
  • If you tried this with real dice and found a significant difference between your simulated results what might be a reasonable cause?
  • If your simulation produced numbers that were significantly different from your calculated results what might a reasonable cause?
  • Does seeing this simulation provide insight as to how other models of real world phenomena are produced?
  • Assess your approach to solving the problem. Where did you struggle? Did you have errors in the logic of your program that needed to be listed? Explain.

Calculate your paper price
Pages (550 words)
Approximate price: -

Why Choose Us

Quality Papers

At Myhomeworkwriters.com, we always aim at 100% customer satisfaction. As such, we never compromise o the quality of our homework services. Our homework helpers ensure that they craft each paper carefully to match the requirements of the instruction form.

Professional Academic Writers

With Myhomeworkwriters.com, every student is guaranteed high-quality, professionally written papers. We ensure that we hire individuals with high academic qualifications who can maintain our quality policy. These writers undergo further training to sharpen their writing skills, making them more competent in writing academic papers.

Affordable Prices

Our company maintains a fair pricing system for all academic writing services to ensure affordability. Our pricing system generates quotations based on the properties of individual papers.

On-Time delivery

My Homework Writers guarantees all students of swift delivery of papers. We understand that time is an essential factor in the academic world. Therefore, we ensure that we deliver the paper on or before the agreed date to give students ample time for reviewing.

100% Originality

Myhomeworkwriters.com maintains a zero-plagiarism policy in all papers. As such, My Homework Writers professional academic writers ensure that they use the students’ instructions to deliver plagiarism-free papers. We are very keen on avoiding any chance of similarities with previous papers.

Customer Support 24/7

Our customer support works around the clock to provide students with assistance or guidance at any time of the day. Students can always communicate with us through our live chat system or our email and receive instant responses. Feel free to contact us via the Chat window or support email: support@myhomeworkwriters.com.

Try it now!

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Homework Writing Services

My Homework Writers holds a reputation for being a platform that provides high-quality homework writing services. All you need to do is provide us with all the necessary requirements of the paper and wait for quality results.

Essays

Essay Writing Services

At My Homework Writers, we have highly qualified academic gurus who will offer great assistance towards completing your essays. Our homework writing service providers are well-versed with all the aspects of developing high-quality and relevant essays.

Admissions

Admission and Business Papers

With Myhomeworkwriters.com, we will help you secure a position at your desired institution. Our essay writing services include the crafting of admissions papers. We will still help you climb your career ladder by helping you write the official papers that will help you secure a job. We will guide you on how to write an outstanding portfolio or resume.

Editing

Editing and Proofreading

Myhomeworkwriters.com has a professional editorial team that will help you organize your paper, paraphrase it, and eliminate any possible mistakes. Also, we will help you check on plagiarism to ensure that your final paper posses quality and originality.

Coursework

Technical papers

My Homework Writers harbors professional academic writers from diverse academic disciplines. As such, we can develop homework writing services in all academic areas. The simplicity or complexity of the paper does not affect the quality of homework writing services.