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
Travis just got promoted to network administrator after the previous administrator left rather abruptly. There are three new hir
anastassius [24]

Answer:

The company's account policy

Explanation:

If there's no common naming system, It's best to go with the company's account policy.

7 0
2 years ago
(Analyze scores) Write a program that reads an unspecified number of scores and determines how many scores are above or equal to
Angelina_Jolie [31]

Answer:

#section 1

ls = []  

while True:

   score = float(input('Enter a New score or negative number to exit: '))

   if score < 0:

       break

   else:

       ls.append(score)

   

#section 2

average = sum(ls)/len(ls)

a = [num for num in ls if num >= average]

print('Total Scores Entered: ',len(ls))

print('Average score entered is: ',average)

print('Number of scores above average is: ',len(a))

print('Number of scores below average is:', len(ls)-len(a))

Explanation:

The programming language used is python 3.

#section 1

In this section, an empty list is initialized to hold all the values that will be inputted.

A while loop created which prompts the user to enter an input until a   negative value is entered. This while loop always evaluates to be true until a value less than 0 allows it to break.

Finally, all the scores are appended to the list.

#section 2

In this section the code gets the average by dividing the sum by the number of items in the list.

A new list 'a' is created to hold all the values that are greater than or equal to the average.

Finally, the results are printed to the screen.

I have attached an image with the example stated in your question.

7 0
3 years ago
A palindrome is a string that reads the same both forward and backward. For example, the string madam is a palindrome. Write a p
miskamm [114]

Answer:

Explanation: Hey bro! Sorry to bother. But have any of your questions got deleted after posting them? I don't know why my question got deleted by a guy.

8 0
3 years ago
Why might an algorithm created to assist in hiring decisions be biased?
nika2105 [10]

Answer:

Previous decisions were flawed

Explanation:

An algorithm depends entirely on the data input into the system in the decision making process.

As such, when there are conclusions in the data set used by the algorithm for decision making which are distorted, such as the association of less individuals that drink and drive in the rich cities than can be found in poorer communities due to the presence of less bars uptown and as such drivers from uptown areas are given preference may include a bias that is due to conclusion on which the previous decisions were made and used in the algorithm which may have been flawed or need more detailed analysis

4 0
3 years ago
Which is NOT a way the network operating sys-
irakobra [83]

Answer: A user authentication

3 0
3 years ago
Other questions:
  • Which of the following can be both an input device and an output device? mouse. keyboard. display screen. laser printer .
    9·1 answer
  • What is the difference between a denial-of-service attack and a distributed denial-of-service attacks? which is potentially more
    10·1 answer
  • Ben buys an Olympus E-PL2 from Sony which starts malfunctioning. When he opts for an exchange, the customer representative says
    11·1 answer
  • The work principle is not always true<br> T or F
    11·2 answers
  • How do you think computers have helped improve documentation, support and services within the healthcare industry
    13·1 answer
  • Persuasion is when Someone speaks to crowd about love <br>○True<br>○False​
    10·1 answer
  • Using existing algorithms as building blocks for new algorithms has all the following benefits EXCEPT
    12·1 answer
  • With SQL, how do you select all the columns from a table named "Persons"?
    8·1 answer
  • 6
    9·1 answer
  • Part of the operating system core is responsible for controlling security, managing the file system, and providing a platform fo
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!