Lecture 7 - Functions and One-to-One

Lecture 7 - Functions and One-to-One - Functions and...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Functions and One-to-One (Computer Science Notes) One-to-One Suppose that f: A → B is a function from A to B. If we pick a value y B, then x A is a pre-image of y if f(x) = y Note: that we said a pre-image and not the pre-image as there are many possibilities, because y might have more than one pre-image For example, in the following function, 1 and 2 are pre-images of 1, 4 and 5 are pre- images of 4, 3 is a pre-image of 3, and 2 has no pre-images 1 1 2 1 3 3 2 4 4 5 4 Formal definition of One-to-One: x, y A, x /= y → f(x) /= f(y) (For all x, y for all set A, x does not equal y, then f(x) does not equal f(y)) x, y A, f(x) = f(y) → x = y (contrapositive) (for all x, y for all set A, f(x) = f(y), then x = y) Mathematicians always mean you to understand that they might be different but there’s also the possibility that they might be the same object Bijections If a function f is both one-to-one and onto, then each output value has exactly one pre- image A function that is both one-to-one and onto is called a one-to-one correspondence or bijective If f maps from A to B, then f^−1 maps from B to A Constructing an onto function from A to B is only possible when A has at least as many elements as B Constructing a one-to-one function from A to B requires that B have at least as many values as A Pigeonhole Principle Pigeonhole principle: Suppose you have n objects and assign k labels to these objects. If n > k, then two objects must get the same label Suppose that A contains more elements than B. Then it’s impossible to construct a bijection from A to B, because two elements of A must be mapped to the same element of B Look at Lecture Notes for Proof Example Permutations Now, suppose that |A| = n = |B|. We can construct a number of one-to-one functions from
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/16/2011 for the course CS 173 taught by Professor Erickson during the Spring '08 term at University of Illinois, Urbana Champaign.

Page1 / 3

Lecture 7 - Functions and One-to-One - Functions and...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online