Discrete Mathematics Questions with Answers

25 practice questions on Discrete Mathematics (Data Structures & Algorithms) with answers and step-by-step solutions. Try 10 samples below, then practise all 25 free in the AptiNest app.

Sample questions

Question 1Easy

How many subsets does a set with 5 elements have?

  1. 32
  2. 10
  3. 25
  4. 120

Answer: A. 32

Explanation

A set with n elements has 2^n subsets: 2^5 = 32.

Step-by-step solution

  1. A set with n elements has 2^n subsets: 2^5 = 32.
  2. So the answer is: 32.

Why the other options are wrong

  • B. 10 is 2 x 5.
  • C. 25 is 5 squared.
  • D. 120 is 5 factorial.

Question 2Easy

In how many ways can 5 different books be arranged on a shelf?

  1. 25
  2. 120
  3. 60
  4. 24

Answer: B. 120

Explanation

Arrangements of 5 distinct items = 5! = 120.

Step-by-step solution

  1. Arrangements of 5 distinct items = 5! = 120.
  2. So the answer is: 120.

Why the other options are wrong

  • A. 25 is 5 squared.
  • C. 60 is half of 120.
  • D. 24 is 4 factorial.

Question 3Easy

17 mod 5 equals

  1. 3
  2. 1
  3. 4
  4. 2

Answer: D. 2

Explanation

17 = 3 x 5 + 2, so the remainder is 2.

Step-by-step solution

  1. 17 = 3 x 5 + 2, so the remainder is 2.
  2. So the answer is: 2.

Why the other options are wrong

  • A. 3 is 17 mod 7 sort of.
  • B. 1 is wrong.
  • C. 4 is wrong.

Question 4Medium

In any graph, the sum of the degrees of all vertices equals

  1. The number of edges
  2. The number of vertices
  3. Twice the number of edges
  4. Half of the number of edges

Answer: C. Twice the number of edges

Explanation

The handshaking lemma: sum of degrees = 2E. So the number of odd-degree vertices is even.

Step-by-step solution

  1. The handshaking lemma: sum of degrees = 2E.
  2. So the number of odd-degree vertices is even.
  3. So the answer is: Twice the number of edges.

Why the other options are wrong

  • A. Each edge adds 2 to the degree sum.
  • B. Vertices count is a different quantity.
  • D. Half would be too small.

Question 5Medium

If 10 people each shake hands once with every other person, the number of handshakes is

  1. 90
  2. 100
  3. 55
  4. 45

Answer: D. 45

Explanation

Handshakes = C(10,2) = 45.

Step-by-step solution

  1. Handshakes = C(10,2) = 45.
  2. So the answer is: 45.

Why the other options are wrong

  • A. 90 counts ordered pairs.
  • B. 100 is 10 squared.
  • C. 55 is C(11,2).

Question 6Medium

A graph with 7 edges has a degree sum of

  1. 7
  2. 21
  3. 49
  4. 14

Answer: D. 14

Explanation

Sum of degrees = 2E = 14.

Step-by-step solution

  1. Sum of degrees = 2E = 14.
  2. So the answer is: 14.

Why the other options are wrong

  • A. 7 is the edge count.
  • B. 21 is C(7,2).
  • C. 49 is 7 squared.

Question 7Medium

The GCD of 48 and 18 is

  1. 6
  2. 3
  3. 9
  4. 12

Answer: A. 6

Explanation

Euclid: 48 mod 18 = 12, 18 mod 12 = 6, 12 mod 6 = 0. GCD = 6.

Step-by-step solution

  1. Euclid: 48 mod 18 = 12, 18 mod 12 = 6, 12 mod 6 = 0.
  2. GCD = 6.
  3. So the answer is: 6.

Why the other options are wrong

  • B. 3 is a common factor but not the greatest.
  • C. 9 does not divide 48.
  • D. 12 does not divide 18.

Question 8Medium

The pigeonhole principle guarantees that among 13 people, at least two share the same

  1. Birth date
  2. Birth year
  3. Name
  4. Birth month

Answer: D. Birth month

Explanation

There are 12 months, so 13 people must have at least two in the same month.

Step-by-step solution

  1. There are 12 months, so 13 people must have at least two in the same month.
  2. So the answer is: Birth month.

Why the other options are wrong

  • A. 366 days would be needed for date.
  • B. Years are many more.
  • C. Names are unconstrained.

Question 9Hard

How many relations are there on a set with 2 elements?

  1. 4
  2. 16
  3. 8
  4. 2

Answer: B. 16

Explanation

A relation is a subset of A x A, which has 4 pairs, so there are 2^4 = 16 relations.

Step-by-step solution

  1. A relation is a subset of A x A, which has 4 pairs, so there are 2^4 = 16 relations.
  2. So the answer is: 16.

Why the other options are wrong

  • A. 4 is 2 squared.
  • C. 8 is 2^3.
  • D. 2 is too few.

Question 10Hard

A connected graph has an Euler circuit if and only if

  1. Every vertex has even degree
  2. Every vertex has odd degree
  3. It has exactly two odd vertices
  4. It has no cycles

Answer: A. Every vertex has even degree

Explanation

An Euler circuit uses every edge once and returns. It needs all even degrees.

Step-by-step solution

  1. An Euler circuit uses every edge once and returns.
  2. It needs all even degrees.
  3. So the answer is: Every vertex has even degree.

Why the other options are wrong

  • B. Odd degrees everywhere is not required.
  • C. Two odd vertices gives an Euler path.
  • D. Trees have no circuit.

Practise all 25 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all Data Structures & Algorithms topics · All topics