C241 Homework Assignment 9

Size: px
Start display at page:

Download "C241 Homework Assignment 9"

Transcription

1 C41 Homework Assignment 9 1. The language L and functions R, A, and T defined below are the same as in Section 7.6. L {a, b, } + 1. L a. u L au L b. u L bu L 3. n. e. A: L L R: L L T : L L 1. A(, v) = v R( ) = T (, v) = v a. A(au, v) = aa(u, v) R(au) = A(R(u), a ) T (au, v) = T (u, av) b. A(bu, v) = ba(u, v) R(bu) = A(R(u), b ) T (bu, v) = T (u, bv) It is proved in the book that Proposition 7.6. A is associative; that is, for all u, v, w L, A(u, A(v, w)) = A(A(u, v), w). Proposition 7.9. Assuming Proposition 7.8, below, R is self-cancelling; that is, for all u L, R(R(u)) = u. Prove the following: (a) Proposition 7.7. For all u L, A(u, ) = u. (b) Proposition 7.8. For all u, v L, R(A(u, v) = A(R(v), R(u)). (c) Proposition For all u, v L, T (u, v) = A((R(u), v). (d) Proposition For all u L, T (u, ) = R(u). (e) Proposition 7.1. For all u L, T (T (u, ), ) = u. (a) Proposition 7.7. For all u L, A(u, ) = u. Proof. By induction on u L. Base Case. A(, ) A.1 =. Induction: Assume IH A(u, ) = u. A(au, ) A.a = a A(u, ) IH = au

2 Similarly, for bu, A(bu, ) A.b = b A(u, ) IH = bu (b) Proposition 7.8. For all u, v L, R(A(u, v) = A(R(v), R(u)). Proof. By induction on u L. Base Case. Induction. R(A(, v)) = R(v) (A.1) = A(R(v), ) (Prop 7.7) = A(R(v), R( )) (R.1) (c) Proposition For all u, v L, T (u, v) = A((R(u), v). Proof. By induction on u L. Base Case. T (, v) = v (T.1) = A(, v) (A.1) = A(R( ), v) (R.1) Induction: Assume T (u, v) = A(R(u), v). Similarly for T (bu, v). T (au, v) = T (u, av) (T.a) = A(R(u), av) (I.H.) = A(R(u), A(a, v)) (A.; A.1) = A(A(R(u), a ), v) (Prop. 7.6) = A(R(au), v) (R.a) (d) Proposition For all u L, T (u, ) = R(u). Proof. Induction is not needed. By Proposition 7.11, T (u, ) = A(R(u), ), and by Proposition 7.7, A(R(u), ) = R(u). (e) Proposition 7.1. For all u L, T (T (u, ), ) = u. Proof. Induction is not needed. By Proposition 7.10, used twice, T (T (u, ), ) = T (R(u), ) = R(R(u)). And by Proposition 7.9, R(R(u)) = u.

3 . The program below is called Wensley s algorithm for computing the quotient of real numbers x and y to within tolerance t. Use the Theorem on Loop Invariants to prove the this program satisfies the post-condition {z x/y < z + t}. {0 x < y 1} begin z := 0; d := 1; u := 0; v := 1 y ; while d > t do { Inv z x/y < z + d u = zy v = 1 dy } begin d := 1 d; if u + v > x then skip else begin z := z + d; u := u + v ; end ; v := 1 v end end {z x/y < z + t} There are three things to prove: Initialization. The program starts with 0 x < y 1, and first reaches the while-loop with z = 0, d = 1, u = 0, and v = 1 y. The invariant Inv is the conjunction of three propositions. All three are true when the variables current values are substituted. 1. z x/y z+d 0 x/y 0+1, which holds because 0 x < y 1.. u = zy 0 = 0 y, which is true. 3. v = 1 dy 1 1 y = 1 y, which is the initial value assigned to v. Invariance. If Inv z x/y < z + d u = zy v = 1 dy holds and d > t then the loop body executes, always computing new values for d = 1 d and v = 1 v. The values of x and y are unchanged througout. A. If conditional test u + v > x is true, all other variables are unchanged. 1. z x/y z + d z x/y z + 1 d. The first part, z x/y, is given by Inv. Also by Inv, x < u + v = zy + 1 dy = (z + 1 d)y = (z + d )y. Dividing through by y preserves the inequality because y is positive and gives x/y z + d as desired.. u = z y u = zy, which is given by Inv. 3. v = 1 d y 1 v = 1 ( 1 d)y. Dividing this equation by 1, we get v = 1 dy, which is given by Inv.

4 B. If the conditional test, u + v > x fails z and u are also changed and in addition to d and v we have. z = z + d because new assignment to d has already occurred = z + 1 d u = u + v x because the conditional test fails Looking again at Inv one conjuct at a time, 1. z x/y z + d z + 1 d x/y (z + 1 d) + 1 d. z + 1 d + 1 d = z + d, and Inv gives us x/y < z + d, so the right-hand inequality is valid. To show z + 1 d x/y, Inv gives us that u = zy and v = 1 dy, so u + v = (z + 1 d)y. At this point of the program, u + v x and y > 0. Thus, (z + 1 d)y x, and dividing both sides by y gives us what we want.. u = z y u+v = (z + 1 d)y. By Inv we have u+v = zy + 1 dy = (z + 1 d)y as needed. 3. v = 1 d y 1 v = 1 ( 1 d)y. Dividing this equation by 1, we get v = 1 dy, which is given by Inv. termination. On termination we have Inv d t. So it is immediate that z x/y < z + d z + t, thus satisfying the postcondition.

5 3. Define F : N N and G: N N as follows: F (0) = 1 F (k + 1) = (k + 1) F (k) G(0, m) = m G(k + 1, m) = G(k, m (k + 1)) (a) Prove by induction on n N: For all n, m N, G(n, m) = m G(n, 1). (b) Prove: For all n N, F (n) = G(n, 1). comment. If you try to prove the result directly by induction, you ll get stuck: Proposition 0. For all n N, F (n) = G(n, 1). base case. F (0) = 1 = G(0, 1) induction. Assume that F (k) = G(k, 1). F (k + 1) = (k + 1) F (k) (Defn. F ) = (k + 1) G(k, 1) (I.H.).?! (Nowhere to go from here...? = G(k + 1, 1)... to reach the goal.) You need to find and prove a more general result about G. Proposition 1. For all n, m N, G(n, m) = m G(n, 1). proof. The proof is by induction on k N. base case. G(0, m) G = m = m 1 F = m F (0) induction. Assume that G(k, m) = m G(k, 1). Then G(k + 1, m) = G(k, m(k + 1)) (Defn. G) = [ m(k + 1) ] G(k, 1) (I.H. = m [ (k + 1) G(k, 1) ] (algebra) = m G(k, k + 1) (I.H.) = m G(k + 1, 1) (Defn. G) comment. A more elegant version of Proposition 1 would be For all n, m, k N, G(n, m k) = m G(n, k). However, we don t need that much generality for our purposes.

6 Corollary. For all n N, F (n) = G(n, 1). proof. The proof is by induction on k N. base case. F (0) = 1 = G(0, 1) induction. Assume that F (k) = G(k, 1). F (k + 1) = (k + 1) F (k) (Defn. F ) = (k + 1) G(k, 1) (I.H.) = G(k, k + 1) (Prop. 1) = G(k + 1, 1) (Defn. G)

7 4. Performance estimation for recursive programs often involves recurrence relations like the one below. Let a N. The function T : N N is defined recursively by T (0) = a T (k + 1) = T (k) + k + 1 We would like to find a closed form for T, that is, and an algebraic expression that does not involve recursion Prove that for all n N, T (n) = a + n + n. proof. The proof is by induction on n N. base case. T (0) = a = a induction case. Assume that T (k) = a + k + k. T (k + 1) = T (k) + k + 1 (Defn. T ) = a + k + k = a + k + k = a + k + 3k + + k + 1 (I.H.) + k + = a + (k + k + 1) + (k + 1) = a + (k + 1) + (k + 1) as needed. This completes the induction. (multiply k + 1 by 1 = ) (adding fractions) (algebra) (factoring k + k + 1)

8 Supplemental Problem. H41 students should attempt this programming problem, but don t spend more than two or three hours on it. In a programming language of your choice, write a program that takes no input and outputs its own source code. No provided.

C241 Homework Assignment 7

C241 Homework Assignment 7 C24 Homework Assignment 7. Prove that for all whole numbers n, n i 2 = n(n + (2n + The proof is by induction on k with hypothesis H(k i 2 = k(k + (2k + base case: To prove H(, i 2 = = = 2 3 = ( + (2 +

More information

C241 Homework Assignment 8

C241 Homework Assignment 8 C241 Homework Assignment 8 1. Estimate the performance of the Bubble Sort program for i from 1 to N 1 by 1 do for j from 1 to i 1 by 1 do if A[j ] A[j + 1] then skip; else t := A[j ] ; A[j ] := A[j + 1]

More information

Math 24 Spring 2012 Questions (mostly) from the Textbook

Math 24 Spring 2012 Questions (mostly) from the Textbook Math 24 Spring 2012 Questions (mostly) from the Textbook 1. TRUE OR FALSE? (a) The zero vector space has no basis. (F) (b) Every vector space that is generated by a finite set has a basis. (c) Every vector

More information

Axiomatic Semantics: Verification Conditions. Review of Soundness of Axiomatic Semantics. Questions? Announcements

Axiomatic Semantics: Verification Conditions. Review of Soundness of Axiomatic Semantics. Questions? Announcements Axiomatic Semantics: Verification Conditions Meeting 18, CSCI 5535, Spring 2010 Announcements Homework 6 is due tonight Today s forum: papers on automated testing using symbolic execution Anyone looking

More information

Axiomatic Semantics: Verification Conditions. Review of Soundness and Completeness of Axiomatic Semantics. Announcements

Axiomatic Semantics: Verification Conditions. Review of Soundness and Completeness of Axiomatic Semantics. Announcements Axiomatic Semantics: Verification Conditions Meeting 12, CSCI 5535, Spring 2009 Announcements Homework 4 is due tonight Wed forum: papers on automated testing using symbolic execution 2 Questions? Review

More information

Soundness and Completeness of Axiomatic Semantics

Soundness and Completeness of Axiomatic Semantics #1 Soundness and Completeness of Axiomatic Semantics #2 One-Slide Summary A system of axiomatic semantics is sound if everything we can prove is also true: if ` { A } c { B } then ² { A } c { B } We prove

More information

Definition 2.3. We define addition and multiplication of matrices as follows.

Definition 2.3. We define addition and multiplication of matrices as follows. 14 Chapter 2 Matrices In this chapter, we review matrix algebra from Linear Algebra I, consider row and column operations on matrices, and define the rank of a matrix. Along the way prove that the row

More information

Lecture Notes: Axiomatic Semantics and Hoare-style Verification

Lecture Notes: Axiomatic Semantics and Hoare-style Verification Lecture Notes: Axiomatic Semantics and Hoare-style Verification 17-355/17-665/17-819O: Program Analysis (Spring 2018) Claire Le Goues and Jonathan Aldrich clegoues@cs.cmu.edu, aldrich@cs.cmu.edu It has

More information

CSE20: Discrete Mathematics

CSE20: Discrete Mathematics Spring 2018 Summary Today: Induction, Program Correctness Reading: Chap. 5 Division Theorem Theorem: For every integer a and positive integer d 1, there exist integers q, r such that a = qd + r and 0 r

More information

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers ALGEBRA CHRISTIAN REMLING 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers by Z = {..., 2, 1, 0, 1,...}. Given a, b Z, we write a b if b = ac for some

More information

Galois Connections. Roland Backhouse 3rd December, 2002

Galois Connections. Roland Backhouse 3rd December, 2002 1 Galois Connections Roland Backhouse 3rd December, 2002 Fusion 2 Many problems are expressed in the form evaluate generate where generate generates a (possibly infinite) candidate set of solutions, and

More information

What happens to the value of the expression x + y every time we execute this loop? while x>0 do ( y := y+z ; x := x:= x z )

What happens to the value of the expression x + y every time we execute this loop? while x>0 do ( y := y+z ; x := x:= x z ) Starter Questions Feel free to discuss these with your neighbour: Consider two states s 1 and s 2 such that s 1, x := x + 1 s 2 If predicate P (x = y + 1) is true for s 2 then what does that tell us about

More information

5 + 9(10) + 3(100) + 0(1000) + 2(10000) =

5 + 9(10) + 3(100) + 0(1000) + 2(10000) = Chapter 5 Analyzing Algorithms So far we have been proving statements about databases, mathematics and arithmetic, or sequences of numbers. Though these types of statements are common in computer science,

More information

Program verification using Hoare Logic¹

Program verification using Hoare Logic¹ Program verification using Hoare Logic¹ Automated Reasoning - Guest Lecture Petros Papapanagiotou Part 2 of 2 ¹Contains material from Mike Gordon s slides: Previously on Hoare Logic A simple while language

More information

Loop Convergence. CS 536: Science of Programming, Fall 2018

Loop Convergence. CS 536: Science of Programming, Fall 2018 Solved Loop Convergence CS 536: Science of Programming, Fall 2018 A. Why Diverging programs aren t useful, so it s useful to know how to show that loops terminate. B. Objectives At the end of this lecture

More information

Properties of Real Numbers

Properties of Real Numbers Properties of Real Numbers Essential Understanding. Relationships that are always true for real numbers are called properties, which are rules used to rewrite and compare expressions. Two algebraic expressions

More information

Notes on generating functions in automata theory

Notes on generating functions in automata theory Notes on generating functions in automata theory Benjamin Steinberg December 5, 2009 Contents Introduction: Calculus can count 2 Formal power series 5 3 Rational power series 9 3. Rational power series

More information

Dynamic Programming: Matrix chain multiplication (CLRS 15.2)

Dynamic Programming: Matrix chain multiplication (CLRS 15.2) Dynamic Programming: Matrix chain multiplication (CLRS.) The problem Given a sequence of matrices A, A, A,..., A n, find the best way (using the minimal number of multiplications) to compute their product.

More information

Solving Recurrence Relations 1. Guess and Math Induction Example: Find the solution for a n = 2a n 1 + 1, a 0 = 0 We can try finding each a n : a 0 =

Solving Recurrence Relations 1. Guess and Math Induction Example: Find the solution for a n = 2a n 1 + 1, a 0 = 0 We can try finding each a n : a 0 = Solving Recurrence Relations 1. Guess and Math Induction Example: Find the solution for a n = 2a n 1 + 1, a 0 = 0 We can try finding each a n : a 0 = 0 a 1 = 2 0 + 1 = 1 a 2 = 2 1 + 1 = 3 a 3 = 2 3 + 1

More information

Math 410 Homework 6 Due Monday, October 26

Math 410 Homework 6 Due Monday, October 26 Math 40 Homework 6 Due Monday, October 26. Let c be any constant and assume that lim s n = s and lim t n = t. Prove that: a) lim c s n = c s We talked about these in class: We want to show that for all

More information

Dynamic Semantics. Dynamic Semantics. Operational Semantics Axiomatic Semantics Denotational Semantic. Operational Semantics

Dynamic Semantics. Dynamic Semantics. Operational Semantics Axiomatic Semantics Denotational Semantic. Operational Semantics Dynamic Semantics Operational Semantics Denotational Semantic Dynamic Semantics Operational Semantics Operational Semantics Describe meaning by executing program on machine Machine can be actual or simulated

More information

Foundations of Computation

Foundations of Computation The Australian National University Semester 2, 2018 Research School of Computer Science Tutorial 6 Dirk Pattinson Foundations of Computation The tutorial contains a number of exercises designed for the

More information

Chapter 1 Review of Equations and Inequalities

Chapter 1 Review of Equations and Inequalities Chapter 1 Review of Equations and Inequalities Part I Review of Basic Equations Recall that an equation is an expression with an equal sign in the middle. Also recall that, if a question asks you to solve

More information

Sums and Products. a i = a 1. i=1. a i = a i a n. n 1

Sums and Products. a i = a 1. i=1. a i = a i a n. n 1 Sums and Products -27-209 In this section, I ll review the notation for sums and products Addition and multiplication are binary operations: They operate on two numbers at a time If you want to add or

More information

Chapter Six. Polynomials. Properties of Exponents Algebraic Expressions Addition, Subtraction, and Multiplication Factoring Solving by Factoring

Chapter Six. Polynomials. Properties of Exponents Algebraic Expressions Addition, Subtraction, and Multiplication Factoring Solving by Factoring Chapter Six Polynomials Properties of Exponents Algebraic Expressions Addition, Subtraction, and Multiplication Factoring Solving by Factoring Properties of Exponents The properties below form the basis

More information

Math From Scratch Lesson 37: Roots of Cubic Equations

Math From Scratch Lesson 37: Roots of Cubic Equations Math From Scratch Lesson 7: Roots of Cubic Equations W. Blaine Dowler September 1, 201 Contents 1 Defining Cubic Equations 1 2 The Roots of Cubic Equations 1 2.1 Case 1: a 2 = a 1 = 0.........................

More information

Section 14.1 Computability then else

Section 14.1 Computability then else Section 14.1 Computability Some problems cannot be solved by any machine/algorithm. To prove such statements we need to effectively describe all possible algorithms. Example (Turing machines). Associate

More information

Program verification. Hoare triples. Assertional semantics (cont) Example: Semantics of assignment. Assertional semantics of a program

Program verification. Hoare triples. Assertional semantics (cont) Example: Semantics of assignment. Assertional semantics of a program Program verification Assertional semantics of a program Meaning of a program: relation between its inputs and outputs; specified by input assertions (pre-conditions) and output assertions (post-conditions)

More information

A-2. Polynomials and Factoring. Section A-2 1

A-2. Polynomials and Factoring. Section A-2 1 A- Polynomials and Factoring Section A- 1 What you ll learn about Adding, Subtracting, and Multiplying Polynomials Special Products Factoring Polynomials Using Special Products Factoring Trinomials Factoring

More information

In this episode of The Verification Corner, Rustan Leino talks about Loop Invariants. He gives a brief summary of the theoretical foundations and

In this episode of The Verification Corner, Rustan Leino talks about Loop Invariants. He gives a brief summary of the theoretical foundations and In this episode of The Verification Corner, Rustan Leino talks about Loop Invariants. He gives a brief summary of the theoretical foundations and shows how a program can sometimes be systematically constructed

More information

Math 412, Introduction to abstract algebra. Overview of algebra.

Math 412, Introduction to abstract algebra. Overview of algebra. Math 412, Introduction to abstract algebra. Overview of algebra. A study of algebraic objects and functions between them; an algebraic object is typically a set with one or more operations which satisfies

More information

Math 346 Notes on Linear Algebra

Math 346 Notes on Linear Algebra Math 346 Notes on Linear Algebra Ethan Akin Mathematics Department Fall, 2014 1 Vector Spaces Anton Chapter 4, Section 4.1 You should recall the definition of a vector as an object with magnitude and direction

More information

Math 309 Notes and Homework for Days 4-6

Math 309 Notes and Homework for Days 4-6 Math 309 Notes and Homework for Days 4-6 Day 4 Read Section 1.2 and the notes below. The following is the main definition of the course. Definition. A vector space is a set V (whose elements are called

More information

Designing Information Devices and Systems II Fall 2016 Murat Arcak and Michel Maharbiz Homework 0. This homework is due August 29th, 2016, at Noon.

Designing Information Devices and Systems II Fall 2016 Murat Arcak and Michel Maharbiz Homework 0. This homework is due August 29th, 2016, at Noon. EECS 16B Designing Information Devices and Systems II Fall 2016 Murat Arcak and Michel Maharbiz Homework 0 This homework is due August 29th, 2016, at Noon. 1. Homework process and study group (a) Who else

More information

Math 192r, Problem Set #3: Solutions

Math 192r, Problem Set #3: Solutions Math 192r Problem Set #3: Solutions 1. Let F n be the nth Fibonacci number as Wilf indexes them (with F 0 F 1 1 F 2 2 etc.). Give a simple homogeneous linear recurrence relation satisfied by the sequence

More information

Mathematical Reasoning & Proofs

Mathematical Reasoning & Proofs Mathematical Reasoning & Proofs MAT 1362 Fall 2018 Alistair Savage Department of Mathematics and Statistics University of Ottawa This work is licensed under a Creative Commons Attribution-ShareAlike 4.0

More information

Presentation 1

Presentation 1 18.704 Presentation 1 Jesse Selover March 5, 2015 We re going to try to cover a pretty strange result. It might seem unmotivated if I do a bad job, so I m going to try to do my best. The overarching theme

More information

Lecture 17: Trees and Merge Sort 10:00 AM, Oct 15, 2018

Lecture 17: Trees and Merge Sort 10:00 AM, Oct 15, 2018 CS17 Integrated Introduction to Computer Science Klein Contents Lecture 17: Trees and Merge Sort 10:00 AM, Oct 15, 2018 1 Tree definitions 1 2 Analysis of mergesort using a binary tree 1 3 Analysis of

More information

Introduction to Axiomatic Semantics

Introduction to Axiomatic Semantics #1 Introduction to Axiomatic Semantics #2 How s The Homework Going? Remember that you can t just define a meaning function in terms of itself you must use some fixed point machinery. #3 Observations A

More information

Convergence of Sequences

Convergence of Sequences James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University September 5, 2018 Outline 1 2 Homework Definition Let (a n ) n k be a sequence of real numbers.

More information

Last Time. Inference Rules

Last Time. Inference Rules Last Time When program S executes it switches to a different state We need to express assertions on the states of the program S before and after its execution We can do it using a Hoare triple written

More information

SCHOOL OF MATHEMATICS MATHEMATICS FOR PART I ENGINEERING. Self-paced Course

SCHOOL OF MATHEMATICS MATHEMATICS FOR PART I ENGINEERING. Self-paced Course SCHOOL OF MATHEMATICS MATHEMATICS FOR PART I ENGINEERING Self-paced Course MODULE ALGEBRA Module Topics Simplifying expressions and algebraic functions Rearranging formulae Indices 4 Rationalising a denominator

More information

Fall 2015 Lecture 14: Modular congruences. cse 311: foundations of computing

Fall 2015 Lecture 14: Modular congruences. cse 311: foundations of computing Fall 2015 Lecture 14: Modular congruences cse 311: foundations of computing If a and b are positive integers, then gcd a, b = gcd (b, a mod b) Useful GCD Fact Proof: By definition a = a div b b + (a mod

More information

Fall 2016 Test 1 with Solutions

Fall 2016 Test 1 with Solutions CS3510 Design & Analysis of Algorithms Fall 16 Section B Fall 2016 Test 1 with Solutions Instructor: Richard Peng In class, Friday, Sep 9, 2016 Do not open this quiz booklet until you are directed to do

More information

Polynomial Operations

Polynomial Operations Chapter 7 Polynomial Operations Sec. 1 Polynomials; Add/Subtract Polynomials sounds tough enough. But, if you look at it close enough you ll notice that students have worked with polynomial expressions

More information

Partial Solution Set, Leon 4.3

Partial Solution Set, Leon 4.3 Partial Solution Set, Leon 4.3 4.3.2 Let [u 1, u 2 ] and [v 1, v 2 ] be ordered bases for R 2, where u 1 (1, 1) T, u 2 ( 1, 1) T, v 1 (2, 1) T, and v 2 (1, ) T. Let L be the linear transformation defined

More information

Expressions, Equations and Inequalities Guided Notes

Expressions, Equations and Inequalities Guided Notes Expressions, Equations and Inequalities Guided Notes Standards: Alg1.M.A.SSE.A.01a - The Highly Proficient student can explain the context of different parts of a formula presented as a complicated expression.

More information

CS156: The Calculus of Computation Zohar Manna Autumn 2008

CS156: The Calculus of Computation Zohar Manna Autumn 2008 Page 3 of 52 Page 4 of 52 CS156: The Calculus of Computation Zohar Manna Autumn 2008 Lecturer: Zohar Manna (manna@cs.stanford.edu) Office Hours: MW 12:30-1:00 at Gates 481 TAs: Boyu Wang (wangboyu@stanford.edu)

More information

Reasoning About Imperative Programs. COS 441 Slides 10b

Reasoning About Imperative Programs. COS 441 Slides 10b Reasoning About Imperative Programs COS 441 Slides 10b Last time Hoare Logic: { P } C { Q } Agenda If P is true in the initial state s. And C in state s evaluates to s. Then Q must be true in s. Program

More information

Solving Equations by Adding and Subtracting

Solving Equations by Adding and Subtracting SECTION 2.1 Solving Equations by Adding and Subtracting 2.1 OBJECTIVES 1. Determine whether a given number is a solution for an equation 2. Use the addition property to solve equations 3. Determine whether

More information

Solutions to the August 2008 Qualifying Examination

Solutions to the August 2008 Qualifying Examination Solutions to the August 2008 Qualifying Examination Any student with questions regarding the solutions is encouraged to contact the Chair of the Qualifying Examination Committee. Arrangements will then

More information

Classical Program Logics: Hoare Logic, Weakest Liberal Preconditions

Classical Program Logics: Hoare Logic, Weakest Liberal Preconditions Chapter 1 Classical Program Logics: Hoare Logic, Weakest Liberal Preconditions 1.1 The IMP Language IMP is a programming language with an extensible syntax that was developed in the late 1960s. We will

More information

Proofs of Correctness: Introduction to Axiomatic Verification

Proofs of Correctness: Introduction to Axiomatic Verification Proofs of Correctness: Introduction to Axiomatic Verification Introduction Weak correctness predicate Assignment statements Sequencing Selection statements Iteration 1 Introduction What is Axiomatic Verification?

More information

THE NATIONAL UNIVERSITY OF IRELAND, CORK COLÁISTE NA hollscoile, CORCAIGH UNIVERSITY COLLEGE, CORK. Summer Examination 2009.

THE NATIONAL UNIVERSITY OF IRELAND, CORK COLÁISTE NA hollscoile, CORCAIGH UNIVERSITY COLLEGE, CORK. Summer Examination 2009. OLLSCOIL NA héireann, CORCAIGH THE NATIONAL UNIVERSITY OF IRELAND, CORK COLÁISTE NA hollscoile, CORCAIGH UNIVERSITY COLLEGE, CORK Summer Examination 2009 First Engineering MA008 Calculus and Linear Algebra

More information

Math 54 Homework 3 Solutions 9/

Math 54 Homework 3 Solutions 9/ Math 54 Homework 3 Solutions 9/4.8.8.2 0 0 3 3 0 0 3 6 2 9 3 0 0 3 0 0 3 a a/3 0 0 3 b b/3. c c/3 0 0 3.8.8 The number of rows of a matrix is the size (dimension) of the space it maps to; the number of

More information

Linear Algebra 2 Spectral Notes

Linear Algebra 2 Spectral Notes Linear Algebra 2 Spectral Notes In what follows, V is an inner product vector space over F, where F = R or C. We will use results seen so far; in particular that every linear operator T L(V ) has a complex

More information

Theory of Computation (VI) Yijia Chen Fudan University

Theory of Computation (VI) Yijia Chen Fudan University Theory of Computation (VI) Yijia Chen Fudan University Review Forced handles Definition A handle h of a valid string v = xhy is a forced handle if h is the unique handle in every valid string xhŷ where

More information

CS 4424 GCD, XGCD

CS 4424 GCD, XGCD CS 4424 GCD, XGCD eschost@uwo.ca GCD of polynomials First definition Let A and B be in k[x]. k[x] is the ring of polynomials with coefficients in k A Greatest Common Divisor of A and B is a polynomial

More information

MATH 115, SUMMER 2012 LECTURE 12

MATH 115, SUMMER 2012 LECTURE 12 MATH 115, SUMMER 2012 LECTURE 12 JAMES MCIVOR - last time - we used hensel s lemma to go from roots of polynomial equations mod p to roots mod p 2, mod p 3, etc. - from there we can use CRT to construct

More information

Algebraic groups Lecture 1

Algebraic groups Lecture 1 Algebraic groups Lecture Notes by Tobias Magnusson Lecturer: WG September 3, 207 Administration Registration: A sheet of paper (for registration) was passed around. The lecturers will alternate between

More information

Mid-Semester Quiz Second Semester, 2012

Mid-Semester Quiz Second Semester, 2012 THE AUSTRALIAN NATIONAL UNIVERSITY Mid-Semester Quiz Second Semester, 2012 COMP2600 (Formal Methods for Software Engineering) Writing Period: 1 hour duration Study Period: 10 minutes duration Permitted

More information

Abstract. In this article, several matrix norm inequalities are proved by making use of the Hiroshima 2003 result on majorization relations.

Abstract. In this article, several matrix norm inequalities are proved by making use of the Hiroshima 2003 result on majorization relations. HIROSHIMA S THEOREM AND MATRIX NORM INEQUALITIES MINGHUA LIN AND HENRY WOLKOWICZ Abstract. In this article, several matrix norm inequalities are proved by making use of the Hiroshima 2003 result on majorization

More information

1 Last time: inverses

1 Last time: inverses MATH Linear algebra (Fall 8) Lecture 8 Last time: inverses The following all mean the same thing for a function f : X Y : f is invertible f is one-to-one and onto 3 For each b Y there is exactly one a

More information

Hoare Logic: Reasoning About Imperative Programs

Hoare Logic: Reasoning About Imperative Programs Hoare Logic: Reasoning About Imperative Programs COMP1600 / COMP6260 Dirk Pattinson Australian National University Semester 2, 2018 Programming Paradigms Functional. (Haskell, SML, OCaml,... ) main paradigm:

More information

CHAPTER 1. Review of Algebra

CHAPTER 1. Review of Algebra CHAPTER 1 Review of Algebra Much of the material in this chapter is revision from GCSE maths (although some of the exercises are harder). Some of it particularly the work on logarithms may be new if you

More information

Second-Order Homogeneous Linear Equations with Constant Coefficients

Second-Order Homogeneous Linear Equations with Constant Coefficients 15 Second-Order Homogeneous Linear Equations with Constant Coefficients A very important class of second-order homogeneous linear equations consists of those with constant coefficients; that is, those

More information

Fall 2017 Test II review problems

Fall 2017 Test II review problems Fall 2017 Test II review problems Dr. Holmes October 18, 2017 This is a quite miscellaneous grab bag of relevant problems from old tests. Some are certainly repeated. 1. Give the complete addition and

More information

Axiomatic Semantics. Hoare s Correctness Triplets Dijkstra s Predicate Transformers

Axiomatic Semantics. Hoare s Correctness Triplets Dijkstra s Predicate Transformers Axiomatic Semantics Hoare s Correctness Triplets Dijkstra s Predicate Transformers Goal of a program = IO Relation Problem Specification Properties satisfied by the input and expected of the output (usually

More information

Dynamic Programming (CLRS )

Dynamic Programming (CLRS ) Dynamic Programming (CLRS.-.) Today we discuss a technique called dynamic programming. It is neither especially dynamic nor especially programming related. We will discuss dynamic programming by looking

More information

Single Source Shortest Paths

Single Source Shortest Paths CMPS 00 Fall 017 Single Source Shortest Paths Carola Wenk Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk Paths in graphs Consider a digraph G = (V, E) with an edge-weight

More information

. =. a i1 x 1 + a i2 x 2 + a in x n = b i. a 11 a 12 a 1n a 21 a 22 a 1n. i1 a i2 a in

. =. a i1 x 1 + a i2 x 2 + a in x n = b i. a 11 a 12 a 1n a 21 a 22 a 1n. i1 a i2 a in Vectors and Matrices Continued Remember that our goal is to write a system of algebraic equations as a matrix equation. Suppose we have the n linear algebraic equations a x + a 2 x 2 + a n x n = b a 2

More information

Introduction to Arithmetic Geometry Fall 2013 Lecture #2 09/10/2013

Introduction to Arithmetic Geometry Fall 2013 Lecture #2 09/10/2013 18.78 Introduction to Arithmetic Geometry Fall 013 Lecture # 09/10/013.1 Plane conics A conic is a plane projective curve of degree. Such a curve has the form C/k : ax + by + cz + dxy + exz + fyz with

More information

Some Facts from Number Theory

Some Facts from Number Theory Computer Science 52 Some Facts from Number Theory Fall Semester, 2014 These notes are adapted from a document that was prepared for a different course several years ago. They may be helpful as a summary

More information

G54FOP: Lecture 17 & 18 Denotational Semantics and Domain Theory III & IV

G54FOP: Lecture 17 & 18 Denotational Semantics and Domain Theory III & IV G54FOP: Lecture 17 & 18 Denotational Semantics and Domain Theory III & IV Henrik Nilsson University of Nottingham, UK G54FOP: Lecture 17 & 18 p.1/33 These Two Lectures Revisit attempt to define denotational

More information

CS 173: Discrete Structures, Fall 2009 Homework 4 Solutions

CS 173: Discrete Structures, Fall 2009 Homework 4 Solutions CS 173: Discrete Structures, Fall 2009 Homework 4 Solutions This homework contains 6 problems worth a total of 50 regular points plus 5 bonus points. Starting with this homework, we will take one point

More information

Math 9 Homework & Notebook

Math 9 Homework & Notebook Math 9 Homework & Notebook Name: Block: Teacher: Miss Zukowski Date Submitted: / / 2018 Unit # : Submission Checklist: (make sure you have included all components for full marks) Cover page & Assignment

More information

For all For every For each For any There exists at least one There exists There is Some

For all For every For each For any There exists at least one There exists There is Some Section 1.3 Predicates and Quantifiers Assume universe of discourse is all the people who are participating in this course. Also let us assume that we know each person in the course. Consider the following

More information

Solutions to Selected Questions from Denis Sevee s Vector Geometry. (Updated )

Solutions to Selected Questions from Denis Sevee s Vector Geometry. (Updated ) Solutions to Selected Questions from Denis Sevee s Vector Geometry. (Updated 24--27) Denis Sevee s Vector Geometry notes appear as Chapter 5 in the current custom textbook used at John Abbott College for

More information

This format is the result of tinkering with a mixed lecture format for 3 terms. As such, it is still a work in progress and we will discuss

This format is the result of tinkering with a mixed lecture format for 3 terms. As such, it is still a work in progress and we will discuss Version 1, August 2016 1 This format is the result of tinkering with a mixed lecture format for 3 terms. As such, it is still a work in progress and we will discuss adaptations both to the general format

More information

Supplemental Worksheet Problems To Accompany: The Pre-Algebra Tutor: Volume 2 Section 16 Solving Single Step Equations

Supplemental Worksheet Problems To Accompany: The Pre-Algebra Tutor: Volume 2 Section 16 Solving Single Step Equations Supplemental Worksheet Problems To Accompany: The Pre-Algebra Tutor: Volume 2 Please watch Section 16 of this DVD before working these problems. The DVD is located at: http://www.mathtutordvd.com/products/item67.cfm

More information

Logic: Bottom-up & Top-down proof procedures

Logic: Bottom-up & Top-down proof procedures Logic: Bottom-up & Top-down proof procedures Alan Mackworth UBC CS 322 Logic 3 March 4, 2013 P & M Textbook 5.2 Lecture Overview Recap: Soundness, Completeness, Bottom-up proof procedure Bottom-up Proof

More information

Algorithms CMSC Basic algorithms in Number Theory: Euclid s algorithm and multiplicative inverse

Algorithms CMSC Basic algorithms in Number Theory: Euclid s algorithm and multiplicative inverse Algorithms CMSC-27200 Basic algorithms in Number Theory: Euclid s algorithm and multiplicative inverse Instructor: László Babai Last updated 02-14-2015. Z denotes the set of integers. All variables in

More information

Core Mathematics 2 Algebra

Core Mathematics 2 Algebra Core Mathematics 2 Algebra Edited by: K V Kumaran Email: kvkumaran@gmail.com Core Mathematics 2 Algebra 1 Algebra and functions Simple algebraic division; use of the Factor Theorem and the Remainder Theorem.

More information

A Short Introduction to Hoare Logic

A Short Introduction to Hoare Logic A Short Introduction to Hoare Logic Supratik Chakraborty I.I.T. Bombay June 23, 2008 Supratik Chakraborty (I.I.T. Bombay) A Short Introduction to Hoare Logic June 23, 2008 1 / 34 Motivation Assertion checking

More information

ALTERNATIVE SECTION 12.2 SUPPLEMENT TO BECK AND GEOGHEGAN S ART OF PROOF

ALTERNATIVE SECTION 12.2 SUPPLEMENT TO BECK AND GEOGHEGAN S ART OF PROOF ALTERNATIVE SECTION 12.2 SUPPLEMENT TO BECK AND GEOGHEGAN S ART OF PROOF MICHAEL P. COHEN Remark. The purpose of these notes is to serve as an alternative Section 12.2 for Beck and Geoghegan s Art of Proof.

More information

1 Last time: least-squares problems

1 Last time: least-squares problems MATH Linear algebra (Fall 07) Lecture Last time: least-squares problems Definition. If A is an m n matrix and b R m, then a least-squares solution to the linear system Ax = b is a vector x R n such that

More information

Theory of Computation

Theory of Computation Theory of Computation Prof. Michael Mascagni Florida State University Department of Computer Science 1 / 33 This course aims to cover... the development of computability theory using an extremely simple

More information

Floyd-Hoare Style Program Verification

Floyd-Hoare Style Program Verification Floyd-Hoare Style Program Verification Deepak D Souza Department of Computer Science and Automation Indian Institute of Science, Bangalore. 9 Feb 2017 Outline of this talk 1 Overview 2 Hoare Triples 3

More information

Convergence of Sequences

Convergence of Sequences Convergence of Sequences James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University February 12, 2018 Outline Convergence of Sequences Definition Let

More information

Ascona Conference Algebraic Groups and Invariant Theory. Springer fibers admitting singular components. Lucas Fresse, joint work with Anna Melnikov

Ascona Conference Algebraic Groups and Invariant Theory. Springer fibers admitting singular components. Lucas Fresse, joint work with Anna Melnikov Ascona Conference Algebraic Groups and Invariant Theory Springer fibers admitting singular components Lucas Fresse, joint work with Anna Melnikov Definition of Springer fibers Let V = C n, let u End(V

More information

3 Propositional Logic

3 Propositional Logic 3 Propositional Logic 3.1 Syntax 3.2 Semantics 3.3 Equivalence and Normal Forms 3.4 Proof Procedures 3.5 Properties Propositional Logic (25th October 2007) 1 3.1 Syntax Definition 3.0 An alphabet Σ consists

More information

1 Direct Proofs Technique Outlines Example Implication Proofs Technique Outlines Examples...

1 Direct Proofs Technique Outlines Example Implication Proofs Technique Outlines Examples... CSE 311: Foundations of Computing I Proof Techniques What Is This? Each of the following is as close as we can get to giving you a template (and a completely worked out example) for every proof technique

More information

PRODUCTS THAT ARE POWERS. A mathematical vignette Ed Barbeau, University of Toronto

PRODUCTS THAT ARE POWERS. A mathematical vignette Ed Barbeau, University of Toronto PRODUCTS THAT ARE POWERS. A mathematical vignette Ed Barbeau, University of Toronto This investigation was originally designed for school students to gain fluency with the factoring of positive integers

More information

1. Propositions: Contrapositives and Converses

1. Propositions: Contrapositives and Converses Preliminaries 1 1. Propositions: Contrapositives and Converses Given two propositions P and Q, the statement If P, then Q is interpreted as the statement that if the proposition P is true, then the statement

More information

Hoare Logic and Model Checking

Hoare Logic and Model Checking Hoare Logic and Model Checking Kasper Svendsen University of Cambridge CST Part II 2016/17 Acknowledgement: slides heavily based on previous versions by Mike Gordon and Alan Mycroft Introduction In the

More information

Lecture 10: Powers of Matrices, Difference Equations

Lecture 10: Powers of Matrices, Difference Equations Lecture 10: Powers of Matrices, Difference Equations Difference Equations A difference equation, also sometimes called a recurrence equation is an equation that defines a sequence recursively, i.e. each

More information

CS294-9 September 14, 2006 Adam Chlipala UC Berkeley

CS294-9 September 14, 2006 Adam Chlipala UC Berkeley Interactive Computer Theorem Proving Lecture 4: Inductively- Defined Predicates CS294-9 September 14, 2006 Adam Chlipala UC Berkeley 1 Administrivia The course registration database has been updated so

More information

Discrete valuation rings. Suppose F is a field. A discrete valuation on F is a function v : F {0} Z such that:

Discrete valuation rings. Suppose F is a field. A discrete valuation on F is a function v : F {0} Z such that: Discrete valuation rings Suppose F is a field. A discrete valuation on F is a function v : F {0} Z such that: 1. v is surjective. 2. v(ab) = v(a) + v(b). 3. v(a + b) min(v(a), v(b)) if a + b 0. Proposition:

More information

Supplement for MAA 3200, Prof S Hudson, Fall 2018 Constructing Number Systems

Supplement for MAA 3200, Prof S Hudson, Fall 2018 Constructing Number Systems Supplement for MAA 3200, Prof S Hudson, Fall 2018 Constructing Number Systems A major goal of this course is to construct the number systems N, Z and Q, and especially the real numbers R, which play such

More information

John L. Lehet

John L. Lehet New! Android App! SAT Mathematics Review Algebra John L. Lehet jlehet@mathmaverick.com www.mathmaverick.com SAT Math Daily Question Android App - new question each day - archive of over 200 questions -

More information