Compilers Questions and Answers – Relations – 1

This set of Compilers Multiple Choice Questions & Answers (MCQs) focuses on “Relations – 1”.

1. (a,b) what is a?
a) Domain
b) Range
c) Domain & Range
d) None of the mentioned
View Answer

Answer: a
Explanation: A is called the domain.

2. (a,b) what is b?
a) Domain
b) Range
c) Domain & Range
d) None of the mentioned
View Answer

Answer: b
Explanation: B is called the Range.

3. R is said to be reflexive if aRa is true for every a in A.
a) True
b) False
View Answer

Answer: a
Explanation: All the elements of A are related with itself by relation R, hence it is a reflexive relation.
advertisement
advertisement

4. If every aRb implies bRa then a relation R will be a symmetric relation.
a) True
b) False
View Answer

Answer: a
Explanation: a is related to b by R, and if b is also related to a by the same relation R.

5. If every aRb and bRc implies aRc, then the relation is transitive.
a) True
b) False
View Answer

Answer: a
Explanation: a is related to b by R, and b is related to c by R, and similarly for a and c.

6. The smallest set A such that A ∪ {1, 2} = {1, 2, 3, 5, 9} is?
a) {2,3,5}
b) {1, 2, 5, 9}
c) {3, 5, 9}
d) None of the mentioned
View Answer

Answer: c
Explanation: Given A ∪ {1, 2} = {1, 2, 3, 5, 9}. Hence A = {3,5,9}.

7. If a set A has n elements, then the total number of subsets of A is?
a) N
b) 2n
c) N2
d) 2n
View Answer

Answer: b
Explanation: Number of subsets of A = nC0 + nC1 + . . . . . + nCn = 2n.
advertisement

Sanfoundry Global Education & Learning Series – Compilers.

To practice all areas of Compilers, here is complete set of 1000+ Multiple Choice Questions and Answers.

advertisement

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.