COMP 2711H: Lecture 9

Date: 2024-09-23 09:11:39

Reviewed: 2024-10-07 03:13:46

Topic / Chapter: Principle of Inclusion & Exclusion

summary

❓Questions

Notes

Functions
  • Derangements

    • for , how many s.t.
      • choose first, then do casework
    • what if: exactly people, among , must be in position?
      • how many such exist?
      • or: exactly position s.t.
      • i.e. deranging people
        • and choosing people to remain seated (in their own)
      • and for remaining people: only one way
  • No. of functions

    • how many functions from to are onto?
      • or: surjective (French)
      • i.e. all elements of has mapping?
    • first, how many functions w/ possible input and possible output exist?
      • if , there is only 1
      • if , there are
    • and subtract no. of non-onto functions
      • i.e. all mapped to , or only
      • = 2 cases
      • onto functions
    • how about a recursive formula?
      • first: choices for input , let's say was chosen
        • then, later ones: can either include or not
      • or: consider the reverse mapping. What's mapped to ?
        • i.e. subset of mapped to
        • assume: inputs are mapped to
        • i.e. possibilities
    • also: it's the same as dividing into non-empty sets
      • based of the output they are mapped to
    • let : no. of ways of dividing into non-empty sets
      • without order
      • 👨‍🏫 same as the ball-and-box problem!
      • if the ball is in its own box:
      • if the ball is sharing its bow with others
  • Problem 1: how many paths do not go through marked segments?

    • i.e. segment ,,,
    • let : no. of paths to point
    • but, how many (invalid) paths go through at most exactly segments?
    • simply: count each cases manually
      • going through and
    • 👨‍🏫 is there a more elegant formula?
      • : no. of paths to point , including exact paths
Principle of Inclusion & Exclusion (PIE)
  • Principles of inclusion & exclusion

    • how many no. are divisible by ?
    • how many no. are divisible by ?
    • how many no. are divisible by both ?
      • i.e. multiple of
    • how many no. are divisible by ?
      • no double counting!
    • same as:
    • how many no. are divisible by ?
      • same as:
        • i.e. eliminate double counting within double-counted elements!
        • ()
    • how many no. are divisible by ?
      • same as:
        • i.e. eliminate double counting within double-counted elements!
        • ()
    • how about sets?
      • finding the pattern
    • let
    • then
    • 👨‍🏫 how can we prove it without induction?
      • induction: painful...
    • proof: let , suppose is in exactly sets
      • 👨‍🏫: ensure you count only once for both sides!
      • if : it only gets added once in
      • if : it only gets counted once in
      • for general : gets added
        • no. of being added: in , in
      • 👨‍🏫 as proven, there are equal no. of even subsets & odd subsets (including )
        • but we don't have in out equation (which could have been subtracted)
        • thus,
          • from
  • Problem 2: derangements

    • how many permutations of exist s.t. ?
    • : set of perms s.t.
    • solution:
      • not in position for all
    • and, as we have total perms
        • as there are permutations
      • (as there are )
        • to be subtracted
    • as converges to infinity, probability of picking a derangement:
      • : used because exponent of inside sum changed
      • according to PIE
  • Problem 3: how many functions from to are onto?

    • i.e. all element w/ at least 1 mapping?
    • let : set of functions not covering
    • let : set of functions not covering
      • 👨‍🏫 we can do so because we know that size of are all same
      • ... and so on; thus:
    • and, as above is the set of non-onto function