MCQ Computer Science

# Compilers Questions and Answers – Relations

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

1. (a,b) what is a?

a) Domain

b) Range

c) All of the mentioned

d) None of the mentioned

Explanation: A is called the domain.

1. (a,b) what is b?

a) Domain

b) Range

c) All of the mentioned

d) None of the mentioned

Explanation: B is called the Range.

1. R is said to be reflexive if aRa is true for every a in A;

a) True

b) False

Explanation: All the elements of A are related with

itself by relation R, hence it is a reflexive relation.

1. If every aRb implies bRa then a relation R will be a symmetric relation.

a) True

b) False

Explanation: a is related to b by R, and if b is also related to a by the

same relation R).

1. If every aRb and bRc implies aRc, then the relation is transitive

a) True

b) False

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

1. 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

Explanation: Given A ? {1, 2} = {1, 2, 3, 5, 9}. Hence A = {3,5,9}.

1. If a set A has n elements, then the total number of subsets of A is.

a) N

b) 2n

c) N2

d) 2n

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

8. If A n B = B, then

a) A ? B

b) A = ø

c) B ? A

d) B = ø

Explanation: Since A n B = B , hence B ? A .

9. Empty set is a

a) Invalid set

b) Infinite set

c) Finite set

d) None of the mentioned

Explanation: Empty set is a finite set.

10. If A, B and C are any three sets, then A – (B ? C) is equal to

a) (A – B) ? (A – C)

b) (A – B) ? C

c) (A – B) n (A – C)

d) (A – B) n C

Explanation: it is De’ Morgan law.

11. A = {x: x ? x }represents

a) {0].

b) {1}

c) {}

d) {x}

Explanation: That is a fact.

12. If A, B, C be three sets such that A ? B = A ? C and A n B = A n C, then

a) A=B

b) A=C

c) B=C

d) A=B=C

Explanation: Transition Law.

13. The number of proper subsets of the set {1, 2, and 3} is.

a) 8

b) 6

c) 7

d) 5

Explanation: Number of proper subsets of the set {1, 2, 3) = 2³ – 2 = 6.

14. If A and B are any two sets, then A ? (A n B) is equal to

a) A

b) B

c) A^C

d) B^C

Explanation: A n B ? A Hence A ? (A n B) = A.

15. If A, B and C are any three sets, then A × (B ? C) is equal to.

a) (A × B) ? (A × C)

b) (A × B) n (A × C)

c) (A ? B) × (A ? C)

d) None of the mentioned