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
1. You are given a database to create, however, you realize that in the instructions you are told to create relationships betwee
Alik [6]

Answer:

In your table create statement, you can reference a primary key of another table. This is called a foreign key.

The syntax varies per database type.

6 0
3 years ago
Assume that scotus is a two-dimensional character array that stores the family names (last names ) of the nine justices on the S
Orlov [11]

Answer:

scotus[8]

Explanation:

scotus[8] gives the last name because there are 9 elements stored in scotus array

3 0
3 years ago
Write a program that prompts the user to enter the weight of a person in kilograms and outputs the equivalent weight in pounds.
Alex

Answer:

#include<iostream>

#include<string>

int main()

{

double weight;

double weightInPounds;

cout<<"Enter Weight of person in kilograms\n";

cin>>weight;

weightInPounds = weight * 2.2;

cout<<"Your weight in Pounds is : "<<weightInPounds<<endl;

return 0;

}

6 0
3 years ago
Find the largest and smallest byte,short,int,long,float, and double. Which of these data types requires the least amount of memo
gladu [14]
<h2>double, long, float, short, byte</h2>

Explanation:

The given data types are built-in types. According to java, the following holds right to justify the order.

Double:

  • This occupies 64 bits
  • It can hold decimal values
  • Example: "1.23456e300d, -1.23456e-300d, 1e1d"

Float:

  • It occupies 32 bits
  • Holds decimal values
  • Example: "1.23e100f, -1.23e-100f, .3f, 3.14F"

Long:

  • It occupies 64 bits
  • Example: "-2L, -1L, 0L, 1L, 2L"

Short:

  • It occupies 16 bits
  • Stores twos complement integer

Byte:

  • It occupies 8 bits
  • Stores twos complement integer
7 0
3 years ago
Which is an internet service?<br><br> Antivirus<br> Chat<br> Firewall<br> Router
leva [86]

Answer:

Router

Explanation:

The others are not related to internet per se.

8 0
4 years ago
Read 2 more answers
Other questions:
  • Think of a game you are familiar with and identify at least three team responsibilities which were required to make the game, on
    5·1 answer
  • The purpose of a memo is to communicate directions, advice , or information true or false
    8·2 answers
  • Compare the logical link control and the media access control. Which of the following is a correct statement?
    7·2 answers
  • Describe an ergonomic consideration for your body while working for long periods in front of a monitor or computer screen?
    14·1 answer
  • For almost all networks today, including the internet, the communication protocol used is called ____.
    15·1 answer
  • Identify which statement explains why a programmer would break a logic problem into steps.
    13·2 answers
  • The memory unit of a computer has 2M Words of 32 bits (or 4 bytes) each. The computer has an instruction format with 4 fields: a
    14·1 answer
  • You need to subnet a network that has 5 subnets, each with at least 16 hosts. Which classful subnet mask would you use?A. 255.25
    12·1 answer
  • The Table Design and Layout tabs are available under the
    13·2 answers
  • Girls question <br> who wants to go out ;p
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!