The command 'sample', as the name suggests, allows you to simulate a random sample. It is...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The command 'sample', as the name suggests, allows you to simulate a random sample. It is however limited to simulating samples from an arbitrary known discrete distribution. We will use this command in what is to follow. Simulating a sample from an arbitrary continuous random variable is also possible. Suppose a vendor stocks four types of pens, each sold for $2., $3.5, $6, and $10. Sup- pose X keeps track of revenue from a single sale, and we know that X has the following distribution: x 246 10 P(X=x) .3 .35.25.1 1. Compute μ = E(X) and o= V ar(X) (this does not require any simulations). 2. Assume that every sale of a pen is independent from any other sale. Further assume that the probability distribution for every sale is given by X (for example sales on one day are independent from sales on any other day). Write code to simulate an experiment that allows you to "find" the distribution of the average earnings of the vendor assuming that he sells exactly n pens, where n = 2,6,12,20,100,150. Notice that sampling once for a fixed value of n does not allow you to "find" the distribution of the (sample) average. You have to simulate picking a sample of size n many time. Use the 'replicate' function for this with the number replicates B set to 8000. Summarize your findings by following the outline given below: 3. For each n, suppose Xn is the sample mean when working with sample of size n. Using the simulation: (a) compute the sample mean Xn and the sample standard deviation sXn. (b) compute the histogram for the distribution of Xn (for the 8000 replicates). (c) Write a short summary of your observations from this experiment. You could consider commenting on: i. The effect of increasing the sample size on the sample mean and it's distribution ii. The effect of increasing the number of replicates on the accuracy distribution of Xn approximated by the simulation. The command 'sample', as the name suggests, allows you to simulate a random sample. It is however limited to simulating samples from an arbitrary known discrete distribution. We will use this command in what is to follow. Simulating a sample from an arbitrary continuous random variable is also possible. Suppose a vendor stocks four types of pens, each sold for $2., $3.5, $6, and $10. Sup- pose X keeps track of revenue from a single sale, and we know that X has the following distribution: x 246 10 P(X=x) .3 .35.25.1 1. Compute μ = E(X) and o= V ar(X) (this does not require any simulations). 2. Assume that every sale of a pen is independent from any other sale. Further assume that the probability distribution for every sale is given by X (for example sales on one day are independent from sales on any other day). Write code to simulate an experiment that allows you to "find" the distribution of the average earnings of the vendor assuming that he sells exactly n pens, where n = 2,6,12,20,100,150. Notice that sampling once for a fixed value of n does not allow you to "find" the distribution of the (sample) average. You have to simulate picking a sample of size n many time. Use the 'replicate' function for this with the number replicates B set to 8000. Summarize your findings by following the outline given below: 3. For each n, suppose Xn is the sample mean when working with sample of size n. Using the simulation: (a) compute the sample mean Xn and the sample standard deviation sXn. (b) compute the histogram for the distribution of Xn (for the 8000 replicates). (c) Write a short summary of your observations from this experiment. You could consider commenting on: i. The effect of increasing the sample size on the sample mean and it's distribution ii. The effect of increasing the number of replicates on the accuracy distribution of Xn approximated by the simulation.
Expert Answer:
Answer rating: 100% (QA)
However I can provide guidance on how to approach the problem To calculate the expected value u and ... View the full answer
Related Book For
Principles Of Information Security
ISBN: 9780357506431
7th Edition
Authors: Michael E. Whitman, Herbert J. Mattord
Posted Date:
Students also viewed these accounting questions
-
Use the alias method to simulate a random variable having the Poisson distribution with mean 5. Use the table of Poisson probabilities in the back of the book, and assume that 16 is the largest value...
-
(i) Write a function to simulate a random walk in the plane that moves up, down, left, and right with equal probability. Use your function to estimate the average distance from the origin after n =...
-
If a new product does not require any new fixed costs because the company utilizes the existing capacity of facilities and personnel, what is the breakeven point?
-
In Exercises find the derivative of the function by the limit process. f(x) = x - 4x + 5
-
The adjusting entry for accrued fees was omitted at December 31, the end of the current year. Indicate which items will be in error, because of the omission, on (a) The income statement for the...
-
Assume a learning curve following the power law. If you double the initial cost c(1) of a product, the costs of producing an order of 20 units: a. Stay the same. b. Are reduced by 50 percent. c. Are...
-
Cloud Cover in San Francisco Often, the same dataset can be visualized in many different ways. Figure 2.99 shows two different visualizations of San Francisco's typical cloud cover (as a percent of...
-
Route Canal Shipping Company has the following schedule for aging of accounts receivable: AGE OF RECEIVABLES APRIL 30, 2001 a. Fill in column (4) for each month. b. If the firm had $1,440,000 in...
-
On January 1, 2024, Kroll Corporation paid $2,559,000 for 31 percent of the outstanding voting stock of Sharon, Incorporated, and appropriately applied the equity method for its investment. Any...
-
a. During February, $194,500 was paid to creditors on account, and purchases on account were $210,400. Assuming that the February 28 balance of Accounts Payable was $62,500, determine the account...
-
Describe the five components of an Information System? (2) A Banking Information System such as an online banking platform, allows banks to offer their customers convenient, efficient, and secure...
-
According to the Wall Street Journal, on May 8, 2009, a BNY Mellon foreign exchange desk bought 4 million on behalf of an L.A. pension fund at a rate of $1.3625, just below the high for the day of...
-
Given the following three property files, what does the following method output? A. morado null B. violette generic C. morado lujoso D. violette null E. The code does not compile. F. An exception is...
-
The $/ exchange rate is 1 = $1.45, and the /CHF exchange rate is CHF 1 = 0.71. What is the CHF/$ exchange rate?
-
Tesla reported total sales of $5,179 million in the second quarter of 2020. The company also reported a gross profit margin of 25.4%. Calculate the cost of goods sold for this quarter.
-
Current-account balance in China. a. In 2010, Chinas overall saving rate was nearly 51.5% of GDP, the highest in the world. Chinas domestic investment rate, at 43%, was also high, but not as high as...
-
On year 2015, you bought BRK at $280/ share. You have tracked down the price of this stock over the last 6 years. Year PPS DPS 2016 270 3 2017 290 10 2018 295 7 2019 300 12 2020 270 - 2021 320 5...
-
Suppose the concentration of glucose inside a cell is 0.1 mm and the cell is suspended in a glucose solution of 0.01 mm. a. What would be the free energy change involved in transporting 10-o mole of...
-
Establish that people are often the weakest link of an information system since they provide direction, design, develop, and ultimately use and game them to operate in the business world.
-
Determine how to select the best risk management model.
-
Explain that security experts are noticing a rise in another form of online vandalism, hacktivist or cyber activist operations. A more extreme version is referred to as cyberterrorism (which is...
-
Example 17.5 showed that a thin film whose thickness is one quarter of the wavelength of light in the film serves as an antireflection coating when coated on glass. In Example 17.5, \(n_{\text {film...
-
Give a specific example of a process that has the energy changes and transfers described. (For example, if the question states " \(\Delta E_{\mathrm{th}}>0, W=0\)," you are to describe a process that...
-
Give a specific example of a process that has the energy changes and transfers described. (For example, if the question states " \(\Delta E_{\mathrm{th}}>0, W=0\)," you are to describe a process that...
Study smarter with the SolutionInn App