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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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