Relational Algebra. Today s Lecture. 1. The Relational Model & Relational Algebra. 2. Relational Algebra Pt. II
|
|
- Avis Malone
- 5 years ago
- Views:
Transcription
1 Reltionl Algebr BBM471 Dtbse Mngement Systems Dr. Fut Akl Tody s Lecture 1. The Reltionl Model & Reltionl Algebr 2. Reltionl Algebr Pt. II 2
2 1. The Reltionl Model & Reltionl Algebr Wht you will lern bout in this section 1. The Reltionl Model 2. Reltionl Algebr: Bsic Opertors 3. Execution 4
3 Motivtion The Reltionl model is precise, implementble, nd we cn operte on it (query/updte, etc.) Dtbse mps internlly into this procedurl lnguge. 5 A Little History Reltionl model due to Edgr Ted Codd, mthemticin t IBM in 1970 A Reltionl Model of Dt for Lrge Shred Dt Bnks". Communictions of the ACM 13 (6): Won Turing wrd 1981 IBM didn t wnt to use reltionl model Apprently used in the moon lnding Google for IMS nd the Apollo progrm 6
4 The Reltionl Model: Schemt Reltionl Schem: Students(sid: string, nme: string, gp: flot) Reltion nme String, flot, int, etc. re the domins of the ttributes Attributes 7 The Reltionl Model: Dt Student An ttribute (or column) is typed dt entry present in ech tuple in the reltion sid nme gp 001 Bob Joe Mry Alice 3.5 The number of ttributes is the rity of the reltion 8
5 The Reltionl Model: Dt Student sid nme gp 001 Bob Joe Mry Alice 3.5 The number of tuples is the crdinlity of the reltion A tuple or row (or record) is single entry in the tble hving the ttributes specified by the schem 9 The Reltionl Model: Dt Student sid nme gp 001 Bob Joe Mry 3.8 Recll: In prctice DBMSs relx the set requirement, nd use multisets. 004 Alice 3.5 A reltionl instnce is set of tuples ll conforming to the sme schem 10
6 To Reiterte A reltionl schem describes the dt tht is contined in reltionl instnce Let R(f 1 :Dom 1,,f m :Dom m ) be reltionl schem then, n instnce of R is subset of Dom 1 x Dom 2 x x Dom n In this wy, reltionl schem R is totl function from ttribute nmes to types 11 One More Time A reltionl schem describes the dt tht is contined in reltionl instnce A reltion R of rity t is function: R : Dom 1 x x Dom t à {0,1} i.e. returns whether or not tuple of mtching types is member of it Then, the schem is simply the signture of the function Note here tht order mtters, ttribute nme doesn t We ll (mostly) work with the other model (lst slide) in which ttribute nme mtters, order doesn t! 12
7 A reltionl dtbse A reltionl dtbse schem is set of reltionl schemt, one for ech reltion A reltionl dtbse instnce is set of reltionl instnces, one for ech reltion Two conventions: 1. We cll reltionl dtbse instnces s simply dtbses 2. We ssume ll instnces re vlid, i.e., stisfy the domin constrints 13 Remember the CMS Reltion DB Schem Students(sid: string, nme: string, gp: flot) Courses(cid: string, cnme: string, credits: int) Enrolled(sid: string, cid: string, grde: string) Note tht the schems impose effective domin / type constrints, i.e. Gp cn t be Apple Sid Nme Gp 101 Bob Mry 3.8 Students Reltion Instnces sid cid Grde A Enrolled cid cnme credits Courses 14
8 2 nd Prt of the Model: Querying SELECT S.nme FROM Students S WHERE S.gp > 3.5; Find nmes of ll students with GPA > 3.5 We don t tell the system how or where to get the dt- just wht we wnt, i.e., Querying is declrtive To mke this hppen, we need to trnslte the declrtive query into series of opertors we ll see this next! Actully, I showed how to do this trnsltion for much richer lnguge! 15 Virtues of the model Physicl independence (logicl too), Declrtive Simple, elegnt, clen: Everything is reltion Why did it tke multiple yers? Doubted it could be done efficiently. 16
9 RDBMS Architecture How does n SQL engine work? SQL Query Reltionl Algebr (RA) Pln Optimized RA Pln Execution Declrtive query (from user) Trnslte to reltionl lgebr expresson Find logiclly equivlent- but more efficient- RA expression Execute ech opertor of the optimized pln! 17 RDBMS Architecture How does SQL engine work? SQL Query Reltionl Algebr (RA) Pln Optimized RA Pln Execution Reltionl Algebr llows us to trnslte declrtive (SQL) queries into precise nd optimizble expressions! 18
10 Reltionl Algebr (RA) Five bsic opertors: Selection: s Projection: P Crtesin Product: Union: È Difference: - Derived or uxiliry opertors: Intersection, complement Joins (nturl,equi-join, thet join, semi-join) Renming: r Division 19 Keep in mind: RA opertes on sets! RDBMSs use multisets, however in reltionl lgebr formlism we will consider sets! Also: we will consider the nmed perspective, where every ttribute must hve unique nme àttribute order does not mtter Now on to the bsic RA opertors 20
11 Selection (!) Returns ll tuples which stisfy condition Nottion: s c (R) Exmples s Slry > (Employee) s nme = Smith (Employee) The condition c cn be =, <,, >, ³, <> Students(sid,snme,gp) SQL: SELECT * FROM Students WHERE gp > 3.5; RA:! "#$ &'.) (+,-./0,1) 21 Another exmple: SSN Nme Slry John Smith Fred s Slry > (Employee) SSN Nme Slry Smith Fred
12 Projection (Π) Elimintes columns, then removes duplictes Nottion: P A1,,An (R) Exmple: project socil-security number nd nmes: P SSN, Nme (Employee) Output schem: Answer (SSN, Nme) Students(sid,snme,gp) SQL: SELECT DISTINCT snme, gp FROM Students; RA: Π 45$67,"#$ (+,-./0,1) 23 Another exmple: SSN Nme Slry John John John P Nme,Slry (Employee) Nme Slry John John
13 Note tht RA Opertors re Compositionl! Students(sid,snme,gp) SELECT DISTINCT snme, gp FROM Students WHERE gp > 3.5; How do we represent this query in RA? Π 45$67,"#$ (! "#$&'.) (+,-./0,1))! "#$&'.) (Π 45$67,"#$ ( +,-./0,1)) Are these logiclly equivlent? 25 Cross-Product ( ) Ech tuple in R1 with ech tuple in R2 Nottion: R1 R2 Exmple: Employee Deprtments Minly used to express joins Students(sid,snme,gp) People(ssn,pnme,ddress) SQL: SELECT * FROM Students, People; RA: +,-./0,1 :/;<=/ 26
14 Another exmple: People ssn pnme ddress John 216 Rosse Bob 217 Rosse Students sid snm e gp 001 John Bob 1.3 +,-./0,1 :/;<=/ ssn pnme ddress sid snme gp John 216 Rosse 001 John Bob 217 Rosse 001 John John 216 Rosse 002 Bob Bob 216 Rosse 002 Bob Renming Chnges the schem, not the instnce A specil opertor- neither bsic nor derived Nottion: r B1,,Bn (R) Students(sid,snme,gp) SQL: SELECT sid AS studid, snme AS nme, gp AS grdeptavg FROM Students; Note: this is shorthnd for the proper form (since nmes, not order mtters!): r A1àB1,,AnàBn (R) RA: > 4BCDED,5$67,"F$D7GBHI" (+,-./0,1) We cre bout this opertor becuse we re working in nmed perspective 28
15 Another exmple: Students sid snme gp > 4BCDED,5$67,"F$D7GBHI" (+,-./0,1) 001 John Bob 1.3 Students studid nme grdeptavg 001 John Bob Nturl Join ( ) Nottion: R 1 R 2 Joins R 1 nd R 2 on equlity of ll shred ttributes If R 1 hs ttribute set A, nd R 2 hs ttribute set B, nd they shre ttributes A B = C, cn lso be written: R 1 L R 2 Our first exmple of derived RA opertor: Mening: R 1 R 2 = P A U B (s C=D (> M O (R 1 ) R 2 )) Where: The renme > M O renmes the shred ttributes in one of the reltions The selection s C=D checks equlity of the shred ttributes The projection P A U B elimintes the duplicte common ttributes Students(sid,nme,gp) People(ssn,nme,ddress) SQL: SELECT DISTINCT ssid, S.nme, gp, ssn, ddress FROM Students S, People P WHERE S.nme = P.nme; RA: +,-./0,1 :/;<=/ 30
16 Another exmple: Students S People P sid S.nme gp 001 John Bob 1.3 ssn P.nme ddress John 216 Rosse Bob 217 Rosse +,-./0,1 :/;<=/ sid S.nme gp ssn ddress 001 John Rosse 002 Bob Rosse 31 Nturl Join Given schems R(A, B, C, D), S(A, C, E), wht is the schem of R S? Given R(A, B, C), S(D, E), wht is R S? Given R(A, B), S(A, B), wht is R S? 32
17 Exmple: Converting SFW Query -> RA Students(sid,snme,gp) People(ssn,snme,ddress) SELECT DISTINCT gp, ddress FROM Students S, People P WHERE gp > 3.5 AND S.snme = P.snme; Π "#$,$DDF744 (! "#$&'.) (+ :)) How do we represent this query in RA? 33 Division Nottion: r s It hs nothing to do with rithmetic division. Let r nd s be reltions on schems R nd S respectively where R = (A 1,, A m, B 1,, B n ) S = (B 1,, B n ) The result of r s is reltion on schem R S = (A 1,, A m ) r s = { t t Î Õ R-S (r) Ù " u Î s ( tu Î r ) } Where tu mens the conctention of tuples t nd u to produce single tuple Dtbse System Concepts, Silberschtz, Korth nd Sudrshn 34
18 Division Opertion - Exmple 35 Reltions r, s r s A B b 1 2 A B b g d d d Î Î b r s Dtbse System Concepts, Silberschtz, Korth nd Sudrshn Division Opertion - Exmple 36 A B b b g g g C D g g g g g g b b b b b E Reltions r, s r s D b E 1 1 A B g C g g r s Dtbse System Concepts, Silberschtz, Korth nd Sudrshn
19 Division Opertion - Exmple Deprtment (did, dnme) Project (pid, pnme, did) Supplier (suppid, snme, saddress) Supply (scode, snme, mountavilble) Production (scode, did, mount) Consumption (scode, pid, mount) Purchsed (scode, suppid, mount) Find projects tht consume ll different kinds of purchsed supplies. Õ pid,scode (Consumption) Purchsed Find deprtments tht produce ll kinds of supplies. Õ did,scode (Production) Supply Veritbnı Sistemleri, Ünl Yrımğn 37 Logicl Equivlence of RA Plns Given reltions R(A,B): Here, projection & selection commute:! HP) (Π H (@)) = Π H (! HP) (@)) Wht bout here?! HP) (Π R (@)) = Π R (! HP) (@))??? 38
20 RDBMS Architecture How does SQL engine work? SQL Query Reltionl Algebr (RA) Pln Optimized RA Pln Execution We sw how we cn trnsform declrtive SQL queries into precise, compositionl RA plns 39 RDBMS Architecture How does SQL engine work? SQL Query Reltionl Algebr (RA) Pln Optimized RA Pln Execution We ll look t how to then optimize these plns lter! 40
21 RDBMS Architecture How is the RA pln executed? SQL Query Reltionl Algebr (RA) Pln Optimized RA Pln Execution We will see lter how to execute ll the bsic opertors! Advnced Reltionl Algebr
22 Wht you will lern bout in this section 1. Set Opertions in RA 2. Fncier RA 3. Extensions & Limittions 43 Reltionl Algebr (RA) Five bsic opertors: Selection: s Projection: P Crtesin Product: Union: È Difference: - Derived or uxiliry opertors: Intersection, complement Joins (nturl,equi-join, thet join, semi-join) Renming: r Division 44
23 Union (È) nd Difference ( ) R1 È R2 Exmple: ActiveEmployees È RetiredEmployees R 1 R 2 R1 R2 Exmple: AllEmployees RetiredEmployees R 1 R 2 45 Wht bout Intersection (Ç)? It is derived opertor R1 Ç R2 = R1 (R1 R2) Also expressed s join! Exmple UnionizedEmployees Ç RetiredEmployees R 1 R 2 46
24 Thet Join ( q ) A join tht involves predicte R1 q R2 = s q (R1 R2) Here q cn be ny condition Students(sid,snme,gp) People(ssn,snme,ddress) SQL: SELECT * FROM Students,People WHERE q; Note tht nturl join is thet join + projection. RA: +,-./0,1 T :/;<=/ 47 Equi-join ( A=B ) A thet join where q is n equlity R1 A=B R2 = s A=B (R1 R2) Exmple: Employee SSN=SSN Dependents Most common join in prctice! Students(sid,snme,gp) People(ssn,pnme,ddress) SQL: SELECT * FROM Students S, People P WHERE snme = pnme; RA: + 45$67P#5$67 : 48
25 Semijoin ( ) R S = P A1,,An (R S) Where A 1,, A n re the ttributes in R Exmple: Employee Dependents Students(sid,snme,gp) People(ssn,pnme,ddress) SQL: SELECT DISTINCT sid,snme,gp FROM Students,People WHERE snme = pnme; RA: +,-./0,1 :/;<=/ 49 Semijoins in Distributed Dtbses Semijoins re often used to compute nturl joins in distributed dtbses Employee SSN Nme network Dependents SSN Dnme Age Send less dt to reduce network bndwidth! Employee ssn=ssn (s ge>71 (Dependents)) R = Employee T T = P SSN s ge>71 (Dependents) Answer = R Dependents 50
26 RA Expressions Cn Get Complex! P nme buyer-ssn=ssn pid=pid seller-ssn=ssn P ssn P pid s nme=fred s nme=gizmo Person Purchse Person Product 51 Opertions on Multisets All RA opertions need to be defined crefully on bgs s C (R): preserve the number of occurrences P A (R): no duplicte elimintion Cross-product, join: no duplicte elimintion This is importnt- reltionl engines work on multisets, not sets! 52
27 RA hs Limittions! Cnnot compute trnsitive closure Nme1 Nme2 Reltionship Fred Mry Fther Mry Joe Cousin Mry Bill Spouse Nncy Lou Sister Find ll direct nd indirect reltives of Fred Cnnot express in RA!!! Need to write C progrm, use grph engine, or modern SQL 53 Exmple: Bnking Dtbse brnch (brnch_nme, brnch_city, ssets) customer (customer_nme, customer_street, customer_city) ccount (ccount_number, brnch_nme, blnce) lon (lon_number, brnch_nme, mount) depositor (customer_nme, ccount_number) borrower (customer_nme, lon_number) 54
28 brnch (brnch_nme, brnch_city, ssets) customer (customer_nme, customer_street, customer_city) ccount (ccount_number, brnch_nme, blnce) lon (lon_number, brnch_nme, mount) depositor (customer_nme, ccount_number) borrower (customer_nme, lon_number) 55 Exmple Queries Find ll lons of over $1200 s mount > 1200 (lon) Find the lon number for ech lon of n mount greter thn $1200 Õ lon_number (s mount > 1200 (lon)) Dtbse System Concepts, Silberschtz, Korth nd Sudrshn 56
29 Exmple Queries Find the nmes of ll customers who hve lon, n ccount, or both, from the bnk Õ customer_nme (borrower) È Õ customer_nme (depositor) Find the nmes of ll customers who hve lon nd n ccount t bnk. Õ customer_nme (borrower) Ç Õ customer_nme (depositor) Dtbse System Concepts, Silberschtz, Korth nd Sudrshn 57 Exmple Queries Find the nmes of ll customers who hve lon t the Perryridge brnch. Õ customer_nme (s brnch_nme= Perryridge (s borrower.lon_number = lon.lon_number (borrower x lon))) Find the nmes of ll customers who hve lon t the Perryridge brnch but do not hve n ccount t ny brnch of the bnk. Õ customer_nme (s brnch_nme = Perryridge (s borrower.lon_number = lon.lon_number (borrower x lon))) Õ customer_nme (depositor) Dtbse System Concepts, Silberschtz, Korth nd Sudrshn 58
30 Exmple Queries Find the nmes of ll customers who hve lon t the Perryridge brnch. Query 1 Õ customer_nme (s brnch_nme = Perryridge ( s borrower.lon_number = lon.lon_number (borrower x lon))) Query 2 Õ customer_nme (s lon.lon_number = borrower.lon_number ( (s brnch_nme = Perryridge (lon)) x borrower)) Dtbse System Concepts, Silberschtz, Korth nd Sudrshn 59 Exmple Queries Find ll customers who hve n ccount t ll brnches locted in Brooklyn city. Dtbse System Concepts, Silberschtz, Korth nd Sudrshn 60
31 Acknowledgements The course mteril used for this lecture is mostly tken nd/or dopted from the course mterils of the CS145 Introduction to Dtbses lecture given by Christopher Ré t Stnford University ( 61
Relational Algebra. 1. The Relational Model & Relational Algebra. Today s Lecture. What you will learn about in this section
Reltionl Aler Tody s Lecture. The Reltionl Model & Reltionl Aler 2. Reltionl Aler Pt. II BBM47 Dtse Mnement Systems Dr. Fut Akl kl@hcettepe.edu.tr 2 Wht you will lern out in this section. The Reltionl
More informationLecture 16. The Relational Model
Lecture 16 The Relational Model Lecture 16 Today s Lecture 1. The Relational Model & Relational Algebra 2. Relational Algebra Pt. II [Optional: may skip] 2 Lecture 16 > Section 1 1. The Relational Model
More information4/10/2018. Relational Algebra (RA) 1. Selection (σ) 2. Projection (Π) Note that RA Operators are Compositional! 3.
Lecture 33: The Relational Model 2 Professor Xiannong Meng Spring 2018 Lecture and activity contents are based on what Prof Chris Ré of Stanford used in his CS 145 in the fall 2016 term with permission
More informationCSC 261/461 Database Systems Lecture 13. Fall 2017
CSC 261/461 Database Systems Lecture 13 Fall 2017 Announcement Start learning HTML, CSS, JavaScript, PHP + SQL We will cover the basics next week https://www.w3schools.com/php/php_mysql_intro.asp Project
More informationL22: The Relational Model (continued) CS3200 Database design (sp18 s2) 4/5/2018
L22: The Relational Model (continued) CS3200 Database design (sp18 s2) https://course.ccs.neu.edu/cs3200sp18s2/ 4/5/2018 256 Announcements! Please pick up your exam if you have not yet HW6 will include
More informationChapter 2: The Relational Algebra
CSE 303: Database Lecture 11 Chapter 2: The Relational Algebra RDBMS Architecture How does a SQL engine work? SQL Query Relational Algebra (RA) Plan Optimized RA Plan Execution Declarative query (from
More informationUNIT 11. Query Optimization
UNIT Query Optimiztion Contents Introduction to Query Optimiztion 2 The Optimiztion Process: An Overview 3 Optimiztion in System R 4 Optimiztion in INGRES 5 Implementing the Join Opertors Wei-Png Yng,
More informationChapter 2: The Relational Algebra
CSE 303: Database RDBMS Architecture Lecture 11 How does a SQL engine work? Chapter 2: The Relational Algebra SQL Query Declarative query (from user) Relational Algebra (RA) Plan Translate to relational
More informationPreserving Constraints for Aggregation Relationship Type Update in XML Document
Preserving Constrints for Aggregtion Reltionship Type Updte in XML Document Eric Prdede 1, J. Wenny Rhyu 1, nd Dvid Tnir 2 1 Deprtment of Computer Science nd Computer Engineering, L Trobe University, Bundoor
More informationSection 10.4 Hyperbolas
66 Section 10.4 Hyperbols Objective : Definition of hyperbol & hyperbols centered t (0, 0). The third type of conic we will study is the hyperbol. It is defined in the sme mnner tht we defined the prbol
More informationDr. D.M. Akbar Hussain
Dr. D.M. Akr Hussin Lexicl Anlysis. Bsic Ide: Red the source code nd generte tokens, it is similr wht humns will do to red in; just tking on the input nd reking it down in pieces. Ech token is sequence
More informationElena Baralis, Silvia Chiusano Politecnico di Torino. Pag. 1. Query optimization. DBMS Architecture. Query optimizer. Query optimizer.
DBMS Architecture SQL INSTRUCTION OPTIMIZER Dtbse Mngement Systems MANAGEMENT OF ACCESS METHODS BUFFER MANAGER CONCURRENCY CONTROL RELIABILITY MANAGEMENT Index Files Dt Files System Ctlog DATABASE 2 Query
More informationDefinition of Regular Expression
Definition of Regulr Expression After the definition of the string nd lnguges, we re redy to descrie regulr expressions, the nottion we shll use to define the clss of lnguges known s regulr sets. Recll
More informationECE 468/573 Midterm 1 September 28, 2012
ECE 468/573 Midterm 1 September 28, 2012 Nme:! Purdue emil:! Plese sign the following: I ffirm tht the nswers given on this test re mine nd mine lone. I did not receive help from ny person or mteril (other
More informationUnit 5 Vocabulary. A function is a special relationship where each input has a single output.
MODULE 3 Terms Definition Picture/Exmple/Nottion 1 Function Nottion Function nottion is n efficient nd effective wy to write functions of ll types. This nottion llows you to identify the input vlue with
More informationMIPS I/O and Interrupt
MIPS I/O nd Interrupt Review Floting point instructions re crried out on seprte chip clled coprocessor 1 You hve to move dt to/from coprocessor 1 to do most common opertions such s printing, clling functions,
More informationFunctor (1A) Young Won Lim 8/2/17
Copyright (c) 2016-2017 Young W. Lim. Permission is grnted to copy, distribute nd/or modify this document under the terms of the GNU Free Documenttion License, Version 1.2 or ny lter version published
More informationEssential Question What are some of the characteristics of the graph of a rational function?
8. TEXAS ESSENTIAL KNOWLEDGE AND SKILLS A..A A..G A..H A..K Grphing Rtionl Functions Essentil Question Wht re some of the chrcteristics of the grph of rtionl function? The prent function for rtionl functions
More informationFunctor (1A) Young Won Lim 10/5/17
Copyright (c) 2016-2017 Young W. Lim. Permission is grnted to copy, distribute nd/or modify this document under the terms of the GNU Free Documenttion License, Version 1.2 or ny lter version published
More informationCOMPUTER SCIENCE 123. Foundations of Computer Science. 6. Tuples
COMPUTER SCIENCE 123 Foundtions of Computer Science 6. Tuples Summry: This lecture introduces tuples in Hskell. Reference: Thompson Sections 5.1 2 R.L. While, 2000 3 Tuples Most dt comes with structure
More informationSIMPLIFYING ALGEBRA PASSPORT.
SIMPLIFYING ALGEBRA PASSPORT www.mthletics.com.u This booklet is ll bout turning complex problems into something simple. You will be ble to do something like this! ( 9- # + 4 ' ) ' ( 9- + 7-) ' ' Give
More informationUnit #9 : Definite Integral Properties, Fundamental Theorem of Calculus
Unit #9 : Definite Integrl Properties, Fundmentl Theorem of Clculus Gols: Identify properties of definite integrls Define odd nd even functions, nd reltionship to integrl vlues Introduce the Fundmentl
More information1. SEQUENCES INVOLVING EXPONENTIAL GROWTH (GEOMETRIC SEQUENCES)
Numbers nd Opertions, Algebr, nd Functions 45. SEQUENCES INVOLVING EXPONENTIAL GROWTH (GEOMETRIC SEQUENCES) In sequence of terms involving eponentil growth, which the testing service lso clls geometric
More informationINTRODUCTION TO SIMPLICIAL COMPLEXES
INTRODUCTION TO SIMPLICIAL COMPLEXES CASEY KELLEHER AND ALESSANDRA PANTANO 0.1. Introduction. In this ctivity set we re going to introduce notion from Algebric Topology clled simplicil homology. The min
More informationMATH 25 CLASS 5 NOTES, SEP
MATH 25 CLASS 5 NOTES, SEP 30 2011 Contents 1. A brief diversion: reltively prime numbers 1 2. Lest common multiples 3 3. Finding ll solutions to x + by = c 4 Quick links to definitions/theorems Euclid
More informationLecture Query evaluation. Combining operators. Logical query optimization. By Marina Barsky Winter 2016, University of Toronto
Lecture 02.03. Query evaluation Combining operators. Logical query optimization By Marina Barsky Winter 2016, University of Toronto Quick recap: Relational Algebra Operators Core operators: Selection σ
More information12-B FRACTIONS AND DECIMALS
-B Frctions nd Decimls. () If ll four integers were negtive, their product would be positive, nd so could not equl one of them. If ll four integers were positive, their product would be much greter thn
More informationMA1008. Calculus and Linear Algebra for Engineers. Course Notes for Section B. Stephen Wills. Department of Mathematics. University College Cork
MA1008 Clculus nd Liner Algebr for Engineers Course Notes for Section B Stephen Wills Deprtment of Mthemtics University College Cork s.wills@ucc.ie http://euclid.ucc.ie/pges/stff/wills/teching/m1008/ma1008.html
More informationA Tautology Checker loosely related to Stålmarck s Algorithm by Martin Richards
A Tutology Checker loosely relted to Stålmrck s Algorithm y Mrtin Richrds mr@cl.cm.c.uk http://www.cl.cm.c.uk/users/mr/ University Computer Lortory New Museum Site Pemroke Street Cmridge, CB2 3QG Mrtin
More informationa(e, x) = x. Diagrammatically, this is encoded as the following commutative diagrams / X
4. Mon, Sept. 30 Lst time, we defined the quotient topology coming from continuous surjection q : X! Y. Recll tht q is quotient mp (nd Y hs the quotient topology) if V Y is open precisely when q (V ) X
More informationIf you are at the university, either physically or via the VPN, you can download the chapters of this book as PDFs.
Lecture 5 Wlks, Trils, Pths nd Connectedness Reding: Some of the mteril in this lecture comes from Section 1.2 of Dieter Jungnickel (2008), Grphs, Networks nd Algorithms, 3rd edition, which is ville online
More informationSection 3.1: Sequences and Series
Section.: Sequences d Series Sequences Let s strt out with the definition of sequence: sequence: ordered list of numbers, often with definite pttern Recll tht in set, order doesn t mtter so this is one
More informationCSE 401 Midterm Exam 11/5/10 Sample Solution
Question 1. egulr expressions (20 points) In the Ad Progrmming lnguge n integer constnt contins one or more digits, but it my lso contin embedded underscores. Any underscores must be preceded nd followed
More informationCS411 Database Systems. 04: Relational Algebra Ch 2.4, 5.1
CS411 Database Systems 04: Relational Algebra Ch 2.4, 5.1 1 Basic RA Operations 2 Set Operations Union, difference Binary operations Remember, a relation is a SET of tuples, so set operations are certainly
More informationIn the last lecture, we discussed how valid tokens may be specified by regular expressions.
LECTURE 5 Scnning SYNTAX ANALYSIS We know from our previous lectures tht the process of verifying the syntx of the progrm is performed in two stges: Scnning: Identifying nd verifying tokens in progrm.
More informationIntroduction to Integration
Introduction to Integrtion Definite integrls of piecewise constnt functions A constnt function is function of the form Integrtion is two things t the sme time: A form of summtion. The opposite of differentition.
More informationThe Reciprocal Function Family. Objectives To graph reciprocal functions To graph translations of reciprocal functions
- The Reciprocl Function Fmil Objectives To grph reciprocl functions To grph trnsltions of reciprocl functions Content Stndrds F.BF.3 Identif the effect on the grph of replcing f () b f() k, kf(), f(k),
More informationTheory of Computation CSE 105
$ $ $ Theory of Computtion CSE 105 Regulr Lnguges Study Guide nd Homework I Homework I: Solutions to the following problems should be turned in clss on July 1, 1999. Instructions: Write your nswers clerly
More informationASTs, Regex, Parsing, and Pretty Printing
ASTs, Regex, Prsing, nd Pretty Printing CS 2112 Fll 2016 1 Algeric Expressions To strt, consider integer rithmetic. Suppose we hve the following 1. The lphet we will use is the digits {0, 1, 2, 3, 4, 5,
More informationHomework. Context Free Languages III. Languages. Plan for today. Context Free Languages. CFLs and Regular Languages. Homework #5 (due 10/22)
Homework Context Free Lnguges III Prse Trees nd Homework #5 (due 10/22) From textbook 6.4,b 6.5b 6.9b,c 6.13 6.22 Pln for tody Context Free Lnguges Next clss of lnguges in our quest! Lnguges Recll. Wht
More informationΕΠΛ323 - Θεωρία και Πρακτική Μεταγλωττιστών
ΕΠΛ323 - Θωρία και Πρακτική Μταγλωττιστών Lecture 3 Lexicl Anlysis Elis Athnsopoulos elisthn@cs.ucy.c.cy Recognition of Tokens if expressions nd reltionl opertors if è if then è then else è else relop
More informationFig.25: the Role of LEX
The Lnguge for Specifying Lexicl Anlyzer We shll now study how to uild lexicl nlyzer from specifiction of tokens in the form of list of regulr expressions The discussion centers round the design of n existing
More informationSmall Business Networking
Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd business. Introducing technology
More information9 4. CISC - Curriculum & Instruction Steering Committee. California County Superintendents Educational Services Association
9. CISC - Curriculum & Instruction Steering Committee The Winning EQUATION A HIGH QUALITY MATHEMATICS PROFESSIONAL DEVELOPMENT PROGRAM FOR TEACHERS IN GRADES THROUGH ALGEBRA II STRAND: NUMBER SENSE: Rtionl
More informationVery sad code. Abstraction, List, & Cons. CS61A Lecture 7. Happier Code. Goals. Constructors. Constructors 6/29/2011. Selectors.
6/9/ Abstrction, List, & Cons CS6A Lecture 7-6-9 Colleen Lewis Very sd code (define (totl hnd) (if (empty? hnd) (+ (butlst (lst hnd)) (totl (butlst hnd))))) STk> (totl (h c d)) 7 STk> (totl (h ks d)) ;;;EEEK!
More informationCAS CS 460/660 Introduction to Database Systems. Relational Algebra 1.1
CAS CS 460/660 Introduction to Database Systems Relational Algebra 1.1 Relational Query Languages Query languages: Allow manipulation and retrieval of data from a database. Relational model supports simple,
More informationMidterm 2 Sample solution
Nme: Instructions Midterm 2 Smple solution CMSC 430 Introduction to Compilers Fll 2012 November 28, 2012 This exm contins 9 pges, including this one. Mke sure you hve ll the pges. Write your nme on the
More informationDynamic Programming. Andreas Klappenecker. [partially based on slides by Prof. Welch] Monday, September 24, 2012
Dynmic Progrmming Andres Klppenecker [prtilly bsed on slides by Prof. Welch] 1 Dynmic Progrmming Optiml substructure An optiml solution to the problem contins within it optiml solutions to subproblems.
More information1.1. Interval Notation and Set Notation Essential Question When is it convenient to use set-builder notation to represent a set of numbers?
1.1 TEXAS ESSENTIAL KNOWLEDGE AND SKILLS Prepring for 2A.6.K, 2A.7.I Intervl Nottion nd Set Nottion Essentil Question When is it convenient to use set-uilder nottion to represent set of numers? A collection
More informationLING/C SC/PSYC 438/538. Lecture 21 Sandiway Fong
LING/C SC/PSYC 438/538 Lecture 21 Sndiwy Fong Tody's Topics Homework 8 Review Optionl Homework 9 (mke up on Homework 7) Homework 8 Review Question1: write Prolog regulr grmmr for the following lnguge:
More informationSmall Business Networking
Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd business. Introducing technology
More informationMisrepresentation of Preferences
Misrepresenttion of Preferences Gicomo Bonnno Deprtment of Economics, University of Cliforni, Dvis, USA gfbonnno@ucdvis.edu Socil choice functions Arrow s theorem sys tht it is not possible to extrct from
More informationDistributed Systems Principles and Paradigms
Distriuted Systems Principles nd Prdigms Chpter 11 (version April 7, 2008) Mrten vn Steen Vrije Universiteit Amsterdm, Fculty of Science Dept. Mthemtics nd Computer Science Room R4.20. Tel: (020) 598 7784
More informationControl-Flow Analysis and Loop Detection
! Control-Flow Anlysis nd Loop Detection!Lst time! PRE!Tody! Control-flow nlysis! Loops! Identifying loops using domintors! Reducibility! Using loop identifiction to identify induction vribles CS553 Lecture
More informationa < a+ x < a+2 x < < a+n x = b, n A i n f(x i ) x. i=1 i=1
Mth 33 Volume Stewrt 5.2 Geometry of integrls. In this section, we will lern how to compute volumes using integrls defined by slice nlysis. First, we recll from Clculus I how to compute res. Given the
More informationSmall Business Networking
Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd processes. Introducing technology
More informationRelational Model and Relational Algebra
Relational Model and Relational Algebra CMPSCI 445 Database Systems Fall 2008 Some slide content courtesy of Zack Ives, Ramakrishnan & Gehrke, Dan Suciu, Ullman & Widom Next lectures: Querying relational
More informationIntegration. September 28, 2017
Integrtion September 8, 7 Introduction We hve lerned in previous chpter on how to do the differentition. It is conventionl in mthemtics tht we re supposed to lern bout the integrtion s well. As you my
More informationPhysics 208: Electricity and Magnetism Exam 1, Secs Feb IMPORTANT. Read these directions carefully:
Physics 208: Electricity nd Mgnetism Exm 1, Secs. 506 510 11 Feb. 2004 Instructor: Dr. George R. Welch, 415 Engineering-Physics, 845-7737 Print your nme netly: Lst nme: First nme: Sign your nme: Plese
More informationTries. Yufei Tao KAIST. April 9, Y. Tao, April 9, 2013 Tries
Tries Yufei To KAIST April 9, 2013 Y. To, April 9, 2013 Tries In this lecture, we will discuss the following exct mtching prolem on strings. Prolem Let S e set of strings, ech of which hs unique integer
More informationCreating Flexible Interfaces. Friday, 24 April 2015
Creting Flexible Interfces 1 Requests, not Objects Domin objects re esy to find but they re not t the design center of your ppliction. Insted, they re trp for the unwry. Sequence digrms re vehicle for
More informationIntroduction to Computer Engineering EECS 203 dickrp/eecs203/ CMOS transmission gate (TG) TG example
Introduction to Computer Engineering EECS 23 http://ziyng.eecs.northwestern.edu/ dickrp/eecs23/ CMOS trnsmission gte TG Instructor: Robert Dick Office: L477 Tech Emil: dickrp@northwestern.edu Phone: 847
More informationCS201 Discussion 10 DRAWTREE + TRIES
CS201 Discussion 10 DRAWTREE + TRIES DrwTree First instinct: recursion As very generic structure, we could tckle this problem s follows: drw(): Find the root drw(root) drw(root): Write the line for the
More informationSmall Business Networking
Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd processes. Introducing technology
More informationSmall Business Networking
Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd processes. Introducing technology
More informationSystems I. Logic Design I. Topics Digital logic Logic gates Simple combinational logic circuits
Systems I Logic Design I Topics Digitl logic Logic gtes Simple comintionl logic circuits Simple C sttement.. C = + ; Wht pieces of hrdwre do you think you might need? Storge - for vlues,, C Computtion
More informationImproper Integrals. October 4, 2017
Improper Integrls October 4, 7 Introduction We hve seen how to clculte definite integrl when the it is rel number. However, there re times when we re interested to compute the integrl sy for emple 3. Here
More informationSmall Business Networking
Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd processes. Introducing technology
More informationL2-Python-Data-Structures
L2-Python-Dt-Structures Mrch 19, 2018 1 Principl built-in types in Python (Python ) numerics: int, flot, long, complex sequences: str, unicode, list, tuple, byterry, buffer, xrnge mppings: dict files:
More information50 AMC LECTURES Lecture 2 Analytic Geometry Distance and Lines. can be calculated by the following formula:
5 AMC LECTURES Lecture Anlytic Geometry Distnce nd Lines BASIC KNOWLEDGE. Distnce formul The distnce (d) between two points P ( x, y) nd P ( x, y) cn be clculted by the following formul: d ( x y () x )
More informationMid-term exam. Scores. Fall term 2012 KAIST EE209 Programming Structures for EE. Thursday Oct 25, Student's name: Student ID:
Fll term 2012 KAIST EE209 Progrmming Structures for EE Mid-term exm Thursdy Oct 25, 2012 Student's nme: Student ID: The exm is closed book nd notes. Red the questions crefully nd focus your nswers on wht
More informationEECS 281: Homework #4 Due: Thursday, October 7, 2004
EECS 28: Homework #4 Due: Thursdy, October 7, 24 Nme: Emil:. Convert the 24-bit number x44243 to mime bse64: QUJD First, set is to brek 8-bit blocks into 6-bit blocks, nd then convert: x44243 b b 6 2 9
More informationWhat do all those bits mean now? Number Systems and Arithmetic. Introduction to Binary Numbers. Questions About Numbers
Wht do ll those bits men now? bits (...) Number Systems nd Arithmetic or Computers go to elementry school instruction R-formt I-formt... integer dt number text chrs... floting point signed unsigned single
More informationRELATIONAL ALGEBRA. CS 564- Fall ACKs: Dan Suciu, Jignesh Patel, AnHai Doan
RELATIONAL ALGEBRA CS 564- Fall 2016 ACKs: Dan Suciu, Jignesh Patel, AnHai Doan RELATIONAL QUERY LANGUAGES allow the manipulation and retrieval of data from a database two types of query languages: Declarative:
More informationSmall Business Networking
Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd business. Introducing technology
More informationAnswer Key Lesson 6: Workshop: Angles and Lines
nswer Key esson 6: tudent Guide ngles nd ines Questions 1 3 (G p. 406) 1. 120 ; 360 2. hey re the sme. 3. 360 Here re four different ptterns tht re used to mke quilts. Work with your group. se your Power
More information4452 Mathematical Modeling Lecture 4: Lagrange Multipliers
Mth Modeling Lecture 4: Lgrnge Multipliers Pge 4452 Mthemticl Modeling Lecture 4: Lgrnge Multipliers Lgrnge multipliers re high powered mthemticl technique to find the mximum nd minimum of multidimensionl
More informationEngineer To Engineer Note
Engineer To Engineer Note EE-169 Technicl Notes on using Anlog Devices' DSP components nd development tools Contct our technicl support by phone: (800) ANALOG-D or e-mil: dsp.support@nlog.com Or visit
More informationMatrices and Systems of Equations
Mtrices Mtrices nd Sstems of Equtions A mtri is rectngulr rr of rel numbers. CHAT Pre-Clculus Section 8. m m m............ n n n mn We will use the double subscript nottion for ech element of the mtri.
More informationSOME EXAMPLES OF SUBDIVISION OF SMALL CATEGORIES
SOME EXAMPLES OF SUBDIVISION OF SMALL CATEGORIES MARCELLO DELGADO Abstrct. The purpose of this pper is to build up the bsic conceptul frmework nd underlying motivtions tht will llow us to understnd ctegoricl
More informationEasyMP Network Projection Operation Guide
EsyMP Network Projection Opertion Guide Contents 2 Introduction to EsyMP Network Projection EsyMP Network Projection Fetures... 5 Disply Options... 6 Multi-Screen Disply Function... 6 Movie Sending Mode...
More informationNotes for Graph Theory
Notes for Grph Theory These re notes I wrote up for my grph theory clss in 06. They contin most of the topics typiclly found in grph theory course. There re proofs of lot of the results, ut not of everything.
More informationsuch that the S i cover S, or equivalently S
MATH 55 Triple Integrls Fll 16 1. Definition Given solid in spce, prtition of consists of finite set of solis = { 1,, n } such tht the i cover, or equivlently n i. Furthermore, for ech i, intersects i
More informationRegistering as an HPE Reseller
Registering s n HPE Reseller Quick Reference Guide for new Prtners Mrch 2019 Registering s new Reseller prtner There re four min steps to register on the Prtner Redy Portl s new Reseller prtner: Appliction
More informationIntroduction to Data Management CSE 344. Lectures 8: Relational Algebra
Introduction to Data Management CSE 344 Lectures 8: Relational Algebra CSE 344 - Winter 2016 1 Announcements Homework 3 is posted Microsoft Azure Cloud services! Use the promotion code you received Due
More informationQuestions About Numbers. Number Systems and Arithmetic. Introduction to Binary Numbers. Negative Numbers?
Questions About Numbers Number Systems nd Arithmetic or Computers go to elementry school How do you represent negtive numbers? frctions? relly lrge numbers? relly smll numbers? How do you do rithmetic?
More informationSmall Business Networking
Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd processes. Introducing technology
More informationEpson Projector Content Manager Operation Guide
Epson Projector Content Mnger Opertion Guide Contents 2 Introduction to the Epson Projector Content Mnger Softwre 3 Epson Projector Content Mnger Fetures... 4 Setting Up the Softwre for the First Time
More informationLecture 5: Spatial Analysis Algorithms
Lecture 5: Sptil Algorithms GEOG 49: Advnced GIS Sptil Anlsis Algorithms Bsis of much of GIS nlsis tod Mnipultion of mp coordintes Bsed on Eucliden coordinte geometr http://stronom.swin.edu.u/~pbourke/geometr/
More informationSage CRM 2017 R3 Software Requirements and Mobile Features. Updated: August 2017
Sge CRM 2017 R3 Softwre Requirements nd Mobile Fetures Updted: August 2017 2017, The Sge Group plc or its licensors. Sge, Sge logos, nd Sge product nd service nmes mentioned herein re the trdemrks of The
More informationCMSC 331 First Midterm Exam
0 00/ 1 20/ 2 05/ 3 15/ 4 15/ 5 15/ 6 20/ 7 30/ 8 30/ 150/ 331 First Midterm Exm 7 October 2003 CMC 331 First Midterm Exm Nme: mple Answers tudent ID#: You will hve seventy-five (75) minutes to complete
More informationMidterm I Solutions CS164, Spring 2006
Midterm I Solutions CS164, Spring 2006 Februry 23, 2006 Plese red ll instructions (including these) crefully. Write your nme, login, SID, nd circle the section time. There re 8 pges in this exm nd 4 questions,
More informationQuiz2 45mins. Personal Number: Problem 1. (20pts) Here is an Table of Perl Regular Ex
Long Quiz2 45mins Nme: Personl Numer: Prolem. (20pts) Here is n Tle of Perl Regulr Ex Chrcter Description. single chrcter \s whitespce chrcter (spce, t, newline) \S non-whitespce chrcter \d digit (0-9)
More informationToday. CS 188: Artificial Intelligence Fall Recap: Search. Example: Pancake Problem. Example: Pancake Problem. General Tree Search.
CS 88: Artificil Intelligence Fll 00 Lecture : A* Serch 9//00 A* Serch rph Serch Tody Heuristic Design Dn Klein UC Berkeley Multiple slides from Sturt Russell or Andrew Moore Recp: Serch Exmple: Pncke
More informationAn Efficient Divide and Conquer Algorithm for Exact Hazard Free Logic Minimization
An Efficient Divide nd Conquer Algorithm for Exct Hzrd Free Logic Minimiztion J.W.J.M. Rutten, M.R.C.M. Berkelr, C.A.J. vn Eijk, M.A.J. Kolsteren Eindhoven University of Technology Informtion nd Communiction
More informationIntroduction to Computer Science, Shimon Schocken, IDC Herzliya. Lecture Writing Classes
Introduction to Computer Science, Shimon Schocken, IDC Herzliy Lecture 5.1-5.2 Writing Clsses Writing Clsses, Shimon Schocken IDC Herzliy, www.ro2cs.com slide 1 Clsses Two viewpos on es: Client view: how
More informationRegistering as a HPE Reseller. Quick Reference Guide for new Partners in Asia Pacific
Registering s HPE Reseller Quick Reference Guide for new Prtners in Asi Pcific Registering s new Reseller prtner There re five min steps to e new Reseller prtner. Crete your Appliction Copyright 2017 Hewlett
More informationSage CRM 2018 R1 Software Requirements and Mobile Features. Updated: May 2018
Sge CRM 2018 R1 Softwre Requirements nd Mobile Fetures Updted: My 2018 2018, The Sge Group plc or its licensors. Sge, Sge logos, nd Sge product nd service nmes mentioned herein re the trdemrks of The Sge
More informationCMPT 354: Database System I. Lecture 3. SQL Basics
CMPT 354: Database System I Lecture 3. SQL Basics 1 Announcements! About Piazza 97 enrolled (as of today) Posts are anonymous to classmates You should have started doing A1 Please come to office hours
More informationFile Manager Quick Reference Guide. June Prepared for the Mayo Clinic Enterprise Kahua Deployment
File Mnger Quick Reference Guide June 2018 Prepred for the Myo Clinic Enterprise Khu Deployment NVIGTION IN FILE MNGER To nvigte in File Mnger, users will mke use of the left pne to nvigte nd further pnes
More information