#include using namespace std; // The manager of a industrial plant is planning to buy a machine of // either type A or type B. For each day’s operation: // The number of repairs, X, that machine needs is a Poisson random // variable with mean 0.88. The daily cost of operating A is 160 + // 40X^2, X = number of repairs for machine A // The number of repairs, Y, that machine needs is a Poisson random // variable with mean . The daily cost of operating B is 128 + 40Y^2, // Y = number of repairs for machine B // Assume that the repairs take a negligible amount of time and the // machines are maintained nightly to ensure that they operate like // new at the start of each day. Find and print the expected daily // cost for each machine. int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ double lambda_A = 0.88; double lambda_B = 1.55; // mean: E[X] = lambda // For poisson random var E[X^2] = lambda + lambda^2 // Cost_A = 160 + 40X^2, X = number of repairs for machine A // Cost_B = 128 + 40Y^2, Y = number of repairs for machine B double cost_A = 160 + 40 * (lambda_A + pow(lambda_A,2)); double cost_B = 128 + 40 * (lambda_B + pow(lambda_B,2)); cout << fixed << setprecision(3) << cost_A << endl; cout << fixed << setprecision(3) << cost_B << endl; return 0; }