## tanvirmahmud201505039

BAN USER- 0of 0 votes

AnswersA mission-critical production system has n stages that have to be performed sequentially; stage

- tanvirmahmud201505039 in India

i is performed by machine Mi. Each machine Mi has a probability ri of functioning reliably and

a probability 1 − ri of failing (and the failures are independent). Therefore, if we implement

each stage with a single machine, the probability that the whole system works is r1 · r2 · · · rn.

To improve this probability we add redundancy, by having mi copies of the machine Mi that

performs stage i. The probability that all mi copies fail simultaneously is only (1 − ri)mi, so the

probability that stage i is completed correctly is 1 − (1 − ri)mi and the probability that the whole

system works is Qni=1(1 − (1 − ri)mi). Each machine Mi has a cost ci, and there is a total budget

B to buy machines. (Assume that B and ci are positive integers.)

Given the probabilities r1, . . . , rn, the costs c1, . . . , cn, and the budget B, find the redundancies

m1, . . . , mn that are within the available budget and that maximize the probability that the

system works correctly| Report Duplicate | Flag | PURGE

Accountant Dynamic Programming

- 0 Answers
**qwrew**A mission-critical production system has n stages that have to be performed sequentially; stage

- tanvirmahmud201505039 June 08, 2017

i is performed by machine Mi. Each machine Mi has a probability ri of functioning reliably and

a probability 1 − ri of failing (and the failures are independent). Therefore, if we implement

each stage with a single machine, the probability that the whole system works is r1 · r2 · · · rn.

To improve this probability we add redundancy, by having mi copies of the machine Mi that

performs stage i. The probability that all mi copies fail simultaneously is only (1 − ri)mi, so the

probability that stage i is completed correctly is 1 − (1 − ri)mi and the probability that the whole

system works is Qni=1(1 − (1 − ri)mi). Each machine Mi has a cost ci, and there is a total budget

B to buy machines. (Assume that B and ci are positive integers.)

Given the probabilities r1, . . . , rn, the costs c1, . . . , cn, and the budget B, find the redundancies

m1, . . . , mn that are within the available budget and that maximize the probability that the

system works correctly| Flag | PURGE

**CareerCup**is the world's biggest and best source for software engineering interview preparation. See all our resources.

Open Chat in New Window

#include<iostream>

- tanvirmahmud201505039 April 20, 2017using namespace std;

int main()

{

while(1)

{

char s1[10],s2[10];

int key=1;

cin>>s1;

cin>>s2;

int i=0,j,k,l,m;

while(s1[i])

{

j=0;

while(s1[j])

{

if(s1[j]==s1[i])

{

if(s2[j]!=s2[i])

{

cout<<"False";

key=0;

break;

}

}

else

{

if(s2[j]==s2[i])

{

key=0;

cout<<"False";

break;

}

}

j++;

}

if(key==0)break;

i++;

}

if(key)

cout<<"True";

}

}