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
Professionalism is defined as what?<br> ASAP PLEASE!
blsea [12.9K]

the competence or skill expected of a professional.

"the key to quality and efficiency is professionalism"

the practicing of an activity, especially a sport, by professional rather than amateur players.

"the trend toward professionalism"

8 0
3 years ago
What is a device that makes it possible for multiple customers to share one address is called a/n
chubhunter [2.5K]
I'm totally not sure but I think sec midterm flashcards
4 0
4 years ago
In a proper webpage, which tag holds all of a webpages visible HTML?
Evgen [1.6K]

Body.


head contains all of the data that we generally don't see.


Link is used to link to external stylesheets.


script is where you would type scrips.


doctype is used to tell the browser the document type.

6 0
3 years ago
Why can videos be streamed from the cloud to a computer with no loss in
mezya [45]
I think the answer is B
3 0
3 years ago
Read 2 more answers
Write a constructor for BaseballPlayer. The constructor takes three int parameters: numHits, numRuns, and numRBIs storing the va
Monica [59]

Answer:

Following are the code to the given question:

public class BaseballPlayer//defining a class BaseballPlayer

{

BaseballPlayer(int numHits, int numRuns, int numRBIs)//defining a parameterized cons

{

}

}

Explanation:

Some of the data is missing, which is why the solution can be represented as follows:

In this code, a class BaseballPlayer is defined, and inside the class a parameterized constructor is defined that holds three integer variable "numHits, numRuns, and numRBIs".

5 0
3 years ago
Other questions:
  • Which term defines a star system with two stars?
    13·2 answers
  • Which sentence in the passage conveys the message that drones can be used in the study of history?
    11·2 answers
  • Write the percentage 5 1/4 as a decimal​
    8·1 answer
  • Pressing the Ctrl+Home keys moves the insertion point to the
    12·2 answers
  • Which internet resource can you use to publicly describe an adventure trip you recently made?
    6·2 answers
  • What is thhe name of service included with windows server operating systemthat manages a centralized database containing user ac
    5·1 answer
  • Given an int variable n that has already been declared and initialized to a positive value, and another int variable j that has
    9·1 answer
  • A(n) _____ is someone who uncovers computer weaknesses and reveals them to manufacturers or system owners, without exploiting th
    15·1 answer
  • Please help i will give brainiest. Plus 30 points
    9·1 answer
  • Help I will mark BRAINLIEST !<br> Explain looping as an invention strategy. Why is it helpful?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!