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
Diano4ka-milaya [45]
2 years ago
9

Write a program that performs a simulation to estimate the probability of rolling five of a kind in a single toss of five six-si

ded dice. Show your results when running 100 Monte Carlo trials, 10,000 Monte Carlo trials, and 1,000,000 Monte Carlo trials.Signature:probability_five_of_a_kind(num_trials)return typestring (formatted to show eight decimal places)Test case:>>> pro bability_five_of_a_kind(500_000)'The probability_five_of_a_kind is 0.00074000'
Computers and Technology
1 answer:
VikaD [51]2 years ago
8 0

Answer:

import random

def probability_five_of_a_kind(num_trials):

   sums = 0

   for _ in range(num_trials):

       roll_1 = random.randrange(1,6, 1)

       roll_2 = random.randrange(1,6, 1)

       roll_3 = random.randrange(1,6, 1)

       roll_4 = random.randrange(1,6, 1)

       roll_5 = random.randrange(1,6, 1)

       collection = roll_1 + roll_2 + roll_3 + roll_4 + roll_5

       if collection == 5:

           sums += 1

   prob = round(sums/7776, 8)

   print(f"The probability_five_of_a_kind is {prob}")

   

probability_five_of_a_kind(100)

probability_five_of_a_kind(10000)

probability_five_of_a_kind(1000000)

Explanation:

The random package of the python language is used to select an integer value from the range of one to six representing the sides of a die. All six rolls are randomized and the sum. If the sum is equal to 5, the sums counter is incremented. At the end of the loop, the sum is divided by the five dices events (which is 6^5 = 7776).

You might be interested in
When creating a report,you can mske groups and subgroups by?​
Mnenie [13.5K]

Answer:

content of the report

Explanation:

  • you must clarify all things
  • the report would be clean and clear
7 0
2 years ago
What block(s) would most effectively keep a sprite from moving off the screen?
Sonja [21]

The block most effectively keep a sprite from moving off the screen if if on edge, bounce. Hence option B is correct.

<h3>What is screen?</h3>

Screen is defined as a portable or stationary object that offers shelter, acts as a partition, etc., and often consists of a covered frame. Screening is defined as the procedure of locating or choosing individuals from a community according to one or more selection criteria.

The block will kept more perfectly if one of the edge there is bounce so that the box will not fall from the sprite.

Thus, the block most effectively keep a sprite from moving off the screen if if on edge, bounce. Hence option B is correct.

To learn more about screen, refer to the link below:

brainly.com/question/23902291

#SPJ1

8 0
10 months ago
An IT security threat is anything that might cause serious harm to a computer system.
Blababa [14]

Answer:

True

Explanation:

this is true because a threat can endanger the computer and its system

5 0
2 years ago
Which is the best method of marketing a game to casual players?
Phoenix [80]
A casual game is a video game targeted at or used by casual gamers. Casual games may exhibit any type of gameplay or genre. They are typically distinguished by simple rules and by reduced demands on time and learned skill, in contrast to more complex hardcore games. They typically impose low production and distribution costs on the producer. Casual games are often played on a personal computer online in web browsers, but are also popular on game consoles and mobile phones.

Hope this helped. Have a great day! :D
3 0
3 years ago
Read 2 more answers
In order to prevent ports that are serving network hosts from being considered as best paths, what should be enabled to block bp
Sergio039 [100]

In order to prevent ports that are serving network hosts from being considered as best paths, BPDU guard should be enabled to block bpdus.

<h3>What are BPDU used for?</h3>

A bridge protocol data unit (BPDU) is known to be a kind of a data message that is known to be often  transmitted in a local area network to be able to know or find loops in that given network topologies.

Hence, in the case above, In order to prevent ports that are serving network hosts from being considered as best paths, BPDU guard should be enabled to block bpdus.

See full question below

. In order to prevent ports that are serving network hosts from being considered as best paths, what should be enabled to block BPDUs?

a. BPDU filter

b. BPDU guard

c. root guard

d. BPDU drop

Learn more about ports from

brainly.com/question/10097616

#SPJ1

6 0
1 year ago
Other questions:
  • True / False
    5·1 answer
  • File Explorer contains ribbon tabs that can be used for various functions. Which ribbon tab provides options to open a new File
    11·1 answer
  • When choosing a new computer to buy, you need to be aware of what operating it uses.
    12·1 answer
  • What is a characteristic of tasks in Outlook?
    10·2 answers
  • Write a function in Java to implement the following logic:
    13·1 answer
  • Lee has changed the style of his table to make the header row stand out. Next, he wants to center the text in the header row and
    11·2 answers
  • Each student has a record on a file consisting of the following data: Student last name, Student ID (numeric), GPA (a decimal nu
    7·1 answer
  • I'm getting pretty desperate plz help me, I'll give brainiest, and ill make a free question worth 100 points this is for coding
    10·1 answer
  • Which 1947 Invention paved the way for the Digital Revolution?
    12·2 answers
  • Consider the following implementation of a search method:
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!