The changes made are highlighted in the code
Get this output
![1) Probability of winning-0.3039 2) Probability of winning-0.3016 3) Probability of winning-0.3041 4) Probability of winning-0.309 5) Probability of winning-0.2989 6) Probability of winning-0.3041 7) Probability of winning-0.3029 8) Probability of winning-0.2941 9) Probability of winning-0.3098 10) Probability of winning-0.3031 The average winning probability is 0.30315 The 90% percentile interval for the w inning probability i [0.2941,0.3098] s](http://img.homeworklib.com/questions/ddb91900-6dc4-11ea-a7a9-236bbba6ae5a.png?x-oss-process=image/resize,w_560)
We can use the 10 repetitions to get an average estimate of the probability of winning.
We can also get a 90% confidence interval (percentile interval as we will use percentiles, rather than standard error).
90% interval indicates that the significance level of
That means a 90% interval would be
So 0.05 and 0.95 quantiles would be the 90% confidence interval for the winning probability.
From the output we can see that
Problem 10 Below is a working Matlab program to simulate many games of craps. The program...
Problem 9 A single game of craps (a dice game) consists of at most two rolls of a pair of six sided dice. The ways to win are as follows: Win-the first roll of the pair of dice sums to either 7 or 1 (you win, game over, no second roll Win the first roll of the pair of dice does NOT sum to either 7 or 1 but the sum of the second roll is equal to the sum...
C++ programming language, starting out with C++. Looping Constructs Write a program to simulate the casino game "craps". It should execute N number of games so that you can compute the probability(%) of the "player" winning and the "house" winning. Probability(%) of the "player" winning = PlayerWins / N * 100. Probability(%) of the "house" winning = HouseWins / N * 100. The rules are: Player rolls two dice. When the sum is 7 or 11 on first throw, player...
Write a c++ program that simulates a million of games in craps. I am having a trouble getting to loop a million of times. I am trying to use a const for a million. This is the code so far. #include <iostream> #include <cstdlib>// contains prototypes for functions srand and rand #include <ctime>// contains prototype for function time #include <iomanip> using namespace std; int rollDice(); // rolls dice, calculates and displays sum void printstats(); int totroll = 0, games, point,...
c++ help Write a program that obtains the execution times for the following three code segments with the different n. code 1: for(int i = 0; i <= n; i++) { x = i; } code 2: for (int i = 0; i <= n; i++) { for (int j = 0; j <= n; j++) { x = i + j; } } code 3: for (int i = 0; i <= n; i++) { for (int j =...
please use python and provide run result, thank you!
click on pic to make it bigger
For this assignment you will have to investigate the use of the Python random library's random generator function, random.randrange(stop), randrange produces a random integer in the range of 0 to stop-1. You will need to import random at the top of your program. You can find this in the text or using the online resources given in the lectures A Slot Machine Simulation Understand...
Java BlackJack Game:
Help with 1-4 using the provided code below
Source code for Project3.java:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class Project3 extends JFrame implements ActionListener
{
private static int winxpos = 0, winypos = 0; // place window
here
private JButton exitButton, hitButton, stayButton, dealButton,
newGameButton;
private CardList theDeck = null;
private JPanel northPanel;
private MyPanel centerPanel;
private static JFrame myFrame = null;
private CardList playerHand = new CardList(0);
private CardList dealerHand = new CardList(0);...