Sipser: Section 0.2

From CSWiki

Jump to: navigation, search

CSC 341: Front Door


| CSC 341: Cooperative commentary | Sipser:_Chapter_0

Contents

Sets

set - a group of objects represented as a unit.

  • Examples include {1,2,3}, {a,b,5}, and {} or \empty (the null set).
  • In a set, repetition and order are not important (unless we are speaking of a multiset)
  • Important sets include N (the set of all natural numbers, integers >= 1) and Z (integers)

Sequences and tuples

Cartesian products

The following example may help elucidate the notion of Cartesian product. Recall the notation \mathbb{R}^n used in linear algebra for the n-dimensional vector space. This is really just referring to the set of real numbers, \mathbb{R}, taken to the nth Cartesian power.

Functions and relations

Equivalence relations

A relation ~ is an equivalence relation ~ if, and only if, it has these three properties:

  1. For every x in the domain of the relation, x~x (reflexivity).
  2. For every x and y in the domain of the relation, if x~y, then y~x (symmetry).
  3. For every x, y, and z in the domain of the relation, if x~y and y~z, then x~z (transitivity).

For example, for any positive integer k, the mod k relation on integers (or on all the integers) is a equivalence relation (this idea is used a lot in Abstract Algebra).

Mathematically, this relation is \{\langle a, b\rangle \mid a\,\bmod\,k = b\,\bmod\, k\}.

Another example is the relation, among people, of being exactly the same height.

Graphs

Image used in examples: [here]

path - a sequence of nodes connected by edges (following direction)

  • An example path would be 1-2-6-7-10-5-8-7-6
  • A simple path does not repeat nodes, for example 1-9-3-4

cycle - a path that starts and ends at the same node

  • An example is 1-2-4-3-2-1
  • A simple cycle contains >= 3 nodes and repeates only the first/last, e.g. 1-2-4-3-0-1

Strings and languages

  • An alphabet is a non-empty collection of symbols
  • A string is an ordered list of symbols from some alphabet
    • \varepsilon is the empty string
  • A language is a set of strings
    • \emptyset is the language of no strings

Boolean logic

  1. 0 \wedge 0 = 0
  2. 0 \wedge 0 = 0
  3. 0 \wedge 1 = 0
  4. 1 \wedge 0 = 0
  5. 1 \wedge 1 = 1
  6. 0 \vee 0 = 0
  7. 0 \vee 1 = 0
  8. 1 \vee 0 = 0
  9. 1 \vee 1 = 1

Boolean logic symbols:

  1. \wedge : and [only true if both operands are true]
  2. \vee : or [true if one of the operands is true]
  3. \leftrightarrow : equality [operands are both true or both false]
  4. \oplus : xor [true if one but not both of the operands is true]
  5. \rightarrow : implication [only false when the first operand is true and its second operand is false, otherwise true.]

Expressing all Boolean operations using only AND and NOT operations

1 OR
P \vee Q = \neg(\neg P\wedge \neg Q)

2 IMPLICATION
P \rightarrow Q = \neg P \vee Q

3 EQUALITY
P \leftrightarrow Q = (P \rightarrow Q) \wedge (Q \rightarrow P)

4 XOR
P \oplus Q = \neg (P \leftrightarrow Q)


CSC 341: Front Door

Personal tools