University

Discrete Mathematics Practice Exam — Free

Generate a realistic AI practice exam with worked solutions

Generate Your Free Practice Exam

Discrete Math covers logic, proofs, sets, functions, recursion, counting, and graph theory — the mathematical backbone of computer science. Exams demand precise proof writing (induction especially) alongside procedural counting and graph questions. Practice exams with full solutions show what a complete proof actually looks like at the grading standard.

Crameleon generates your practice exam from your own course materials — lecture notes, syllabi, past exams, or any combination. Upload what you have and get a fully formatted exam with the same structure as your professor's actual tests: multiple choice, short answer, and worked problems, all with step-by-step solutions (first 2 free; all with Premium).

Unlike generic question banks, every Crameleon exam reflects the specific framing, terminology, and difficulty level of your course. You'll practise answering questions that look and feel like the real thing — which is exactly what the research on retrieval practice says you should be doing. Students who test themselves with practice exams consistently outperform students who re-read notes, regardless of study time. The generation takes under 2 minutes and your first exam is completely free.

Topics typically tested

  • Propositional & predicate logic
  • Proof techniques & induction
  • Set theory & functions
  • Recurrence relations
  • Counting & the pigeonhole principle
  • Graphs & trees

Sample Discrete Mathematics exam questions

Three original questions in the style of a real Discrete Mathematics exam, each with a worked solution. Your own practice exam can be built from your course's notes and syllabus.

Question 1Multiple choiceCounting & the pigeonhole principle

A department must form a 5-person committee from 6 professors and 8 students. The committee must include at least 2 professors. How many different committees are possible?

  1. A.

    840

  2. B.

    1526

  3. C.

    1582

  4. D.

    1946

Worked solution
Answer:B

Count directly by the number of professors on the committee, which can be 2, 3, 4 or 5; the cases are disjoint, so the sum rule applies. Within each case the professors and the students are chosen independently, so the product rule applies:

(62)(83)+(63)(82)+(64)(81)+(65)(80)=15⋅56+20⋅28+15⋅8+6⋅1=840+560+120+6=1526.\binom{6}{2}\binom{8}{3} + \binom{6}{3}\binom{8}{2} + \binom{6}{4}\binom{8}{1} + \binom{6}{5}\binom{8}{0} = 15\cdot 56 + 20\cdot 28 + 15\cdot 8 + 6\cdot 1 = 840 + 560 + 120 + 6 = 1526.

A second route is complementary counting: all committees minus those with fewer than 2 professors (0 or 1):

(145)−(85)−(61)(84)=2002−56−420=1526.\binom{14}{5} - \binom{8}{5} - \binom{6}{1}\binom{8}{4} = 2002 - 56 - 420 = 1526.

Both methods agree.

The tempting wrong answer is 1582, which is 2002 − 420: it subtracts the committees with exactly 1 professor but forgets the 56 all-student committees, which also violate the "at least 2" condition. The answer 1946 (2002 − 56) makes the opposite error, excluding only the all-student committees as if the condition were "at least 1 professor". The answer 840 counts only committees with exactly 2 professors and ignores the cases with 3, 4 or 5.

1526 committees (option B).

Question 2Short answerRecurrence relations

Solve the recurrence relation

an=5an−1−6an−2(n≥2),a0=1,a1=4.a_n = 5a_{n-1} - 6a_{n-2} \quad (n \ge 2), \qquad a_0 = 1, \quad a_1 = 4.

Give a closed-form formula for ana_n.

Worked solution
Answer:

an=2⋅3n−2na_n = 2\cdot 3^n - 2^n

This is a linear homogeneous recurrence with constant coefficients, so look for solutions of the form an=rna_n = r^n. Substituting gives rn=5rn−1−6rn−2r^n = 5r^{n-1} - 6r^{n-2}; dividing by rn−2r^{n-2} yields the characteristic equation

r2−5r+6=0⟹(r−2)(r−3)=0⟹r=2 or r=3.r^2 - 5r + 6 = 0 \quad\Longrightarrow\quad (r - 2)(r - 3) = 0 \quad\Longrightarrow\quad r = 2 \text{ or } r = 3.

The roots are distinct, so the general solution is a combination of the two:

an=α⋅2n+β⋅3n.a_n = \alpha\cdot 2^n + \beta\cdot 3^n.

The initial conditions determine α\alpha and β\beta:

n=0: α+β=1,n=1: 2α+3β=4.n = 0:\ \alpha + \beta = 1, \qquad n = 1:\ 2\alpha + 3\beta = 4.

Subtracting twice the first equation from the second gives β=2\beta = 2, and then α=−1\alpha = -1. Hence

an=2⋅3n−2n.a_n = 2\cdot 3^n - 2^n.

Comparing with the recurrence: the formula gives a2=18−4=14a_2 = 18 - 4 = 14 and a3=54−8=46a_3 = 54 - 8 = 46, while the recurrence gives a2=5(4)−6(1)=14a_2 = 5(4) - 6(1) = 14 and a3=5(14)−6(4)=46a_3 = 5(14) - 6(4) = 46. They match.

an=2⋅3n−2na_n = 2\cdot 3^n - 2^n for all n≥0n \ge 0.

Question 3Worked problemProof techniques & induction

Prove by mathematical induction that for every integer n≥1n \ge 1,

12+32+52+⋯+(2n−1)2=n(2n−1)(2n+1)3.1^2 + 3^2 + 5^2 + \cdots + (2n-1)^2 = \frac{n(2n-1)(2n+1)}{3}.
Worked solution
Answer:

Proof by induction: the base case n=1n = 1 gives 1=11=1, and the inductive step shows P(k)⇒P(k+1)P(k) \Rightarrow P(k+1) for every k≥1k \ge 1, so the identity holds for all n≥1n \ge 1.

Let P(n)P(n) be the statement ∑i=1n(2i−1)2=n(2n−1)(2n+1)3\displaystyle\sum_{i=1}^{n} (2i-1)^2 = \frac{n(2n-1)(2n+1)}{3}.

Base case (n=1n = 1). The left side is 12=11^2 = 1. The right side is 1⋅1⋅33=1\dfrac{1\cdot 1\cdot 3}{3} = 1. So P(1)P(1) is true.

Inductive step. Assume P(k)P(k) holds for some integer k≥1k \ge 1 (the inductive hypothesis):

12+32+⋯+(2k−1)2=k(2k−1)(2k+1)3.1^2 + 3^2 + \cdots + (2k-1)^2 = \frac{k(2k-1)(2k+1)}{3}.

We must show P(k+1)P(k+1), whose right side is (k+1)(2k+1)(2k+3)3\dfrac{(k+1)(2k+1)(2k+3)}{3} (replace kk by k+1k+1: 2(k+1)−1=2k+12(k+1) - 1 = 2k+1 and 2(k+1)+1=2k+32(k+1) + 1 = 2k+3). The next odd number after 2k−12k-1 is 2k+12k+1, so the sum for k+1k+1 is the sum for kk plus (2k+1)2(2k+1)^2. Using the hypothesis,

∑i=1k+1(2i−1)2=k(2k−1)(2k+1)3+(2k+1)2.\sum_{i=1}^{k+1} (2i-1)^2 = \frac{k(2k-1)(2k+1)}{3} + (2k+1)^2.

Factor out the common factor (2k+1)(2k+1) and combine over 3:

=(2k+1)[k(2k−1)3+(2k+1)]=(2k+1)⋅2k2−k+6k+33=(2k+1)(2k2+5k+3)3.= (2k+1)\left[\frac{k(2k-1)}{3} + (2k+1)\right] = (2k+1)\cdot\frac{2k^2 - k + 6k + 3}{3} = \frac{(2k+1)(2k^2 + 5k + 3)}{3}.

Since 2k2+5k+3=(k+1)(2k+3)2k^2 + 5k + 3 = (k+1)(2k+3) (expand: 2k2+3k+2k+32k^2 + 3k + 2k + 3), this equals

(k+1)(2k+1)(2k+3)3,\frac{(k+1)(2k+1)(2k+3)}{3},

which is exactly the right side of P(k+1)P(k+1). Thus P(k)⇒P(k+1)P(k) \Rightarrow P(k+1).

Conclusion. By the principle of mathematical induction, P(n)P(n) is true for every integer n≥1n \ge 1. (For instance, n=2n = 2 gives 1+9=101+9 = 10 on the left and 2⋅3⋅53=10\dfrac{2\cdot 3\cdot 5}{3} = 10 on the right.)

The identity ∑i=1n(2i−1)2=n(2n−1)(2n+1)3\displaystyle\sum_{i=1}^{n}(2i-1)^2 = \frac{n(2n-1)(2n+1)}{3} holds for all integers n≥1n \ge 1.

Used by 3,000+ students across Canadian universities·Step-by-step solutions (first 2 free)·Works for any course

Ready to practice?

Generate Your Free Discrete Mathematics Practice Exam

Your first exam is free — just sign in, no credit card.