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
A deleted file or folder is not permanently deleted from a computer until which event occurs? The computer is restarted. The Rec
Vesnalui [34]

The recycle bin/ trash is emptied.

hope that helps :)✨

8 0
4 years ago
Read 2 more answers
When you write a C# program that stores a value in a variable, you are using temporary storage; the value you store is lost when
beks73 [17]

Answer:

The name for this kind of storage is Volatile memory.

Explanation:

Temporary storage is a memory which is freed or deleted when program ends or your computer accidentally losses power and the specific name for that  storage is volatile memory.

5 0
3 years ago
Cable inside the computer transferring data between the mother board and storage devices.
Keith_Richards [23]

A cable inside the computer transferring data between the mother board and storage devices is referred to as a storage device cable.

<h3>What is a hard drive?</h3>

A hard drive can be defined as an electro-mechanical, non-volatile data storage device that is made up of magnetic disks (platters) that rotates at high speed.

In Computer technology, all hard drives are commonly installed on computers and other digital service for the storage of digital files and to enable the booting of a computer through its operating system (OS).

In conclusion, a cable inside the computer that is designed and developed to facilitate the transfer of data between the mother board and storage devices is referred to as a storage device cable such as Serial Advanced Technology Attachment (SATA).

Read more on hard drive here: brainly.com/question/26382243

#SPJ1

3 0
2 years ago
A(n) ____________ calculator is a device that assists in the process of numeric calculations but requires the human operator to
Zielflug [23.3K]

Answer:

The answer that goes in the blank is <u>manual</u>

Explanation:

Have a good day :)

8 0
2 years ago
How do i cancel my brainly premium account?
Vikki [24]

Answer:

press cancel

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • Laura is photographing her son’s baseball game. What ISO setting should she use?
    11·1 answer
  • Storing a value in a variable<br> Exponent<br> Variable<br> Assignment<br> Operator
    13·1 answer
  • An installed theme can be applied by clicking on a theme in the themes group on the ____ tab.
    7·2 answers
  • A ____ is a text document written in HTML.
    13·1 answer
  • Adam is evaluating the security of a web server before it goes live. He believes that an issue in the code allows an SQL injecti
    5·1 answer
  • Kevin manages the security for his company and is working to implement a kernel integrity subsystem for key servers. Of the foll
    9·1 answer
  • Mariah was working on a multimedia presentation that included both video and audio files. The file was huge, and she wanted to s
    13·2 answers
  • Brake fluid should be checked __________.
    8·2 answers
  • The NVCC college professor receives frequent emails disguised as official business emails. They may be requests to reset a passw
    10·2 answers
  • How to execute python code in command prompt *window*?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!