# Project #84729 - MATLAB ASSIGNMENT

I need help with this matlab assignment.

I am willing to pay \$30 for it provided the program works and is correct.

I need it today by 5pm Pacific Time.

Â

Here is the assignment:

Here is a simple game: a player can roll a fair, six-sided die up to three times. After each roll a player may stop the game and receive \$1 for each dot on the upturned die. The player has to roll at least once, and the game automatically stops after the third roll. For example, if a player rolls 1, rolls 4, and then stops, the player receives \$4. The purpose of this exercise is to determine a good strategy to play this game, one that maximizes the chances of winning the most money.

Â

A) The MATLAB command rand yields a uniformly distributed, random number between 0 and 1. Therefore the statement ceil(6*rand) provides a 1, 2, 3, 4, 5 or 6 each with probability 1/6.

We may thus interpret the result of the above MATLAB statement to be the occurrence of a roll of a fair, six-sided die.

Use the above command to simulate rolls of a die when you implement a MATLAB function of the form function Strategy(minFirstRoll,minSecRoll).

Strategy(minFirstRoll,minSecRoll) simulates the outcome of the strategy that stops if the outcome of the first roll is at least minFirstRoll and stops if the outcome of the second roll at least minSecRoll.

The Strategy function inputs two integers between 1 and 6 and outputs the number representing the upturned die where the player employing the strategy in question stops.

Note: the output of Strategy is a random number.

B) We seek to find which strategies do well on average, so we need to average the results in part a.

Write a function AveStrategy(minFirstRoll,minSecRoll,numGames) that computes the arithmetic average of Strategy(minFirstRoll,minSecRoll) after playing numGames games.

Display command line outputs of AveStrategy(1,2,10000), AveStrategy(4,3,10000) and AveStrategy(5,5,10000).

C) Of the strategies considered above, which one does best? and what is its average (as the number of games played gets larger and larger)?

Â

****Remarks: For parts a and b, provide the MATLAB code you wrote for the Strategy and AveStrategy functions; for part b, also provide your numerical results; for part c, just answer the questions.

Â

 Subject Computer Due By (Pacific Time) 10/03/2015 12:00 pm
TutorRating
pallavi

Chat Now!

out of 1971 reviews
amosmm

Chat Now!

out of 766 reviews
PhyzKyd

Chat Now!

out of 1164 reviews
rajdeep77

Chat Now!

out of 721 reviews
sctys

Chat Now!

out of 1600 reviews

Chat Now!

out of 770 reviews
topnotcher

Chat Now!

out of 766 reviews
XXXIAO

Chat Now!

out of 680 reviews