search
Log In
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
7 votes
7k views

If a program $P$ calls two subprograms $P1$ and $P2$ and $P1$ can fail $50$% of the time and $P2$ can fail $40$% of the time, what is the failure rate of program $P$?

  1. $50$%
  2. $60$%
  3. $70$%
  4. $10$%
  • 🚩 Edit necessary | 👮 Ollie | 💬 “Correct answer is (c) 70% while in GateOverflow answer key it is given (d) 10%, please correct the key.”
in IS&Software Engineering 1 flag
edited by
7k views
3
An intuitive  way of thinking about this problem is the following

Assume we run this program 100 times.

50 times it fails at p1 and only 50 times the control reaches to p2.

and P2 fails at 40 %

40% of 50 is 20

Therefore out of 100 times it fails 70 times....

2 Answers

22 votes
 
Best answer

Program P fails when either P1 fails or P2 fails, i.e. failure of P1 + failure of P2. 

But this will also contain the case when both P1 and P2 fails at the same time, i.e. failure of P1 ∩ failure of P2, since this case will be already be counted on (P1+P2). 

Therefore, our final answer will be failure of P1 + failure of P2 - (failure of P1 ∩ failure of P2)

= $\left ( \frac{50}{100} \right )$ + $\left ( \frac{40}{100} \right )$ -$\left ( \frac{50}{100} * \frac{40}{100}\right )$

= $\left ( \frac{90}{100} \right )$ - $\left ( \frac{2000}{10000} \right )$

= $\left ( \frac{90}{100} \right )$ - $\left ( \frac{20}{100} \right )$

= $\left ( \frac{70}{100} \right )$

= 70%


selected by
18 votes

P1: fails 50% time. Success 50% time....0.5

P2: fails 40% time. Success 60% time.... 0.6

Success rate = both p1 and p2 wins = 0.5x0.6= 0.3

Failure rate =1- success rate = 1-0.3 =0.7=

70%

0
You have answered it in a very good way, Shiva. I am very happy to read your solution.Thanks.
Answer:

Related questions

2 votes
3 answers
1
3.5k views
Which of the following testing methods uses fault simulation technique? Unit testing Beta testing Stress testing Mutation testing
asked May 12, 2016 in IS&Software Engineering makhdoom ghaya 3.5k views
3 votes
1 answer
2
2.8k views
Which of the following types of coupling has the weakest coupling? Pathological coupling Control coupling Data coupling Message coupling
asked May 12, 2016 in IS&Software Engineering makhdoom ghaya 2.8k views
5 votes
1 answer
3
3k views
What is the cyclomatic complexity of a module which has seventeen edges and thirteen nodes? $4$ $5$ $6$ $7$
asked May 12, 2016 in IS&Software Engineering makhdoom ghaya 3k views
0 votes
3 answers
4
1.2k views
Equivalence partitioning is a ______ method that divides the input domain of a program into classes of data from which test cases can be derived White-box testing Black-box testing Orthogonal array testing Stress testing
asked Jul 16, 2016 in IS&Software Engineering jothee 1.2k views
...