VillanovaUniversityCSC1300www.csc.villanova.edu/~map/1300Dr.Papalaskari
CSC1300-003DiscreteStructures
Exam2March10,2015
Name:_____KEY___________
Question Value Score
1 10 2 30 3 30
4 30
TOTAL 100
Please answer questions in the spaces provided. If you make a mistake or for some other reason need more space, please use the back of pages and clearly indicate where the answer can be found. Show your work carefully. Just writing an answer will not do. Show any assumptions, show the steps you took, and show how you came to your answer. Good luck!
VillanovaUniversityCSC1300www.csc.villanova.edu/~map/1300Dr.Papalaskari
1. [ /10] Consider the following graphs:
G1 G2
a) [ /3] Verify the handshaking lemma for G1.
Vertex degrees:
A: 3
B: 3
D: 3
E: 2
F: 3 Sum total = 3+3+3+2+3=14
Handshaking lemma states that e = 14/2 = 7 and this graph indeed has 7 edges.
b) [ /3] Is either of the graphs bipartite? Justify your answer.
Neither graph is bipartite, because they both contain 𝐶! as a subgraph.
c) [ /4] Are the graphs isomorphic? If so, exhibit the isomorphism. If not, find a property
that should be preserved by isomorphism for which the two graphs differ.
Yes, the graphs are isomorphic.
Here is an isomorphism mapping (other correct answers are possible):
A à H
B à J
D à K
E à I
F à L
VillanovaUniversityCSC1300www.csc.villanova.edu/~map/1300Dr.Papalaskari
2. [ /30]
a) [ /10] Expand and evaluate the following summations:
• 2!!!!! = 2! + 2! + 2! = 4+ 8+ 16 = 28
• −1 ! ⋅ 3 ⋅ 𝑗 + 1 !!
!!!
= 3 ⋅ 1! − 3 ⋅ 2! + 3 ⋅ 3! − 3 ⋅ 4! = 3− 12+ 27− 48 = −30 b) [ /10] Rewrite as a summation:
• 2 + 2 + 2 + 2 + 2 + 2 = 2!!!!
• 5+ 7+ 9+⋯+ 45 = (3+ 2𝑗)!"
!!! [other answers possible, eg: (2𝑗 − 1)!"!!!
(sum of all odd numbers from 5 to 45) c) [ /10] Show, using induction that for anyn ∈ ℕ, 𝐴! ∪ 𝐴! ∪⋯𝐴! = 𝐴! ∩ 𝐴! ∩⋯𝐴!
VillanovaUniversityCSC1300www.csc.villanova.edu/~map/1300Dr.Papalaskari
a b c d e f g h i j k l m 0 1 2 3 4 5 6 7 8 9 10 11 12 n o p q r s t u v w x y z 13 14 15 16 17 18 19 20 21 22 23 24 25
3. [ /30] quick reference for conversion a) [ /5] Decrypt the message below using ROT13:
watch jngpu
b) [ /5] Encrypt Decrypt the message below using the simple Vigenere cipher (not the original) with key word able.
ikdrebh
ilovecs c) [ /10] Let ∼ be defined so that a ∼ b exactly when a · b is divisible by 3. Is this an equivalence relation? If not, which of the three properties (reflexive, symmetric, transitive) does not hold? Answer: If a is divisible by 3, then a · a is divisible by 3, so a ∼ a and ∼ is reflexive. If either a or b is divisible by 3, then a · b and b · a are divisible by 3, so ∼ is symmetric. However, if b is divisible by 3 but a, c are not divisible by 3 (e.g., a = 2, b = 6, c = 4) then a ∼ b and b ∼ c but a /∼ c so ∼ is not transitive.
d) [ /10] Prove that if a ≡ b (mod n) and c ≡ d (mod n), then ac ≡ bd (mod n).
Answer: By definition of congruence modulo n, we know that a − b = kn and c − d = jn. We can rewrite these statements as a = b + kn and c = d +jn. Therefore, ac = (b + kn)(d + jn) = bd + dkn + bjn + kjn2
This last expression can be written as bd + qn, where q = dk + bj + kjn, so we have that: ac = bd + qn Thus, ac − bd = qn and this means ac ≡ bd (mod n).
VillanovaUniversityCSC1300www.csc.villanova.edu/~map/1300Dr.Papalaskari
4. [ /30]
a) [ /10] How many bit strings of length 5 contain:
• two 1’s? List all of them here: !! = 10 00011, 00101, 00110, 01011, 01100, 01101, 10001, 10010, 10100, 11000
• three 1’s? List all of them here:
!! = 10 11100, 11010, 11001, 10100, 10011, 10010, 01110, 01101, 01011, 00111
b) [ /10] Prove !
! = !!!!
!! represents the number of choices of k items out of n possible items. Selecting these k
items implies that there are n-k remaining items that are NOT selected. Thus, for each
choice of k items there is a corresponding choice of n-k items that are being left out, so !
!!! , the number of ways to choose n-k items, is the same as the number of ways to
choose k items.
(The above is a combinatorial proof. This fact can also be proved using the formula for
combinations.)
c) [ /10] Using the binomial Theorem:
• Find the coefficient of 𝑥!𝑦! in the binomial expansion of (𝑥 + 𝑦)!". !"! = !"!
!!⋅!!= !"⋅!⋅!
!⋅!= 5 ⋅ 3 ⋅ 8 = 120
Evaluate
𝑛𝑖
−1 ! = !
!!!
𝑛𝑖
1 !!! −1 ! = !
!!! 1 − 1 ! = 0! = 0