Write a script to simulate each player’s chances of winning

Assignment Help Basic Computer Science
Reference no: EM131412603

Two players, A and B, play a game called Eights. They take it in turns to choose a number 1, 2, or 3, which may not be the same as the last number chosen (so if A starts with 2, B may only choose 1 or 3 at the next move). A starts, and may choose any of the three numbers for the first move. After each move, the number chosen is added to a common running total. If the total reaches 8 exactly, the player whose turn it was wins the game. If a player causes the total to go over 8, the other player wins. For example, suppose A starts with 1 (total 1), B chooses 2 (total 3), A chooses 1 (total 4) and B chooses 2 (total 6). A would like to play 2 now, to win, but he can't because B cunningly played it on the last move, so A chooses 1 (total 7). This is even smarter, because B is forced to play 2 or 3, making the total go over 8 and thereby losing. Write a script to simulate each player's chances of winning, if they always play at random.

Reference no: EM131412603

Questions Cloud

University library-kudler fine foods virtual organization : Use the Virtual Organization link on the student website to access additional company information on Kudler Fine Foods. Use the Virtual Organization link on the student website to access additional company information on Kudler Fine Foods.
Simulate bacteria growth : So for p=0.75, p(E) is expected to be 1/3. But for p≤0.5, p(E) is expected to be 1, which means that extinction is certain (a rather unexpected result). You can use your script to test this theory by running it for different values of p, and estim..
Translate statements into symbolic form- jaguar and porsche : Translate the following statements into symbolic form using capital letters to represent affirmative English statements.- Not both Jaguar and Porsche make motorcycles.
Select a client problem that you think calls for ct or cbt : Similar hypotheses underpin cognitive therapy (CT) and cognitive-behavioral therapy (CBT), yet the application of each is different when working with clients. CT involves adjusting how clients think and feel. CBT involves adjusting how clients thi..
Write a script to simulate each player’s chances of winning : Write a script to simulate each player's chances of winning, if they always play at random.
Female reproductive system external genitalia diagram : Female Reproductive System External Genitalia Diagram. Locate, label and color each of the structures and regions listed below on the black and white unlabeled external genitalia (vulva) diagram found in the assignment section.
How the histogram changes each time : Simulate such an experiment 200 times by generating 200 random numbers with this mean and standard deviation. Plot the histogram (use 10 bins).
Translate statements into symbolic form- motorcycles : Translate the following statements into symbolic form using capital letters to represent affirmative English statements.- Both Jaguar and Porsche do not make motorcycles.
Explain how family systems theory applies to your family : Understanding your family system can help provide useful information when working with families. Family systems may be open or closed. Open family systems involve acceptance of all family members as equal participants in the family. For example, c..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd