Databases 2011 The Relational Algebra

Size: px
Start display at page:

Download "Databases 2011 The Relational Algebra"

Transcription

1 Databases 2011 Christian S. Jensen Computer Science, Aarhus University

2 What is an Algebra? An algebra consists of values operators rules Closure: operations yield values Examples integers with +,, sets with,, \, matrices with +,, functions with,, -1 O relations with query operators 2

3 Mathematical Relations An n-ary relation on a set S is a subset of S n Examples is a binary relation on R, a subset of R R { (1.2, 3.4), (34, ), ( 53, ),... } divides is a binary relation on N, a subset of N N { (2, 4), (3, 9), (3, 12), (17, 34), (1237, 21029),... } negative is a binary relation on N, a subset of N N { (3,-3), (-17,17), (0,0), (2, -2), (-2,2), (87, -87),...} sum is a ternary relation on N, a subset of N N N { (3,5,8), (23,14,37), (0,123,123), (42,87,129),... } married to is a binary relation on people { (Hillary, Bill), (Bill, Hillary), (Angelina, Brad),... } 3

4 Tables as Relations A database relation on a data set D consists of a schema of attribute names (a 1, a 2,..., a n ) a finite n-ary relation on D, a subset of D n A relation is like a table where all columns have the same generic type no duplicates are allowed no other constraints are imposed We implicitly allow permutations of the attributes 4

5 Relational Operators Database relations form an algebra with the operators union: intersection: difference: \ projection: π renaming: ρ selection: σ Cartesian product: natural join: These provide an abstract model of database queries 5

6 Union, Intersection, Difference The arguments must have the same schema The result has again that schema R S R S R \ S They compute the set operations on the relations 6

7 Projection π a 1,...,a n (R) Assume the schema of R is (a 1,...,a n,b 1,...,b m ) The schema of the result is (a 1,...,a n ) The result relation is { (d 1,..., d n ) (d 1,..., d n+m ) R } 7

8 Renaming ρ a b (R) The name a must occur as a i in the schema of R The name b must not occur in the schema of R Schema of the result: (a 1,..., a i-1, b, a i+1,..., a n ) The result relation is unchanged ρ a b,c d,e f (R) = ρ a b (ρ c d (ρ e f (R))) 8

9 Selection σ C (R) C is a condition of the attributes of R The resulting schema is unchanged The relation part is: { r r R C(r) } 9

10 Cartesian Product R S Assume R has schema (a 1,..., a m ) S has schema (b 1,..., b n ) The new schema is (a 1,..., a m, b 1,..., b n ) The relation part is { (c 1,..., c m+n ) (c 1,..., c m ) R (c m+1,..., c m+n ) S } 10

11 Natural Join R S Assume R has schema (a 1,..., a k, c 1,..., c n ) S has schema (c 1,..., c n, b 1,..., b m ) {a i } {b i } = The new schema is (a 1,..., a k, c 1,..., c n, b 1,..., b m ) The relation part is { (d 1,..., d k, e 1,..., e n, f 1,..., f m ) (d 1,..., d k, e 1,..., e n ) R (e 1,..., e n, f 1,..., f m ) S } 11

12 Derived Operators R S = R S = R (R S) when the schemas are identical R S = R S when the schemas are disjoint R Θ S = σ Θ (R S) the theta join SELECT DISTINCT X 1,, X k FROM R 1,, R n WHERE C = π x 1,, xk (σ C (R 1 R n ) 12

13 Query Trees In which meetings do the owners participate? π what,meetid (σ status= a ( ρ owner userid (Meetings) ρ pid userid (Participants))) π what,meetid σ status= a ρ owner userid ρ pid userid Meetings Participants 13

14 Limitations The relational algebra cannot answer all queries Flights from Copenhagen to Madrid Rome London Madrid Athens Athens Rome Which cities can be reached from Copenhagen in one or more flights? 14

15 Transitive Closure The transitive closure of a binary relation R R = { (x 1,x k ) x 1,...,x k-1 ((x i,x i+1 ) R) } No relational algebra expression computes R No SQL query can handle it either unless SQL is extended with recursion or a special closure operator is added (some DBMSs do support this) 15

16 Algebraic Laws (1/3) x x = x x y = y x x x = x x y = y x x (y z) = (x y) z x (y z) = (x y) z x (y z) = (x y) (x z) idempotence commutativity idempotence commutativity associativity associativity distributivity 16

17 Algebraic Laws (2/3) σ C (x y) = σ C (x) σ C (y) σ C (x \ y) = σ C (x) \ σ C (y) = σ C (x) \ y σ C (x y) = σ C (x) σ C (y) σ C (x y) = σ C (x) σ C (y) σ C (x) = σ C (σ C (x)) σ C (σ D (x)) = σ D (σ C (x)) σ C D (x) = σ C (σ D (x)) = σ C (x) σ D (x) σ C D (x) = σ C (x) σ D (x) σ C (x) = x \ σ C (x) distributivity distributivity distributivity distributivity idempotence commutativity splitting splitting splitting 17

18 Algebraic Laws (3/3) π a (x y) = π a (x) π a (y) distributivity (does not hold for and ) ρ a b (x y) = ρ a b (x) ρ a b (y) ρ a b (x \ y) = ρ a b (x) \ ρ a b (y) ρ b c (ρ a b (x)) = ρ a c (x) ρ a b (ρ c d (x)) = ρ c d (ρ a b (x)) distributivity distributivity cancellation commutativity 18

19 Zero and Unit Define 0 = the empty relation (for each schema) Define 1 as follows the schema is empty the relation contains the single empty row 0 x = x 0 = x 0 x = x 0 = 0 1 x = x 1 = x 19

20 Division 20

21 Division Example Completed student task Fred Database1 Fred Database2 Fred Compiler1 Eugene Database1 Eugene Compiler1 Eugene Compiler2 Sara Database1 Sara Database2 John Usability1 ddb task Database1 Database2 Completed ddb student Fred Sara Those students that have completed all the ddb tasks 21

22 Algebraic Query Optimization Rewritings may improve efficiency (A B) C A (B C) σ C (A B) σ C (A) σ C (B) Depends on the predicates (selectivities) and the specific instances 22

23 Algebraic Query Optimization Rewritings may improve efficiency: 10 6 rows 10 6 rows 10 rows (A B) C A (B C) rows 10 rows σ C (A B) σ C (A) σ C (B) Depends on the predicates (selectivities) and the specific instances 23

24 Rules of Thumb Push selections down the expressions tree Push projections down the expression tree Order joins based on size estimates In general, search for a good expression tree use heuristics use statistics: table sizes, distinct values for attributes, histograms, etc. 24

25 Bag Algebra Allows relations to contain duplicate entries Sets are replaced by bags The bag versions of,, and \ count copies The bag versions of π, σ, and keep duplicates A better match with real-life SQL than sets Does still not account for the ordering of the tuples SQL offers some support for ordering Tuples in a relation are stored on disk in some order 25

26 Algebraic Laws for Bags Fewer algebraic laws are valid for the bag algebra Counter examples x (y z) = (x y) (x z) σ C D (x) = σ C (x) σ D (x) Beware when optimizing bag queries! 26

27 Algebraic Laws for Bags Fewer algebraic laws are valid for the bag algebra Counter examples x (y z) = (x y) (x z) σ C D (x) = σ C (x) σ D (x) x,y,z = a 42 C,D = true Beware when optimizing bag queries! 27

Query Processing. 3 steps: Parsing & Translation Optimization Evaluation

Query Processing. 3 steps: Parsing & Translation Optimization Evaluation rela%onal algebra Query Processing 3 steps: Parsing & Translation Optimization Evaluation 30 Simple set of algebraic operations on relations Journey of a query SQL select from where Rela%onal algebra π

More information

Plan of the lecture. G53RDB: Theory of Relational Databases Lecture 2. More operations: renaming. Previous lecture. Renaming.

Plan of the lecture. G53RDB: Theory of Relational Databases Lecture 2. More operations: renaming. Previous lecture. Renaming. Plan of the lecture G53RDB: Theory of Relational Lecture 2 Natasha Alechina chool of Computer cience & IT nza@cs.nott.ac.uk Renaming Joins Definability of intersection Division ome properties of relational

More information

Relational Algebra on Bags. Why Bags? Operations on Bags. Example: Bag Selection. σ A+B < 5 (R) = A B

Relational Algebra on Bags. Why Bags? Operations on Bags. Example: Bag Selection. σ A+B < 5 (R) = A B Relational Algebra on Bags Why Bags? 13 14 A bag (or multiset ) is like a set, but an element may appear more than once. Example: {1,2,1,3} is a bag. Example: {1,2,3} is also a bag that happens to be a

More information

CSE 562 Database Systems

CSE 562 Database Systems Outline Query Optimization CSE 562 Database Systems Query Processing: Algebraic Optimization Some slides are based or modified from originals by Database Systems: The Complete Book, Pearson Prentice Hall

More information

Relational Algebra & Calculus

Relational Algebra & Calculus Relational Algebra & Calculus Yanlei Diao UMass Amherst Slides Courtesy of R. Ramakrishnan and J. Gehrke 1 Outline v Conceptual Design: ER model v Logical Design: ER to relational model v Querying and

More information

7 RC Simulates RA. Lemma: For every RA expression E(A 1... A k ) there exists a DRC formula F with F V (F ) = {A 1,..., A k } and

7 RC Simulates RA. Lemma: For every RA expression E(A 1... A k ) there exists a DRC formula F with F V (F ) = {A 1,..., A k } and 7 RC Simulates RA. We now show that DRC (and hence TRC) is at least as expressive as RA. That is, given an RA expression E that mentions at most C, there is an equivalent DRC expression E that mentions

More information

Databases 2012 Normalization

Databases 2012 Normalization Databases 2012 Christian S. Jensen Computer Science, Aarhus University Overview Review of redundancy anomalies and decomposition Boyce-Codd Normal Form Motivation for Third Normal Form Third Normal Form

More information

Relational-Database Design

Relational-Database Design C H A P T E R 7 Relational-Database Design Exercises 7.2 Answer: A decomposition {R 1, R 2 } is a lossless-join decomposition if R 1 R 2 R 1 or R 1 R 2 R 2. Let R 1 =(A, B, C), R 2 =(A, D, E), and R 1

More information

Math 3121, A Summary of Sections 0,1,2,4,5,6,7,8,9

Math 3121, A Summary of Sections 0,1,2,4,5,6,7,8,9 Math 3121, A Summary of Sections 0,1,2,4,5,6,7,8,9 Section 0. Sets and Relations Subset of a set, B A, B A (Definition 0.1). Cartesian product of sets A B ( Defintion 0.4). Relation (Defintion 0.7). Function,

More information

Chapter 2 - Basics Structures MATH 213. Chapter 2: Basic Structures. Dr. Eric Bancroft. Fall Dr. Eric Bancroft MATH 213 Fall / 60

Chapter 2 - Basics Structures MATH 213. Chapter 2: Basic Structures. Dr. Eric Bancroft. Fall Dr. Eric Bancroft MATH 213 Fall / 60 MATH 213 Chapter 2: Basic Structures Dr. Eric Bancroft Fall 2013 Dr. Eric Bancroft MATH 213 Fall 2013 1 / 60 Chapter 2 - Basics Structures 2.1 - Sets 2.2 - Set Operations 2.3 - Functions 2.4 - Sequences

More information

Chapter 2 - Basics Structures

Chapter 2 - Basics Structures Chapter 2 - Basics Structures 2.1 - Sets Definitions and Notation Definition 1 (Set). A set is an of. These are called the or of the set. We ll typically use uppercase letters to denote sets: S, A, B,...

More information

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

Relations. Relations of Sets N-ary Relations Relational Databases Binary Relation Properties Equivalence Relations. Reading (Epp s textbook) Relations Relations of Sets N-ary Relations Relational Databases Binary Relation Properties Equivalence Relations Reading (Epp s textbook) 8.-8.3. Cartesian Products The symbol (a, b) denotes the ordered

More information

Relational Algebra and Calculus

Relational Algebra and Calculus Topics Relational Algebra and Calculus Linda Wu Formal query languages Preliminaries Relational algebra Relational calculus Expressive power of algebra and calculus (CMPT 354 2004-2) Chapter 4 CMPT 354

More information

INTRODUCTION TO RELATIONAL DATABASE SYSTEMS

INTRODUCTION TO RELATIONAL DATABASE SYSTEMS INTRODUCTION TO RELATIONAL DATABASE SYSTEMS DATENBANKSYSTEME 1 (INF 3131) Torsten Grust Universität Tübingen Winter 2017/18 1 THE RELATIONAL ALGEBRA The Relational Algebra (RA) is a query language for

More information

Database Systems Relational Algebra. A.R. Hurson 323 CS Building

Database Systems Relational Algebra. A.R. Hurson 323 CS Building Relational Algebra A.R. Hurson 323 CS Building Relational Algebra Relational model is based on set theory. A relation is simply a set. The relational algebra is a set of high level operators that operate

More information

0 Sets and Induction. Sets

0 Sets and Induction. Sets 0 Sets and Induction Sets A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a A to denote that a is an element of the set

More information

Schedule. Today: Jan. 17 (TH) Jan. 24 (TH) Jan. 29 (T) Jan. 22 (T) Read Sections Assignment 2 due. Read Sections Assignment 3 due.

Schedule. Today: Jan. 17 (TH) Jan. 24 (TH) Jan. 29 (T) Jan. 22 (T) Read Sections Assignment 2 due. Read Sections Assignment 3 due. Schedule Today: Jan. 17 (TH) Relational Algebra. Read Chapter 5. Project Part 1 due. Jan. 22 (T) SQL Queries. Read Sections 6.1-6.2. Assignment 2 due. Jan. 24 (TH) Subqueries, Grouping and Aggregation.

More information

Sets. Alice E. Fischer. CSCI 1166 Discrete Mathematics for Computing Spring, Outline Sets An Algebra on Sets Summary

Sets. Alice E. Fischer. CSCI 1166 Discrete Mathematics for Computing Spring, Outline Sets An Algebra on Sets Summary An Algebra on Alice E. Fischer CSCI 1166 Discrete Mathematics for Computing Spring, 2018 Alice E. Fischer... 1/37 An Algebra on 1 Definitions and Notation Venn Diagrams 2 An Algebra on 3 Alice E. Fischer...

More information

CS5300 Database Systems

CS5300 Database Systems CS5300 Database Systems Relational Algebra A.R. Hurson 323 CS Building hurson@mst.edu This module is intended to introduce: relational algebra as the backbone of relational model, and set of operations

More information

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

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

More information

CS54100: Database Systems

CS54100: Database Systems CS54100: Database Systems Relational Algebra 3 February 2012 Prof. Walid Aref Core Relational Algebra A small set of operators that allow us to manipulate relations in limited but useful ways. The operators

More information

Propositional Logic. What is discrete math? Tautology, equivalence, and inference. Applications

Propositional Logic. What is discrete math? Tautology, equivalence, and inference. Applications What is discrete math? Propositional Logic The real numbers are continuous in the senses that: between any two real numbers there is a real number The integers do not share this property. In this sense

More information

Relations and Equivalence Relations

Relations and Equivalence Relations Relations and Equivalence Relations In this section, we shall introduce a formal definition for the notion of a relation on a set. This is something we often take for granted in elementary algebra courses,

More information

Relational Database: Identities of Relational Algebra; Example of Query Optimization

Relational Database: Identities of Relational Algebra; Example of Query Optimization Relational Database: Identities of Relational Algebra; Example of Query Optimization Greg Plaxton Theory in Programming Practice, Fall 2005 Department of Computer Science University of Texas at Austin

More information

Chapter 9: Relations Relations

Chapter 9: Relations Relations Chapter 9: Relations 9.1 - Relations Definition 1 (Relation). Let A and B be sets. A binary relation from A to B is a subset R A B, i.e., R is a set of ordered pairs where the first element from each pair

More information

BASIC MATHEMATICAL TECHNIQUES

BASIC MATHEMATICAL TECHNIQUES CHAPTER 1 ASIC MATHEMATICAL TECHNIQUES 1.1 Introduction To understand automata theory, one must have a strong foundation about discrete mathematics. Discrete mathematics is a branch of mathematics dealing

More information

Sets are one of the basic building blocks for the types of objects considered in discrete mathematics.

Sets are one of the basic building blocks for the types of objects considered in discrete mathematics. Section 2.1 Introduction Sets are one of the basic building blocks for the types of objects considered in discrete mathematics. Important for counting. Programming languages have set operations. Set theory

More information

Provenance Semirings. Todd Green Grigoris Karvounarakis Val Tannen. presented by Clemens Ley

Provenance Semirings. Todd Green Grigoris Karvounarakis Val Tannen. presented by Clemens Ley Provenance Semirings Todd Green Grigoris Karvounarakis Val Tannen presented by Clemens Ley place of origin Provenance Semirings Todd Green Grigoris Karvounarakis Val Tannen presented by Clemens Ley place

More information

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

Notes. Relations. Introduction. Notes. Relations. Notes. Definition. Example. Slides by Christopher M. Bourke Instructor: Berthe Y. Relations Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Spring 2006 Computer Science & Engineering 235 Introduction to Discrete Mathematics Sections 7.1, 7.3 7.5 of Rosen cse235@cse.unl.edu

More information

CS2742 midterm test 2 study sheet. Boolean circuits: Predicate logic:

CS2742 midterm test 2 study sheet. Boolean circuits: Predicate logic: x NOT ~x x y AND x /\ y x y OR x \/ y Figure 1: Types of gates in a digital circuit. CS2742 midterm test 2 study sheet Boolean circuits: Boolean circuits is a generalization of Boolean formulas in which

More information

Relations Graphical View

Relations Graphical View Introduction Relations Computer Science & Engineering 235: Discrete Mathematics Christopher M. Bourke cbourke@cse.unl.edu Recall that a relation between elements of two sets is a subset of their Cartesian

More information

A set is an unordered collection of objects.

A set is an unordered collection of objects. Section 2.1 Sets A set is an unordered collection of objects. the students in this class the chairs in this room The objects in a set are called the elements, or members of the set. A set is said to contain

More information

CS632 Notes on Relational Query Languages I

CS632 Notes on Relational Query Languages I CS632 Notes on Relational Query Languages I A. Demers 6 Feb 2003 1 Introduction Here we define relations, and introduce our notational conventions, which are taken almost directly from [AD93]. We begin

More information

Axioms of Kleene Algebra

Axioms of Kleene Algebra Introduction to Kleene Algebra Lecture 2 CS786 Spring 2004 January 28, 2004 Axioms of Kleene Algebra In this lecture we give the formal definition of a Kleene algebra and derive some basic consequences.

More information

Ring Sums, Bridges and Fundamental Sets

Ring Sums, Bridges and Fundamental Sets 1 Ring Sums Definition 1 Given two graphs G 1 = (V 1, E 1 ) and G 2 = (V 2, E 2 ) we define the ring sum G 1 G 2 = (V 1 V 2, (E 1 E 2 ) (E 1 E 2 )) with isolated points dropped. So an edge is in G 1 G

More information

MATH 433 Applied Algebra Lecture 22: Review for Exam 2.

MATH 433 Applied Algebra Lecture 22: Review for Exam 2. MATH 433 Applied Algebra Lecture 22: Review for Exam 2. Topics for Exam 2 Permutations Cycles, transpositions Cycle decomposition of a permutation Order of a permutation Sign of a permutation Symmetric

More information

CHAPTER 7: Systems and Inequalities

CHAPTER 7: Systems and Inequalities (Exercises for Chapter 7: Systems and Inequalities) E.7.1 CHAPTER 7: Systems and Inequalities (A) means refer to Part A, (B) means refer to Part B, etc. (Calculator) means use a calculator. Otherwise,

More information

You are here! Query Processor. Recovery. Discussed here: DBMS. Task 3 is often called algebraic (or re-write) query optimization, while

You are here! Query Processor. Recovery. Discussed here: DBMS. Task 3 is often called algebraic (or re-write) query optimization, while Module 10: Query Optimization Module Outline 10.1 Outline of Query Optimization 10.2 Motivating Example 10.3 Equivalences in the relational algebra 10.4 Heuristic optimization 10.5 Explosion of search

More information

With Question/Answer Animations. Chapter 2

With Question/Answer Animations. Chapter 2 With Question/Answer Animations Chapter 2 Chapter Summary Sets The Language of Sets Set Operations Set Identities Functions Types of Functions Operations on Functions Sequences and Summations Types of

More information

Relational Algebra as non-distributive Lattice

Relational Algebra as non-distributive Lattice Relational Algebra as non-distributive Lattice VADIM TROPASHKO Vadim.Tropashko@orcl.com We reduce the set of classic relational algebra operators to two binary operations: natural join and generalized

More information

n CS 160 or CS122 n Sets and Functions n Propositions and Predicates n Inference Rules n Proof Techniques n Program Verification n CS 161

n CS 160 or CS122 n Sets and Functions n Propositions and Predicates n Inference Rules n Proof Techniques n Program Verification n CS 161 Discrete Math at CSU (Rosen book) Sets and Functions (Rosen, Sections 2.1,2.2, 2.3) TOPICS Discrete math Set Definition Set Operations Tuples 1 n CS 160 or CS122 n Sets and Functions n Propositions and

More information

Exercise Sheet 1: Relational Algebra David Carral, Markus Krötzsch Database Theory, 17 April, Summer Term 2018

Exercise Sheet 1: Relational Algebra David Carral, Markus Krötzsch Database Theory, 17 April, Summer Term 2018 Exercise Sheet 1: Relational Algebra David Carral, Markus Krötzsch Database Theory, 17 April, Summer Term 2018 Exercise 1.1. Consider a cinema database with tables of the following form (adapted from a

More information

Comp 5311 Database Management Systems. 5. Functional Dependencies Exercises

Comp 5311 Database Management Systems. 5. Functional Dependencies Exercises Comp 5311 Database Management Systems 5. Functional Dependencies Exercises 1 Assume the following table contains the only set of tuples that may appear in a table R. Which of the following FDs hold in

More information

P Q1 Q2 Q3 Q4 Q5 Tot (60) (20) (20) (20) (60) (20) (200) You are allotted a maximum of 4 hours to complete this exam.

P Q1 Q2 Q3 Q4 Q5 Tot (60) (20) (20) (20) (60) (20) (200) You are allotted a maximum of 4 hours to complete this exam. Exam INFO-H-417 Database System Architecture 13 January 2014 Name: ULB Student ID: P Q1 Q2 Q3 Q4 Q5 Tot (60 (20 (20 (20 (60 (20 (200 Exam modalities You are allotted a maximum of 4 hours to complete this

More information

Lineage implementation in PostgreSQL

Lineage implementation in PostgreSQL Lineage implementation in PostgreSQL Andrin Betschart, 09-714-882 Martin Leimer, 09-728-569 3. Oktober 2013 Contents Contents 1. Introduction 3 2. Lineage computation in TPDBs 4 2.1. Lineage......................................

More information

The Laplace Expansion Theorem: Computing the Determinants and Inverses of Matrices

The Laplace Expansion Theorem: Computing the Determinants and Inverses of Matrices The Laplace Expansion Theorem: Computing the Determinants and Inverses of Matrices David Eberly, Geometric Tools, Redmond WA 98052 https://www.geometrictools.com/ This work is licensed under the Creative

More information

Correlated subqueries. Query Optimization. Magic decorrelation. COUNT bug. Magic example (slide 2) Magic example (slide 1)

Correlated subqueries. Query Optimization. Magic decorrelation. COUNT bug. Magic example (slide 2) Magic example (slide 1) Correlated subqueries Query Optimization CPS Advanced Database Systems SELECT CID FROM Course Executing correlated subquery is expensive The subquery is evaluated once for every CPS course Decorrelate!

More information

GROUPS. Chapter-1 EXAMPLES 1.1. INTRODUCTION 1.2. BINARY OPERATION

GROUPS. Chapter-1 EXAMPLES 1.1. INTRODUCTION 1.2. BINARY OPERATION Chapter-1 GROUPS 1.1. INTRODUCTION The theory of groups arose from the theory of equations, during the nineteenth century. Originally, groups consisted only of transformations. The group of transformations

More information

Notes on Sets, Relations and Functions

Notes on Sets, Relations and Functions PURE MTH 3002 Topology & Analysis III (3246) 2002 Notes on Sets, Relations and Functions These are some notes taken from Mathematical Applications (now Mathematics for Information Technology (MIT)). They

More information

Algebraic Structures Exam File Fall 2013 Exam #1

Algebraic Structures Exam File Fall 2013 Exam #1 Algebraic Structures Exam File Fall 2013 Exam #1 1.) Find all four solutions to the equation x 4 + 16 = 0. Give your answers as complex numbers in standard form, a + bi. 2.) Do the following. a.) Write

More information

Database Systems SQL. A.R. Hurson 323 CS Building

Database Systems SQL. A.R. Hurson 323 CS Building SQL A.R. Hurson 323 CS Building Structured Query Language (SQL) The SQL language has the following features as well: Embedded and Dynamic facilities to allow SQL code to be called from a host language

More information

Definitions, Theorems and Exercises. Abstract Algebra Math 332. Ethan D. Bloch

Definitions, Theorems and Exercises. Abstract Algebra Math 332. Ethan D. Bloch Definitions, Theorems and Exercises Abstract Algebra Math 332 Ethan D. Bloch December 26, 2013 ii Contents 1 Binary Operations 3 1.1 Binary Operations............................... 4 1.2 Isomorphic Binary

More information

First Steps in Relational Lattice

First Steps in Relational Lattice First Steps in Relational Lattice MARSHALL SPIGHT Marshall.Spight@gmai1.com VADIM TROPASHKO Vadim.Tropashko@orcl.com Relational lattice reduces the set of si classic relational algebra operators to two

More information

Abstract Vector Spaces

Abstract Vector Spaces CHAPTER 1 Abstract Vector Spaces 1.1 Vector Spaces Let K be a field, i.e. a number system where you can add, subtract, multiply and divide. In this course we will take K to be R, C or Q. Definition 1.1.

More information

DEPARTMENT OF MATHEMATIC EDUCATION MATHEMATIC AND NATURAL SCIENCE FACULTY

DEPARTMENT OF MATHEMATIC EDUCATION MATHEMATIC AND NATURAL SCIENCE FACULTY HANDOUT ABSTRACT ALGEBRA MUSTHOFA DEPARTMENT OF MATHEMATIC EDUCATION MATHEMATIC AND NATURAL SCIENCE FACULTY 2012 BINARY OPERATION We are all familiar with addition and multiplication of two numbers. Both

More information

Desirable properties of decompositions 1. Decomposition of relational schemes. Desirable properties of decompositions 3

Desirable properties of decompositions 1. Decomposition of relational schemes. Desirable properties of decompositions 3 Desirable properties of decompositions 1 Lossless decompositions A decomposition of the relation scheme R into Decomposition of relational schemes subschemes R 1, R 2,..., R n is lossless if, given tuples

More information

Module 10: Query Optimization

Module 10: Query Optimization Module 10: Query Optimization Module Outline 10.1 Outline of Query Optimization 10.2 Motivating Example 10.3 Equivalences in the relational algebra 10.4 Heuristic optimization 10.5 Explosion of search

More information

Reading 11 : Relations and Functions

Reading 11 : Relations and Functions CS/Math 240: Introduction to Discrete Mathematics Fall 2015 Reading 11 : Relations and Functions Instructor: Beck Hasti and Gautam Prakriya In reading 3, we described a correspondence between predicates

More information

INTRODUCTION TO THE GROUP THEORY

INTRODUCTION TO THE GROUP THEORY Lecture Notes on Structure of Algebra INTRODUCTION TO THE GROUP THEORY By : Drs. Antonius Cahya Prihandoko, M.App.Sc e-mail: antoniuscp.fkip@unej.ac.id Mathematics Education Study Program Faculty of Teacher

More information

Models of Computation. by Costas Busch, LSU

Models of Computation. by Costas Busch, LSU Models of Computation by Costas Busch, LSU 1 Computation CPU memory 2 temporary memory input memory CPU output memory Program memory 3 Example: f ( x) x 3 temporary memory input memory Program memory compute

More information

REVIEW QUESTIONS. Chapter 1: Foundations: Sets, Logic, and Algorithms

REVIEW QUESTIONS. Chapter 1: Foundations: Sets, Logic, and Algorithms REVIEW QUESTIONS Chapter 1: Foundations: Sets, Logic, and Algorithms 1. Why can t a Venn diagram be used to prove a statement about sets? 2. Suppose S is a set with n elements. Explain why the power set

More information

MA : Introductory Probability

MA : Introductory Probability MA 320-001: Introductory Probability David Murrugarra Department of Mathematics, University of Kentucky http://www.math.uky.edu/~dmu228/ma320/ Spring 2017 David Murrugarra (University of Kentucky) MA 320:

More information

Relational Algebra Part 1. Definitions.

Relational Algebra Part 1. Definitions. .. Cal Poly pring 2016 CPE/CC 365 Introduction to Database ystems Alexander Dekhtyar Eriq Augustine.. elational Algebra Notation, T,,... relations. t, t 1, t 2,... tuples of relations. t (n tuple with

More information

CS Discrete Mathematics Dr. D. Manivannan (Mani)

CS Discrete Mathematics Dr. D. Manivannan (Mani) CS 275 - Discrete Mathematics Dr. D. Manivannan (Mani) Department of Computer Science University of Kentucky Lexington, KY 40506 Course Website: www.cs.uky.edu/~manivann/cs275 Notes based on Discrete Mathematics

More information

Languages. Theory I: Database Foundations. Relational Algebra. Paradigms. Projection. Basic Operators. Jan-Georg Smaus (Georg Lausen)

Languages. Theory I: Database Foundations. Relational Algebra. Paradigms. Projection. Basic Operators. Jan-Georg Smaus (Georg Lausen) Languages Theory I: Database Foundations Jan-Georg Smaus (Georg Lausen) Paradigms 1. Languages: Relational Algebra Projection Union and Difference Summary 26.7.2011 Relational algebra Relational calculus

More information

Mathematics Course 111: Algebra I Part I: Algebraic Structures, Sets and Permutations

Mathematics Course 111: Algebra I Part I: Algebraic Structures, Sets and Permutations Mathematics Course 111: Algebra I Part I: Algebraic Structures, Sets and Permutations D. R. Wilkins Academic Year 1996-7 1 Number Systems and Matrix Algebra Integers The whole numbers 0, ±1, ±2, ±3, ±4,...

More information

BOOLEAN ALGEBRA INTRODUCTION SUBSETS

BOOLEAN ALGEBRA INTRODUCTION SUBSETS BOOLEAN ALGEBRA M. Ragheb 1/294/2018 INTRODUCTION Modern algebra is centered around the concept of an algebraic system: A, consisting of a set of elements: ai, i=1, 2,, which are combined by a set of operations

More information

Notes for Science and Engineering Foundation Discrete Mathematics

Notes for Science and Engineering Foundation Discrete Mathematics Notes for Science and Engineering Foundation Discrete Mathematics by Robin Whitty BSc PhD CMath FIMA 2009/2010 Contents 1 Introduction 1 1.1 The Laws of Arithmetic....................... 2 2 Polynomial

More information

DISTINGUISHING PARTITIONS AND ASYMMETRIC UNIFORM HYPERGRAPHS

DISTINGUISHING PARTITIONS AND ASYMMETRIC UNIFORM HYPERGRAPHS DISTINGUISHING PARTITIONS AND ASYMMETRIC UNIFORM HYPERGRAPHS M. N. ELLINGHAM AND JUSTIN Z. SCHROEDER In memory of Mike Albertson. Abstract. A distinguishing partition for an action of a group Γ on a set

More information

Chapter 3 Relational Model

Chapter 3 Relational Model Chapter 3 Relational Model Table of Contents 1. Structure of Relational Databases 2. Relational Algebra 3. Tuple Relational Calculus 4. Domain Relational Calculus Chapter 3-1 1 1. Structure of Relational

More information

Chapter Summary. Sets The Language of Sets Set Operations Set Identities Functions Types of Functions Operations on Functions Computability

Chapter Summary. Sets The Language of Sets Set Operations Set Identities Functions Types of Functions Operations on Functions Computability Chapter 2 1 Chapter Summary Sets The Language of Sets Set Operations Set Identities Functions Types of Functions Operations on Functions Computability Sequences and Summations Types of Sequences Summation

More information

Advanced Engineering Mathematics Prof. Pratima Panigrahi Department of Mathematics Indian Institute of Technology, Kharagpur

Advanced Engineering Mathematics Prof. Pratima Panigrahi Department of Mathematics Indian Institute of Technology, Kharagpur Advanced Engineering Mathematics Prof. Pratima Panigrahi Department of Mathematics Indian Institute of Technology, Kharagpur Lecture No. # 02 Vector Spaces, Subspaces, linearly Dependent/Independent of

More information

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

Relationships between elements of sets occur in many contexts. Every day we deal with C H A P T E R 9 Relations 9.1 Relations and Their Properties 9.2 n-ary Relations and Their Applications 9.3 Representing Relations 9.4 Closures of Relations 9.5 Equivalence Relations 9.6 Partial Orderings

More information

LINEAR ALGEBRA W W L CHEN

LINEAR ALGEBRA W W L CHEN LINEAR ALGEBRA W W L CHEN c W W L Chen, 1982, 28. This chapter originates from material used by the author at Imperial College, University of London, between 1981 and 199. It is available free to all individuals,

More information

Groups. 3.1 Definition of a Group. Introduction. Definition 3.1 Group

Groups. 3.1 Definition of a Group. Introduction. Definition 3.1 Group C H A P T E R t h r e E Groups Introduction Some of the standard topics in elementary group theory are treated in this chapter: subgroups, cyclic groups, isomorphisms, and homomorphisms. In the development

More information

bc7f2306 Page 1 Name:

bc7f2306 Page 1 Name: Name: Questions 1 through 4 refer to the following: Solve the given inequality and represent the solution set using set notation: 1) 3x 1 < 2(x + 4) or 7x 3 2(x + 1) Questions 5 and 6 refer to the following:

More information

Information Systems for Engineers. Exercise 5. ETH Zurich, Fall Semester Hand-out Due

Information Systems for Engineers. Exercise 5. ETH Zurich, Fall Semester Hand-out Due Information Systems for Engineers Exercise 5 ETH Zurich, Fall Semester 2017 Hand-out 27.10.2017 Due 03.11.2017 Reading material: Chapter 2.4 in [1]. Lecture slides 4. 1. Given the two tables below, write

More information

System of Linear Equations

System of Linear Equations CHAPTER 2 System of Linear Equations. Introduction Study of a linear system of equations is classical. First let s consider a system having only one equation: 2x+3y +4z = 5 (2.) Indeterminates x,y,z are

More information

Chordal Graphs, Interval Graphs, and wqo

Chordal Graphs, Interval Graphs, and wqo Chordal Graphs, Interval Graphs, and wqo Guoli Ding DEPARTMENT OF MATHEMATICS LOUISIANA STATE UNIVERSITY BATON ROUGE, LA 70803-4918 E-mail: ding@math.lsu.edu Received July 29, 1997 Abstract: Let be the

More information

RELATIONS PROPERTIES COMPATIBILITY

RELATIONS PROPERTIES COMPATIBILITY RELATIONS PROPERTIES COMPATIBILITY Misha Mikhaylov E-mail address: misha59mikhaylov@gmail.com ABSTRACT. Thoughts expressed in previous paper [3] were developed. There was shown formally that collection

More information

Sets and Motivation for Boolean algebra

Sets and Motivation for Boolean algebra SET THEORY Basic concepts Notations Subset Algebra of sets The power set Ordered pairs and Cartesian product Relations on sets Types of relations and their properties Relational matrix and the graph of

More information

DRAFT CONCEPTUAL SOLUTION REPORT DRAFT

DRAFT CONCEPTUAL SOLUTION REPORT DRAFT BASIC STRUCTURAL MODELING PROJECT Joseph J. Simpson Mary J. Simpson 08-12-2013 DRAFT CONCEPTUAL SOLUTION REPORT DRAFT Version 0.11 Page 1 of 18 Table of Contents Introduction Conceptual Solution Context

More information

A is a subset of (contained in) B A B iff x A = x B Socrates is a man. All men are mortal. A = B iff A B and B A. A B means A is a proper subset of B

A is a subset of (contained in) B A B iff x A = x B Socrates is a man. All men are mortal. A = B iff A B and B A. A B means A is a proper subset of B Subsets C-N Math 207 - Massey, 71 / 125 Sets A is a subset of (contained in) B A B iff x A = x B Socrates is a man. All men are mortal. A = B iff A B and B A x A x B A B means A is a proper subset of B

More information

Sets. Subsets. for any set A, A and A A vacuously true: if x then x A transitivity: A B, B C = A C N Z Q R C. C-N Math Massey, 72 / 125

Sets. Subsets. for any set A, A and A A vacuously true: if x then x A transitivity: A B, B C = A C N Z Q R C. C-N Math Massey, 72 / 125 Subsets Sets A is a subset of (contained in) B A B iff x A = x B Socrates is a man. All men are mortal. A = B iff A B and B A x A x B A B means A is a proper subset of B A B but A B, so x B x / A Illustrate

More information

In-Database Factorised Learning fdbresearch.github.io

In-Database Factorised Learning fdbresearch.github.io In-Database Factorised Learning fdbresearch.github.io Mahmoud Abo Khamis, Hung Ngo, XuanLong Nguyen, Dan Olteanu, and Maximilian Schleich December 2017 Logic for Data Science Seminar Alan Turing Institute

More information

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

spaghetti fish pie cake Ann X X Tom X X X Paul X X X CmSc175 Discrete Mathematics Lesson 14: Set Relations 1. Introduction A college cafeteria line has two stations: main courses and desserts. The main course station offers spaghetti or fish; the dessert

More information

Sets. Introduction to Set Theory ( 2.1) Basic notations for sets. Basic properties of sets CMSC 302. Vojislav Kecman

Sets. Introduction to Set Theory ( 2.1) Basic notations for sets. Basic properties of sets CMSC 302. Vojislav Kecman Introduction to Set Theory ( 2.1) VCU, Department of Computer Science CMSC 302 Sets Vojislav Kecman A set is a new type of structure, representing an unordered collection (group, plurality) of zero or

More information

Relational Algebra SPJRUD

Relational Algebra SPJRUD Relational Algebra SPJRUD Jef Wijsen Université de Mons (UMONS) May 14, 2018 Jef Wijsen (Université de Mons (UMONS)) SPJRUD May 14, 2018 1 / 1 Tabular Representation The table A B C 1 3 2 1 4 1 2 4 2 2

More information

Mathematics Review for Business PhD Students Lecture Notes

Mathematics Review for Business PhD Students Lecture Notes Mathematics Review for Business PhD Students Lecture Notes Anthony M. Marino Department of Finance and Business Economics Marshall School of Business University of Southern California Los Angeles, CA 90089-0804

More information

* 8 Groups, with Appendix containing Rings and Fields.

* 8 Groups, with Appendix containing Rings and Fields. * 8 Groups, with Appendix containing Rings and Fields Binary Operations Definition We say that is a binary operation on a set S if, and only if, a, b, a b S Implicit in this definition is the idea that

More information

MATH 433 Applied Algebra Lecture 22: Semigroups. Rings.

MATH 433 Applied Algebra Lecture 22: Semigroups. Rings. MATH 433 Applied Algebra Lecture 22: Semigroups. Rings. Groups Definition. A group is a set G, together with a binary operation, that satisfies the following axioms: (G1: closure) for all elements g and

More information

2MA105 Algebraic Structures I

2MA105 Algebraic Structures I 2MA105 Algebraic Structures I Per-Anders Svensson http://homepage.lnu.se/staff/psvmsi/2ma105.html Lecture 12 Partially Ordered Sets Lattices Bounded Lattices Distributive Lattices Complemented Lattices

More information

EECS-3421a: Test #2 Electrical Engineering & Computer Science York University

EECS-3421a: Test #2 Electrical Engineering & Computer Science York University 18 November 2015 EECS-3421a: Test #2 1 of 16 EECS-3421a: Test #2 Electrical Engineering & Computer Science York University Family Name: Given Name: Student#: CSE Account: Instructor: Parke Godfrey Exam

More information

Subplanes of projective planes

Subplanes of projective planes Subplanes of projective planes Cafer Caliskan Department of Mathematical Sciences Florida Atlantic University ccaliska@fau.edu and Spyros S. Magliveras Department of Mathematical Sciences Florida Atlantic

More information

Functions and Relations

Functions and Relations Functions and Relations Reading 12.1, 12.2, 12.3 Recall Cartesian products and pairs: E.g. {1, 2, 3} {T,F} {(1,T),(1,F),(2,T),(2,F),(3,T),(3,F)} What is a function? Informal Defn. A function is a rule

More information

A General Lower Bound on the I/O-Complexity of Comparison-based Algorithms

A General Lower Bound on the I/O-Complexity of Comparison-based Algorithms A General Lower ound on the I/O-Complexity of Comparison-based Algorithms Lars Arge Mikael Knudsen Kirsten Larsent Aarhus University, Computer Science Department Ny Munkegade, DK-8000 Aarhus C. August

More information

Database Applications (15-415)

Database Applications (15-415) Database Applications (15-415) Relational Calculus Lecture 5, January 27, 2014 Mohammad Hammoud Today Last Session: Relational Algebra Today s Session: Relational algebra The division operator and summary

More information

1 Predicates and Quantifiers

1 Predicates and Quantifiers 1 Predicates and Quantifiers We have seen how to represent properties of objects. For example, B(x) may represent that x is a student at Bryn Mawr College. Here B stands for is a student at Bryn Mawr College

More information

MATH STUDENT BOOK. 11th Grade Unit 10

MATH STUDENT BOOK. 11th Grade Unit 10 MATH STUDENT BOOK 11th Grade Unit 10 Unit 10 ALGEBRA II REVIEW MATH 1110 ALGEBRA II REVIEW INTRODUCTION 3 1. INTEGERS, OPEN SENTENCES, AND GRAPHS 5 INTEGERS 5 OPEN SENTENCES 10 GRAPHS 18 SELF TEST 1 24

More information

Unit 3 Vocabulary. An algebraic expression that can contains. variables, numbers and operators (like +, An equation is a math sentence stating

Unit 3 Vocabulary. An algebraic expression that can contains. variables, numbers and operators (like +, An equation is a math sentence stating Hart Interactive Math Algebra 1 MODULE 2 An algebraic expression that can contains 1 Algebraic Expression variables, numbers and operators (like +,, x and ). 1 Equation An equation is a math sentence stating

More information