The primary goal of this course is to become familiar with some of the basic mathematical ideas used in programming.

Discuss homework 1

Proving ∀n∈**N **∃k∈**N**(n=2k or n=2k+1). Our
first *Proof by Mathematical Induction*.

Two-move games. The moves are a1, b1, a2, b2

A has a winning strategy if ∃a1 ∀b1 ∃a2 ∀b2 (A wins).

A does *not* have a winning strategy if ~ ∃a1 ∀b1 ∃a2 ∀b2 (A
wins)

which is ∀a1 ∃b1 ∀a2 ∃b2 (~ A wins), which is ∀a1 ∃b1 ∀a2 ∃b2 (B wins), which means there is a winning strategy for B.

game 1: B wins if a1<b1<a2<b2. Who has the winning strategy?

game2: B wins if a1/a2 = b1/b2, or a2==b2==0. Who has the winning strategy?

game 3: B wins if exactly *one* of a1,a2 is between b1 and b2.

game 4: B wins if the line from (a1,b1) to (a2,b2) has positive slope (or a1=a2)

game 5: B wins if the line from (a1,a2) to (b1,b2) has positive slope

game 6: A and B pick points on the plane. B wins if b2 is equidistant from a1, b1, a2.

Sets: Levin 0.3

- membership
- Listing elements versus giving a rule
- set equality; order does not matter
- subsets
- empty set, ∅
- union and intersection
- Venn diagrams

Functions: Levin 0.4

- defined by table or by rule
- domain
- recursive functions f:
**N**->**N** - bijections
- injections (1-to-1)
- surjections
- set-theoretic definition of f:A->B as a subset of AxB

Counting: Levin 1.1, on page 57

- Additive principle
- Multiplicative principle
- Set-theoretic approach
- Pies on page 64

Counting subsets of {1, 2, ..., N}, Levin 1.2 on page 70

- Counting
**all**subsets (including ∅)