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

Info icon This 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
Image of page 1

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern