1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kaheart [24]
3 years ago
9

Implement the simulation of a biased 6-sided die which takes the values 1,2,3,4,5,6 with probabilities 1/8,1/12,1/8,1/12,1/12,1/

2. In [ ]: # WRITE YOUR OWN CODE HERE! FEEL FREE TO INSERT MORE CELLS! # ADD SOME COMMENTS TO YOUR CODE! ​ Plot a histrogramm with 1,000,000 simulations to check if the relative counts of each number is approximately equal to the corresponding specified probabilities. Remark: Specify the bins of your histogram correctly.

Computers and Technology
1 answer:
hjlf3 years ago
4 0

Answer:

see explaination

Explanation:

import numpy as np

import matplotlib.pyplot as plt

a = [1, 2, 3, 4, 5, 6]

prob = [1.0/8.0, 1.0/12.0, 1.0/8.0, 1.0/12.0, 1.0/12.0, 1.0/2.0]

smls = 1000000

rolls = list(np.random.choice(a, smls, p=prob))

counts = [rolls.count(i) for i in a]

prob_exper = [float(counts[i])/1000000.0 for i in range(6)]

print("\nProbabilities from experiment : \n\n", prob_exper, end = "\n\n")

plt.hist(rolls)

plt.title("Histogram with counts")

plt.show()

check attachment output and histogram

You might be interested in
You are the Emergency Management Director of a small island nation. Your nation has come under Cyber-attack and the attackers ha
kozerog [31]

Answer:

okay actually what are you trying to get an answer for

Explanation:

8 0
2 years ago
__ is/are the amount of blank space between lines of text in a paragraph
Natali [406]
Indents? Double Space? one of those
5 0
3 years ago
Read 2 more answers
W-11/6=4<br><img src="https://tex.z-dn.net/?f=%20%20%5Cfrac%7Bx%20-%2011%20%7D%7B%206%7D%20%20%3D%204" id="TexFormula1" title="
kozerog [31]

step 1, multiply by 6:

x-11 = 4*6 = 24

step 2, add 11:

x = 35

7 0
3 years ago
Write c program to check character is alphabate or not?​
Elan Coil [88]

Lookup the isalpha() function in the C standard library, this function will check and return non-zero for alphabetic characters.

8 0
3 years ago
Write a program Using loops to display the following patterns –
lukranit [14]

Answer:mm, no se como

Explanation:ayudarte

5 0
3 years ago
Other questions:
  • Which type of chemical bonds are formed by sharing electrons?
    11·1 answer
  • 1.Characters archetypes are typical characters that represent universal patterns of human or human roles. (True or false)
    14·1 answer
  • Arrays are described as immutable because they are two dimensional. are arranged sequentially. can be reordered. cannot be chang
    13·1 answer
  • What is my favorite color?<br> Red<br>Orange<br>Yellow<br>Blue <br>Gold<br>Silver
    13·1 answer
  • Who like the videos where is clown is from :)
    6·1 answer
  • Which of the following statements are true regarding models? Select 3 options.
    11·1 answer
  • The road is closed a head
    9·1 answer
  • Shelby wants to move “ExpirationDate” to the top of the datasheet. What should she do?
    13·1 answer
  • What is the difference between electrical and electronic devices?
    5·2 answers
  • HW2.24. Statement: Area of a Triangle The area of a triangle can be computed by knowing the base and height of the triangle usin
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!