Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MATH 9 (LEC B 44292) HOMEWORK 3 Winter 2021 (Virtual Remote Session) Write the following function files in Matlab and upload them to Canvas. To

image text in transcribedimage text in transcribed

MATH 9 (LEC B 44292) HOMEWORK 3 Winter 2021 (Virtual Remote Session) Write the following function files in Matlab and upload them to Canvas. To receive full credit, you must use the exact function names given below, and you must not have extra terms getting printed to the screen. Make sure your file name is the same as your function name. 1. Write a function named "ThreeDices Add to perform the following "experiment" 1000 times: roll 3 six-sided dice and add their values. Put the outcomes in a list called addDiceList. So addDiceList should have length 1000, and each of the 1000 elements should be an integer from 3 to 18. Plot the histogram of the outcomes. 2. For the same experiment as in question 1, write a function named "ThreeDices Add2" to increase the experiment times (N) and see how the histogram of the outcomes changes. For each N, you will have one histogram plot. Output all plots as a GIF file. (Choose N= 1000 : 10,000 : 1,000,000). The "Craps" game: https://en.wikipedia.org/wiki/Craps Don't Come 4 5 *18 1101 4 to 1 4 to 1 NINE 10 to 110 to 1 PASS LINE COME 8 to 18 to 1 BE 23:4.9.10.11.12 PO!!! Pays Double Pays Double 30 to 130 to 1 FIELD 15 to 1 Don't Pass Bar !! 15 to 1 E 7 to 1 7 to. PASS LINE We will use a number pair to denote the outcomes of two dices, For example, (4, 5) means that you have one dice is 4, and the other is 5. 3. Write a function named "Craps" to simulate the craps game: roll 2 six-sided dice and add their values. Define a variable ProbSum8 that estimates the probability that 8 is obtained by the player. Calculate it probability and return it as function output. Use enough trials so that ProbSum8 always looks the same to at least 2 decimal places. If it changes, then use more trials. 4. Consider the same process as in the previous question, estimate the probabilities for ProbSum2, ProbSum9 and ProbSum12. Name the function as "Crap2", which returns the estimated probabilities for each outcomes. For example: function(r2, r9, r12]=Crap2(N) page 1 of 2 Math 9: Introduction to Programming for Numerical Analysis January 24, 2021 5. Write a function "Crap3" to estimate the probability of obtaining a pair of (3,3). With the 10 to 1 odds payout, what's the dealer's house edge? (1,2) has a 15 to 1 odds payout as shown in the picture above, what's the dealer's house edge? page 2 of 2 MATH 9 (LEC B 44292) HOMEWORK 3 Winter 2021 (Virtual Remote Session) Write the following function files in Matlab and upload them to Canvas. To receive full credit, you must use the exact function names given below, and you must not have extra terms getting printed to the screen. Make sure your file name is the same as your function name. 1. Write a function named "ThreeDices Add to perform the following "experiment" 1000 times: roll 3 six-sided dice and add their values. Put the outcomes in a list called addDiceList. So addDiceList should have length 1000, and each of the 1000 elements should be an integer from 3 to 18. Plot the histogram of the outcomes. 2. For the same experiment as in question 1, write a function named "ThreeDices Add2" to increase the experiment times (N) and see how the histogram of the outcomes changes. For each N, you will have one histogram plot. Output all plots as a GIF file. (Choose N= 1000 : 10,000 : 1,000,000). The "Craps" game: https://en.wikipedia.org/wiki/Craps Don't Come 4 5 *18 1101 4 to 1 4 to 1 NINE 10 to 110 to 1 PASS LINE COME 8 to 18 to 1 BE 23:4.9.10.11.12 PO!!! Pays Double Pays Double 30 to 130 to 1 FIELD 15 to 1 Don't Pass Bar !! 15 to 1 E 7 to 1 7 to. PASS LINE We will use a number pair to denote the outcomes of two dices, For example, (4, 5) means that you have one dice is 4, and the other is 5. 3. Write a function named "Craps" to simulate the craps game: roll 2 six-sided dice and add their values. Define a variable ProbSum8 that estimates the probability that 8 is obtained by the player. Calculate it probability and return it as function output. Use enough trials so that ProbSum8 always looks the same to at least 2 decimal places. If it changes, then use more trials. 4. Consider the same process as in the previous question, estimate the probabilities for ProbSum2, ProbSum9 and ProbSum12. Name the function as "Crap2", which returns the estimated probabilities for each outcomes. For example: function(r2, r9, r12]=Crap2(N) page 1 of 2 Math 9: Introduction to Programming for Numerical Analysis January 24, 2021 5. Write a function "Crap3" to estimate the probability of obtaining a pair of (3,3). With the 10 to 1 odds payout, what's the dealer's house edge? (1,2) has a 15 to 1 odds payout as shown in the picture above, what's the dealer's house edge? page 2 of 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Technology

Authors: Suad Alagic

1st Edition

354096276X, 978-3540962762

More Books

Students also viewed these Databases questions

Question

2. (1 point) Given AABC, tan A b b

Answered: 1 week ago