RU beehive logo promo banner for Computing & Info Sciences
CS 420
2024fall
ibarland

Sets and cardinalities

READING: Chpt.03

Previously, on itec420…

Sets, and set-operations — making new sets out of old ones. What was the concatenation of two languages defined as, again?
For two languages A,B, we say:

w∈AB
iff
∃a∈A,b∈B and w=ab.
We saw |AB| ≤ |A|⋅|B|.

Recall lexicographic order.

Finishing up languages/sets

Kleene star: A*; Sigma*

define: "the set A closed under f":
  - ints closed under squaring (unary operator)
  - ints closed under * (binary operator)
  - ints *not* closed under square-rooting, nor division
  - general def'n, in ENGLISH (logic as exer. below)
       unary f : X→Y :  for any number n, f(n)
      (for a unary f, and separately for a binary f)
- Showing sets equal:
    compare:
    L₃  = strings over {a,b}* where every 'a' is followed by a 'b'
    vs
    L₃' = strings over {a,b}* which don't contain "aa"

   Show/argue :
      - L₃ ⊆  L₃': quick proof-by-contra
      - try other dir (careful!)
- review proof-by-induction: n(n+1)(2n+1)/6
    sum-of-squares formula



  Want to prove:
      1² + 2² + 3² + ... + (n-1)² + n² = n(n+1)(2n+1)/6
      holds for all natural number n ∈ ℕ.

  Proof by induction:
      Let P(n) be the assertion that
        1² + 2² + 3² + ... + (n-1)² + n² = n(n+1)(2n+1)/6

      I. Show that P(0) holds.  [check]
     II. Show that for any k,   P(k) → P(k+1)
          So we assume P(k) is true, that is:
        1² + 2² + 3² + ... + (k-1)² + k² = k(k+1)(2k+1)/6
      Then we can add (k+1)² to both sides:
        1² + 2² + 3² + ... + (k-1)² + k² (k+1)²
      = k(k+1)(2k+1)/6  + (k+1)²
      = k(2k²+k+2k+1)/6  + k²+ 2k + 1
      = 2k³/6 +3k²/6 +k/6  + k²+ 2k + 1
      = 2k³/6 +3k²/2 + 13k/6 +1
      = (2k³ + 9k² + 13k +6)/6
      = (2k³ + 3k²  +4k² + 2k² + 13k + 6)/6
      = (k+1)(k+2)(2(k+1)+1)/6
      = P(k+1)


     The rule of Proof by Induction lets us conclude:
            ∀n.P(n)   is true


Countability

Def'n: a set S is countable if ∃f . f:ℕ→S, f is onto.1
(If S is countably infinite, it's convenient to also require f to be 1:1 — a bijection, and hence f will be invertable.)

  1. Def'n
  2. Σ* countable, (e.g. Σ = {0, 1, 2, …, 9}). Corollary: Java programs countable.
  3. primes countable
  4. ℤ countable
  5. 0.01⋅ℕ = {0, 0.01, 0.02, …} countable
  6. ℚ countable!!
  7. not countable: sketch diagonalization argument

1 Well, not quite: What if S={} ? We still say it's countable!      

logo for creative commons by-attribution license
This page licensed CC-BY 4.0 Ian Barland
Page last generated
Please mail any suggestions
(incl. typos, broken links)
to ibarlandradford.edu
Rendered by Racket.