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
Imagine you were going to use a dedicated workstation for an animation job rather than a personal PC or the all-purpose PCs you
xeze [42]

Answer:

Explanation:

The three most notable differences that any user will notice between these two would be the following

  1. High-Resolution Display
  2. Specific Hardware (graphics tablet, camera, etc)
  3. Increased Speed

An individual that is working in a career in Animation needs a workstation that is capable of rendering animations which take lots of processing power. Therefore, the workstation would have to be high-end meaning that it will be much faster than a normal personal PC. Animation and Digital Design require a very High-Resolution display and specific hardware to allow you to bring your creations to life and make sure they look as beautiful as possible. All of this is not found in a normal personal PC either.

7 0
3 years ago
Carrie is creating a personal balance sheet. The heading includes the period of time that the balance sheet
frez [133]

Answer:

the answer is A

Explanation:

carries balance sheet ( 2013)

4 0
3 years ago
a machine needs a minimum of 100 sec to sort 1000 names by quicksort what is the approximate worst case time needed to sort 100
alexira [117]

Answer:

6.7seconds

Explanation:

4 0
3 years ago
What allow you to write alphas on a computer keyboard
lions [1.4K]

Answer:

"To create any of these Greek letters using the Alt codes, simply press the "Alt" key while simultaneously typing the listed number. For example, to create the Greek letter Alpha (α), press the "Alt" key and type 224 using the keypad at the right side of your keyboard." - GOOGLE

5 0
2 years ago
Which of the following is not a true statement about Christopher Columbus it oko
Thepotemich [5.8K]

Answer:

  • There has been a need to explore the different regions across the globe in the early ages, as there were ships to travel but there was no one before who knew about the different routes and maps of the region, so, it was sort of blind folded traveling when some one wanted to go far distances yet some of them knew about other regions on the far sides of many seas having a unique culture, different languages, along with having diversity among the flora and fauna inside the region.
  • So, like many other curious people across the globe there was a need for the people to explore all the regions. As, it was a need for the travelers and all the rest of free fork to know about this world. Now, every wanted to know more about the different lands but there were few who even performed the great feat, as they had fear for their lives.While, Christopher Columbus was more into sacrificing his own life in order to explore the lands at the far lands across the Pacific ocean. As, he arranged his mind and covered all the required arrangements for the journey.
  • As, was at first wanted to explore the lands of far east and thus wanted to more about the Subcontinent India, but in turn he reached the lands of the American continent in far west.While, upon arriving the American region we say many people with different skin tone, culture and language which was very different then he heard about the people of India.There was more different world then he could ever think of as he had a lot to tell about these lands upon the way back to Europe or his home land.

7 0
3 years ago
Other questions:
  • Consider a multiprocessor CPU scheduling policy. There are 2 options: 1) a singlecommon ready queue of jobs; when a CPU becomes
    8·1 answer
  • Ada lovelace designed the first computer
    7·1 answer
  • Your customer, Mykel, is ordering a custom-built computer for his home office and isn’t sure which components should be the high
    12·1 answer
  • Which port must be open on your router to allow you to upload device configuration and firmware updates using trivial file trans
    13·1 answer
  • What does the CFO of a company do
    14·1 answer
  • The camera still is bad even with the new iPhone xr and especially in low light it is even worst because you can see the pixels
    15·1 answer
  • Ad identifies and describes at least four ways to prevent downloading of spyware, adware, and viruses to computer
    9·1 answer
  • Whate is function of northe bridge<br>​
    12·1 answer
  • Type the correct answer in the box
    13·1 answer
  • This method of file transfer has been used for decades and is frequently used for uploading changes to a website hosted by an in
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!