BİL 354 Veritabanı Sistemleri. Relational Algebra (İlişkisel Cebir)

Size: px
Start display at page:

Download "BİL 354 Veritabanı Sistemleri. Relational Algebra (İlişkisel Cebir)"

Transcription

1 BİL 354 Veritnı Sistemleri Reltionl lger (İlişkisel Ceir)

2 Reltionl Queries Query lnguges: llow mnipultion nd retrievl of dt from dtse. Reltionl model supports simple, powerful QLs: Strong forml foundtion sed on logic. llows for much optimiztion. Query Lnguges!= progrmming lnguges! QLs not intended to e used for complex clcultions. QLs support esy, efficient ccess to lrge dt sets.

3 Forml Reltionl Query Lnguges Two mthemticl Query Lnguges form the sis for rel lnguges (e.g. SQL), nd for implementtion: Reltionl lger: More opertionl, very useful for representing execution plns. Reltionl Clculus: Lets users descrie wht they wnt, rther thn how to compute it. (Nonopertionl,declrtive.) 3

4 Wht is Reltionl lger? n lger whose opernds re reltions or vriles tht represent reltions. Opertors re designed to do the most common things tht we need to do with reltions in dtse. The result is n lger tht cn e used s query lnguge for reltions. 4

5 Reltionl lger Procedurl lnguge Six sic opertors select project union set difference Crtesin product renme The opertors tke one or more reltions s inputs nd give new reltion s result. Dtse System Concepts 3.5 Silerschtz, Korth nd Sudrshn

6 Select Opertion Exmple Reltion r B C D =B ^ D > 5 (r) B C D Dtse System Concepts 3.6 Silerschtz, Korth nd Sudrshn

7 Select Opertion Nottion: p (r) p is clled the selection predicte Defined s: p (r) = {t t r nd p(t)} Where p is formul in propositionl clculus consisting of terms connected y : (nd), (or), (not) Ech term is one of: <ttriute> op <ttriute> or <constnt> where op is one of: =,, >,. <. Exmple of selection: rnch-nme= Perryridge (ccount) Dtse System Concepts 3.7 Silerschtz, Korth nd Sudrshn

8 Project Opertion Exmple Reltion r: B C ,C (r) C C = Dtse System Concepts 3.8 Silerschtz, Korth nd Sudrshn

9 Project Opertion Nottion:,,, k (r) where, re ttriute nmes nd r is reltion nme. The result is defined s the reltion of k columns otined y ersing the columns tht re not listed Duplicte rows removed from result, since reltions re sets E.g. To eliminte the rnch-nme ttriute of ccount ccount-numer, lnce (ccount) Dtse System Concepts 3.9 Silerschtz, Korth nd Sudrshn

10 Union Opertion Exmple Reltions r, s: B B 3 r s r s: B 3 Dtse System Concepts 3.0 Silerschtz, Korth nd Sudrshn

11 Union Opertion Nottion: r s Defined s: r s = {t t r or t s} For r s to e vlid.. r, s must hve the sme rity (sme numer of ttriutes). The ttriute domins must e comptile (e.g., nd column of r dels with the sme type of vlues s does the nd column of s) E.g. to find ll customers with either n ccount or lon customer-nme (depositor) customer-nme (orrower) Dtse System Concepts 3. Silerschtz, Korth nd Sudrshn

12 Set Difference Opertion Exmple Reltions r, s: B B 3 r s r s: B Dtse System Concepts 3. Silerschtz, Korth nd Sudrshn

13 Set Difference Opertion Nottion r s Defined s: r s = {t t r nd t s} Set differences must e tken etween comptile reltions. r nd s must hve the sme rity ttriute domins of r nd s must e comptile Dtse System Concepts 3.3 Silerschtz, Korth nd Sudrshn

14 Crtesin-Product Opertion-Exmple Reltions r, s: B C D E r r x s: s B C D E Dtse System Concepts 3.4 Silerschtz, Korth nd Sudrshn

15 Nottion r x s Defined s: Crtesin-Product Opertion r x s = {t q t r nd q s} ssume tht ttriutes of r(r) nd s(s) re disjoint. (Tht is, R S = ). If ttriutes of r(r) nd s(s) re not disjoint, then renming must e used. Dtse System Concepts 3.5 Silerschtz, Korth nd Sudrshn

16 Composition of Opertions Cn uild expressions using multiple opertions Exmple: =C (r x s) r x s B C D E =C (r x s) B C D E Dtse System Concepts 3.6 Silerschtz, Korth nd Sudrshn

17 Renme Opertion llows us to nme, nd therefore to refer to, the results of reltionl-lger expressions. llows us to refer to reltion y more thn one nme. Exmple: x (E) returns the expression E under the nme X If reltionl-lger expression E hs rity n, then x (,,, n) (E) returns the result of expression E under the nme X, nd with the ttriutes renmed to,,., n. Dtse System Concepts 3.7 Silerschtz, Korth nd Sudrshn

18 Bnking Exmple rnch (rnch-nme, rnch-city, ssets) customer (customer-nme, customer-street, customer-only) ccount (ccount-numer, rnch-nme, lnce) lon (lon-numer, rnch-nme, mount) depositor (customer-nme, ccount-numer) orrower (customer-nme, lon-numer) Dtse System Concepts 3.8 Silerschtz, Korth nd Sudrshn

19 Exmple Queries Find ll lons of over $00 mount > 00 (lon) Find the lon numer for ech lon of n mount greter thn $00 lon-numer ( mount > 00 (lon)) Dtse System Concepts 3.9 Silerschtz, Korth nd Sudrshn

20 Exmple Queries Find the nmes of ll customers who hve lon, n ccount, or oth, from the nk customer-nme (orrower) customer-nme (depositor) Find the nmes of ll customers who hve lon nd n ccount t nk. customer-nme (orrower) customer-nme (depositor) Dtse System Concepts 3.0 Silerschtz, Korth nd Sudrshn

21 Exmple Queries Find the nmes of ll customers who hve lon t the Perryridge rnch. customer-nme ( rnch-nme= Perryridge ( orrower.lon-numer = lon.lon-numer (orrower x lon))) Find the nmes of ll customers who hve lon t the Perryridge rnch ut do not hve n ccount t ny rnch of the nk. customer-nme ( rnch-nme = Perryridge ( orrower.lon-numer = lon.lon-numer (orrower x lon))) customer-nme (depositor) Dtse System Concepts 3. Silerschtz, Korth nd Sudrshn

22 Exmple Queries Find the nmes of ll customers who hve lon t the Perryridge rnch. Query customer-nme ( rnch-nme = Perryridge ( orrower.lon-numer = lon.lon-numer (orrower x lon))) Query customer-nme ( lon.lon-numer = orrower.lon-numer ( ( rnch-nme = Perryridge (lon)) x orrower)) Dtse System Concepts 3. Silerschtz, Korth nd Sudrshn

23 Find the lrgest ccount lnce Renme ccount reltion s d The query is: Exmple Queries lnce (ccount) - ccount.lnce ( ccount.lnce < d.lnce (ccount x d (ccount))) Dtse System Concepts 3.3 Silerschtz, Korth nd Sudrshn

24 Forml Definition sic expression in the reltionl lger consists of either one of the following: reltion in the dtse constnt reltion Let E nd E e reltionl-lger expressions; the following re ll reltionl-lger expressions: E E E - E E x E p (E ), P is predicte on ttriutes in E s (E ), S is list consisting of some of the ttriutes in E x (E ), x is the new nme for the result of E Dtse System Concepts 3.4 Silerschtz, Korth nd Sudrshn

25 dditionl Opertions We define dditionl opertions tht do not dd ny power to the reltionl lger, ut tht simplify common queries. Set intersection Nturl join Division ssignment Dtse System Concepts 3.5 Silerschtz, Korth nd Sudrshn

26 Set-Intersection Opertion Nottion: r s Defined s: r s ={ t t r nd t s } ssume: r, s hve the sme rity ttriutes of r nd s re comptile Note: r s = r - (r - s) Dtse System Concepts 3.6 Silerschtz, Korth nd Sudrshn

27 Set-Intersection Opertion - Exmple Reltion r, s: B B 3 r s r s B Dtse System Concepts 3.7 Silerschtz, Korth nd Sudrshn

28 Nottion: r s Nturl-Join Opertion Let r nd s e reltions on schems R nd S respectively. Then, r s is reltion on schem R S otined s follows: Consider ech pir of tuples t r from r nd t s from s. If t r nd t s hve the sme vlue on ech of the ttriutes in R S, dd tuple t to the result, where Exmple: t hs the sme vlue s t r on r t hs the sme vlue s t s on s R = (, B, C, D) S = (E, B, D) Result schem = (, B, C, D, E) r s is defined s: r., r.b, r.c, r.d, s.e ( r.b = s.b r.d = s.d (r x s)) Dtse System Concepts 3.8 Silerschtz, Korth nd Sudrshn

29 Silerschtz, Korth nd Sudrshn 3.9 Dtse System Concepts Nturl Join Opertion Exmple Reltions r, s: B 4 C D B 3 3 D E r B C D E s r s

30 Division Opertion Suited to queries tht include the phrse for ll. Let r nd s e reltions on schems R nd S respectively where R = (,, m, B,, B n ) S = (B,, B n ) The result of r s is reltion on schem R S = (,, m ) r s r s = { t t R-S (r) u s ( tu r ) } Dtse System Concepts 3.30 Silerschtz, Korth nd Sudrshn

31 Silerschtz, Korth nd Sudrshn 3.3 Dtse System Concepts Division Opertion Exmple Reltions r, s: r s: B B r s

32 Silerschtz, Korth nd Sudrshn 3.3 Dtse System Concepts nother Division Exmple B C D E 3 Reltions r, s: r s: D E B C r s

33 Division Opertion (Cont.) Property Let q r s Then q is the lrgest reltion stisfying q x s r Definition in terms of the sic lger opertion Let r(r) nd s(s) e reltions, nd let S R r s = R-S (r) R-S ( ( R-S (r) x s) R-S,S (r)) To see why R-S,S (r) simply reorders ttriutes of r R-S ( R-S (r) x s) R-S,S (r)) gives those tuples t in R-S (r) such tht for some tuple u s, tu r. Dtse System Concepts 3.33 Silerschtz, Korth nd Sudrshn

34 ssignment Opertion The ssignment opertion () provides convenient wy to express complex queries. Write query s sequentil progrm consisting of series of ssignments followed y n expression whose vlue is displyed s result of the query. ssignment must lwys e mde to temporry reltion vrile. Exmple: Write r s s temp R-S (r) temp R-S ((temp x s) R-S,S (r)) result = temp temp The result to the right of the is ssigned to the reltion vrile on the left of the. My use vrile in susequent expressions. Dtse System Concepts 3.34 Silerschtz, Korth nd Sudrshn

35 Exmple Queries Find ll customers who hve n ccount from t lest the Downtown nd the Uptown rnches. Query CN ( BN= Downtown (depositor ccount)) CN ( BN= Uptown (depositor ccount)) where CN denotes customer-nme nd BN denotes rnch-nme. Query customer-nme, rnch-nme (depositor ccount) temp(rnch-nme) ({( Downtown ), ( Uptown )}) Dtse System Concepts 3.35 Silerschtz, Korth nd Sudrshn

36 Exmple Queries Find ll customers who hve n ccount t ll rnches locted in Brooklyn city. customer-nme, rnch-nme (depositor ccount) rnch-nme ( rnch-city = Brooklyn (rnch)) Dtse System Concepts 3.36 Silerschtz, Korth nd Sudrshn

RELATIONAL MODEL.

RELATIONAL MODEL. RELATIONAL MODEL Structure of Reltionl Dtbses Reltionl Algebr Tuple Reltionl Clculus Domin Reltionl Clculus Extended Reltionl-Algebr- Opertions Modifiction of the Dtbse Views EXAMPLE OF A RELATION BASIC

More information

INF1383 -Bancos de Dados

INF1383 -Bancos de Dados 3//0 INF383 -ncos de Ddos Prof. Sérgio Lifschitz DI PUC-Rio Eng. Computção, Sistems de Informção e Ciênci d Computção LGER RELCIONL lguns slides sedos ou modificdos dos originis em Elmsri nd Nvthe, Fundmentls

More information

DATABASE DESIGN I - 1DL300

DATABASE DESIGN I - 1DL300 DATABASE DESIGN I - DL300 Fll 00 An introductory course on dtse systems http://www.it.uu.se/edu/course/homepge/dstekn/ht0/ Mnivskn Sesn Uppsl Dtse Lortory Deprtment of Informtion Technology, Uppsl University,

More information

DATABASTEKNIK - 1DL116

DATABASTEKNIK - 1DL116 DATABASTEKNIK - DL6 Spring 004 An introductury course on dtse systems http://user.it.uu.se/~udl/dt-vt004/ Kjell Orsorn Uppsl Dtse Lortory Deprtment of Informtion Technology, Uppsl University, Uppsl, Sweden

More information

Learning Goals. Relational Query Languages. Formal Relational Query Languages. Formal Query Languages: Relational Algebra and Relational Calculus

Learning Goals. Relational Query Languages. Formal Relational Query Languages. Formal Query Languages: Relational Algebra and Relational Calculus Forml Query Lnguges: Reltionl Alger nd Reltionl Clculus Chpter 4 Lerning Gols Given dtse ( set of tles ) you will e le to express dtse query in Reltionl Alger (RA), involving the sic opertors (selection,

More information

Chapter 2 Finite Automata

Chapter 2 Finite Automata Chpter 2 Finite Automt 28 2.1 Introduction Finite utomt: first model of the notion of effective procedure. (They lso hve mny other pplictions). The concept of finite utomton cn e derived y exmining wht

More information

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 4 1. UsetheproceduredescriedinLemm1.55toconverttheregulrexpression(((00) (11)) 01) into n NFA. Answer: 0 0 1 1 00 0 0 11 1 1 01 0 1 (00)

More information

Reasoning and programming. Lecture 5: Invariants and Logic. Boolean expressions. Reasoning. Examples

Reasoning and programming. Lecture 5: Invariants and Logic. Boolean expressions. Reasoning. Examples Chir of Softwre Engineering Resoning nd progrmming Einführung in die Progrmmierung Introduction to Progrmming Prof. Dr. Bertrnd Meyer Octoer 2006 Ferury 2007 Lecture 5: Invrints nd Logic Logic is the sis

More information

Homework 3 Solutions

Homework 3 Solutions CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 3 Solutions 1. Give NFAs with the specified numer of sttes recognizing ech of the following lnguges. In ll cses, the lphet is Σ = {,1}.

More information

Linear Inequalities. Work Sheet 1

Linear Inequalities. Work Sheet 1 Work Sheet 1 Liner Inequlities Rent--Hep, cr rentl compny,chrges $ 15 per week plus $ 0.0 per mile to rent one of their crs. Suppose you re limited y how much money you cn spend for the week : You cn spend

More information

CS 330 Formal Methods and Models Dana Richards, George Mason University, Spring 2016 Quiz Solutions

CS 330 Formal Methods and Models Dana Richards, George Mason University, Spring 2016 Quiz Solutions CS 330 Forml Methods nd Models Dn Richrds, George Mson University, Spring 2016 Quiz Solutions Quiz 1, Propositionl Logic Dte: Ferury 9 1. (4pts) ((p q) (q r)) (p r), prove tutology using truth tles. p

More information

CS 330 Formal Methods and Models

CS 330 Formal Methods and Models CS 330 Forml Methods nd Models Dn Richrds, George Mson University, Spring 2017 Quiz Solutions Quiz 1, Propositionl Logic Dte: Ferury 2 1. Prove ((( p q) q) p) is tutology () (3pts) y truth tle. p q p q

More information

p-adic Egyptian Fractions

p-adic Egyptian Fractions p-adic Egyptin Frctions Contents 1 Introduction 1 2 Trditionl Egyptin Frctions nd Greedy Algorithm 2 3 Set-up 3 4 p-greedy Algorithm 5 5 p-egyptin Trditionl 10 6 Conclusion 1 Introduction An Egyptin frction

More information

Coalgebra, Lecture 15: Equations for Deterministic Automata

Coalgebra, Lecture 15: Equations for Deterministic Automata Colger, Lecture 15: Equtions for Deterministic Automt Julin Slmnc (nd Jurrin Rot) Decemer 19, 2016 In this lecture, we will study the concept of equtions for deterministic utomt. The notes re self contined

More information

The Regulated and Riemann Integrals

The Regulated and Riemann Integrals Chpter 1 The Regulted nd Riemnn Integrls 1.1 Introduction We will consider severl different pproches to defining the definite integrl f(x) dx of function f(x). These definitions will ll ssign the sme vlue

More information

Overview of Today s Lecture:

Overview of Today s Lecture: CPS 4 Computer Orgniztion nd Progrmming Lecture : Boolen Alger & gtes. Roert Wgner CPS4 BA. RW Fll 2 Overview of Tody s Lecture: Truth tles, Boolen functions, Gtes nd Circuits Krnugh mps for simplifying

More information

Boolean Algebra. Boolean Algebra

Boolean Algebra. Boolean Algebra Boolen Alger Boolen Alger A Boolen lger is set B of vlues together with: - two inry opertions, commonly denoted y + nd, - unry opertion, usully denoted y ˉ or ~ or, - two elements usully clled zero nd

More information

Riemann Sums and Riemann Integrals

Riemann Sums and Riemann Integrals Riemnn Sums nd Riemnn Integrls Jmes K. Peterson Deprtment of Biologicl Sciences nd Deprtment of Mthemticl Sciences Clemson University August 26, 203 Outline Riemnn Sums Riemnn Integrls Properties Abstrct

More information

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun:

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun: CMPU 240 Lnguge Theory nd Computtion Spring 2019 NFAs nd Regulr Expressions Lst clss: Introduced nondeterministic finite utomt with -trnsitions Tody: Prove n NFA- is no more powerful thn n NFA Introduce

More information

CSE : Exam 3-ANSWERS, Spring 2011 Time: 50 minutes

CSE : Exam 3-ANSWERS, Spring 2011 Time: 50 minutes CSE 260-002: Exm 3-ANSWERS, Spring 20 ime: 50 minutes Nme: his exm hs 4 pges nd 0 prolems totling 00 points. his exm is closed ook nd closed notes.. Wrshll s lgorithm for trnsitive closure computtion is

More information

Bob Brown Math 251 Calculus 1 Chapter 5, Section 4 1 CCBC Dundalk

Bob Brown Math 251 Calculus 1 Chapter 5, Section 4 1 CCBC Dundalk Bo Brown Mth Clculus Chpter, Section CCBC Dundlk The Fundmentl Theorem of Clculus Informlly, the Fundmentl Theorem of Clculus (FTC) sttes tht differentition nd definite integrtion re inverse opertions

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Finite Automt Theory nd Forml Lnguges TMV027/DIT321 LP4 2018 Lecture 10 An Bove April 23rd 2018 Recp: Regulr Lnguges We cn convert between FA nd RE; Hence both FA nd RE ccept/generte regulr lnguges; More

More information

Minimal DFA. minimal DFA for L starting from any other

Minimal DFA. minimal DFA for L starting from any other Miniml DFA Among the mny DFAs ccepting the sme regulr lnguge L, there is exctly one (up to renming of sttes) which hs the smllest possile numer of sttes. Moreover, it is possile to otin tht miniml DFA

More information

Riemann Sums and Riemann Integrals

Riemann Sums and Riemann Integrals Riemnn Sums nd Riemnn Integrls Jmes K. Peterson Deprtment of Biologicl Sciences nd Deprtment of Mthemticl Sciences Clemson University August 26, 2013 Outline 1 Riemnn Sums 2 Riemnn Integrls 3 Properties

More information

Boolean algebra.

Boolean algebra. http://en.wikipedi.org/wiki/elementry_boolen_lger Boolen lger www.tudorgir.com Computer science is not out computers, it is out computtion nd informtion. computtion informtion computer informtion Turing

More information

Parse trees, ambiguity, and Chomsky normal form

Parse trees, ambiguity, and Chomsky normal form Prse trees, miguity, nd Chomsky norml form In this lecture we will discuss few importnt notions connected with contextfree grmmrs, including prse trees, miguity, nd specil form for context-free grmmrs

More information

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4 Intermedite Mth Circles Wednesdy, Novemer 14, 2018 Finite Automt II Nickols Rollick nrollick@uwterloo.c Regulr Lnguges Lst time, we were introduced to the ide of DFA (deterministic finite utomton), one

More information

Section 6.1 INTRO to LAPLACE TRANSFORMS

Section 6.1 INTRO to LAPLACE TRANSFORMS Section 6. INTRO to LAPLACE TRANSFORMS Key terms: Improper Integrl; diverge, converge A A f(t)dt lim f(t)dt Piecewise Continuous Function; jump discontinuity Function of Exponentil Order Lplce Trnsform

More information

Introduction to Electrical & Electronic Engineering ENGG1203

Introduction to Electrical & Electronic Engineering ENGG1203 Introduction to Electricl & Electronic Engineering ENGG23 2 nd Semester, 27-8 Dr. Hden Kwok-H So Deprtment of Electricl nd Electronic Engineering Astrction DIGITAL LOGIC 2 Digitl Astrction n Astrct ll

More information

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.) CS 373, Spring 29. Solutions to Mock midterm (sed on first midterm in CS 273, Fll 28.) Prolem : Short nswer (8 points) The nswers to these prolems should e short nd not complicted. () If n NF M ccepts

More information

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 utomt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Prolem (II) Chpter II.5.: Properties of Context Free Grmmrs (14) nton Setzer (Bsed on ook drft y J. V. Tucker nd K. Stephenson)

More information

Symbolic enumeration methods for unlabelled structures

Symbolic enumeration methods for unlabelled structures Go & Šjn, Comintoril Enumertion Notes 4 Symolic enumertion methods for unlelled structures Definition A comintoril clss is finite or denumerle set on which size function is defined, stisfying the following

More information

Designing Information Devices and Systems I Discussion 8B

Designing Information Devices and Systems I Discussion 8B Lst Updted: 2018-10-17 19:40 1 EECS 16A Fll 2018 Designing Informtion Devices nd Systems I Discussion 8B 1. Why Bother With Thévenin Anywy? () Find Thévenin eqiuvlent for the circuit shown elow. 2kΩ 5V

More information

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton 25. Finite Automt AUTOMATA AND LANGUAGES A system of computtion tht only hs finite numer of possile sttes cn e modeled using finite utomton A finite utomton is often illustrted s stte digrm d d d. d q

More information

Nondeterminism and Nodeterministic Automata

Nondeterminism and Nodeterministic Automata Nondeterminism nd Nodeterministic Automt 61 Nondeterminism nd Nondeterministic Automt The computtionl mchine models tht we lerned in the clss re deterministic in the sense tht the next move is uniquely

More information

The area under the graph of f and above the x-axis between a and b is denoted by. f(x) dx. π O

The area under the graph of f and above the x-axis between a and b is denoted by. f(x) dx. π O 1 Section 5. The Definite Integrl Suppose tht function f is continuous nd positive over n intervl [, ]. y = f(x) x The re under the grph of f nd ove the x-xis etween nd is denoted y f(x) dx nd clled the

More information

378 Relations Solutions for Chapter 16. Section 16.1 Exercises. 3. Let A = {0,1,2,3,4,5}. Write out the relation R that expresses on A.

378 Relations Solutions for Chapter 16. Section 16.1 Exercises. 3. Let A = {0,1,2,3,4,5}. Write out the relation R that expresses on A. 378 Reltions 16.7 Solutions for Chpter 16 Section 16.1 Exercises 1. Let A = {0,1,2,3,4,5}. Write out the reltion R tht expresses > on A. Then illustrte it with digrm. 2 1 R = { (5,4),(5,3),(5,2),(5,1),(5,0),(4,3),(4,2),(4,1),

More information

Things to Memorize: A Partial List. January 27, 2017

Things to Memorize: A Partial List. January 27, 2017 Things to Memorize: A Prtil List Jnury 27, 2017 Chpter 2 Vectors - Bsic Fcts A vector hs mgnitude (lso clled size/length/norm) nd direction. It does not hve fixed position, so the sme vector cn e moved

More information

AT100 - Introductory Algebra. Section 2.7: Inequalities. x a. x a. x < a

AT100 - Introductory Algebra. Section 2.7: Inequalities. x a. x a. x < a Section 2.7: Inequlities In this section, we will Determine if given vlue is solution to n inequlity Solve given inequlity or compound inequlity; give the solution in intervl nottion nd the solution 2.7

More information

Finite Automata-cont d

Finite Automata-cont d Automt Theory nd Forml Lnguges Professor Leslie Lnder Lecture # 6 Finite Automt-cont d The Pumping Lemm WEB SITE: http://ingwe.inghmton.edu/ ~lnder/cs573.html Septemer 18, 2000 Exmple 1 Consider L = {ww

More information

Lecture Solution of a System of Linear Equation

Lecture Solution of a System of Linear Equation ChE Lecture Notes, Dept. of Chemicl Engineering, Univ. of TN, Knoville - D. Keffer, 5/9/98 (updted /) Lecture 8- - Solution of System of Liner Eqution 8. Why is it importnt to e le to solve system of liner

More information

Continuous Random Variables Class 5, Jeremy Orloff and Jonathan Bloom

Continuous Random Variables Class 5, Jeremy Orloff and Jonathan Bloom Lerning Gols Continuous Rndom Vriles Clss 5, 8.05 Jeremy Orloff nd Jonthn Bloom. Know the definition of continuous rndom vrile. 2. Know the definition of the proility density function (pdf) nd cumultive

More information

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3 2 The Prllel Circuit Electric Circuits: Figure 2- elow show ttery nd multiple resistors rrnged in prllel. Ech resistor receives portion of the current from the ttery sed on its resistnce. The split is

More information

Lecture 3: Equivalence Relations

Lecture 3: Equivalence Relations Mthcmp Crsh Course Instructor: Pdric Brtlett Lecture 3: Equivlence Reltions Week 1 Mthcmp 2014 In our lst three tlks of this clss, we shift the focus of our tlks from proof techniques to proof concepts

More information

Software Engineering using Formal Methods

Software Engineering using Formal Methods Softwre Engineering using Forml Methods Propositionl nd (Liner) Temporl Logic Wolfgng Ahrendt 13th Septemer 2016 SEFM: Liner Temporl Logic /GU 160913 1 / 60 Recpitultion: FormlistionFormlistion: Syntx,

More information

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1 Chpter Five: Nondeterministic Finite Automt Forml Lnguge, chpter 5, slide 1 1 A DFA hs exctly one trnsition from every stte on every symol in the lphet. By relxing this requirement we get relted ut more

More information

Chapter 9 Definite Integrals

Chapter 9 Definite Integrals Chpter 9 Definite Integrls In the previous chpter we found how to tke n ntiderivtive nd investigted the indefinite integrl. In this chpter the connection etween ntiderivtives nd definite integrls is estlished

More information

CS 330 Formal Methods and Models

CS 330 Formal Methods and Models CS 0 Forml Methods nd Models Dn Richrds, George Mson University, Fll 2016 Quiz Solutions Quiz 1, Propositionl Logic Dte: Septemer 8 1. Prove q (q p) p q p () (4pts) with truth tle. p q p q p (q p) p q

More information

Lecture 3: Curves in Calculus. Table of contents

Lecture 3: Curves in Calculus. Table of contents Mth 348 Fll 7 Lecture 3: Curves in Clculus Disclimer. As we hve textook, this lecture note is for guidnce nd supplement only. It should not e relied on when prepring for exms. In this lecture we set up

More information

P 1 (x 1, y 1 ) is given by,.

P 1 (x 1, y 1 ) is given by,. MA00 Clculus nd Bsic Liner Alger I Chpter Coordinte Geometr nd Conic Sections Review In the rectngulr/crtesin coordintes sstem, we descrie the loction of points using coordintes. P (, ) P(, ) O The distnce

More information

CHAPTER 1 Regular Languages. Contents

CHAPTER 1 Regular Languages. Contents Finite Automt (FA or DFA) CHAPTE 1 egulr Lnguges Contents definitions, exmples, designing, regulr opertions Non-deterministic Finite Automt (NFA) definitions, euivlence of NFAs nd DFAs, closure under regulr

More information

Geometric Sequences. Geometric Sequence a sequence whose consecutive terms have a common ratio.

Geometric Sequences. Geometric Sequence a sequence whose consecutive terms have a common ratio. Geometric Sequences Geometric Sequence sequence whose consecutive terms hve common rtio. Geometric Sequence A sequence is geometric if the rtios of consecutive terms re the sme. 2 3 4... 2 3 The number

More information

Handout: Natural deduction for first order logic

Handout: Natural deduction for first order logic MATH 457 Introduction to Mthemticl Logic Spring 2016 Dr Json Rute Hndout: Nturl deduction for first order logic We will extend our nturl deduction rules for sententil logic to first order logic These notes

More information

Resources. Introduction: Binding. Resource Types. Resource Sharing. The type of a resource denotes its ability to perform different operations

Resources. Introduction: Binding. Resource Types. Resource Sharing. The type of a resource denotes its ability to perform different operations Introduction: Binding Prt of 4-lecture introduction Scheduling Resource inding Are nd performnce estimtion Control unit synthesis This lecture covers Resources nd resource types Resource shring nd inding

More information

1 Sets Functions and Relations Mathematical Induction Equivalence of Sets and Countability The Real Numbers...

1 Sets Functions and Relations Mathematical Induction Equivalence of Sets and Countability The Real Numbers... Contents 1 Sets 1 1.1 Functions nd Reltions....................... 3 1.2 Mthemticl Induction....................... 5 1.3 Equivlence of Sets nd Countbility................ 6 1.4 The Rel Numbers..........................

More information

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9.

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9. Regulr Expressions, Pumping Lemm, Right Liner Grmmrs Ling 106 Mrch 25, 2002 1 Regulr Expressions A regulr expression descries or genertes lnguge: it is kind of shorthnd for listing the memers of lnguge.

More information

Lecture 08: Feb. 08, 2019

Lecture 08: Feb. 08, 2019 4CS4-6:Theory of Computtion(Closure on Reg. Lngs., regex to NDFA, DFA to regex) Prof. K.R. Chowdhry Lecture 08: Fe. 08, 2019 : Professor of CS Disclimer: These notes hve not een sujected to the usul scrutiny

More information

SOLVING SYSTEMS OF EQUATIONS, ITERATIVE METHODS

SOLVING SYSTEMS OF EQUATIONS, ITERATIVE METHODS ELM Numericl Anlysis Dr Muhrrem Mercimek SOLVING SYSTEMS OF EQUATIONS, ITERATIVE METHODS ELM Numericl Anlysis Some of the contents re dopted from Lurene V. Fusett, Applied Numericl Anlysis using MATLAB.

More information

Improper Integrals, and Differential Equations

Improper Integrals, and Differential Equations Improper Integrls, nd Differentil Equtions October 22, 204 5.3 Improper Integrls Previously, we discussed how integrls correspond to res. More specificlly, we sid tht for function f(x), the region creted

More information

Lecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations.

Lecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations. Lecture 3 3 Solving liner equtions In this lecture we will discuss lgorithms for solving systems of liner equtions Multiplictive identity Let us restrict ourselves to considering squre mtrices since one

More information

CS 330 Formal Methods and Models

CS 330 Formal Methods and Models CS 330 Forml Methods nd Models Dn Richrds, section 003, George Mson University, Fll 2017 Quiz Solutions Quiz 1, Propositionl Logic Dte: Septemer 7 1. Prove (p q) (p q), () (5pts) using truth tles. p q

More information

STRUCTURE OF CONCURRENCY Ryszard Janicki. Department of Computing and Software McMaster University Hamilton, ON, L8S 4K1 Canada

STRUCTURE OF CONCURRENCY Ryszard Janicki. Department of Computing and Software McMaster University Hamilton, ON, L8S 4K1 Canada STRUCTURE OF CONCURRENCY Ryszrd Jnicki Deprtment of Computing nd Softwre McMster University Hmilton, ON, L8S 4K1 Cnd jnicki@mcmster.c 1 Introduction Wht is concurrency? How it cn e modelled? Wht re the

More information

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2 CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt

More information

Bases for Vector Spaces

Bases for Vector Spaces Bses for Vector Spces 2-26-25 A set is independent if, roughly speking, there is no redundncy in the set: You cn t uild ny vector in the set s liner comintion of the others A set spns if you cn uild everything

More information

First Midterm Examination

First Midterm Examination Çnky University Deprtment of Computer Engineering 203-204 Fll Semester First Midterm Exmintion ) Design DFA for ll strings over the lphet Σ = {,, c} in which there is no, no nd no cc. 2) Wht lnguge does

More information

3 Regular expressions

3 Regular expressions 3 Regulr expressions Given n lphet Σ lnguge is set of words L Σ. So fr we were le to descrie lnguges either y using set theory (i.e. enumertion or comprehension) or y n utomton. In this section we shll

More information

Non-deterministic Finite Automata

Non-deterministic Finite Automata Non-deterministic Finite Automt Eliminting non-determinism Rdoud University Nijmegen Non-deterministic Finite Automt H. Geuvers nd T. vn Lrhoven Institute for Computing nd Informtion Sciences Intelligent

More information

SWEN 224 Formal Foundations of Programming WITH ANSWERS

SWEN 224 Formal Foundations of Programming WITH ANSWERS T E W H A R E W Ā N A N G A O T E Ū P O K O O T E I K A A M Ā U I VUW V I C T O R I A UNIVERSITY OF WELLINGTON Time Allowed: 3 Hours EXAMINATIONS 2011 END-OF-YEAR SWEN 224 Forml Foundtions of Progrmming

More information

Lecture 2: January 27

Lecture 2: January 27 CS 684: Algorithmic Gme Theory Spring 217 Lecturer: Év Trdos Lecture 2: Jnury 27 Scrie: Alert Julius Liu 2.1 Logistics Scrie notes must e sumitted within 24 hours of the corresponding lecture for full

More information

Before we can begin Ch. 3 on Radicals, we need to be familiar with perfect squares, cubes, etc. Try and do as many as you can without a calculator!!!

Before we can begin Ch. 3 on Radicals, we need to be familiar with perfect squares, cubes, etc. Try and do as many as you can without a calculator!!! Nme: Algebr II Honors Pre-Chpter Homework Before we cn begin Ch on Rdicls, we need to be fmilir with perfect squres, cubes, etc Try nd do s mny s you cn without clcultor!!! n The nth root of n n Be ble

More information

Matrix Algebra. Matrix Addition, Scalar Multiplication and Transposition. Linear Algebra I 24

Matrix Algebra. Matrix Addition, Scalar Multiplication and Transposition. Linear Algebra I 24 Mtrix lger Mtrix ddition, Sclr Multipliction nd rnsposition Mtrix lger Section.. Mtrix ddition, Sclr Multipliction nd rnsposition rectngulr rry of numers is clled mtrix ( the plurl is mtrices ) nd the

More information

Lecture 3 ( ) (translated and slightly adapted from lecture notes by Martin Klazar)

Lecture 3 ( ) (translated and slightly adapted from lecture notes by Martin Klazar) Lecture 3 (5.3.2018) (trnslted nd slightly dpted from lecture notes by Mrtin Klzr) Riemnn integrl Now we define precisely the concept of the re, in prticulr, the re of figure U(, b, f) under the grph of

More information

Homework Solution - Set 5 Due: Friday 10/03/08

Homework Solution - Set 5 Due: Friday 10/03/08 CE 96 Introduction to the Theory of Computtion ll 2008 Homework olution - et 5 Due: ridy 10/0/08 1. Textook, Pge 86, Exercise 1.21. () 1 2 Add new strt stte nd finl stte. Mke originl finl stte non-finl.

More information

First Midterm Examination

First Midterm Examination 24-25 Fll Semester First Midterm Exmintion ) Give the stte digrm of DFA tht recognizes the lnguge A over lphet Σ = {, } where A = {w w contins or } 2) The following DFA recognizes the lnguge B over lphet

More information

ɛ-closure, Kleene s Theorem,

ɛ-closure, Kleene s Theorem, DEGefW5wiGH2XgYMEzUKjEmtCDUsRQ4d 1 A nice pper relevnt to this course is titled The Glory of the Pst 2 NICTA Resercher, Adjunct t the Austrlin Ntionl University nd Griffith University ɛ-closure, Kleene

More information

Lecture 2e Orthogonal Complement (pages )

Lecture 2e Orthogonal Complement (pages ) Lecture 2e Orthogonl Complement (pges -) We hve now seen tht n orthonorml sis is nice wy to descrie suspce, ut knowing tht we wnt n orthonorml sis doesn t mke one fll into our lp. In theory, the process

More information

(e) if x = y + z and a divides any two of the integers x, y, or z, then a divides the remaining integer

(e) if x = y + z and a divides any two of the integers x, y, or z, then a divides the remaining integer Divisibility In this note we introduce the notion of divisibility for two integers nd b then we discuss the division lgorithm. First we give forml definition nd note some properties of the division opertion.

More information

set is not closed under matrix [ multiplication, ] and does not form a group.

set is not closed under matrix [ multiplication, ] and does not form a group. Prolem 2.3: Which of the following collections of 2 2 mtrices with rel entries form groups under [ mtrix ] multipliction? i) Those of the form for which c d 2 Answer: The set of such mtrices is not closed

More information

W. We shall do so one by one, starting with I 1, and we shall do it greedily, trying

W. We shall do so one by one, starting with I 1, and we shall do it greedily, trying Vitli covers 1 Definition. A Vitli cover of set E R is set V of closed intervls with positive length so tht, for every δ > 0 nd every x E, there is some I V with λ(i ) < δ nd x I. 2 Lemm (Vitli covering)

More information

dy ky, dt where proportionality constant k may be positive or negative

dy ky, dt where proportionality constant k may be positive or negative Section 1.2 Autonomous DEs of the form 0 The DE y is mthemticl model for wide vriety of pplictions. Some of the pplictions re descried y sying the rte of chnge of y(t) is proportionl to the mount present.

More information

CMSC 330: Organization of Programming Languages

CMSC 330: Organization of Programming Languages CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 CMSC 330 1 Types of Finite Automt Deterministic Finite Automt (DFA) Exctly one sequence of steps for ech string All exmples so fr Nondeterministic

More information

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb. CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt

More information

Designing finite automata II

Designing finite automata II Designing finite utomt II Prolem: Design DFA A such tht L(A) consists of ll strings of nd which re of length 3n, for n = 0, 1, 2, (1) Determine wht to rememer out the input string Assign stte to ech of

More information

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique? XII. LINEAR ALGEBRA: SOLVING SYSTEMS OF EQUATIONS Tody we re going to tlk out solving systems of liner equtions. These re prolems tht give couple of equtions with couple of unknowns, like: 6= x + x 7=

More information

Closure Properties of Regular Languages

Closure Properties of Regular Languages Closure Properties of Regulr Lnguges Regulr lnguges re closed under mny set opertions. Let L 1 nd L 2 e regulr lnguges. (1) L 1 L 2 (the union) is regulr. (2) L 1 L 2 (the conctention) is regulr. (3) L

More information

2.4 Linear Inequalities and Interval Notation

2.4 Linear Inequalities and Interval Notation .4 Liner Inequlities nd Intervl Nottion We wnt to solve equtions tht hve n inequlity symol insted of n equl sign. There re four inequlity symols tht we will look t: Less thn , Less thn or

More information

A Matrix Algebra Primer

A Matrix Algebra Primer A Mtrix Algebr Primer Mtrices, Vectors nd Sclr Multipliction he mtrix, D, represents dt orgnized into rows nd columns where the rows represent one vrible, e.g. time, nd the columns represent second vrible,

More information

CM10196 Topic 4: Functions and Relations

CM10196 Topic 4: Functions and Relations CM096 Topic 4: Functions nd Reltions Guy McCusker W. Functions nd reltions Perhps the most widely used notion in ll of mthemtics is tht of function. Informlly, function is n opertion which tkes n input

More information

Quadratic Forms. Quadratic Forms

Quadratic Forms. Quadratic Forms Qudrtic Forms Recll the Simon & Blume excerpt from n erlier lecture which sid tht the min tsk of clculus is to pproximte nonliner functions with liner functions. It s ctully more ccurte to sy tht we pproximte

More information

CS 311 Homework 3 due 16:30, Thursday, 14 th October 2010

CS 311 Homework 3 due 16:30, Thursday, 14 th October 2010 CS 311 Homework 3 due 16:30, Thursdy, 14 th Octoer 2010 Homework must e sumitted on pper, in clss. Question 1. [15 pts.; 5 pts. ech] Drw stte digrms for NFAs recognizing the following lnguges:. L = {w

More information

a,b a 1 a 2 a 3 a,b 1 a,b a,b 2 3 a,b a,b a 2 a,b CS Determinisitic Finite Automata 1

a,b a 1 a 2 a 3 a,b 1 a,b a,b 2 3 a,b a,b a 2 a,b CS Determinisitic Finite Automata 1 CS4 45- Determinisitic Finite Automt -: Genertors vs. Checkers Regulr expressions re one wy to specify forml lnguge String Genertor Genertes strings in the lnguge Deterministic Finite Automt (DFA) re nother

More information

4.1. Probability Density Functions

4.1. Probability Density Functions STT 1 4.1-4. 4.1. Proility Density Functions Ojectives. Continuous rndom vrile - vers - discrete rndom vrile. Proility density function. Uniform distriution nd its properties. Expected vlue nd vrince of

More information

5: The Definite Integral

5: The Definite Integral 5: The Definite Integrl 5.: Estimting with Finite Sums Consider moving oject its velocity (meters per second) t ny time (seconds) is given y v t = t+. Cn we use this informtion to determine the distnce

More information

along the vector 5 a) Find the plane s coordinate after 1 hour. b) Find the plane s coordinate after 2 hours. c) Find the plane s coordinate

along the vector 5 a) Find the plane s coordinate after 1 hour. b) Find the plane s coordinate after 2 hours. c) Find the plane s coordinate L8 VECTOR EQUATIONS OF LINES HL Mth - Sntowski Vector eqution of line 1 A plne strts journey t the point (4,1) moves ech hour long the vector. ) Find the plne s coordinte fter 1 hour. b) Find the plne

More information

State space systems analysis (continued) Stability. A. Definitions A system is said to be Asymptotically Stable (AS) when it satisfies

State space systems analysis (continued) Stability. A. Definitions A system is said to be Asymptotically Stable (AS) when it satisfies Stte spce systems nlysis (continued) Stbility A. Definitions A system is sid to be Asymptoticlly Stble (AS) when it stisfies ut () = 0, t > 0 lim xt () 0. t A system is AS if nd only if the impulse response

More information

Fundamental Theorem of Calculus

Fundamental Theorem of Calculus Fundmentl Theorem of Clculus Recll tht if f is nonnegtive nd continuous on [, ], then the re under its grph etween nd is the definite integrl A= f() d Now, for in the intervl [, ], let A() e the re under

More information

Combinational Logic. Precedence. Quick Quiz 25/9/12. Schematics à Boolean Expression. 3 Representations of Logic Functions. Dr. Hayden So.

Combinational Logic. Precedence. Quick Quiz 25/9/12. Schematics à Boolean Expression. 3 Representations of Logic Functions. Dr. Hayden So. 5/9/ Comintionl Logic ENGG05 st Semester, 0 Dr. Hyden So Representtions of Logic Functions Recll tht ny complex logic function cn e expressed in wys: Truth Tle, Boolen Expression, Schemtics Only Truth

More information

Advanced Calculus: MATH 410 Notes on Integrals and Integrability Professor David Levermore 17 October 2004

Advanced Calculus: MATH 410 Notes on Integrals and Integrability Professor David Levermore 17 October 2004 Advnced Clculus: MATH 410 Notes on Integrls nd Integrbility Professor Dvid Levermore 17 October 2004 1. Definite Integrls In this section we revisit the definite integrl tht you were introduced to when

More information

Scientific notation is a way of expressing really big numbers or really small numbers.

Scientific notation is a way of expressing really big numbers or really small numbers. Scientific Nottion (Stndrd form) Scientific nottion is wy of expressing relly big numbers or relly smll numbers. It is most often used in scientific clcultions where the nlysis must be very precise. Scientific

More information

Duality # Second iteration for HW problem. Recall our LP example problem we have been working on, in equality form, is given below.

Duality # Second iteration for HW problem. Recall our LP example problem we have been working on, in equality form, is given below. Dulity #. Second itertion for HW problem Recll our LP emple problem we hve been working on, in equlity form, is given below.,,,, 8 m F which, when written in slightly different form, is 8 F Recll tht we

More information