homework6-godara - ECE 1574 Homework Set#6 Problem Solving...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE 1574 Homework Set #6 Problem Solving with C++ Due date: 2/28/10 by 11:55PM This assignment is to be done individually Complete the lab exercise and answer questions 1 and 2 during the lab session. Answer the other questions later. LAB EXERCISE In good C++ style, write a program which (a) by a Monte Carlo technique estimates the reliability of the engineered system represented schematically below and (b) calculates the reliability analytically. Let the reliabilities of the individual components be C1 = 0.95, C2 = 0.90 and C3 = 0.85. -----C1----- | | --------- --------C3-------- | | -----C2----- Observe that the pair C1 and C2 run in parallel with one another, so that it suffices if either of the two works; but that the pair together stand in series with C3 which thus must work. Requirements: 1. Initialize the random number generator with the seed 20000. 2. Calculate the reliability using 10000 samples. 3. In your code, include the <cstdlib> header and make appropriate use of its symbols srand(), rand() and RAND_MAX. (Note: the <cstdlib> header apparently dumps the symbol RAND_MAX directly into the global namespace; you need not import it.) 4. Store the results (1 for success and 0 for failure) of each trail in a vector named "results". 5. Use the results vector to calculate the system reliability. 6. For readability, code using symbolic constants rather than numbers. Having coded in this way, you should for instance be able to change the number of samples or the output precision by changing the value of an appropriate constant at the top of the program source.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
7. Read carefully and follow instructions: Let your program output only a pair of numbers in a
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 6

homework6-godara - ECE 1574 Homework Set#6 Problem Solving...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online