next up previous
Next: About this document Up: My Home Page

Distributivity

Theorem. For all sets A, B, and C,

displaymath405

Proof. Let A, B, and C be arbitrary sets. We show that the two sets tex2html_wrap_inline437 and tex2html_wrap_inline439 have the same elements:

eqnarray225

height6pt width4pt

Note the close connection between the ``algebra of sets'' and the ``algebra of propositions'' (Boolean algebra).

Venn Diagrams

Sets can often be conveniently represented by Venn diagrams.

The union tex2html_wrap_inline441 of A and B is represented by:

The intersection tex2html_wrap_inline447 is represented by:

The set difference B - A is represented by:

Counterexamples for Set Identities

Claim. For all sets A, B, and C,

displaymath406

Is this claim true?

Consider the two Venn Diagrams:

The diagram on the left represents tex2html_wrap_inline457 , the one on the right, A - C.

The difference in the diagrams suggests a counterexample to the claim.

Take tex2html_wrap_inline461 , tex2html_wrap_inline463 , and tex2html_wrap_inline465 . Then tex2html_wrap_inline467 , whereas tex2html_wrap_inline469 .

The Empty Set

A set with no elements is called an empty set.

Theorem. If tex2html_wrap_inline471 is an empty set, then tex2html_wrap_inline473 , for all sets A.

Proof. It is vacuously true that every element of an empty set is an element of every other set A. height6pt width4pt

Corollary. There is only one empty set.

Proof. Suppose A and B are both empty sets. By the theorem above we have tex2html_wrap_inline483 and tex2html_wrap_inline485 , and hence A=B. height6pt width4pt

We use the symbol tex2html_wrap_inline489 , or sometimes tex2html_wrap_inline491 , to denote the (unique) empty set.

Theorem.

eqnarray252

Disjoint Sets

Two sets A and B are said to be disjoint if they have no elements in common, i.e., tex2html_wrap_inline497 .

Examples.

Is tex2html_wrap_inline499 ?
No, tex2html_wrap_inline501 .

Is tex2html_wrap_inline503 ?
Yes, by previous theorem.

A partition of a set A is a collection of pairwise disjoint sets tex2html_wrap_inline507 , such that

displaymath407

For example, at the end of the semester I will partition the class into subsets with grades of A, A-, etc. It will be a partition, since each student gets one, and only one, grade.

Partitions are closely related to equivalence relations, which we will discuss later in the semester.

Powersets

Powerset Axiom.

If A is a set, then there exists a set, called the powerset of A and denoted by the symbol tex2html_wrap_inline517 , whose elements are exactly all the subsets of A.

Example. If A is the set tex2html_wrap_inline523 , then

eqnarray266

Do we have tex2html_wrap_inline525 , or tex2html_wrap_inline527 , or tex2html_wrap_inline529 ?

No, because tex2html_wrap_inline531 , etc.

If A has n elements, how many elements are there in its powerset?

Answer: tex2html_wrap_inline537 . Why?

Set-Theoretic Definition of Functions

In mathematics a function tex2html_wrap_inline539 is usually thought of as a subset of the cartesian product tex2html_wrap_inline541 that satisfies certain properties.

For example, the set

displaymath408

describes a function from tex2html_wrap_inline543 to tex2html_wrap_inline545 , that maps a to 1, b to 2, and c to 1.

In general, a set of pairs tex2html_wrap_inline559 must satisfy two conditions to specify a (total) function:

Partial Functions

Is the (multiplicative) inverse mapping, which assigns to each rational number m/n the number n/m a function on the rational numbers?

No, because n/m is not defined if m=0.
It is a function on the non-zero rational numbers, though.

When we speak of a function we usually mean a total function, that is, a mapping f that assigns a value from B to each argument from the specified domain A.

In computer science one also often encounters ``partial functions,'' such as division, which may be ``undefined'' for certain arguments.

In set-theoretic terms, a partial function is a subset of tex2html_wrap_inline597 that satisfies the uniqueness property, but not the completeness property.

Equality of functions

Two functions f and g from A to B are said to be equal, written f=g, if they agree on all arguments, i.e., f(x)=g(x) for all tex2html_wrap_inline611 .

For example, let f and g be functions on the integers such that tex2html_wrap_inline617 and g(n) = (n+1)(n-1). Then f=g.

The identity function on a set A is the function tex2html_wrap_inline625 such that id(x) = x, for all tex2html_wrap_inline629 .

Is the function f on the natural numbers, such that tex2html_wrap_inline633 , equal to the identity function on tex2html_wrap_inline635 ?

Sequences

A sequence is formally a function on the natural numbers, or some initial segment of the natural numbers.

For example, the infinite sequence

displaymath409

can be thought of as a function f that maps each natural number n to a rational number, tex2html_wrap_inline641 .

The finite sequence

displaymath410

can be thought of as a function tex2html_wrap_inline643 such that

eqnarray302

Arrays are essentially finite sequences, though as a data type they also come with operations for accessing array elements, changing them, etc.

Tuples

We have seen that tuples may be thought of as ``nested pairs.''

Alternatively, a tuple may be defined as a sequence of finite length. More specifically, an n-tuple is a sequence of length n, that is, the domain of the corresponding function has n elements.

The notation tex2html_wrap_inline651 is used to denote the set of all n-tuples with the property that the first element is in tex2html_wrap_inline655 , the second in tex2html_wrap_inline657 , and so on. Sets tex2html_wrap_inline659 and tex2html_wrap_inline661 may be different, but need not be.

For example, tex2html_wrap_inline663 denotes the set of all pairs of integers.

An example of a set of tuples with components of different type is a collection of pairs of names and corresponding ID-numbers.

Multiple-Argument Functions

Functions of two or more arguments may be viewed as standard one-argument functions where the domain is a set of tuples (of fixed length).

For example, a binary function is a function f of type tex2html_wrap_inline667 .

Example. The addition function on the integers is a binary function that maps each pair of integers (m,n) to their sum m+n.

In general, by an n-ary function we mean a function of type

displaymath411

the domain of which is a set of n-tuples.

It is of course also possible for the codomain of a function to be a set of pairs or tuples.

For example, we may define a function tex2html_wrap_inline675 such that f(m,n) = (q,r), where q and r are the quotient and remainder, respectively, of the integer division of m by n.

Boolean Functions

Truth tables describe functions, called Boolean functions, that map n-tuples of truth values to single truth values.

On the other hand, every propositional formula A defines a truth table, and hence a (unique) Boolean function.

For example, the formula tex2html_wrap_inline691 defines the following Boolean function.

One-to-One and Onto Functions

A function tex2html_wrap_inline693 is said to be one-to-one (or injective) if, and only if, for all elements x and y in X, we have x=y whenever f(x)=f(y).

Example. Let f and g be functions with domain tex2html_wrap_inline709 and co-domain tex2html_wrap_inline711 , defined by:

eqnarray321

Then g is one-to-one, but f is not.

A function tex2html_wrap_inline717 is said to be onto (or surjective) if, and only if, for every element y in Y, there exists an element x in X, such that f(x)=y.

A function is onto iff its range equals its codomain.

For example, the function f from tex2html_wrap_inline731 to tex2html_wrap_inline733 , defined by:

displaymath412

is surjective, whereas no function from tex2html_wrap_inline735 to tex2html_wrap_inline737 can possibly be onto.

Permutations

One class of bijective functions are permutations, which rearrange a (finite) sequence of the numbers tex2html_wrap_inline739 .

For example, reversing a sequence is a permutation:

displaymath413

or

displaymath414

Another examples is a card shuffle. We can represent the 52 cards in a deck by the numbers tex2html_wrap_inline743 . Shuffling corresponds to rearranging a given sequence of these numbers.

This is an example of a perfect shuffle on an eight card deck.




next up previous
Next: About this document Up: My Home Page

Steve Skiena
Tue Aug 24 19:16:37 EDT 1999