Answered step by step
Verified Expert Solution
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]
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
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