Write a matlab program that rolls a fair 10-sided dice

Assignment Help Computer Engineering
Reference no: EM132206053

(a) Write a MATLAB program that rolls a fair 10-sided dice (whose faces go from 0 to 10) for some given number of times. In other words, you will pick a number uniformly at random on from {1, 2, 3, . . . 10} a number of times independently.

(b) Roll the dice 100 times, and meanwhile count the number of times you obtain each face. Write down the frequency of each face. For example, if you got 13 1s out of the 100 rolls, your result would be 0.13 for 1. Plot a graph that shows the face in the X-axis vs frequency in the Y-axis.

(c) Repeat (b) for 1000000 (one million) rolls.

(d) What we have done so far can be considered as the use of computer to and an approximation to the PMF of the dice roll. Compare the results you obtained in (b) and (c) with the "actual" PMF of the roll of the 10-sided fair dice. This so-called Monte Carlo method is pretty powerful and can be used to approximate the probabilities of events that are hard to calculate using formal methods.

(d) As another exercise, using one million rolls of the dice, approximate the PMF of X + |X-6|, where X is the random variable that is uniform on {1,2,3 ....10} (Rolls of the 10-sided dice). Compare what you obtain with the exact PMF of X + |X-6|. Plot both the approximate PMF and the actual PMF.

*hint

a) Type x = rand, and hit enter. Nice; the function rand is like a continuous random variable that is uniformly distributed on [0, 1]. We now need to nd a way to obtain a discrete random variable out of this continuous random variable.

b) Think about what type of numbers would you get from x = ceil(10*rand). Type help ceil to the command line to see what ceil does.

Reference no: EM132206053

Questions Cloud

Write a test program to declare and initialize two integer : Write a method called logicAnd that accepts as parameters two arrays of integer (A and B) and returns another array of integer (C).
Write a method called append that accepts two integer : Write a method called append that accepts two integer arrays as parameters and returns a new array that contains the result of appending the second array.
Write a merge program that merges two ordered lists : Write a "merge" program that merges two ordered lists of integers into a new ordered list.
Design for the business and application domains : MN503 - Network requirement analysis and plan - Investigate and develop an architectural internetworking design for the business and application domains
Write a matlab program that rolls a fair 10-sided dice : Write a MATLAB program that rolls a fair 10-sided dice (whose faces go from 0 to 10) for some given number of times.
Prompt the user for an integer between 10 and 100 : Write a MATLAB script (write using MATLAB) that prompts the user for an integer between 10 and 100 by displaying.
Write a matlab script to numerically solve any first order : Write a MATLAB script file to numerically solve any first order initial value problem using Rulers method.
Accept a two-dimensional array of integers as a parameter : Write a method called is Magic Square that accepts a two-dimensional array of integers as a parameter and returns true if it is a magic square.
Disadvantages of adding indexes to a database tables : What are the advantages and disadvantages of adding indexes to a database tables?

Reviews

Write a Review

Computer Engineering Questions & Answers

  How arrangement of subnet masks to make this possible

Suggest what the company may do if department D grows to 34 hosts.

  Create a textsquare function using the same techniques

Create a textsquare function using the same techniques as the pyramid function. The function will take in two values as input: the character to use in making.

  Questioncreate a shadow on phrase html5 canvas with an

questioncreate a shadow on phrase html5 canvas with an offeset -x of 2px an offset-y of 5px a blur of 6px and a

  Provide the different kinds of access protocols

explain an example of the Public Key Infrastructure that would explain the differing usages of symmetric and asymmetric encryption and how these encryption methods might use either a substitution or a transposition cipher.

  Select which currency they wish to display

Expand the "Currency Conversion" program to have a menu of five currencies that allows the user to choose which currency they wish to show in its equivalency to the US dollars.

  Which process is the best choice

In SQL Server, multiple WHERE statements can accomplish almost everything that a UNION can. TRUE OR FALSE. Justify your reply . This question is not asking that method is the best choice or the more efficient. It is simply asking is it possible.

  What is the w3c

sum up about P3P and present how this affects a website, website usage policies, privacy issues, agreements, etc.

  Add a method to the turtle class to draw your initials

Add a method to the Turtle class to draw a street of houses. Add a method to Turtle class to draw a letter. Add a method to Turtle class to draw your initials.

  Write a class encapsulating a grocery store

Write a class encapsulating a Grocery store, which inherits from Store. Store has the following attributes: name and sales tax rate.

  Discuss the relationship between data and knowledge

Discuss the relationship between data, information, and knowledge. Support your discussion with at least 3 academically reviewed articles.

  What does the super keyword represents

What does the super keyword represents and where can it be used? Give an example of a superclass and subclass.

  Create a use case diagram for the system

Create an object relationship diagram for the Personal Trainer information system. Create a use case diagram for the system.

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