Solutions to Problem Set #1

Similar documents
Mid-Term Examination - Spring 2014 Mathematical Programming with Applications to Economics Total Score: 45; Time: 3 hours

Solutions for HW9. Bipartite: put the red vertices in V 1 and the black in V 2. Not bipartite!

Lecture 6: Coding theory

Algebra 2 Semester 1 Practice Final

CS 491G Combinatorial Optimization Lecture Notes

Lecture 8: Abstract Algebra

Factorising FACTORISING.

CIT 596 Theory of Computation 1. Graphs and Digraphs

1 PYTHAGORAS THEOREM 1. Given a right angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides.

The DOACROSS statement

Lesson 2.1 Inductive Reasoning

Lesson 2.1 Inductive Reasoning

F / x everywhere in some domain containing R. Then, + ). (10.4.1)

POSITIVE IMPLICATIVE AND ASSOCIATIVE FILTERS OF LATTICE IMPLICATION ALGEBRAS

Numbers and indices. 1.1 Fractions. GCSE C Example 1. Handy hint. Key point

18.06 Problem Set 4 Due Wednesday, Oct. 11, 2006 at 4:00 p.m. in 2-106

Section 2.3. Matrix Inverses

22: Union Find. CS 473u - Algorithms - Spring April 14, We want to maintain a collection of sets, under the operations of:

Chapter 4 State-Space Planning

Bisimulation, Games & Hennessy Milner logic

Graph Theory. Simple Graph G = (V, E). V={a,b,c,d,e,f,g,h,k} E={(a,b),(a,g),( a,h),(a,k),(b,c),(b,k),...,(h,k)}

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER MACHINES AND THEIR LANGUAGES ANSWERS

Proportions: A ratio is the quotient of two numbers. For example, 2 3

AP Calculus BC Chapter 8: Integration Techniques, L Hopital s Rule and Improper Integrals

Green s Theorem. (2x e y ) da. (2x e y ) dx dy. x 2 xe y. (1 e y ) dy. y=1. = y e y. y=0. = 2 e

System Validation (IN4387) November 2, 2012, 14:00-17:00

CS 360 Exam 2 Fall 2014 Name

I 3 2 = I I 4 = 2A

Linear Algebra Introduction

Counting Paths Between Vertices. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs

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

Surds and Indices. Surds and Indices. Curriculum Ready ACMNA: 233,

If the numbering is a,b,c,d 1,2,3,4, then the matrix representation is as follows:

Maximum size of a minimum watching system and the graphs achieving the bound

for all x in [a,b], then the area of the region bounded by the graphs of f and g and the vertical lines x = a and x = b is b [ ( ) ( )] A= f x g x dx

50 AMC Lectures Problem Book 2 (36) Substitution Method

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

DATABASE DESIGN I - 1DL300

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

Sturm-Liouville Theory

Lecture 2: Cayley Graphs

Polynomials. Polynomials. Curriculum Ready ACMNA:

Coalgebra, Lecture 15: Equations for Deterministic Automata

On Implicative and Strong Implicative Filters of Lattice Wajsberg Algebras

DATABASTEKNIK - 1DL116

Computing data with spreadsheets. Enter the following into the corresponding cells: A1: n B1: triangle C1: sqrt

QUADRATIC EQUATIONS OBJECTIVE PROBLEMS

CS 2204 DIGITAL LOGIC & STATE MACHINE DESIGN SPRING 2014

APPENDIX. Precalculus Review D.1. Real Numbers and the Real Number Line

QUADRATIC EQUATION. Contents

Nondeterministic Finite Automata

PYTHAGORAS THEOREM WHAT S IN CHAPTER 1? IN THIS CHAPTER YOU WILL:

QUADRATIC RESIDUES MATH 372. FALL INSTRUCTOR: PROFESSOR AITKEN

Project 6: Minigoals Towards Simplifying and Rewriting Expressions

For a, b, c, d positive if a b and. ac bd. Reciprocal relations for a and b positive. If a > b then a ab > b. then

Necessary and sucient conditions for some two. Abstract. Further we show that the necessary conditions for the existence of an OD(44 s 1 s 2 )

CSC2542 State-Space Planning

Total score: /100 points

CARLETON UNIVERSITY. 1.0 Problems and Most Solutions, Sect B, 2005

Boolean Algebra cont. The digital abstraction

Intermediate Math Circles Wednesday 17 October 2012 Geometry II: Side Lengths

AP Calculus AB Unit 4 Assessment

arxiv: v2 [math.co] 31 Oct 2016

Propositional models. Historical models of computation. Application: binary addition. Boolean functions. Implementation using switches.

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

1.2 What is a vector? (Section 2.2) Two properties (attributes) of a vector are and.

16z z q. q( B) Max{2 z z z z B} r z r z r z r z B. John Riley 19 October Econ 401A: Microeconomic Theory. Homework 2 Answers

Harvard University Computer Science 121 Midterm October 23, 2012

September 30, :24 WSPC/Guidelines Y4Spanner

Separable discrete functions: recognition and sufficient conditions

INF1383 -Bancos de Dados

Algorithms & Data Structures Homework 8 HS 18 Exercise Class (Room & TA): Submitted by: Peer Feedback by: Points:

CHENG Chun Chor Litwin The Hong Kong Institute of Education

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.

Unit 4. Combinational Circuits

Review: set theoretic definition of the numbers. Natural numbers:

DIFFERENCE BETWEEN TWO RIEMANN-STIELTJES INTEGRAL MEANS

Probability The Language of Chance P(A) Mathletics Instant Workbooks. Copyright

April 8, 2017 Math 9. Geometry. Solving vector problems. Problem. Prove that if vectors and satisfy, then.

Algorithm Design and Analysis

Exercise sheet 6: Solutions

MAT 403 NOTES 4. f + f =

Lesson 55 - Inverse of Matrices & Determinants

Technische Universität München Winter term 2009/10 I7 Prof. J. Esparza / J. Křetínský / M. Luttenberger 11. Februar Solution

Logic, Set Theory and Computability [M. Coppenbarger]

List all of the possible rational roots of each equation. Then find all solutions (both real and imaginary) of the equation. 1.

Vectors , (0,0). 5. A vector is commonly denoted by putting an arrow above its symbol, as in the picture above. Here are some 3-dimensional vectors:

Monochromatic Plane Matchings in Bicolored Point Set

6.5 Improper integrals

Farey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University

Exercises with (Some) Solutions

ON LEFT(RIGHT) SEMI-REGULAR AND g-reguar po-semigroups. Sang Keun Lee

Boolean Algebra. Boolean Algebra

Introduction to Olympiad Inequalities

Discrete Structures Lecture 11

Closure Properties of Regular Languages

CS 330 Formal Methods and Models

Answers and Solutions to (Some Even Numbered) Suggested Exercises in Chapter 11 of Grimaldi s Discrete and Combinatorial Mathematics

SOME INTEGRAL INEQUALITIES FOR HARMONICALLY CONVEX STOCHASTIC PROCESSES ON THE CO-ORDINATES

Chapter Five - Eigenvalues, Eigenfunctions, and All That

Transcription:

CSE 233 Spring, 2016 Solutions to Prolem Set #1 1. The movie tse onsists of the following two reltions movie: title, iretor, tor sheule: theter, title The first reltion provies titles, iretors, n tors of vrious movies. Assume movie is uniquely ientifie y its title. Do not ssume tht movie hs unique iretor (so movie y Hithok is one for whih one of the iretors is Hithok). The seon reltion provies the titles of urrently plying movies n the theters where they re eing shown. Express the following queries in (i) reltionl lulus n (ii) reltionl lger. () List the theters showing some movie y Hithok. (i) {t : th x (sheule(t, x) movie(x, Hithok, ))} (ii) π th (sheule π title (σ iretor=hithok (movie))) () List the theters showing only movies y Hithok. (i) {t : th x(sh(t, x)) x[sh(t, x) (movie(x, Hith, ))]} With tive omin semntis, the onjunt x(sh(t, x)) is neee to mke sure t is theter. (ii) π th (sh) π th [sh (π title (movie) π title (σ ir=hith (movie)))] 2. The ivision inry opertor on reltions is efine s follows. Given reltions P n Q for whih tt(q) tt(p ), P Q is reltion with ttriutes tt(p ) tt(q) ontining the tuples t for whih {t} Q P. For exmple, if tt(p ) = {A, B} n tt(q) = {B}, P Q is the reltion with ttriute {A} ontining the tuples for whih, P for every tuple Q. Intuitively, is iret implementtion of universl quntifition. 1

(i) Use (n stnr lger opertors) to express the query List the theters showing every movie y Hithok. sheule π title (σ ir=hith (movie)) (ii) Show how P Q n e expresse using the stnr reltionl lger opertors (you n ssume, for simpliity, tht tt(p ) = {A, B} n tt(q) = {B}). π A (P ) π A [π A (P ) Q P ] 3. Consier the following query on the ove sheule reltion: Fin the theters showing more thn one title (i) Express this query in reltionl lulus n reltionl lger. {t : th x 1 x 2 (sh(t, x 1 ) sh(t, x 2 ) x 1 x 2 )} π th (σ title title1 (sheule δ title title1 (sheule))) (σ A B (e) stns for e σ A=B (e)). (ii) ( ) Prove tht every reltionl lger expression efining the ove query must use the ttriute renming opertor δ. Suppose e expresses the query n uses no δ. In the proof elow we lso ssume tht e uses no onstnt reltions (the proof with onstnt reltions is slightly more omplite ut follows the sme lines). However, e my use seletion with onstnts. Let I e the instne of sh: sh th title 1 2 3 where e oes not use seletion with ny of the onstnts in C = {,, 1, 2, 3}. Consier ny reltionl lger expression f over sh 2

using no renming n no onstnts in C (e is one suh expression). Denote y tt(f) the set of ttriutes of the result of f. Oviously, tt(f) {th, title} sine no renming is use. We enote y I the reltion π th (I) π title (I) n Ī = (I) I. We show y struturl inution the following: if f hs one ttriute A {th, title}, then f(i) = or f(i) = π A (I). if tt(f) = {th, title} then f(i) {, I, Ī, (I)} Note tht this shows tht e nnot express the esire query, sine tt(e) = {th} so y the ove e(i) must equl or π th (I), neither of whih is the esire nswer {}. Bsis f = sh. Then tt(f) = {th, title} n f(i) = I. Inution step We onsier the following ses, where f 1 n f 2 re lger expressions over sh ssume, y the inution hypothesis, to stisfy the ove sttement: f = σ A= (f 1 ). Then f(i) =, sine C, so f 1 (I) oes not ontin. f = σ A=B (f 1 ). Then tt(f 1 ) = {th, title}, so A = th n B = title (or onversely). By the inution hypothesis, f 1 (I) {, I, Ī, (I)}, so σ A=B(f 1 (I)) =. f = π A (f 1 ). We n ssume wlog 1 tht tt(f 1 ) = {th, title}. By the inution hypothesis, f 1 (I) {, I, Ī, (I)}. It follows tht f(i) is either empty or equls π A (I). f is f 1 f 2, f 1 f 2, or f 1 f 2. By the inution hypothesis, f j (I) {, π th (I), π title (I), I, Ī, (I)}. By onsiering ll possiilities (sujet to typing onstrints), we see tht f(i) stisfies the sttement. This ompletes the inution n proves (ii). 4. (Automorphisms) (i) (5 points) Show tht CALC queries re invrint uner utomorphisms. In other wors, if ϕ( x) is CALC query without onstnts 1 Without loss of generlity. 3

over shem σ, then for every instne I over σ n one-to-one mpping f : om om, if f(i) = I then f(ϕ(i)) = ϕ(i). Hint: Assume without loss of generlity tht ϕ uses only,,, n use struturl inution on the formul. Let ϕ( x) e CALC formul with free vriles x. following: We prove the ( ) For eh instne I n utomorphism f of I, f(ϕ(i)) ϕ(i). One ( ) is proven, the onverse inlusion ϕ(i) f(ϕ(i)) is shown s follows. Sine f is n utomorphism of I, so is f 1. By ( ) we hve tht f 1 (ϕ(i)) ϕ(i). But then f(f 1 (ϕ(i))) f(ϕ(i)), so ϕ(i) f(ϕ(i)). The proof of ( ) is y struturl inution on the formul. Suppose ϕ( x) is n tom. If ϕ( x) = R( x) then ϕ(i) = I(R), so f(ϕ(i)) = f(i(r)) = I(R) = ϕ(i). If ϕ is x = y then ϕ(i) = {, om(i)} so f(ϕ(i)) = { f(), f() om(i)} = ϕ(i) (sine f(om(i)) = om(i)). For the inution step, we hve three ses: 1. ϕ = ϕ( x, ȳ, z) = α( x, ȳ) β(ȳ, z). Let f(ū), f( v), f( w) f(ϕ(i)), with ū, v, w ϕ(i). Then ū, v α(i) n v, w β(i). Sine f(α(i)) = α(i), f(ū), f( v) α(i) n similrly f( v), f( w) β(i). It follows tht f(ū), f( v), f( w) ϕ(i). We onlue tht f(ϕ(i)) ϕ(i). 2. ϕ = xα(x, ȳ). Let ū ϕ(i). Then there exists v om(i) suh tht v, ū α(i). Sine f(α(i)) = α(i), it follows tht f(v), f(ū) α(i), n f(ū) ϕ(i). Thus, f(ϕ(i)) ϕ(i). 3. ϕ = α( x). Let ū ϕ(i). Then ū om u n ū α(i). But then f(ū) om u n f(ū) α(i). Inee, suppose f(ū) α(i). Sine f 1 is n utomorphism of I, f 1 (α(i)) α(i) y the inution hypothesis, so f 1 (f(ū)) α(i) n ū α(i). However, this is flse. We onlue tht f(ū) α(i), so f(ū) ϕ(i) n f(ϕ(i)) ϕ(i). This ompletes the proof of ( ) n of (i). (ii) (2 points) Let σ onsist of inry reltion R. Using (i), show tht there is no CALC query without onstnts whih on input 4

R proues s nswer Suppose there is CALC query ϕ with no onstnts, with the ove property. Let I e the input in the figure. By (i), f(ϕ(i)) = ϕ(i) for every utomorphism f of I. Consier the 1-1 mping f on om(i) efine y the tle f Clerly f(i) = I. However, f(ϕ(i)) ϕ(i), ontrition. 5