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
Ken is a mobile app developer. He is designing a mobile app that offers tips and guidance to people interested in learning jazz
Luden [163]

Answer:

D is the one that makes the most sense

3 0
3 years ago
Read 2 more answers
What are the characteristics of a good text-based adventure game? In other words, what are some features that should be in the g
Degger [83]

Answer:

spelling and good format

Explanation:thats all i know

8 0
2 years ago
Hexadecimal to denary gcse method
Anuta_ua [19.1K]

There are two ways to convert from hexadecimal to denary gcse method. They are:

  • Conversion from hex to denary via binary.
  • The use of base 16 place-value columns.

<h3>How is the conversion done?</h3>

In Conversion from hex to denary via binary:

One has to Separate the hex digits to be able to know or find its equivalent in binary, and then the person will then put them back together.

Example - Find out the denary value of hex value 2D.

It will be:

2 = 0010

D = 1101

Put them them together and then you will have:

00101101

Which is known to be:

0 *128 + 0 * 64 + 1 *32 + 0 * 16 + 1 *8 + 1 *4 + 0 *2 + 1 *1

= 45 in denary form.

Learn more about hexadecimal from

brainly.com/question/11109762

#SPJ1

3 0
2 years ago
What does "ttyt" stand for?
EastWind [94]
TTYT stands for "talk to you tomorrow".
6 0
3 years ago
Read 2 more answers
1. find the network address for 172.22.49.252/17
mariarad [96]

Answer:

1. The network address for 172.22.49.252/17 is 172.22.0.0/17.

2. The last valid assignable host address of 172.22.4.129/26 is 172.22.4.190.

3. The first and last host address of 192.167.25.25/16 is 192.167.0.1 and 192.167.255.254.

4. The broadcast address of 10.75.96.0/20 is 10.75.111.255

Explanation:

Subnetting in networking is the process of managing the use of host addresses and subnet masks of a network IP address. For example, the IP address "172.22.49.252/17" is a class B address that receives an extra bit from the third octet which changes its subnet-mask from "255.255.0.0" to "255.255.128.0". with this, only 32766 IP addresses are used, with the network address of "172.22.0.0/17".

7 0
3 years ago
Other questions:
  • How can i use css/html coding to create links
    15·1 answer
  • Tom wants a way to automatically create ads and simplify campaign management, using his resources and Google's machine learning
    12·1 answer
  • _______ view focuses on the text and content of a document, without much information on the page layout.
    7·1 answer
  • What are two types of formulas in Excel
    13·2 answers
  • the microsoft excel application is a _____ program. database word-processing spreadsheet desktop-publishing
    8·1 answer
  • What element is not a selection in the Interface preferences? UI Character Presets UI Font Size UI Language UI Scaling
    9·1 answer
  • Should the federal government have bug bounty programs? Why or why not?
    9·2 answers
  • What are the 2 things you are not sure about evaluating functions​
    7·2 answers
  • Which of the following is an operating system?<br> MacBook Air<br> Windows 10<br> Dell
    13·2 answers
  • Which of these would be the fastest transition duration?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!