Question 16: In a software house of a city with 300 software developers, a survey was conducted to determie which programming languages are liked more. The survey revealed the following statistics:
\(\bullet\quad\) 150 developers like Python.
\(\bullet\quad\) 130 developers like Java.
\(\bullet\quad\) 120 developers like PHP.
\(\bullet\quad\) 70 developers like both Python and Java.
\(\bullet\quad\) 60 developers like both Python and PHP.
\(\bullet\quad\) 50 developers like both Java and PHP.
\(\bullet\quad\) 40 developers like all three languages: Python, Java and PHP.
\(\quad(a)\) \(\;\) How many developers use at least one of these languages?
\(\quad(b)\) \(\;\) How many developers use only one of these languages?
\(\quad(c)\) \(\;\) How many deveopers do not use any of these languages?
\(\quad(d)\) \(\;\) How many developers use only PHP?
Solution:
Let we assign symbol to each language
Python: \(n(P)=150\)
Java: \(n(J)=130\)
PHP: \(n(PH)=120\)
Python and Java: \(n(P\cap J)=70\)
Python and PHP: \(n(P\cap PH)=60\)
Java and PHP:\(n(J \cap PH)=50\)
All languages: \(n(P \cap J \cap PH)=40\)
\((a)\) \(\;\) How many developers use at least one of these languages?
\(n(P\cup J\cup PH)=\ \)\(n(P)+n(J)+n(PH)\ \)\(−\ n(P\cap J)−n(P\cap PH)\ \)\(−\ \)\(n(J\cap PH)+n(P\cap J\cap PH)\)
\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =\ \)\(150+130+120\ \)\(−\ 70−60\ \)\(−\ \)\(50+40\)
\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =\ \)\(260\)
\((b)\) \(\;\) How many developers use only one of these languages?
\(n(P)\) \(\text{only}\) \(\ =\ \)\(n(P)-n(P\cap J)-n(P\cap PH)+n(P\cap J\cap PH)\)
\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =150-70-60+40\)
\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =60\) people like python
\(n(J)\) \(\text{only}\) \(\ =\ \)\(n(J)-n(P\cap J)-n(J\cap PH)+n(P\cap J\cap PH)\)
\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =130-70-50+40\)
\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =50\) people like java
\(n(PH)\) \(\text{only}\) \(\ =\ \)\(n(PH)-n(J\cap PH)-n(P\cap PH)+n(P\cap J\cap PH)\)
\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =120-50-60+40\)
\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =50\) people like PHP
Total Developers who use only single language are: \(60+50+50=160\)
\((c)\) \(\;\) How many deveopers do not use any of these languages?
\(\text{Developer who do not use P,J, or PH}\)\(\ =\ \)\(\text{Total}\)\(\ -\ \)\(\text{Developer who use atleast any of P, J or PH}\)
\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \)\(\ =\ \)\(300\)\(\ -\ \)\(260\)
\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \)\(\ =\ \)\(40\)
\(40\) developers do not use any of these language mentioned in this question.
\((d)\) \(\;\) How many developers use only PHP?
\(n(PH)\) \(\text{only}\) \(\ =\ \)\(n(PH)-n(J\cap PH)-n(P\cap PH)+n(P\cap J\cap PH)\)
\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =120-50-60+40\)
\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =50\) people like PHP