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
A software program that allows you to create professional looking multimedia presentations. Question 1 options: Excel 365 Word 3
maks197457 [2]

Powerpoint is a program that allows  us to create professional looking multimedia presentations.

<h3>What is Multimedia presentations?</h3>

A multimedia presentation is a way of communication where we use audio,vedio,arts,drawings and other various ways to present communcations.

<h3>Why Ms-PowerPoint ?</h3>

Ms-PowerPoint consists of some simple and understandable features to make notes through slides create vedio and vedio editing, Coral Draws Audio editing etc.

We can create banners,record vedios,draw and design with the help of tools provided by powerpoint.

Powerpoint also helps to transform boring presentation to an eye catching presentation.

Learn more about PowerPoint here:brainly.com/question/10117380

4 0
2 years ago
Jake was working on an essay for his English class on a stormy Sunday afternoon. Before he could save his document, a big strike
matrenka [14]

Maybe in atosave, Computers mostly save what your working on :3

8 0
3 years ago
Implement a function inValues() that asks the user to input a set of nonzero floating-point values. When the user enters a value
elena-s [515]

Answer:

Explanation:

The following is written in Python and uses exception handling to do exactly as requested. It then goes adding all of the integer values to an array called num_list and finally adding them all together when the function ends.

def in_values():

   num_list = []

   while True:

       try:

           num = input("Input non-zero floating point: ")

           num = int(num)

           if num == 0:

               break

           else:

               num_list.append(num)

       except ValueError:

           print("No valid integer! Please try again ...")

           try:

               num = input("Input non-zero floating point: ")

               num = int(num)

               break

           except ValueError:

               break

   sum = 0

   for number in num_list:

       sum += number

   return sum

5 0
3 years ago
In the Northern Hemisphere, large south-facing windows receive more total sunlight during the day and would be a part of a ___ s
9966 [12]

Answer:

Passive solar heating system

Explanation:

The goal of passive solar heating systems usually refers to the system in which the energy provided by the sun is used for heating and cooling of the living places in a house.

When sunlight falls on the house, the building elements capture the heat energy of the sun and it later releases back this heat when the sun is not there. The main objective of this system is to regulate the room temperature. It is comprised of two main elements, one is the glasses that face towards the south and a thermal mass that is used for heat absorption, storing and distribution of heat.

6 0
3 years ago
In Microsoft Word, a user can find the Customize Keyboard dialog box in the Customize Ribbon section of the
MissTica

Answer:

view tab

Explanation:

I think that is the answer

5 0
2 years ago
Other questions:
  • Default tab stops are set in Word every _______ inch.<br> a. ¾<br> b. 1<br> c. ½<br> d. ¼
    13·1 answer
  • Which of the following decimal (base-10) values is equivalent to the binary (base-2) value 101001?
    15·1 answer
  • What is the difference between an embedded image and an attached image
    7·2 answers
  • List 3 items that were on kens resume that should have been excluded
    13·2 answers
  • What is the meaning of the word joystick
    6·2 answers
  • Universal Containers uses a custom object within the product development team. Product development, executives, and System Admin
    11·1 answer
  • A large number of genetic codes are stored as binary values in a list. Which one of the following conditions must be true in ord
    5·2 answers
  • You are an IT technician for your company. One of your employees has a computer that continually reboots when it is powered on.
    8·1 answer
  • Full meaning of CASE in system analysis
    11·2 answers
  • 1. Define the term M.A.N.
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!