R 1 = {(a, 1), (a, 2), (b, 1), (b, 3), (c, 3)} R 2 = {(x, y) x y (mod 5) } R 3 = {(c 1, c 2 ) c 1 is a prerequisite of c 2 }

Similar documents
Today. Binary relations establish a relationship between elements of two sets

Relations. Relations of Sets N-ary Relations Relational Databases Binary Relation Properties Equivalence Relations. Reading (Epp s textbook)

Chapter 9: Relations Relations

Binary Relation Review Questions

Today s topics. Binary Relations. Inverse Relations. Complementary Relations. Let R:A,B be any binary relation.

Chapter 19 Classwork Famous Scientist Biography Isaac...

Solar System Perambulations

Some history. F p. 1/??

Section 7.1 Relations and Their Properties. Definition: A binary relation R from a set A to a set B is a subset R A B.

Relations. We have seen several types of abstract, mathematical objects, including propositions, predicates, sets, and ordered pairs and tuples.

Congratulations from LSTM - Erlangen

COMP 182 Algorithmic Thinking. Relations. Luay Nakhleh Computer Science Rice University

Relationships between elements of sets occur in many contexts. Every day we deal with

Math.3336: Discrete Mathematics. Chapter 9 Relations

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Section Summary. Relations and Functions Properties of Relations. Combining Relations

1. To be a grandfather. Objects of our consideration are people; a person a is associated with a person b if a is a grandfather of b.

Thornton & Rex, 4th ed. Fall 2018 Prof. Sergio B. Mendes 1

Week 4-5: Binary Relations

Lecture 2: What is Proof?

Relations, Functions, Binary Relations (Chapter 1, Sections 1.2, 1.3)

Definition: A binary relation R from a set A to a set B is a subset R A B. Example:

Johann Bernoulli ( )he established the principle of the so-called virtual work for static systems.

O1 History of Mathematics Lecture VI Successes of and difficulties with the calculus: the 18th-century beginnings of rigour

Exercises. Exercise Sheet 1: Propositional Logic

ME EN 3700: FLUID MECHANICS (Fall 2003)

First Order Logic (FOL)

Week 4-5: Binary Relations

Automaten und Formale Sprachen Automata and Formal Languages

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

JACKIE AND THE HORRIBLE FAMILY TRAVAUX PEDAGOGIQUES AVANT-SPECTACLE. -Copyright by Koalako-

CSE 311: Foundations of Computing I Autumn 2014 Practice Final: Section X. Closed book, closed notes, no cell phones, no calculators.

Sinfonia. Professor Hong Guo 1

Match Up the Inventions with their Inventors (and then the Year)

Numerical Methods for Partial Differential Equations CAAM 452. Spring 2005

An Introduction to Numerical Analysis

Rigorous Software Development CSCI-GA

524 partial differential equations

Bergen Community College Division of Math, Science and Technology Department of Physical Sciences. Course Syllabus PHY 294 Engineering Mechanics

Definition: A binary relation R from a set A to a set B is a subset R A B. Example:

STANDARD WHII.6a The student will demonstrate knowledge of scientific, political, economic, and religious changes during the sixteenth, seventeenth,

Stewart Calculus 7e Appendix Solutions

Module 3 : Differentiation and Mean Value Theorems. Lecture 7 : Differentiation. Objectives. In this section you will learn the following :

MATH DAY 2018 TEAM COMPETITION

Chapter 1. Complex Numbers. 1.1 Complex Numbers. Did it come from the equation x = 0 (1.1)

Notes. Relations. Introduction. Notes. Relations. Notes. Definition. Example. Slides by Christopher M. Bourke Instructor: Berthe Y.

spaghetti fish pie cake Ann X X Tom X X X Paul X X X

Beyond Newton and Leibniz: The Making of Modern Calculus. Anthony V. Piccolino, Ed. D. Palm Beach State College Palm Beach Gardens, Florida

Lecture 7: Relations

PHYS 502 Lecture 3: Fourier Series

What are relations? f: A B

Her birthday is May 4 th. He is not from Korea. You are not in Level 4.

HL Topic. Sets, relations and groups. (Further Mathematics SL Topic 3) Sets Ordered pairs Functions Binary operations Groups Further groups

Albert Einstein VOLUME 8 THE BERLIN YEARS: CORRESPONDENCE, PART A: Robert Schulmann, A.J. Kox, Michel Janssen, and Jozsef Illy

Basic on the physics of energy transforma2ons at micro and nanoscales

Functions: How they have changed through History

Relations. Binary Relation. Let A and B be sets. A (binary) relation from A to B is a subset of A B. Notation. Let R A B be a relation from A to B.

Historical notes on calculus

Boyce/DiPrima/Meade 11 th ed, Ch 1.1: Basic Mathematical Models; Direction Fields

The Physics of Energy

Basic thermodynamics

GEOMETRY WITHOUT POINTS

Introduzione al conce/o di energia

The History and Philosophy of Astronomy

Advanced Classical Mechanics I. PH610/PH710. Interpretation of Newton's Laws of Motion (not discussed in the Textbook) Instructor: Ryoichi Kawai

Relations Graphical View

9/17/2014. Fluid Mechanics (I) Introduction. Hamid-Reza Kariminia Fall, Idle vs. Moving Car. Any change in smoke distribution?

An Overview on Behavioural Theory to Systems and Control. Md. Haider Ali Biswas PDEEC, FEUP

AP Calculus B C Syllabus

Mathematical Foundations of Public-Key Cryptography

An Introduction to the Concept of Relations

Advanced Classical Mechanics (NS-350B) - Lecture 3. Alessandro Grelli Institute for Subatomic Physics

Math 4388 Amber Pham 1. The Birth of Calculus. for counting. There are two major interrelated topics in calculus known as differential and

Work and Kinetic Energy

1 Solution of a Large-Scale Traveling-Salesman Problem... 7 George B. Dantzig, Delbert R. Fulkerson, and Selmer M. Johnson

Relations. P. Danziger. We may represent a relation by a diagram in which a line is drawn between two elements if they are related.

Complex Analysis: A Round-Up

Concepts in Engineering Mathematics: Lecture 39

Reading 11 : Relations and Functions

A short presentation on Newton-Raphson method

Scientific Revolution and the Enlightenment Introduction

THE MATHEMATICS OF EULER. Introduction: The Master of Us All. (Dunham, Euler the Master xv). This quote by twentieth-century mathematician André Weil

CAM Ph.D. Qualifying Exam in Numerical Analysis CONTENTS

4/30/14. Chapter Sequencing Problems. NP and Computational Intractability. Hamiltonian Cycle

Application of Series in Heat Transfer - transient heat conduction

Index. c, 400 Ørstead, Christian, 397 matrix:symmetric, 160

CSE 20. Lecture 4: Introduction to Boolean algebra. CSE 20: Lecture4

SEVENTH EDITION and EXPANDED SEVENTH EDITION

Rela%ons and Their Proper%es. Slides by A. Bloomfield

An Introduction To The Analysis Of Algorithms (2nd Edition) By Robert Sedgewick READ ONLINE

[1] Robert G. Bartle, The Elements of Real Analysis. Second Edition. John Wiley and Sons, New York, 1964.

Discrete Structures: Sample Questions, Exam 2, SOLUTIONS

Spring Based on Partee, ter Meulen, & Wall (1993), Mathematical Methods in Linguistics

1.4 Equivalence Relations and Partitions

Factors That Affect Acceleration. Inquiry Investigation Laboratory Report

Lahore University of Management Sciences. MATH 210 Introduction to Differential Equations

Functions and Relations

Chapter 8. NP and Computational Intractability

STRUCTURAL BIOINFORMATICS I. Fall 2015

CSE 311: Foundations of Computing. Lecture 23: Finite State Machine Minimization & NFAs

Transcription:

Announcements CSE 311 Foundations of Computing I Lecture 20 Relations, Directed Graphs Spring 2013 Reading assignments 7 th Edition, Section 9.1 and pp. 594-601 6 th Edition, Section 8.1 and pp. 541-548 Upcoming topic Finite State Machines 1 2 Definition of Relations Let A and B be sets, A binary relation from A to B is a subset of A B Relation Examples R 1 = {(a, 1), (a, 2), (b, 1), (b, 3), (c, 3)} R 2 = {(x, y) x y (mod 5) } Let A be a set, A binary relation on A is a subset of A A R 3 = {(c 1, c 2 ) c 1 is a prerequisite of c 2 } R 4 = {(s, c) student s had taken course c } 3 4

Properties of Relations Combining Relations Let R be a relation on A R is reflexive iff (a,a) R for every a A R is symmetric iff (a,b) R implies (b, a) R R is antisymmetric iff (a,b) R and a b implies (b,a) / R Let R be a relation from A to B Let S be a relation from B to C The composite of R and S, S R is the relation from A to C defined S R = {(a, c) b such that (a,b) R and (b,c) S} R is transitive iff (a,b) R and (b, c) R implies (a, c) R 5 6 Examples (a,b) Parent: b is a parent of a (a,b) Sister: b is a sister of a What is Sister Parent? Examples Using the relations: Parent, Child, Brother, Sister, Sibling, Father, Mother, Husband, Wife express - Uncle: b is an uncle of a What is Parent Sister? Cousin: b is a cousin of a S R = {(a, c) b such that (a,b) R and (b,c) S} 7 8

Powers of a Relation R 2 = R R = {(a, c) b such that (a,b) R and (b,c) R} Matrix representation Relation R on A={a 1, a p } R 0 = {(a,a) a A} R 1 = R R n+1 = R n R {(1, 1), (1, 2), (1, 4), (2,1), (2,3), (3,2), (3, 3) (4,2) (4,3)} 9 10 Directed graphs G = (V, E) V vertices E edges, order pairs of vertices Path: v 1, v 2,, v k, with (v i, v i+1 ) in E Simple Path Cycle Simple Cycle Representation of relations Directed Graph Representation (Digraph) {(a, b), (a, a), (b, a), (c, a), (c, d), (c, e) (d, e) } b c a d e 11 12

Computing the Composite Relation using the Graph Representation If S={(2,2),(2,3),(3,1)} and R={(1,2),(2,1),(1,3)} compute S R Paths in relations Let R be a relation on a set A. There is a path of length n from a to b if and only if (a,b) R n 13 14 Connectivity relation Let R be a relation on a set A. The connectivity relation R* consists of the pairs (a,b) such that there is a path from a to b in R. Properties of Relations Let R be a relation on A R is reflexive iff (a,a) R for every a A R is symmetric iff (a,b) R implies (b, a) R R is transitive iff (a,b) R and (b, c) R implies (a, c) R Note: The text uses the wrong definition of this quantity. What the text defines (ignoring k=0) is usually called R + 15 16

Transitive-Reflexive Closure How is Anderson related to Bernoulli? Add the minimum possible number of edges to make the relation transitive and reflexive The transitive-reflexive closure of a relation R is the connectivity relation R* 17 How is Anderson related to Bernoulli? http://genealogy.math.ndsu.nodak.edu/ Autumn 2011 CSE 311 20

Anderson Mayr Bauer Caratheodory Minkowski Klein Beame Lipschitz Dirichlet Fourier Lagrange Nicolaus Copernicus Georg Rheticus Moritz Steinmetz Christoph Meurer Philipp Muller Erhard Weigel Gottfried Leibniz Noclas Malebranache Jacob Bernoulli Johann Bernoulli Leonhard Euler Joseph Lagrange Jean-Baptiste Fourier Gustav Dirichlet Rudolf Lipschitz Felix Klein C. L. Ferdinand Lindemann Herman Minkowski Constantin Caratheodory Georg Aumann Friedrich Bauer Manfred Paul Ernst Mayr Richard Anderson Leibniz Weigel Galileo Galilei Vincenzo Viviani Issac Barrow Isaac Newton Roger Cotes Robert Smith Walter Taylor Stephen Whisson Thomas Postlethwaite Thomas Jones Adam Sedgewick William Hopkins Edward Routh Alfred North Whitehead Willard Quine Hao Wang Stephen Cook Paul Beame Quine Whitehead Hopkins Euler Sedgewick Johann Bernoulli Jacob Bernoulli Cook Smith Newton Barrow Galileo Rheticus Copernicus n-ary relations Let A1, A2,, An be sets. An n-ary relation on these sets is a subset of A1 A2... An. 24

Relational databases STUDENT Student_Name ID_Number Office GPA Knuth 328012098 022 4.00 Von Neuman 481080220 555 3.78 Russell 238082388 022 3.85 Einstein 238001920 022 2.11 Newton 1727017 333 3.61 Karp 348882811 022 3.98 Bernoulli 2921938 022 3.21 STUDENT Relational databases Student_Name ID_Number Office GPA Course Knuth 328012098 022 4.00 CSE311 Knuth 328012098 022 4.00 CSE351 Von Neuman 481080220 555 3.78 CSE311 Russell 238082388 022 3.85 CSE312 Russell 238082388 022 3.85 CSE344 Russell 238082388 022 3.85 CSE351 Newton 1727017 333 3.61 CSE312 Karp 348882811 022 3.98 CSE311 Karp 348882811 022 3.98 CSE312 Karp 348882811 022 3.98 CSE344 Karp 348882811 022 3.98 CSE351 Bernoulli 2921938 022 3.21 CSE351 25 What s not so nice? 26 Relational databases TAKES STUDENT ID_Number Course Student_Name ID_Number Office GPA 328012098 CSE311 Knuth 328012098 022 4.00 328012098 CSE351 Von Neuman 481080220 555 3.78 481080220 CSE311 Russell 238082388 022 3.85 238082388 CSE312 Einstein 238001920 022 2.11 238082388 CSE344 Newton 1727017 333 3.61 238082388 CSE351 Karp 348882811 022 3.98 1727017 CSE312 Bernoulli 2921938 022 3.21 348882811 CSE311 348882811 CSE312 348882811 CSE344 348882811 CSE351 Better 2921938 CSE351 27 Database Operations: Projection Find all offices: Π Office (STUDENT) Office 022 555 333 Office GPA Find offices and GPAs: Π Office,GPA (STUDENT) 022 4.00 555 3.78 022 3.85 022 2.11 333 3.61 022 3.98 022 3.21 28

Database Operations: Selection Database Operations: Natural Join Student Takes Find students with GPA > 3.9 : σ GPA>3.9 (STUDENT) Student_Name ID_Number Office GPA Knuth 328012098 022 4.00 Karp 348882811 022 3.98 Retrieve the name and GPA for students with GPA > 3.9 : Π Student_Name,GPA (σ GPA>3.9 (STUDENT)) Student_Name GPA Knuth 4.00 Karp 3.98 29 Student_Name ID_Number Office GPA Course Knuth 328012098 022 4.00 CSE311 Knuth 328012098 022 4.00 CSE351 Von Neuman 481080220 555 3.78 CSE311 Russell 238082388 022 3.85 CSE312 Russell 238082388 022 3.85 CSE344 Russell 238082388 022 3.85 CSE351 Newton 1727017 333 3.61 CSE312 Karp 348882811 022 3.98 CSE311 Karp 348882811 022 3.98 CSE312 Karp 348882811 022 3.98 CSE344 Karp 348882811 022 3.98 CSE351 Bernoulli 2921938 022 3.21 CSE351 30