Monday 10th December
Math 240: Discrete Structures I
Final Exam
Instructions. The exam is 3 hours long and contains 6 questions. Write your
answers clearly in the notebo ok provided. You may quote any result/theorem
seen in the lectures or in the assignme
Math 240
Solutions to Assignment 2
jbav@math.mcgill.ca
Question 1.
(a) (b) Prove that for positive integers k and n with k n, Find the numerical value of 10000 / 9999 . 5000 4999
n k
[4] =
n nk
.
Solution 1.
(a) By denition they are equal since n k = n! n
CLASS NOTES MATH 240
Notes on Logic
1
Propositional Calculus
A proposition or statement is an assertion which can be determined to be
either true or false (T or F). For example, zero is less than any positive
number is a statement. We are interested in co
Math 240: Discrete Structures I
Assignment 3: Sketch Solutions
1. Prime Factorisation. One way to nd a prime factorisation of n is to greedily
try to divide n by all numbers less than n. If we attempt that here we get:
(a) 419 is prime.
(b) 9555 = 3 5 72
Math 240: Discrete Structures I
Assignment 1: Sketch Solutions
1. Venn Diagrams. Draw the Venn diagrams for
(a) (A B) C
Only the regions (A C) B and (B C) A should be included.
A
C
B
(b) A B C
Only the region U (A B C) should be included.
U
A
C
B
1
2. Set
Math 240: Discrete Structures I
Assignment 1: Solutions
1. Venn Diagrams I.
Draw the Venn diagrams for
(a) A (B C)
(b) (A B) C
A
A
B
B
C
(a)
C
(b)
2. Venn Diagrams II.
Give the simplest description you can of the following Venn diagrams
A
B
A
C
(a)
B
(b)
Math 240: Discrete Structures I
Assignment 2: Solutions
1. Proof Techniques
(a) Give a direct proof that: If x is an integer then x3 x is divisible by 3.
Proof. We have
x3 x = x(x2 1)
= x(x 1)(x + 1)
= (x 1)x(x + 1)
But x 1, x and x + 1 are three consecut
Math 240: Discrete Structures I
Due: Wednesday 14th October
Assignment 2: Proofs
0. Latex.
[10 marks]
Bonus for writing your solutions to this assignment using Latex. (You may
draw any gures by hand if you want.)
1. Proof Techniques
[10 marks]
(a) Give a
Math 240: Discrete Structures I
Due: Thursday 9th October
Assignment 2: Logic and Proofs
1. The Class NP. Prove the following problem is in NP.
Subset Sum Problem: Given a set of n integers cfw_x1 , x2 , . . . , xn , is there a
subset of these numbers tha
Math 240: Discrete Structures I
Assignment 4: Sketch Solutions
1. Primality Testing.
(a) We have
5123 mod 124 = 5341 mod 124
= (53 )41 mod 124
= (125)41 mod 124
= (1)41 mod 124
= 1 mod 124
So 124 does pass the Fermat primality test for base 2.
(b) Clearly
Math 240: Discrete Structures I
Assignment 2: Sketch Solutions
1. The Class NP. A yes certicate for the Subset Sum Problem is just a subset
J cfw_1, 2, . . . , n where
xj = k
jJ
Clearly, if the magician gives us J we can test in polynomial time if the cor
Math 240: Discrete Structures I
Practice Exam A
Instructions. The exam is 3 hours long and contains 6 questions. Write your
answers clearly. You may quote any result/theorem seen in the lectures or in the
assignments without proving it (unless, of course,
Math 240: Discrete Structures I
Assignment 6: Sketch Solutions
1. Cycles and Circuits.
(a) A graph on 11 vertices contains at most 11 = 55 edges. So G is a
2
complete graph on 11 vertices minus two edges. These two edges may or
may not share an endpoint.
Math 240: Discrete Structures I
Practice Exam A - Solutions
1. Logic.
(a) The negation is
n N (n3 + 6n + 5 is odd n is odd)
(b) If n is odd then n3 + 6n + 5 is even because n3 is then odd and 6n is then
even. So the original statement is true.
(c) The tru
Math 240: Discrete Structures I
Practice Midterm
Instructions. The exam is 50 minutes long and contains 2 questions. You may
quote any result/theorem seen in the lectures or in the assignments without proving
it (unless, of course, it is what the question
Math 240: Discrete Structures I
Due: Thursday 25th September
Assignment 1: Sets and Logic
1. Venn Diagrams. Draw the Venn diagrams for
(a) (A B) C
(b) A B C
2. Set Identities. Prove the following
(a) A B = A B
(b) (B A) (C A) = (B C) A
3. Propositions. Wh
Math 240: Discrete Structures I
Due: Wednesday 30th September
Assignment 1: Sets and Logic
0. Latex.
Bonus for writing your solutions to this assignment using Latex. (You may
draw any gures by hand if you want.)
[10 marks]
1. Venn Diagrams I.
Draw the Ven
Math 240: Discrete Structures I
Due: Wednesday 25th November
Assignment 5: Combinatorics
1. Recurrence Equations.
(a) Solve the recurrence equation
gn = 4 gn1 3 gn2 n 2; g0 = 1, g1 = 7
(b) Let fn be the number of sequences with alphabet cfw_0, 1, 2, 3, 4