# Lecture 1 Summary

• Intro
• Logistics
• Starting definitions (with Sudoku example)
• key terms: set, cartesian product, function, domain, codomain

## Logistics

• mostly see the syllabus
• first homework released Friday sometime after class
• nobody is on CMS yet; I'll let you know
• please no laptops or other devices in lecture
• Prof. Hopcroft is traveling, he will lecture on Monday. We'll alternate throughout the semester.

## Definition: Set

Definition: a set is an unordered collection of elements. Two sets are considered the same if they contain the same elements; the order and duplication of elements is ignored. We write e ∈ S to indicate that e is an element of the set S (similarly $e \notin S$ indicates that e is not an element of S).

(Note:  ∈  ("is an element of", \in in LaTeX) is different from e or E (the letter e) and ε (the greek letter epsilon, LaTeX \epsilon).)

There are many ways to write down sets.

• You can enumerate the elements: {1, 2, 3, 4, 5}
• You can use ellipses if it's clear: {1, 2, . . . , 5}
• You can give a (clear!) english description: "the set of all even natural numbers"
• We'll discuss set comprehension notation next time.

You have written down a set if the reader can unambiguously determine whether a given element is or is not in the set.

Examples:

• {1, 2} = {2, 1} = {1, 2, 2, 1, 2} ≠ {1, 2, 3}
• {1, 2} ≠ {3, 4}
• We let N = {1, 2, . . . 9} for the sudoku example
• We defined C as the set of all pairs of numbers from N:
C = {(1, 1), (1, 2), …, (1, 9), (2, 1), (2, 2), …, (2, 9), …, (9, 1), …, (9, 9)}
This set is called the cartesian product of N with itself, and is written N × N.

## Definition: Function

A function f from a set A to a set B is an unambiguous rule, which gives an element of B for each element of A. A is called the domain of f, while B is called the codomain of f. We often write
f: A → B to represent the statement "f is a function from A to B".

As with sets, there are many ways to write down functions. The key rule is that everyone agrees (unambiguously!) what the output is for a given input (the input is the element of the domain, the output is the element of the codomain).

The domain and codomain are different: every element of the domain must have a corresponding element of the codomain, but an element of the codomain may have any number (including 0) of elements of the domain that map to it.

## Case study: Sudoku

We started modeling sudoku solutions. Here's where we are so far:

Let the set of numbers N = {1, 2, …, 9}. Let the set of cells C = N × N.

Definition: a sudoku solution is a function from C to N satisfying certain properties (properties to be enumerated later).