### Create a StudySoup account

#### Be part of our community, it's free to join!

Already have a StudySoup account? Login here

# CS 250, Week 2 Notes CS 250

PSU

GPA 3.82

### View Full Document

## About this Document

## 43

## 1

## Popular in Discrete Structures I

## Popular in Computer Science and Engineering

This 12 page Class Notes was uploaded by Parker Moore on Monday October 10, 2016. The Class Notes belongs to CS 250 at Portland State University taught by Sergio Antony in Fall 2016. Since its upload, it has received 43 views. For similar materials see Discrete Structures I in Computer Science and Engineering at Portland State University.

## Reviews for CS 250, Week 2 Notes

### What is Karma?

#### Karma is the currency of StudySoup.

#### You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/10/16

CS 250 Week 2 Notes PSU: Fall term Highlight = Link to further help on topic Function A function ffrom a setA (the domain) to a setB (the codomain) associates to each element x of A exactly one elementy of B. Notations: f:A→B and f(x)=y Examples name of students. parent of students. f(x)=x2 ? f(x)=√ x ? Concepts Let f:A→B Ify=f(x), thenyis the image ofxx and xx is a preimage ofy (for some authors, sets not elements). IfC⊂A , thef(C)={f(x)∣x∈C}is the image oC . The image of A is called the range f, e.g., range of temperature in Portland in July. Properties Injective (one-to-one∀x,y∈A,f(x)=f(y)→x=ySame output implies same input. Surjective (onto)∀y∈B,∃x∈A,y=f(x). Every element (of the codomain) is an output (of some input). Bijective: both injective(1-1) and surjective(onto) Surjective (Onto Function) A function f from A to B is called onto if for all b in B there is an a in Asuch that f (a) = b. All elements in B are used. Such functions are referred to as surjective. "Onto" NOT "Onto" (all elements in B are used) (the 8 and 1 in Set B are not used) By definition, to determine if a function is ONTO, you need to know information about both set A and B. When working in the coordinate plane, tAeandtB may both become the Real numbers, stated as . EXAMPLE 1: Is f (x) = 3x - 4onto where ? This function (a straight line) iONTO. As you progress along the line, every possible y-value is used. In addition, this straight line also possesses the property that each x-value has one uniquey-value that is not used by any other x-element. This characteristic is referred to as being one-to-one. EXAMPLE 2: Is g (x) = x² - 2onto where ? This function (a parabola) is NOTONTO. Values less than -2 on the y-axis are never used. Since possible y-values belong to the set of ALL Real numbers, not ALL possibley-values are used. In addition, this parabola also has y- values that are paired with more than one x-value, such as (3, 7) and (-3, 7). This function will not be one-to-one. EXAMPLE 3: Is g (x) = x² - 2onto where ? If seB is redefined to be , ALL of the possible y-values are now used, and function g (x) (under these conditiONTO.is Injective (One-to-One Function) A function f from A to B is called one-to-one (or 1-1) if whenever f (a) = f (b) then a = b. No element of B is the image of more than one element in A. In a one-to-one function, given any y there is only one x that can be paired with the given y. Such functions are referred to as injective. "One-to-One" NOT "One-to-One" EXAMPLE 1: Is f (x) = x³ one-to-one where ? This functionOne-to- One. This cubic function possesses the property that each x-value has one unique y-value that is not used by any other x-element. This characteristic is referred to as being 1-1. Also, in this function, as you progress along the graph, every possible y-value is used, making the function onto. EXAMPLE 2: Is g (x) = | x - 2 |one-to-one where ? This function is NOTOne-to-One. This absolute value function has y-values that are paired with more than one x- value, such as (4, 2) and (0, 2). This function is not one-to-one. In addition, values less than 0 on the y- axis are never used, making the function NOT onto. EXAMPLE 3: Is g (x) = | x - 2 |one-to-one where ? With setB redefined to be , function g (x) will still be NOT one-to-one, but it will now be ONTO. BOTH Functions can be both one-to-one and onto. Such functions are called bijective. Bijections are functions that are both injective and surjective. "Both" NOT "Both" - not Onto . Composition Iff:A→B and g:B→C , then(g∘f):A→C is defined b(g∘f)(x)=g(f(.)) Composition help: https://www.youtube.com/watch?v=G7rGep_v-EM Inverse The function 1A:A→A1 defined by ∀x∈A (1A(x)=x)is called the identity function foA . Iff:A→B is bijective, then there exists a unique functionf−:B→A , called the inverse of , such that f∘−1=1Bf∘f−1=1Band −1∘f=1Af−1∘f=1A. Help with Converse, inverse, Contrapositive: https://www.youtube.com/watch?v=afAt0jEF74c Operator A function from A×A to A, e.g., ''+'' ovZ(binary). Extends to unary and ternary. Help with operators: https://en.wikibooks.org/wiki/Discrete_Mathematics/Logic Relations A relation R is a subset of the cartesian product of some sets S1,…SnS1,…Sn. Example: SS set of students {Ann,Bud,Carla,…}{Ann,Bud,Carla,,C set of course {162,250,…}{162,250,…}. Relation takes⊆S×C is defined by takes={(Ann,161),(Bud,250),(Ann,250)…} Infix notation:Ann takes 161Ann takes 1.1 Notation for binary relations: (Z,<. Help with Relations: https://www.youtube.com/watch?v=h34hZ_hynzE Representing relations Venn diagrams (a relation is a set). Arrow diagrams (a relation is similar to a function). Binary relation on a set: a directed graph (defined later). Binary relation on a set: a matrix. Inverse, composition IfA and Bare sets and R a relation overA×B , then the inverse R−1R−1 ofR is defined by: ∀a∈A,b∈B ((b,a)∈R −1↔(a,b)∈R Question: if RR is ''parent'' what Rs−1R−1? IfA, B and C are sets,R⊆A×B , andS⊆B×C then the composition R∘S ofR and Sis defined by: ∀a∈A,c∈C ((a,c)∈R∘S↔∃b∈B((a,b)∈R∧(b,c)∈S)) Ex: compose ''student takes course'' with ''course is taught in classroom'' Properties Let R be a binary relation on a seA . reflexive:∀x∈A (x R x). symmetric: ∀x,y∈A (x R y→y R x). transitive:∀x,y,z∈A (x R y∧y R z→x R .) antisymmetric: ∀x,y∈A (x R y∧y R x→x=y. Help with properties of relations: https://www.youtube.com/watch?v=LPIWJ1tOM-E Partial order Reflexive, transitive, antisymmetric. Denoted '' ≤'' or ⪯'''. Ex.: (Z,≤, (Z+,|where a|b↔∃t (b=at)a|b↔∃t (b=at) ,(2A,⊆)where A is any set. Note: reflexive is optional for some authors. Representation: Hasse diagrams, left 2 {a,b,, right({1,2,…10},|. Links to partial order help: http://mathworld.wolfram.com/PartialOrder.html https://www.youtube.com/watch?v=hQweMQ7usmU Equivalence Reflexive, symmetric, transitive. Denoted '' ∼''. Ex.: on Z,x∼y↔x mod 5=y mod 5x∼y↔x mod 5=y mod 5 . Ex.: on Students, x∼y↔x and yare born in the same month. Equivalence class of xx: [x]={y∣x∼y,y∈A}. Quotient: A/∼={[x]∣x∈A}. A/∼ is a partition{A1,A2,…} ofA : 1. Ai∩A =∅ , foi≠j 2. ∪A =A Help with equivalence: https://www.youtube.com/watch?v=2p5AuV35i2s Notation Both Nk and Zk denote the set {0,1,…k−1}. Elements in this set can be added, multiplied, etc., always modulo k E.g.,N ={0,1,2,3,4}and in this set2−4=3 because −2=3 (everything mod 5).

### BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.

### You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

## Why people love StudySoup

#### "Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

#### "I signed up to be an Elite Notetaker with 2 of my sorority sisters this semester. We just posted our notes weekly and were each making over $600 per month. I LOVE StudySoup!"

#### "There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

#### "Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

### Refund Policy

#### STUDYSOUP CANCELLATION POLICY

All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email support@studysoup.com

#### STUDYSOUP REFUND POLICY

StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here: support@studysoup.com

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to support@studysoup.com

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.