In: Computer Science
A coding competition was conducted inside TCS campus with e
employees. Data of employees who participated and who did not
participate in the competition isavailable. There were three
problems in the coding competition. Data as mentioned below is
available
The number of employees who have solved only the first, only the
second and only the third problem are equal.
There are p1 employees who solved the first and the second
problem.
- There are p2 employees who solved the second and the third
problem
There are p3 employees who solved the third and the first
problem.
There are q employees who solved all the 3 problems.
There are r employees who did not participate in the
competition
Answer the following questions on the basis of data provided
above.
How many employees have solved the first problem?
How many employees have solved exactly one of the 3 problems?
<<<<<<<<<<<< disscussion and solution >>>>>>>>>>>>>
venn diagram accoding to question
GIven:
The total employees = e.
The number of employees who have solved
first == second == third
let it be equal to x.
solved all 3 problems == q
employees who solved the first and and the second problem == p1
so number of employees who solved first and second problem
but not the third == p1-q
as q employees solved all the 3 problems.
employees who solved the second and the third problem== p2
Hence number of employees who solved second and third problem
but not the first == p2-q.
employees who solved the second and the third problem== p3
Hence number of employees who solved third and first problem
but not the second == p3-q.
employees did not participate == r
total number of employee are e.
x+x+x+p1-q+p2-q+p3-q+q+r = e
3x+p1+p2+p3-2q+r = e
3x = e-(p1+p2+p3-2q+r)
==> x= {e-(p1+p2+p3-2q+r)}/3 ....................(1)
Using the above derivation and the Venn diagram we can answer the given questions
<<<<<<<<<<<<<<<< part 1 >>>>>>>>>>>>>>>>>>>>>>>
1) How many employees have solved the first problem?
The employees who have solved the first problem are
x+p1-q+p3-q+q
==> x+p1+p3-q
substituting 1 in above equation we get
==> {e-(p1+p2+p3-2q+r)}/3+p1+p3-q
Employees who solved Problem 1=
<<<<<<<<<<<<<<<< part 2 >>>>>>>>>>>>>>>>>>>>>>>
2) Employees who have solved exactly one of the three problems
so we have to find value of 3x
from equation 1
x= {e-(p1+p2+p3-2q+r)}/3 ....................(1)
so employees who have solved exactly 1 of three problems = e-(p1+p2+p3-2q+r)
<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>