In MATLAB, the command rand generates a single random number on [0, 1] according to the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In MATLAB, the command rand generates a single random number on [0, 1] according to the uniform law. Try it. The command rand (m, 1) generates a column vector of length m where each entry is generated independently according to the uniform law. Try it with m = 37. If we set x = (rand < .32), the variable x will be either 0 (if the random number is greater than 0.32) or 1 (if the random number is less than .32). It shouldn't be hard to see that x = 1 with probability 0.32 and x = 0 with probability 0.68. Similarly, x = (rand(37,1) < .32) will create a vector of 37 variables, each of which is 1 or 0 with probability 0.32 or 0.68, respectively. It should be clear how to generalize this to vector lengths other than 37 and probabilities other than 0.32. So if I tell you that basketball player Dwight is a 45% free throw shooter, you can simulate a sequence of 100 free throws with FT (rand(100,1) < .45); The entry FT (k) will be 1 if Dwight made free throw number k, and 0 if he missed. The result of sum (FT) will tell you the total number of free throws out of the 100 that Dwight made. (a) Write a MATLAB function free throws.m that takes a probability p and a positive integer N and returns a simulated sequence of free throws of length N, with a probability of success p. (b) Use your function to estimate the probability that Dwight makes at least 5 of his next 10 free throws. This will require you running it many times (say at least 10,000) and collecting the results in a smart way. (c) Use your script to estimate the probability that Dwight makes at least 50 of his next 100 free throws. (d) Use your script to estimate the probability that Dwight makes at least 500 of his next 1000 free throws. In MATLAB, the command rand generates a single random number on [0, 1] according to the uniform law. Try it. The command rand (m, 1) generates a column vector of length m where each entry is generated independently according to the uniform law. Try it with m = 37. If we set x = (rand < .32), the variable x will be either 0 (if the random number is greater than 0.32) or 1 (if the random number is less than .32). It shouldn't be hard to see that x = 1 with probability 0.32 and x = 0 with probability 0.68. Similarly, x = (rand(37,1) < .32) will create a vector of 37 variables, each of which is 1 or 0 with probability 0.32 or 0.68, respectively. It should be clear how to generalize this to vector lengths other than 37 and probabilities other than 0.32. So if I tell you that basketball player Dwight is a 45% free throw shooter, you can simulate a sequence of 100 free throws with FT (rand(100,1) < .45); The entry FT (k) will be 1 if Dwight made free throw number k, and 0 if he missed. The result of sum (FT) will tell you the total number of free throws out of the 100 that Dwight made. (a) Write a MATLAB function free throws.m that takes a probability p and a positive integer N and returns a simulated sequence of free throws of length N, with a probability of success p. (b) Use your function to estimate the probability that Dwight makes at least 5 of his next 10 free throws. This will require you running it many times (say at least 10,000) and collecting the results in a smart way. (c) Use your script to estimate the probability that Dwight makes at least 50 of his next 100 free throws. (d) Use your script to estimate the probability that Dwight makes at least 500 of his next 1000 free throws.
Expert Answer:
Related Book For
Statistics The Art And Science Of Learning From Data
ISBN: 9780321997838
4th Edition
Authors: Alan Agresti, Christine A. Franklin, Bernhard Klingenberg
Posted Date:
Students also viewed these computer network questions
-
"internet radios" for streaming audio, and personal video recorders and players. Describe design and evaluation processes that could be used by a start-up company to improve the usability of such...
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
Write a method \(\max ()\) that takes the first Node in a linked list as its argument and returns the value of the maximum item in the list. Assume that all items are positive integers, and return 0...
-
Give a big-O estimate for the number of comparisons used by the algorithm that determines the number of 1s in a bit string by examining each bit of the string to determine whether it is a 1 bit (see...
-
1. How should Wes and his team go about developing a survival stratgegy for Saratoga Supply? 2. Does Sarataoga Supply really need a survival strategy? Or should the company just begting to downsize...
-
The photon energies used in different types of medical x-ray imaging vary widely, depending upon the application. Single dental \(x\) rays use photons with energies of about \(25 \mathrm{keV}\). The...
-
Using the information below, draw an AOA network. Find the critical path and use it to compute the number of days you would be 95 percent sure the project would be completed. Calculate the slack,...
-
Bean Company has the following selected transactions in January: Jan. 1 Signed a $100,000, six-month, 5% note payable. Interest is payable at maturity. Jan. 15 Sales made totaling $300,000. The...
-
6.3. A 50 Hz, three phase, 275 kV, 400 km long transmission line has resistance 0.035 /km, inductance 1 mH/km and capacitance 0.01 F/km. If the line is supplied at 275 kV, find out the MVA rating of...
-
Consider the following algorithm: procedure who knows (a_1,a_2,...a_n: integers) k = 0 for (i 1 to n-1) for(j=i+1 to n). : if la ia_j >k then k = |a_i - a_jl a. What does the algorithm compute? b)...
-
Judy wants to buy a new bed, but it will cost her $668. The sales tax rate is 4.4% where she is buying the bed. Her budget only allows her to purchase a bed that is no more than $700. Calculate the...
-
Will setting different tax rates on the two sectors based on the cost information gathered by the engineers lead to a more cost-effective outcome? Explain why or why not.
-
Create fictional review for a social media site ( eg Amazon, Microsoft, Walmart etc) ?
-
Jonathan would like to know if he is deemed to be carrying on a trade with his vinyl record sales, what will happen if the trade makes a loss in 2022/23, how will the loss be treated for tax purposes...
-
Describe the goals of monetary policy and how Does Monetary Policy Affect the U.S. Economy?
-
Juanita owns a home in Richardson, TX. She purchases a Homeowners Policy (HO-3) from Farm State Ins. Co. The policy provides $100,000 in liability coverage (coverage E) and $5,000 in Med Pay coverage...
-
Go to www.kellogs.com, and examine the brands offered by Kelloggs. Using the BCG growth-share matrix, classify 10 brands as stars, question marks, cash cows, or dogs. Find at least one product you...
-
Discuss how a new brand manufacturer would go about defining their market segments and then begin to target them.
-
Diff Eyewear is a successful business built around a socially conscious mission. The company makes and sells stylish eyewear with comparable quality but a significantly lower price than luxury...
Study smarter with the SolutionInn App