Course Test · University: first two years

Discrete mathematics: independent answers

Each answer here was worked out by hand, without RatMath, before the RatMath code was written. Where the arithmetic is long, the working says how it was checked.

  1. 1.Tautology
    Is ((p→q)∧(q→r))→(p→r)((p \to q) \land (q \to r)) \to (p \to r) a tautology?
    Answer
    Yes (hypothetical syllogism): the only way to make p→rp \to r false is pp true, rr false, and then one of the hypotheses is false.
  2. 2.De Morgan
    Show that ¬(p∧q)≡¬p∨¬q\lnot(p \land q) \equiv \lnot p \lor \lnot q.
    Answer
    Both are false exactly when pp and qq are both true.
  3. 3.Inclusion–exclusion
    How many integers from 1 to 1000 are divisible by 3, 5 or 7?
    Answer
    333+200+142−66−47−28+9=543333 + 200 + 142 - 66 - 47 - 28 + 9 = 543.
  4. 4.Counting hands
    How many five-card poker hands contain exactly two pairs?
    Answer
    (132)(42)2⋅11⋅4=78⋅36⋅44=123,552\binom{13}{2}\binom42^2\cdot 11\cdot 4 = 78 \cdot 36 \cdot 44 = 123{,}552.
  5. 5.Arrangements with repetition
    How many arrangements of the letters of MISSISSIPPI are there?
    Answer
    11!4! 4! 2!=34,650\dfrac{11!}{4!\,4!\,2!} = 34{,}650.
  6. 6.Stars and bars
    How many solutions in non-negative integers has x1+x2+x3+x4=10x_1 + x_2 + x_3 + x_4 = 10?
    Answer
    (133)=286\binom{13}{3} = 286.
  7. 7.Derangements
    In how many ways can 6 letters go into 6 envelopes with none in its own envelope?
    Answer
    D6=6!(1−1+12−16+124−1120+1720)=265D_6 = 6!\left(1 - 1 + \tfrac12 - \tfrac16 + \tfrac1{24} - \tfrac1{120} + \tfrac1{720}\right) = 265.
  8. 8.Linear recurrence
    Solve an=5an−1−6an−2a_n = 5a_{n-1} - 6a_{n-2}, a0=1a_0 = 1, a1=4a_1 = 4.
    Answer
    Roots 2 and 3: an=2⋅3n−2na_n = 2\cdot 3^n - 2^n.
  9. 9.A sum proved by induction
    Find a closed form for ∑k=1nk3\sum_{k=1}^n k^3.
    Answer
    (n(n+1)2)2\left(\dfrac{n(n + 1)}{2}\right)^2.
  10. 10.Modular exponent
    Find 7222 mod 117^{222} \bmod 11.
    Answer
    710≡17^{10} \equiv 1 (Fermat); 222=22⋅10+2222 = 22\cdot10 + 2: 72=49≡57^2 = 49 \equiv 5.
  11. 11.Euclid and Bézout
    Find gcd⁡(252,198)\gcd(252, 198) and integers with 252x+198y=gcd⁡252x + 198y = \gcd.
    Answer
    gcd⁡=18=4⋅252−5⋅198\gcd = 18 = 4\cdot252 - 5\cdot198.
  12. 12.Modular inverse
    Find the inverse of 17 modulo 43.
    Answer
    17⋅38=646=15⋅43+117 \cdot 38 = 646 = 15\cdot43 + 1: 38.
  13. 13.Chinese remainder theorem
    Solve x≡2(mod3)x \equiv 2 \pmod 3, x≡3(mod5)x \equiv 3 \pmod 5, x≡2(mod7)x \equiv 2 \pmod 7.
    Answer
    x≡23(mod105)x \equiv 23 \pmod{105}.
  14. 14.Euler circuits
    Does K5K_5 have an Euler circuit? Does K4K_4?
    Answer
    K5K_5: every degree is 4 (even) and it is connected, so yes. K4K_4: degrees are 3, so no.
  15. 15.Shortest path
    Edges with weights: AB 4, AC 2, BC 1, BD 5, CD 8, CE 10, DE 2. Find the shortest path from A to E.
    Answer
    A–C–B–D–E, length 2+1+5+2=102 + 1 + 5 + 2 = 10.
  16. 16.Minimum spanning tree
    Find the weight of a minimum spanning tree of the same graph.
    Answer
    Kruskal: BC 1, AC 2, DE 2, (AB 4 makes a cycle), BD 5: weight 10.
  17. 17.Counting trees
    How many labelled trees are there on 5 vertices?
    Answer
    Cayley: 53=1255^{3} = 125.
  18. 18.Equivalence relations
    Is R={(1,1),(2,2),(3,3),(1,2),(2,1)}R = \{(1,1), (2,2), (3,3), (1,2), (2,1)\} an equivalence relation on {1,2,3}\{1, 2, 3\}? If so, give its classes.
    Answer
    Yes (reflexive, symmetric, transitive): classes {1,2}\{1, 2\} and {3}\{3\}.
  19. 19.Number bases
    Write 2026 in binary.
    Answer
    2026=1024+512+256+128+64+32+8+2=1111110101022026 = 1024 + 512 + 256 + 128 + 64 + 32 + 8 + 2 = 11111101010_2.
  20. 20.Pigeonhole principle
    How many people must be in a room to be sure that three share a birth month?
    Answer
    2⋅12+1=252\cdot 12 + 1 = 25.