Does the connected graph have an Euler circuit, an Euler path that is not a circuit, or neither? Click your answer.
|V| = 5|E| = 5
1Euler circuit
2Euler path, no circuit
3neither
6.Graph theoryHard
Find the total weight W of a minimum spanning tree of the weighted graph.
|V| = 6|E| = 9
W =
7.Number theory & modular arithmeticMedium
Find the smallest positive integer x with x ≡ 2 (mod 3) and x ≡ 9 (mod 13).
x ≡ 2 (mod 3)x ≡ 9 (mod 13)
x =
8.Number theory & modular arithmeticHard
Use repeated squaring to find 5538 mod 91.
a = 55k = 38n = 91
5538 mod 91 =
3Solutions
1.Propositional logic & proofs
Answer: ¬q → ¬r
Logical equivalence: two formulas are equivalent (≡) when they have the same value in every row of the truth table. A tautology is 1 in every row, a contradiction is 0 in every row, and a contingency is neither. Useful laws: De Morgan, ¬(a ∧ b) ≡ ¬a ∨ ¬b and ¬(a ∨ b) ≡ ¬a ∧ ¬b; a → b ≡ ¬a ∨ b ≡ ¬b → ¬a (contrapositive); ¬(a → b) ≡ a ∧ ¬b; and the distributive laws, a ∨ (b ∧ c) ≡ (a ∨ b) ∧ (a ∨ c).
The law
An implication is equivalent to its contrapositive ¬b → ¬a, not to its converse b → a or its inverse ¬a → ¬b.
r → q ≡ ¬q → ¬r
Check with the truth table
q = 1, r = 1: 1 | 1 0 1 1
q = 1, r = 0: 1 | 0 0 0 1
q = 0, r = 1: 0 | 1 0 1 0
q = 0, r = 0: 1 | 1 1 1 1
Answer
¬q → ¬r
The columns after the bar are the options in the order shown.
2.Propositional logic & proofs
Answer: N = 12
Truth tables: a formula with n different variables has 2ⁿ rows, one for every combination of truth values (1 = true, 0 = false). Work from the inside out and give every subformula its own column. ¬a flips the value; a ∧ b is 1 only when both are 1; a ∨ b is 0 only when both are 0; a → b is 0 only when a = 1 and b = 0; a ↔ b is 1 when both sides are equal.
Columns
r ∧ q; ¬(r ∧ q); ¬p; ¬q; s ∧ ¬q; ¬p ∧ (s ∧ ¬q); ¬(r ∧ q) ∨ (¬p ∧ (s ∧ ¬q))
Split on p
p = 1: 6
p = 0: 6
N = 6 + 6 = 12
Answer
N = 12
3.Sets, relations & functions
Answer: region 8
Sets and Venn diagrams: A ∪ B holds the elements in A or B (or both), A ∩ B the elements in both, A − B the elements of A that are not in B, and the complement A′ everything in U that is not in A. In a Venn diagram every set expression is a union of regions, so count it region by region. Inclusion–exclusion: |A ∪ B| = |A| + |B| − |A ∩ B|, and |A ∪ B ∪ C| = |A| + |B| + |C| − |A ∩ B| − |A ∩ C| − |B ∩ C| + |A ∩ B ∩ C|.
Inside or outside each set
A ∩ B ∩ C′
The region
region 8
Answer
region 8
4.Sets, relations & functions
Answer: (g ∘ f)(3) = 4
Functions and counting: a function f: A → B gives every element of A exactly one image in B. f is injective (one-to-one) when different elements have different images, surjective (onto) when every element of B is an image, and bijective when both hold. With |A| = m and |B| = n there are nᵐ functions, n!/(n − m)! injective ones (m ≤ n), and by inclusion–exclusion Σ (−1)ᵏ·C(n, k)·(n − k)ᵐ surjective ones. |𝒫(A)| = 2ᵐ and |A × B| = m·n.
Inner function
f(3) = 4
Outer function
g(4) = 4
(g ∘ f)(3) = 4
Answer
(g ∘ f)(3) = 4
5.Graph theory
Answer: Euler circuit
Euler, Hamilton and trees: a connected graph has an Euler circuit (every edge once, back to the start) when every vertex has even degree, and an Euler path that is not a circuit when exactly two vertices have odd degree; the path then runs from one odd vertex to the other. A Hamilton circuit visits every vertex once; Kn has (n − 1)!/2 of them. A tree on n vertices has n − 1 edges, and a connected graph with m edges keeps a spanning tree after removing m − n + 1 edges.
Shortest paths and spanning trees: Dijkstra’s algorithm settles one vertex per round: the unsettled vertex with the smallest tentative distance. Its distance is then final, and every neighbour v gets d(v) = min(d(v), d(u) + w(u, v)). Kruskal’s algorithm builds a minimum spanning tree by taking the edges from light to heavy and skipping any edge that would close a cycle; Prim’s algorithm grows one tree from a start vertex by always adding the lightest edge that leaves it. A spanning tree of n vertices has n − 1 edges.
Kruskal’s algorithm
DF (4): take
DE (8): take
EF (9): skip, closes a cycle
AB (11): take
AC (13): take
BD (14): take
Total weight
W = 4 + 8 + 11 + 13 + 14 = 50
Answer
W = 50
7.Number theory & modular arithmetic
Answer: x = 35
Inverses and congruences: a has an inverse modulo n exactly when gcd(a, n) = 1. The extended Euclidean algorithm writes 1 = s·n + t·a, and then a⁻¹ ≡ t (mod n). A congruence a·x ≡ b (mod n) with gcd(a, n) = 1 has the solution x ≡ a⁻¹·b. Two congruences x ≡ r₁ (mod m₁) and x ≡ r₂ (mod m₂) with coprime moduli have one solution modulo m₁·m₂ (Chinese remainder theorem). Euler’s φ(n) counts the numbers from 1 to n that are coprime to n: φ(n) = n·∏(1 − 1/p).
First congruence
x = 2 + 3k
Second congruence
2 + 3k ≡ 9 (mod 13) → 3k ≡ 7 (mod 13)
k ≡ 9·7 ≡ 11 (mod 13)
Result
x = 2 + 3·11 = 35
x = 35
check: 35 mod 3 = 2, 35 mod 13 = 9
Answer
x = 35
8.Number theory & modular arithmetic
Answer: 5538 mod 91 = 22
Modular powers and RSA: compute aᵏ mod n by repeated squaring: write k in binary, square, reduce after every step and multiply the powers whose bit is 1. Fermat: aᵖ⁻¹ ≡ 1 (mod p) for a prime p not dividing a, so the exponent can be reduced modulo p − 1. RSA: choose primes p and q, n = p·q and φ(n) = (p − 1)(q − 1); the public exponent e is coprime to φ(n), and the private exponent is d = e⁻¹ mod φ(n). Encrypt with c = mᵉ mod n and decrypt with m = cᵈ mod n.