Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

140 marks, 25 marks for Grads] This Assignment requires you to write a Python script file called sol2.py. 2.1. [10 marks, 5 marks for Grads]

image text in transcribed

140 marks, 25 marks for Grads] This Assignment requires you to write a Python script file called sol2.py. 2.1. [10 marks, 5 marks for Grads] Write a program that rolls two dice (randomly selects a number 2. between 1 and 6 inclusive for each die). Repeat rolling dice 20 times. For each trial, you should add the two numbers that appear on each die and save it in a vector. Plot a histogram of the values you have gathered in the vector. Based on this histogram, what are the estimates for the probabilities of each number? 2.2. [10 marks, 5 marks for Grads] Run your code for 1000 times. What is your estimation now? 2.3. [20 marks, 10 marks for Grads] Change your program and assume that you have one fake die and one correct die. The fake die has 0 instead of 2. This means when you roll this defect die, a random number should be chosen among (1,0,3,4,5, and 6). Plot histogram of the values you have gathered in the vector Calculate the probability of getting a 7 as the sum of the numbers appeared on the dice. What is the probability of getting 3

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_2

Step: 3

blur-text-image_3

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

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions