Prof Waters wants to play a game of Yahtzee. It is a popular game played with...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Prof Waters wants to play a game of Yahtzee. It is a popular game played with 5 six-sided dices. In each turn, he rolls all five dice, and he keeps a count of the number of turns needed until he sees sixes on all five dice. He wonders how many turns are needed in expectation to roll 5 sixes. Taking what was talked about in Introduction to Scientific Programming about computing probabilities and expectations, he wants to write a program that computes this. Please write a program yahtzee.py that computes the expected number of tries to win at Yahtzee. You may write a single function named experiment that rolls five dice over and over until all of them are sixes. This function should return the number of turns needed until all sixes are rolled. You can then call this function many times and take the average over 1000 games of Yahtzee. The expected output is shown below. Sample Output: In expectation, it takes 7768.991 attempts to roll 5 sixes. For full credit, the answer should be plus or minus 500 from 7700, and it should take between 20 and 30 seconds to run. Prof Waters wants to play a game of Yahtzee. It is a popular game played with 5 six-sided dices. In each turn, he rolls all five dice, and he keeps a count of the number of turns needed until he sees sixes on all five dice. He wonders how many turns are needed in expectation to roll 5 sixes. Taking what was talked about in Introduction to Scientific Programming about computing probabilities and expectations, he wants to write a program that computes this. Please write a program yahtzee.py that computes the expected number of tries to win at Yahtzee. You may write a single function named experiment that rolls five dice over and over until all of them are sixes. This function should return the number of turns needed until all sixes are rolled. You can then call this function many times and take the average over 1000 games of Yahtzee. The expected output is shown below. Sample Output: In expectation, it takes 7768.991 attempts to roll 5 sixes. For full credit, the answer should be plus or minus 500 from 7700, and it should take between 20 and 30 seconds to run.
Expert Answer:
Related Book For
Statistics For The Social Sciences A General Linear Model Approach
ISBN: 9781107576971
1st Edition
Authors: Russell T. Warne
Posted Date:
Students also viewed these programming questions
-
A player pays $ 1 to play a game where three fair dice are rolled. It three 6s are obtained the player wins $500. and otherwise the player wins nothing. What are the expected net winnings of this...
-
Write a program that computes the following summation series using the Rational class: You will discover that the output is incorrect because of integer overflow (too large). To fix this problem, see...
-
Write a program that computes the edit distance (also called the Levenshtein distance, for its creator Vladimir Levenshtein) between two words. The edit distance between two strings is the minimum...
-
Suppose that a nonnegative function y = (x) has a continuous first derivative on [a, b]. Let C be the boundary of the region in the xy-plane that is bounded below by the x-axis, above by the graph of...
-
Just a little longer . . . I want to be sure this is working correctly before I change over, says Buffy, the owner of three bathroom accessories boutiques called Tub n Stuff. Her accountant, who...
-
A hospital claims that 75% of people who come to its emergency room are seen by a doctor within 30 minutes of checking in. To verify this claim, an auditor inspects the medical records of 55 randomly...
-
An engineer studied the effect of four variables on a dimensionless factor used to describe pressure drops in a screen-plate bubble column. Table B. 9 summarizes the experimental results. a. Fit a...
-
KenCor Pizza Emporium produces frozen pizzas for sale to grocery stores. The company has built a strong reputation for high-quality pizzas and has been profitable for a number of years. Because of...
-
On September 30, 2022, Panther Learning shows the following balances in its ledger. Use the data to prepare the trial balance below. Cash 5,000 Accounts Payable 1,300 Accounts Receivable 1,200 Common...
-
For the differential manometer shown in Fig. 3.27, calculate the pressure difference between points A and B. The specific gravity of the oil is 0.85. 10 in 32 in Oil Water 9 in el
-
For the following game tree, perform A. Minimax Evaluation B. Minimax Evaluation with alpha-beta pruning. Do indicate all alpha values and all beta values. Specify alpha cutoffs and beta cutoffs, if...
-
Five years from now, would you choose different benefits from those you selected today? Why or why not?
-
If management treats employees well, pays them a fair wage, communicates with them, and ensures that they have a safe and healthy work environment, there is no need for a union. Do you agree or...
-
Given your career aspirations, might you join a union? Why or why not? Explain.
-
What changes do you think this might cause in the immediate task environment for a business operating within the financial service industry? Look at the Financial Times online for information.
-
What are the reasons for strategic planners to pay more attention to the importance of planning and implementing an effective pricing strategy in a competitive market?
-
What is the Altman discriminant function value for MNO Inc.? Recall that: Net working capital = current assets minus current liabilities Current assets = cash + accounts receivable + inventories...
-
In the busy port of Chennai, India, the number of containers loaded onto ships during a 15-week period is as follows: 1. Develop a linear trend equation to forecast container loadings. 2. Using the...
-
Jim found that the p-value in his study was less than .01. He says, This means that my null hypothesis is false. My findings are strong enough to replicate. a. Why are both of Jims statements...
-
Logans favorite sports team has an 80% chance of winning their next game. Convert this value into an odds ratio where his team is the non baseline group and the outcome of interest is a victory.
-
Calculate the standard error when: a. = 9.8 and n = 12. b. = 9.8 and n = 25. c. = 9.8 and n = 180. d. = 4.2 and n = 12. e. = 12.9 and n = 25. f. = 1.3 and n = 180. g. Compare the standard...
-
Give examples of policies that a country could implement to reduce its absorption.
-
In Section 6.2.3, we made the comment "Perception is reality." How does this play in the valuation of a tangible versus intangible asset? 6.2.3 Politics to explore Our roadmap for this chapter would...
-
We discussed risk aversion as being descriptive of investor behavior. Can Do you think of any real-world behavior that you might consider to be evidence of the existence of risk preferrers?
Study smarter with the SolutionInn App