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

Assignment Help Basic Computer Science
Reference no: EM131406961

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: EM131406961

Questions Cloud

Discuss the efforts of ics-cert : Discuss the efforts of ICS-CERT specifically to the Stuxnet threat and examine its incident response efforts to mitigate this risk against U.S. industrial systems and Explain the role of US-CERT in protecting the nation's industrial systems and an..
What does it mean to be unhealthy : In your initial post, think about the definition of disease and answer the following questions:What does it mean to be unhealthy, and does the word "unhealthy" automatically mean pathology?Does being unhealthy automatically include a drug treatment? ..
What do you think has impacted ability to remember : What do you think has impacted ability to remember? What do think has impacted your inability to remember? (Include examples to support your responses.)
Make a recommendation for one common pto system : Make a recommendation for one common PTO system. Explain your system and why you think this system is the best system for the company.
Write a script to simulate each player’s chances of winning : 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.
Discuss about the pathophysiology and pharmacology : What have you learned in this course about pathophysiology and pharmacology?How will you apply this knowledge to your future health information management profession?
Describe the quality culture within fedex : Describe the quality culture within FedEx. Explain how FedEx can use its quality culture as a competitive advantage - Explain how FedEx has incorporated total quality management
What information is the most important to planning process : What information is the most important to this planning process? Which might be the least important consideration? Conduct research into this problem and cite your reasoning.
Explain the role self-concept plays in ethical communication : Describe self-concept. Explain the role self-concept plays in ethical communication. Describe your self-concept and whether it is generally positive or negative

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