Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Problem

In the game of craps, a "Pass Line" bet proceeds as follows. The first roll of the two, six-sided dice in a craps round is called the "come out roll." The bet immediately wins when the come out roll is 7 or 11, and loses when the come out roll is 2, 3, or 12. If 4, 5, 6, 8, 9, or 10 is rolled on the come out roll, that number becomes "the point." The player keeps rolling the dice until either 7 or the point is rolled. If the point is rolled first, then the player wins the bet. If the player rolls a 7 first, then the player loses. Write a program that plays craps using those rules so that it simulates a game without human input. Instead of asking for a wager, the program should calculate whether the player would win or lose. Create a function that simulates rolling the two dice and returns the sum. Add a loop so that the program plays 10,000 games. Add counters that count how many times the player wins, and how many times the player loses. At the end of the 10,000 games, compute the probability of winning, as Wins / (Wins + Losses), and output this value. Over the long run, who is going to win more games of craps, you or the house?

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92788904

Have any Question?


Related Questions in Computer Engineering

1 what is the price of a semiannual 1000 par value bond

1) What is the price of a semiannual $1,000 par value bond with four years left until maturity that pays a coupon of 3.75% and is yielding 5.25%? What would it be yielding if the price decreased to $973.47? Assume semian ...

Dud bolt is preparing for the boonta eve classic speeder

Dud Bolt is preparing for the Boonta Eve Classic speeder race and has to make a decision about which racer to bet on. He has calculated his potential payoffs and narrowed it down to two racers shown in the following tabl ...

Question suppose you are starting work on a project for an

Question : Suppose you are starting work on a project for an organization that has never used any modeling techniques or tools in designing a system. (Yes, it is hard to imagine, but it does exist.) Your manager is reluc ...

By chance does any know what percentage of the world gdp

By chance does any know What percentage of the world GDP has the Global 500 contributed most recently?

A compare the properties of cpu registers with the main

(a) Compare the properties of CPU registers with the main memory in MIPS.  (b) Describe the purpose of the stack pointer ($sp) for procedure calling. (c) What is a "basic block" and how is it used by a compiler? (d) Ther ...

Poblem 1 a firms production function c is given by c q

Problem 1. A firm's production function C is given by C (q) = 0:5q 2+2q 1 2 +18, where q is the level of output. (i) Calculate marginal costs (ii) If all fixed costs are sunk, and the minimum price at which this firm wil ...

You run a small pizza shop named pizza hat initially you

You run a small pizza shop named Pizza Hat. Initially you sold pizzas for $8 and every week you sold around 3000 pizzas. Each pizza costs you $3 to make. One day you decided to over discounts to customers to see if you c ...

The solution of this exercise please 37 creating an

The solution of this exercise please: 3.7 (Creating an Autocomplete Form) Create a simple search form using a search input element in which the user can enter a search query. Using the Firefox web browser, test the form ...

What is the broadcast domain and ports for hubs and

What is the Broadcast Domain and Ports for hubs and bridges?

Elmers utility function isnbspuxnbspy minxnbspy2 if the

Elmer's utility function is  U ( x ,  y ) = min{ x ,  y 2 }. If the price of  x  is $10 and the price of  y  is $15 and if Elmer chooses to consume 4 units of  y , what must his income be? a. $220 b. $100 c. $320 d. Ther ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As