Basic features
- Free title page and bibliography
- Unlimited revisions
- Plagiarism-free guarantee
- Money-back guarantee
- 24/7 support
How robust does the method of simulation seem to be for calculation of probabilities? How many times must you roll the die to expect your % error to be less than 10%, or 5% or 1%? Is Raptor able to carry out the process in a reasonable amount of time?. Group Names: CECS 100 Critical Thinking in the Digital Age Assignment #1 Simulation of Rolling Dice DUE: 10/06/2018 SUBMIT: This sheet and also the final Raptor Flowchart as pdf document: GroupNames_Assign1.pdf into dropbox. Notes: 1- One team member need to submit the assignment on behalf of the team. 2- Late assignments won t be accepted. Introduction: Simulation of probabilities is a very common computer task. For complex situations, the mathematical probability cannot be worked out due to the many factors involved. In simple cases though, it is easily computed. For example, rolling a fair six sided die has six equi probable outcomes, viz. 1,2,3,4,5,6. Each outcome has a chance of 1/6=0.1667 of happening on any one roll of the die. That is to say P(roll)=1/6 where roll is the value of the roll of the die. We would like to compute this probability by simulation of the process or experiment of rolling a fair die a very large number of times and use of the formula P(R)=(number of times R rolled in experiment)/(total number of rolls in experiment). Procedure: First we draw a flowchart using Raptor simulating the rolling a die 1000 times to show the algorithm for finding the probability (or chance) of rolling a two, viz. P(2)=(#times 2 rolled)/(total #rolls). Include your names and assignment# in the EXPERIMENT block. Figure 1. Rolling Die Simulation Algorithm The variable names appearing the flowchart are poor choices since they have no relation to what information they contain. Re draw the flowchart replacing k with numberOfTwos, n with numberOfRolls, r with rollOfDie, p with probabilityOfTwo, N with totalNumberOfRolls, and R with rollOfTwo. (Remember to replace the variable RNG in your Raptor flowchart while-loop with Raptor instruction floor (random*6)+1 . RNG stands for random number generator and its implementation is different in different languages.) After redrawing the flowchart, run the simulation using Raptor to encode the blocks of the flowchart. Begin by single stepping through the code using N=5 to validate the algorithm. If this is successful, change to N=1000 and note the value of P(2) that Raptor generates. Compute the percent error from the known value P*(2)=1/6 by using error=100*sqrt((P(2) P*(2))^2)/P*(2) where P*(2) is the known theoretical value. Add an output block to Raptor to show the error. Validate the Raptor code. Run the flowchart for values of N shown in the table and record the values in the corresponding column of the table. Table 1. Simulation Results of Rolling Fair Die N (# of Rolls) P(2) P*(2) Error (%) 50 0.1667 100 0.1667 250 0.1667 500 0.1667 1000 0.1667 5000 0.1667 10000 0.1667 25000 0.1667 50000 0.1667 100000 0.1667 Discussion: 1. What assumptions have been made when we say that this Raptor simulation can accurately give P(2)? 2. What effect does increasing the variable N have on the error calculation seen in Table 1? 3. What effect (difference) does changing R=2 to R=5 in the simulation of the probability calculation? 4. How would you modify the Raptor flowchart to find the probability of rolling an ODD number? What is the probability? Conclusion: 1. How robust does the method of simulation seem to be for calculation of probabilities? How many times must you roll the die to expect your % error to be less than 10%, or 5% or 1%? Is Raptor able to carry out the process in a reasonable amount of time? 2. Could this method of simulation be applied to other processes besides rolling dice? Give some examples. 3. The seventeenth century mathematician Pascal (along with Fermat) was the first to investigate the notion of probability. A notorious problem he encountered was how many times must you roll a pair of fair dice to have the probability of rolling a 12 become greater than 0.5 (an even money bet to gamblers). He was able to show that the answer was 25. From your investigations, do you think this problem can be solved by simulation? If so, how would you go about it? How robust does the method of simulation seem to be for calculation of probabilities? How many times must you roll the die to expect your % error to be less than 10%, or 5% or 1%? Is Raptor able to carry out the process in a reasonable amount of time?
We guarantee 0% plagiarism! Our orders are custom made from scratch. Our team is dedicated to providing you academic papers with zero traces of plagiarism.
We know how hard it is to pay the bills while being in college, which is why our rates are extremely affordable and within your budget. You will not find any other company that provides the same quality of work for such affordable prices.
Our writer are the crème de la crème of the essay writing industry. They are highly qualified in their field of expertise and have extensive experience when it comes to research papers, term essays or any other academic assignment that you may be given!
Place an order in 3 easy steps. Takes less than 5 mins.