Set Theory: Total Students You are given four variables A, B, C, and D. A denotes the number of students who read Newspaper 1. B denotes the number of students who read Newspaper 2. c denotes the number of students who read both, Newspaper 1 and Newspaper 2. D denotes the number of students who do not read any newspaper. h Find the total number of students present in the class. . write a Java logic
Answers
Let A be the set of people who read newspaper H.
Let B be the set of people who read newspaper T.
Let C be the set of people who read newspaper I.
Given n(A)=25,n(B)=26, and n(C)=26
n(A∩C)=9,n(A∩B)=11, and (B∩C)=8
n(A∩B∩C)=3
Let U be the set of people who took part in the survey.
Explanation:
(i) n(A∪B∪C)=n(A)+n(B)+n(C)−n(A∩B)−n(B∩C)−n(C∩A)+n(A∩B∩C)
=25+26+26−11−8−9+3
=52
Hence, 52 people read at least one of the newspaper.
(ii) Let a be the number of people who read newspapers H and T only.
Let b denote the number of people who read newspapers I and H only.
Let c denote the number of people who read newspaper T and I only.
Let d denote the number of people who read all three newspaper.
Accordingly, d=n(A∩B∩C)=3
Now, n(A∩B)=a+d
n(B∩C)=c+d
n(C∩A)=b+d
∴a+d+c+d+b+d=11+8+9=28
⇒a+b+c+d=28−2d=28−6=22
Hence, (52−22)=30 people read exactly one newspaper.
Answer:
Explanation:
//write your logic here
in place of this write the following code
result = ((A+B)-C)*D;