Problem: This program computes instrumentation reliability. Equations for analyz
ID: 3804383 • Letter: P
Question
Problem: This program computes instrumentation reliability. Equations for analyzing the reliability of instrumentation can be developed from the study of statistics and probability, where the reliability is the proportion of the time that the component works properly. If a component has a reliability of 0.8, then it should work properly 80% of the time. The reliability of combinations of components can also be determined if the individual component reliabilities are known. In order for information to flow from point a to point b in the series design, all three components must work properly. In the parallel design, only one of the three components must work properly for information to flow from point a to point b.
Series design: a - component 1 - component 2 - component 3 - b
Parallel design:
a
component1
component2
component3
b
The input/output formats for your program should look like this:
Enter individual component reliability: 0.8
Enter in the number of trials: 3
Enter in the unsigned integer seed: 47
Analytical reliability:
Series: 0.512 Parallel: 0.992
Simulation reliability, 3 trials
Series: 0.667 Parallel: 1.000
Additional example of program execution using other test data:
Enter individual component reliability: 0.8
Enter in the number of trials: 100
Enter in the unsigned integer seed: 123
Analytical reliability:
Series: 0.512 Parallel: 0.992
Simulation reliability, 100 trials
Series: 0.470 Parallel: 1.000
Additional example of program execution using other test data:
Enter individual component reliability: 0.8
Enter in the number of trials: 1000
Enter in the unsigned integer seed: 3535
Analytical reliability:
Series: 0.512 Parallel: 0.992
Simulation reliability, 1000 trials
Series: 0.530 Parallel: 0.990
3r-3r2 + r'Explanation / Answer
#include <stdio.h>
#include <stdlib.h>
int get_input(double *reliablity, unsigned int *seed, unsigned int *trials);
void put_output(double reliablity);
double rand_float(double a, double b);
double series, parallel, s_series, s_parallel, reliablity;
unsigned int seed, trials;
int main()
{
get_input(&r, &seed, &trials);
put_output(r);
rand_float(0,1);
}
int get_input(double *reliablity, unsigned int *seed, unsigned int *trials)
{
printf("Enter individual component reliability: ");
scanf("%lf", reliablity);
printf("Enter in the number of trials: ");
scanf("%d", &trials);
printf("Enter in the unsigned integer seed: ");
scanf("%u", &seed);
printf(" ");
}
void put_output(double reliablity)
{
series = reliablity*reliablity*reliablity;
parallel = 3*reliablity - 3*reliablity*reliablity + reliablity*reliablity*reliablity;
s_series = rand_float(0,1)*rand_float(0,1)*rand_float(0,1);
printf("Analytical reliability: ");
printf("Series = %.3lf ", series);
printf("Parallel = %.3lf ", parallel);
printf(" ");
printf("Simulation reliability, %u trials ", &trials);
printf("Series = %.3lf ", s_series);
printf("Parallel = %.3lf ", s_parallel);
}
double rand_float(double a, double b)
{
return ((double)rand()/RAND_MAX)* (b-a) + a;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.