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]
3 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]3 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
Which of the following makes a virtual tour different from a printed map
iris [78.8K]
Because it is more realistic then from a map 
3 0
4 years ago
Read 2 more answers
A computer professional's job involves analyzing computer systems for
ira [324]

Information technology is the discipline that includes analyzing computer systems for businesses and determining whether they are protected from cyber threats. Option A is correct.

<h3>What is information technology?</h3>

The practice of using computers to generate, process, store, retrieve, and communicate various types of electronic data and information is known as information technology (IT).

Analysis of computer systems for organizations to ascertain if they are secure against cyber attacks is part of a computer professional's work. This position falls within the discipline of information technology.

Unlike personal or recreational technology, IT is primarily utilized in the context of commercial activities. ​

A computer professional's job involves analyzing computer systems for businesses and determining whether they are protected from cyber threats. The discipline included in this job will be Information technology.

Hence option A is correct.

To learn more about information technology refer;

brainly.com/question/14426682

#SPJ1

7 0
2 years ago
4. In computers, an integer can be represented by more than 8-bit, what is the largest positive integer that
serious [3.7K]
Ok give me some minutes I’m on it now
5 0
3 years ago
Edmund wants to create a website for his university. He has created all the necessary content and now wants to style and format
Harman [31]

Javascript because it is a very helpful website and doesn't put bugs on your computer

5 0
4 years ago
How can you ensure that the website you are using is secured?
poizon [28]
By having the lock by the website address
3 0
3 years ago
Other questions:
  • A person who enjoyed making paper airplanes as a child might very well find a satisfying career as a(n) _____ engineer.
    7·2 answers
  • Write a program that accepts 5 number and arrange them in ascending order​
    7·1 answer
  • A smartphone user entered an incorrect passcode on his phone several times in a row, which locked the device.
    5·1 answer
  • Need help with these
    5·1 answer
  • Tim is trying to explain to his aunt how her computer works, but she does not understand what a CPU does. Which description will
    11·1 answer
  • Mr. Ray is looking for a platform to launch his product. His marketing team advises him to launch the product via as it is free
    15·2 answers
  • Can use some help with Computer Networking, with a focus on routing protocols. Part A: Which of these routing protocols is the o
    5·1 answer
  • A human interest story is an example of hard news.<br> O True<br> O False HEL
    15·1 answer
  • In the program below, numA is a _____.
    8·2 answers
  • Which of these countries has very strict cultural
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!