Determine number of values of x that are greater than zero

Assignment Help Mechanical Engineering
Reference no: EM13860284

The purpose of this assignment is to investigate a Monte Carlo Simulation to numerically calculate the area under a Gaussian PDF as in Figure 8.10-a of your text (the Q(y) function).

One of the most useful methods to determine the integral of function that cannot be performed in closed form are the so-called Monte Carlo methods. For the particular method that we are using here, matlab will generate a large number of gaussian distributed random numbers. The fraction of these numbers greater than a value. y will be the value of Q(y).

This works because the PDF for a gaussian is normalized, iePx(x)dx = 1

To generate a 1 dimensional array of gaussian random numbers in matlab use the randn(M,N) function.

For example to generate 10000 random numbers we can use

N=10000;

x=randn(1,N);

If we want to determine the number of values of x that are greater than zero we can use code similar to the following

x0=x ./abs(x); % converts the array elements to ±1

x1=(x0+1)/2; % converts the array elements to 1s and 0s

n0 = (z1*ones(N,1))/N;

% n0 is the fraction of array elements that are greater than 0

Of course, due to the symmetry of the pdf, the answer should be .5. Implementing this code should give one confidence that the method works. Note that the answer might not come out to be .5 unless N is big enough. Try for N=10, N=100, N=1000, N=10000;, N=100000;

N=1000000, and N=10000000;

randn(M, N) generates gaussian random numbers with 0 mean and unity variance. To change to a mean in and variance a. remember the new sequence can be formed form the orginal sequence, x, by

σx(x + m)

To compare to a value y rather than 0, just subtract y from the random variables and test for greater than zero.

Assignment:

1. Complete the code for arbitrary, m, σx and y.

2. Test when m = 0, σx = 1, and y = 0 and various N's to verify your answer is .5.

3. Rerun part 2 when σx = .01, .1, 10, and 100. Are your results what you expect? Why or why not?

4. Test when m = 5, σx = 1, and y = 5, 7, 9, 11. Are your results what you expect? Why or why not?

5. Reran part 5 when σx = .01, .1, 10, and 100. Are your results what you expect? Why or why not?

Note: this should be implemented using no for loops.

Reference no: EM13860284

Questions Cloud

Calculate the weighted average cost of capital employed : Calculate the weighted average cost of capital employed by filling in the following table. (Round all calculations to four significant digits. Enter percent in decimals.
Explain what the income eect : Explain what the income eect is. You may use plain English or use an illustrative example. However, you must convince me you know what it is without copying a denition. Repeat the above for the substitution eect.
What would you describe as the strengths and weakness : What would you describe as the strengths in your writing
About the indierence curves : Indierence Curves- Explain what an indierence curve is. Explain why an indierence curve always has a negative slope. Indierence curves are concentric to each other. What does an indierence \above" another indierence curve indicate?
Determine number of values of x that are greater than zero : If we want to determine the number of values of x that are greater than zero we can use code similar to the following x0=x ./abs(x); % converts the array elements to ±1
Are strict liability standards fair as general rule : In what situations will a court impose a strict liability standard instead of a negligence standard? Provide a real-world example of a strict liability case. Is imposing this standard fair? Are strict liability standards fair as a general rule?
Persuasive regarding ethical pricing of pharmaceuticals : In “Intellectual Property and Pharmaceutical  Drugs: An Ethical Analysis,” Richard T. De George lays out what he comes to  call the “Status Quo Approach” as a defense of copyright protection of pharmaceuticals.   Do you find this argument persuasive ..
Develop a reasonable way to share the housekeeping costs : Develop a reasonable way to share the housekeeping costs. How should they be allocated? Justify your reasoning and explain.
Genetically modified organisms and business duties : Explain Cooley’s argument in “Genetically  Modified Organisms and Business Duties.”  What would Cooley say about the activities of Monsanto and related in the case study “Monsanto’s Round-Up Ready Wheat”? In general, do you agree or disagree with Coo..

Reviews

Write a Review

Mechanical Engineering Questions & Answers

  Package design

Package Design Brief: Assume you are the packaging engineer for a large consumer products company. In this company, the Packaging Design Briefs are initiated by the marketing group and forwarded to the Package Engineering group.

  Mechanical engineering questions

Define dynamic viscosity, Determine the centroid, Pressure due to the height of liquid, Advantage of changing the liquid, Calculate the total moment about the hinge of the seal gate.

  Automatic control

DOF system and Find the differential equation describing the system

  Write a paper on boyle''s law

Write a paper on Boyle's law and describe Compression and Combustion stroke . Also explain Charles's law and illustrate SI engine and CI engine.

  Verify the law for parallelogram of forces

To Verify the law for parallelogram of forces, law for triangle of forces and law of polygon of forces. These laws are very useful to calculate unknown forces in very short time.

  Discharge pressure of the compressor

What is the discharge revised discharge pressure of the compressor.

  The Case for Global Accounting Standards

The role of IFRS in both developing and developed capital markets.

  Wind turbine

Wind turbines are becoming more and more common as a method of energy production, wind turbines by their very nature are dynamic and are subject to and create their own internal and external kinematics and kinetics.

  Advanced design methodologies

8 x product engineering and design review (week 2 – 12), ~3 pages per item which must contain a brief description of the product then delve into concepts such as materials selection, manufacturing methods, life cycle analysis, recyclability and overa..

  Design of absorption column and the cooler

Design of absorption column and the cooler. Process design of other units should be completed along with pipe sizes.

  Determine the maximum total bending moment

Determine maximum total bending moment (static plus dynamic) of the beam under steady-state conditions.

  Force of the water on the gate

Determine the magnitude of the horizontal and vertical components of the force of the water on the gate.

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