CPSC 121: Models of Computation. Module 5: Predicate Logic

Size: px
Start display at page:

Download "CPSC 121: Models of Computation. Module 5: Predicate Logic"

Transcription

1 CPSC 121: Models of Computation Module 5: Predicate Logic

2 Module 5: Predicate Logic Midterm 1: Friday February 9 th, 17:00 to 18:15 A to C (by last name): room DMP 310 D to K: room MATH 100 L to P: room FSC 1005 Q to Z: room ESB 1013 Modules 1 to 5, plus Labs 1 to 4. You can bring Two 2-sided letter-size (8.5 x 11in, x 27.94cm) piece of paper but NO CALCULATOR CPSC W T2 2

3 Module 5: Predicate Logic Assignment #2 is due Tuesday February 6 th at 16:00. Pre-class quiz #6 is due Tuesday February 13 th at 19:00 Assigned reading for the quiz: Epp, 4 th edition: 3.2, 3.4 Epp, 3 rd edition: 2.2, 2.4 Rosen, 6 th edition: 1.3, 1.4 Rosen, 7 th edition: 1.4, 1.5 CPSC W T2 3

4 Module 5: Predicate Logic Pre-class quiz #7 is tentatively due Thursday March 1 st at 19:00. Assigned reading for the quiz: Epp, 4 th edition: 4.1, 4.6, Theorem Epp, 3 rd edition: 3.1, 3.6, Theorem Rosen, 6 th edition: 1.6, (theorem 2 only). Rosen 7 th edition: 1.7, 1.8, 4.1 (theorem 2 only). CPSC W T2 4

5 Module 5: Predicate Logic Quiz 5 feedback: Very well done; only one question below 90%: If D is the set of 8 bit signed integers, is x D, y D, ((x > 0) ^ (y > 0)) (x + y) > 0 true? Answer: NO. For instance = -56. As usual, we will discuss the open-ended question (what it means for an algorithm to be faster or slower than another one) in class. CPSC W T2 5

6 Module 5: Predicate Logic By the start of class, you should be able to Evaluate the truth of predicates applied to particular values. Show a predicate logic statement is true by enumerating examples, i.e. one (all) in the domain for an existential (universal) quantifier. Show a predicate logic statement is false by enumerating counterexamples, i.e. all (one) in the domain for an existential (universal) quantifier. Translate between statements in formal predicate logic notation and equivalent statements in closely matching informal language, i.e., informal statements with clear and explicitly stated quantifiers. CPSC W T2 6

7 Module 5: Predicate Logic CPSC 121: the BIG questions:??? How can we convince ourselves that an? algorithm? does what it's supposed to do? We need to prove that it?? works. We have done a few proofs in the last week or so.??? Many statements (that we need to prove) involve quantifiers. How do we determine whether? or not one algorithm is better?? than another one?? We can finally answer? that question!? CPSC W T2 7

8 Module 5: Predicate Logic By the end of this module, you should be able to: Build statements about the relationships between properties of various objects using predicate logic. These may be real-world like every candidate got votes from at least two people in every province or computing related like on the i th repetition of this algorithm, the variable min contains the smallest element in the list between element 0 and element i. CPSC W T2 8

9 Module 5: Predicate Logic Module Summary Predicates vs Propositions Examples More examples: sorted lists Algorithm efficiency revisited. Additional examples to consider. CPSC W T2 9

10 Module 5.1: Predicates vs Propositions Is Propositional Logic a complete model? Can it be used to model every real-world situation? Which of the following can it model effectively? a) Specializing abstract patterns to specific instances, like... so Donald Trump was born in the United States of America. b) Defining what it means for a number to be prime. c) Generalizing from examples to abstract patterns like everyone takes off their shoes at airport security. d) It can model all of these effectively. e) It can not model any of these effectively. CPSC W T2 10

11 Module 5.1: Predicates vs Propositions What is predicate logic good for modeling? Relationships among real-world objects. Generalizations about patterns Infinite domains Generally, problems where the properties of the different concepts, or parts, depend on each other. CPSC W T2 12

12 Module 5.1: Predicates vs Propositions Examples of predicate logic use: Data structures: Every key stored in the left subtree of a node N is smaller than the key stored at N. [CPSC 221] Language definition: No path via references exists from any variable in scope to any memory location available for garbage collection... [CPSC 311 or 312] Databases: the relational model is based on predicate logic. [CPSC 304] Algorithms: in the worst case, every comparison sort requires at least cnlog 2 n comparisons to sort n values, for some constant c > 0. [CPSC 320] CPSC W T2 13

13 Module 5.1: Predicates vs Propositions Quantifiers scope: A quantifier applies to everything to its right, up to the closing parenthesis of the () pair that contains it. Example: x D, y E, Q x, y z F, R y, z P x CPSC W T2 14

14 Module 5.1: Predicates vs Propositions Quantifiers scope (continued) Which of the following placements of parentheses yields the same meaning as: x Z, y Z, x < y Even(y)? a) ( x Z), y Z, x < y Even(y) b) ( x Z, y Z, x < y) Even(y) c) ( x Z, y Z, x < y Even(y)) d) None of the above. CPSC W T2 15

15 Module 5.1: Predicates vs Propositions Negation scope: Which of the following placements of parentheses yields the same meaning as: ~ x Z +, y Z +, x < y Even(y)? a) (~( x)) Z +, y Z +, x < y Even(y) b) (~( x Z + )), y Z +, x < y Even(y) c) (~( x Z +, y Z +, x < y)) Even(y) d) (~( x Z +, y Z +, x < y Even(y) )) e) None of the above. CPSC W T2 17

16 Module 5.1: Predicates vs Propositions What is the difference between a proposition and a predicate? a) A predicate may contain one or more quantifiers, but a proposition never does. b) A proposition's name is a lowercase letter, whereas a predicate's name is an uppercase letter. c) A predicate may contain unbound variables, but a proposition does not. d) They are the same thing, using different names. e) None of the above. CPSC W T2 19

17 Module 5.1: Predicates vs Propositions What is the truth value of the proposition: x Z, x*x = y? a) True because (for example) 5 * 5 = 25 b) True because every y = y * y c) False, because of counterexamples like no integer multiplied by itself equals 3 d) It depends on y, but given a value for y, we could calculate a truth value. e) None of the above. CPSC W T2 21

18 Module 5.1: Predicates vs Propositions Which variables do we need values for in order to determine this formula's truth value? i a) i and v b) l and n c) n and v d) i and n Z +, (i n) ~ v Z +, HasValue(l, i, v) e) None of these are correct. CPSC W T2 23

19 Module 5.1: Predicates vs Propositions A predicate is a logic formula with unbound variables, such as Perfect Square(y): x Z, x*x = y Then PerfectSquare(25) is PerfectSquare(27) is y Z, PerfectSquare(y) is y Z, PerfectSquare(y) is CPSC W T2 25

20 Module 5: Predicate Logic Module Summary Predicates vs Propositions Examples More examples: sorted lists Algorithm efficiency revisited. Additional examples to consider. CPSC W T2 26

21 Module 5.2: Examples Given the definitions: F: the set of foods. E(x): Alice eats food x. g: Alice grows. s: Alice shrinks. (c) Walt Disney Co. CPSC W T2 27

22 Module 5.2: Examples Express these statements using predicate logic: Eating food causes Alice to grow or shrink. Alice shrank when she ate some food. CPSC W T2 28

23 Module 5.2: Examples Given the definitions: F(x): x is a fierce creature. L(x): x is a lion C(x): x drinks coffee D: the set of all creatures. T(x,y): creature x has tasted creature y. (c) animal.discovery.com CPSC W T2 29

24 Module 5.2: Examples Express these statements using predicate logic: All lions are fierce. Some lions do not drink coffee. CPSC W T2 30

25 Module 5.2: Examples Compare and contrast the following: Some creature drinks coffee Some lion drinks coffee Some fierce lion drinks coffee (restricting the domain of an existential stmt) CPSC W T2 31

26 Module 5.2: Examples Compare and contrast the following: Every creature drinks coffee Every lion drinks coffee Every fierce lion drinks coffee (restricting the domain of an universal stmt) CPSC W T2 32

27 Module 5.2: Examples Consider the statement All fierce creatures are not lions Give two different (not logically equivalent) translations into predicate logic. Why did we end up with two translations? CPSC W T2 33

28 Module 5.2: Examples Express these two propositions in English: x D, y D, T(x,y) y D, x D, T(x,y) Give an example where one of the propositions is true, and the other proposition is false. CPSC W T2 34

29 Module 5: Predicate Logic Module Summary Predicates vs Propositions Examples More examples: sorted lists Algorithm efficiency revisited. Additional examples to consider. CPSC W T2 35

30 Module 5.3: More examples: sorted lists Definitions: Assume that L represents a list of values. The length of L is denoted by (length L). The i th element of L is denoted by (list-ref L i). The first element of L is (list-ref L 0). Are length and list-ref predicates? No: a predicate is a function that returns true or false. What do these functions return? length: an integer. list-ref: a value whose type depends on the contents of L. CPSC W T2 36

31 Module 5.3: More examples: sorted lists Problem: Define a predicate Sorted(L) whose value is true if and only if L is sorted in non-decreasing order. We can use the functions length and list-ref. Assumption: The call (list-ref L i) returns an undefined value if i is negative, or greater than or equal to (length L). Recall the first element of L is (list-ref L 0), so L's last element is (list-ref L (- (length L) 1)). CPSC W T2 37

32 Module 5.3: More examples: sorted lists Which of the following is/are a problem with this definition? Sorted(L) i N j N (list-ref L i) ^ (list-ref L j) ^ v i < v j a) There is no quantifier for L. b) There are no quantifiers for v i and v j. c) We can not use ^ with (list-ref L i) and (list-ref L j) d) Both (a) and (b) e) Both (b) and (c) CPSC W T2 38

33 Module 5.3: More examples: sorted lists Which of the following is a problem with this definition? Sorted(L) i N j N i < j (list-ref L i) < (list-ref L j) a) It is too restrictive (it does not allow for equal values). b) It does not restrict the ranges of i and j. c) It is missing quantifiers. d) Both (a) and (b) e) Both (b) and (c) CPSC W T2 40

34 Module 5.3: More examples: sorted lists How do we modify the attempt on the previous slide to get a working predicate? Sorted(L) i N j N i < j (list-ref L i) < (list-ref L j) CPSC W T2 42

35 Module 5.3: More examples: sorted lists There exists means there is at least one. How do we write there is exactly one? lists have exactly one element at each valid index. Definitions: There is exactly one There is at most one with property P There are at least two CPSC W T2 43

36 Module 5.3: More examples: sorted lists Soon we will use English more often than we will write every predicate explicitly using logic. However the ability to use predicate logic will help us think things through and not overlook minor (but important) details. when we become comfortable with formal manipulations, we can use them to check our intuition, and then we can use our intuition to check our formal manipulations. -- Epp, (4 th ed), p. 127 CPSC W T2 44

37 Module 5: Predicate Logic Module Summary Predicates vs Propositions Examples More examples: sorted lists Algorithm efficiency revisited Additional examples to consider CPSC W T2 45

38 Module 5.4: Algorithm efficiency revisited What does it mean for one algorithm to be generally faster than another algorithm? Here are some answers we saw on the quiz: Algorithm A is generally faster because as the problem size gets larger, A will only get slightly slower while B will get exponentially slower, so B is a slower algorithm in general. For an algorithm to be considered generally faster. It must be in most cases faster. Looking at the diagram above we see that algorithm B is generally faster up to a certain point.certain algorithms work best with a small set of data but then when scaling to larger collections of data get slower. CPSC W T2 46

39 Module 5.4: Algorithm efficiency revisited More responses: For an algorithm to be faster than another, it could mean that the algorithm takes less time to produce an output than another. However, if the speed of an algorithm depends on the input it's given, then we can't necessarily say it is ""faster,"" because it isn't always so. We could then define an algorithm as faster if, on average, it takes the least amount of time to return an output as compared to other algorithms. We could also define faster based on the storage space used up by an algorithm; a simpler algorithm could be equivalent to a more complicated one but be more efficient with both time and space. CPSC W T2 47

40 Module 5.4: Algorithm efficiency revisited More responses: There is likely a certain range of inputs for which Algorithm B is much faster at solving compared to Algorithm A, and vice versa. What would have to be looked at is which range of inputs are more commonly used. The easiest way to compare the two algorithms would be to compare the longest amount of time either algorithm could possibly take. It would also be useful to compare the average amount of time each algorithm would take. The easiest way to compare the two algorithms would be to compare the longest amount of time either algorithm could possibly take. It would also be useful to compare the average amount of time each algorithm would take. CPSC W T2 48

41 Module 5.4: Algorithm efficiency revisited Consider the following problem: Given: a sorted list of names with phone numbers. Wanted: the phone number for a given name N. Which algorithm is generally faster? Algorithm L: check the first name. If it's not N, then check the second name. Then the third name, etc. Algorithm B: check the name in the middle of the list. If N comes earlier alphabetically then search the first half of the list using B. If it comes later search the second half of the list instead. Repeat until you have found N or you're looking at an empty sublist. CPSC W T2 49

42 Module 5.4: Algorithm efficiency revisited Assumptions: Reading the name after the current name takes 1s on average. Reading a name given its position takes 10s on average. For a list with 15 names: Algorithm L takes 15 * 1s = 15s in the worst case. Algorithm B takes 4 * 10s = 40s in the worst case. CPSC W T2 50

43 Module 5.4: Algorithm efficiency revisited For a list with 63 names: Algorithm L takes 63 * 1s = 1m 3s in the worst case. Algorithm B takes 6 * 10s = 1m 0s in the worst case. For a list with names: Algorithm L takes * 1s = 12d 3h 16m 15s in the worst case. Algorithm B takes 20 * 10s = 3m 20s in the worst case. CPSC W T2 51

44 Module 5.4: Algorithm efficiency revisited How do we determine whether or not an algorithm is generally faster than another? We want to measure how good the algorithm is, in a way that does not depend on the programming language used to implement it. the quality of the compiler or interpreter. the speed of the computer it is executed on. One idea is to count the number of elementary steps of the algorithm as a function of the size of its input n. A step is anything that can be computed in constant time, that is, independent from n. CPSC W T2 52

45 Module 5.4: Algorithm efficiency revisited Is an algorithm with 3n steps faster than one with 6n steps? a) Yes, always. b) No, never. c) Sometimes. d) None of the above. CPSC W T2 53

46 Module 5.4: Algorithm efficiency revisited Example: One algorithm performs 6n steps of the following type (only the first 6 are written): The other algorithm performs 3n steps of the following type (only the first 3 are written): 2 5 x 4 x 2 2 dx 1 6 xcos( x)+sin (x)dx 1 1 x 2 dx Which one is faster? CPSC W T2 55

47 Module 5.4: Algorithm efficiency revisited Facts about execution times: we can not rely on the values of the constants in front of the functions describing the number of steps. it's almost impossible to compute the number of steps exactly. So we want to come up with a way to count steps that ignores these constants. an approximation of the correct number of steps. CPSC W T2 56

48 Module 5.4: Algorithm efficiency revisited Terminology: an algorithm runs in O(g) time, stated big-oh of g time, if it performs at most g(n) steps (approximately). Examples: Algorithm L runs in O(n) time. Algorithm B runs in O(log 2 n) time. The algorithm we used to order students by date of birth runs in O(n 2 ) time. Let's see how we can define O using quantifiers. CPSC W T2 57

49 Module 5.4: Algorithm efficiency revisited Which of the following predicates says that the number of steps f(n) is (approximately) at most n 2? a) c R + n N f(n) cn 2 b) c R + n N f(n) cn 2 c) c R + n N f(n) cn 2 d) c R + n N f(n) cn 2 e) None of the above. CPSC W T2 58

50 Module 5.4: Algorithm efficiency revisited Which of the following functions f(n) is the last one for which the (correct) predicate from the previous slide is true? a) f(n) = n b) f(n) = n 2 /2 c) f(n) = 3n 2 d) f(n) = n 3 e) f(n) = 2 n CPSC W T2 60

51 Module 5.4: Algorithm efficiency revisited Which of the following two functions grows faster? a) f(n) = n b) f(n) = nlog 2 n c) Neither; they both grow equally fast. CPSC W T2 62

52 Module 5.4: Algorithm efficiency revisited Is the following predicate true for f(n) = n? c a) Yes b) No R + n N f(n) cnlog 2 n CPSC W T2 64

53 Module 5.4: Algorithm efficiency revisited Is the following predicate true for f(n) = n? c a) Yes b) No R + n 0 N n N n n 0 f(n) cnlog 2 n CPSC W T2 66

54 Module 5.4: Algorithm efficiency revisited So we define O(g) by: f is in O(g) if c R + n 0 N n N n n 0 f(n) cg(n) CPSC W T2 68

55 Module 5.4: Algorithm efficiency revisited Pictorially: c CPSC W T2 69 n 0

56 Module 5.4: Algorithm efficiency revisited Some common running times: 1 log n n nlog n n 2 2 n CPSC W T2 70

57 Module 5.4: Algorithm efficiency revisited How long will my algorithm take to execute? Time n = 10 n = 20 n = 100 n = 1000 n sec sec sec sec n sec sec 0.01 sec 1 sec n sec sec 1 sec 16 min 40 sec n sec 3.2 sec 2h 47 min 31.7 years 2 n sec 1 sec 4 x yrs way too long 3 n sec 58 min yrs eons CPSC W T2 71

58 Module 5.4: Algorithm efficiency revisited How big a problem can I solve if my computer is k times faster? Time k = 1 k = 10 k = 100 k = 1000 n N 10N 100N 1000N n 2 N 3.16N 10N 31.6N n 3 N 2.15N 4.64N 10N n 5 N 1.58N 2.51N 3.98N 2 n N N + 3 N + 6 N n N N + 2 N + 4 N + 6 CPSC W T2 72

59 Module 5.4: Algorithm efficiency revisited Revisiting sorted lists: Recall Sorted(L) i N j N (0 i) ^ (i < j) ^ (j < (length L)) (list-ref L i) (list-ref L j) If we verify that L is sorted using this definition, how many comparisons will we need? Can we do better? CPSC W T2 73

60 Module 5.4: Algorithm efficiency revisited Here is another definition: Sorted(L) i N (0 i) ^ (i < (length L) - 1) (list-ref L i) (list-ref L i+1) These two definitions are logically equivalent. If we verify that L is sorted using this definition, how many comparisons will we need? CPSC W T2 74

61 Module 5: Predicate Logic Module Summary Predicates vs Propositions Examples More examples: sorted lists Algorithm efficiency revisited Additional examples to consider CPSC W T2 75

62 Module 5.5: Additional examples to consider Specifying the behaviour of a function/method that takes a list l and a value x: Translate returns true if and only if either l and x are both equal to null, or l contains at least one element e that is equal to x. Define a predicate Prime(x) that evaluates to true if and only if x is a prime. Assume that you have a predicate such that x y is true if and only if x divides y (that is, y/x is an integer). CPSC W T2 76

CPSC 121: Models of Computation. Module 6: Rewriting predicate logic statements

CPSC 121: Models of Computation. Module 6: Rewriting predicate logic statements CPSC 121: Models of Computation Module 6: Rewriting predicate logic statements Module 6: Rewriting predicate logic statements Pre-class quiz #7 is due March 1st at 19:00. Assigned reading for the quiz:

More information

Notes. Notes. Introduction. Notes. Propositional Functions. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry.

Notes. Notes. Introduction. Notes. Propositional Functions. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Spring 2006 1 / 1 Computer Science & Engineering 235 Introduction to Discrete Mathematics Sections 1.3 1.4 of Rosen cse235@cse.unl.edu Introduction

More information

CPSC 121: Models of Computation Assignment #4, due Thursday, March 16 th,2017at16:00

CPSC 121: Models of Computation Assignment #4, due Thursday, March 16 th,2017at16:00 CPSC 121: Models of Computation Assignment #4, due Thursday, March 16 th,2017at16:00 [18] 1. Consider the following predicate logic statement: 9x 2 A, 8y 2 B,9z 2 C, P(x, y, z)! Q(x, y, z), where A, B,

More information

CPSC 121: Models of Computation

CPSC 121: Models of Computation CPSC 121: Models of Computation Unit 1 Propositional Logic Based on slides by Patrice Belleville and Steve Wolfman Last Updated: 2017-09-09 12:04 AM Pre Lecture Learning Goals By the start of the class,

More information

Introduction to Data Structure

Introduction to Data Structure Introduction to Data Structure CONTENTS 1.1 Basic Terminology 1. Elementary data structure organization 2. Classification of data structure 1.2 Operations on data structures 1.3 Different Approaches to

More information

6.001 Notes: Section 8.1

6.001 Notes: Section 8.1 6.001 Notes: Section 8.1 Slide 8.1.1 In this lecture we are going to introduce a new data type, specifically to deal with symbols. This may sound a bit odd, but if you step back, you may realize that everything

More information

Algorithm efficiency can be measured in terms of: Time Space Other resources such as processors, network packets, etc.

Algorithm efficiency can be measured in terms of: Time Space Other resources such as processors, network packets, etc. Algorithms Analysis Algorithm efficiency can be measured in terms of: Time Space Other resources such as processors, network packets, etc. Algorithms analysis tends to focus on time: Techniques for measuring

More information

Math 55 - Spring 04 - Lecture notes # 1 - Jan 20 (Tuesday)

Math 55 - Spring 04 - Lecture notes # 1 - Jan 20 (Tuesday) Math 55 - Spring 04 - Lecture notes # 1 - Jan 20 (Tuesday) Name, class, URL (www.cs.berkeley.edu/~demmel/ma55) on board Head TA Mike West speaks on bureaucracy Advertise CS 70 (T Th 2-3:30) as an "honors"

More information

Computation Club: Gödel s theorem

Computation Club: Gödel s theorem Computation Club: Gödel s theorem The big picture mathematicians do a lot of reasoning and write a lot of proofs formal systems try to capture the ideas of reasoning and proof in a purely mechanical set

More information

CSE 20 DISCRETE MATH. Fall

CSE 20 DISCRETE MATH. Fall CSE 20 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Final exam The final exam is Saturday December 16 11:30am-2:30pm. Lecture A will take the exam in Lecture B will take the exam

More information

TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA

TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA 1 TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and B. Ericson, and instructor materials prepared

More information

Introduction to Homotopy Type Theory

Introduction to Homotopy Type Theory Introduction to Homotopy Type Theory Lecture notes for a course at EWSCS 2017 Thorsten Altenkirch March 5, 2017 1 What is this course about? To explain what Homotopy Type Theory is, I will first talk about

More information

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Final exam The final exam is Saturday March 18 8am-11am. Lecture A will take the exam in GH 242 Lecture B will take the exam

More information

Back to the knights and knaves island

Back to the knights and knaves island Back to the knights and knaves island During your Thanksgiving trip, you found another island with knights and knaves (you have a feeling that you may encounter many such islands this semester). Knights

More information

CPSC 121 Midterm 2 Friday November 13th, 2015

CPSC 121 Midterm 2 Friday November 13th, 2015 CPSC 121 Midterm 2 Friday November 13th, 2015 [10] 1. For each of the following statements: Rewrite the statement using predicate logic. Write down ALL of the proof strategies (from the list given below),

More information

Assignment 1 (concept): Solutions

Assignment 1 (concept): Solutions CS10b Data Structures and Algorithms Due: Thursday, January 0th Assignment 1 (concept): Solutions Note, throughout Exercises 1 to 4, n denotes the input size of a problem. 1. (10%) Rank the following functions

More information

0.1 Welcome. 0.2 Insertion sort. Jessica Su (some portions copied from CLRS)

0.1 Welcome. 0.2 Insertion sort. Jessica Su (some portions copied from CLRS) 0.1 Welcome http://cs161.stanford.edu My contact info: Jessica Su, jtysu at stanford dot edu, office hours Monday 3-5 pm in Huang basement TA office hours: Monday, Tuesday, Wednesday 7-9 pm in Huang basement

More information

Chapter 1.3 Quantifiers, Predicates, and Validity. Reading: 1.3 Next Class: 1.4. Motivation

Chapter 1.3 Quantifiers, Predicates, and Validity. Reading: 1.3 Next Class: 1.4. Motivation Chapter 1.3 Quantifiers, Predicates, and Validity Reading: 1.3 Next Class: 1.4 1 Motivation Propositional logic allows to translate and prove certain arguments from natural language If John s wallet was

More information

Introduction to the Analysis of Algorithms. Algorithm

Introduction to the Analysis of Algorithms. Algorithm Introduction to the Analysis of Algorithms Based on the notes from David Fernandez-Baca Bryn Mawr College CS206 Intro to Data Structures Algorithm An algorithm is a strategy (well-defined computational

More information

Introduction to Sets and Logic (MATH 1190)

Introduction to Sets and Logic (MATH 1190) Introduction to Sets and Logic () Instructor: Email: shenlili@yorku.ca Department of Mathematics and Statistics York University Dec 4, 2014 Outline 1 2 3 4 Definition A relation R from a set A to a set

More information

CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims. Lecture 10: Asymptotic Complexity and

CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims. Lecture 10: Asymptotic Complexity and CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims Lecture 10: Asymptotic Complexity and What Makes a Good Algorithm? Suppose you have two possible algorithms or

More information

Intermediate Algebra. Gregg Waterman Oregon Institute of Technology

Intermediate Algebra. Gregg Waterman Oregon Institute of Technology Intermediate Algebra Gregg Waterman Oregon Institute of Technology c 2017 Gregg Waterman This work is licensed under the Creative Commons Attribution 4.0 International license. The essence of the license

More information

Programming Languages Third Edition

Programming Languages Third Edition Programming Languages Third Edition Chapter 12 Formal Semantics Objectives Become familiar with a sample small language for the purpose of semantic specification Understand operational semantics Understand

More information

Strategies for Proofs

Strategies for Proofs Strategies for Proofs Landscape with House and Ploughman Van Gogh Discrete Structures (CS 173) Madhusudan Parthasarathy, University of Illinois 1 Goals of this lecture A bit more logic Reviewing Implication

More information

CMPSCI 250: Introduction to Computation. Lecture #7: Quantifiers and Languages 6 February 2012

CMPSCI 250: Introduction to Computation. Lecture #7: Quantifiers and Languages 6 February 2012 CMPSCI 250: Introduction to Computation Lecture #7: Quantifiers and Languages 6 February 2012 Quantifiers and Languages Quantifier Definitions Translating Quantifiers Types and the Universe of Discourse

More information

Class Note #02. [Overall Information] [During the Lecture]

Class Note #02. [Overall Information] [During the Lecture] Class Note #02 Date: 01/11/2006 [Overall Information] In this class, after a few additional announcements, we study the worst-case running time of Insertion Sort. The asymptotic notation (also called,

More information

MATH 22 MORE ABOUT FUNCTIONS. Lecture M: 10/14/2003. Form follows function. Louis Henri Sullivan

MATH 22 MORE ABOUT FUNCTIONS. Lecture M: 10/14/2003. Form follows function. Louis Henri Sullivan MATH 22 Lecture M: 10/14/2003 MORE ABOUT FUNCTIONS Form follows function. Louis Henri Sullivan This frightful word, function, was born under other skies than those I have loved. Le Corbusier D ora innanzi

More information

CSC Discrete Math I, Spring Sets

CSC Discrete Math I, Spring Sets CSC 125 - Discrete Math I, Spring 2017 Sets Sets A set is well-defined, unordered collection of objects The objects in a set are called the elements, or members, of the set A set is said to contain its

More information

Phil 320 Chapter 1: Sets, Functions and Enumerability I. Sets Informally: a set is a collection of objects. The objects are called members or

Phil 320 Chapter 1: Sets, Functions and Enumerability I. Sets Informally: a set is a collection of objects. The objects are called members or Phil 320 Chapter 1: Sets, Functions and Enumerability I. Sets Informally: a set is a collection of objects. The objects are called members or elements of the set. a) Use capital letters to stand for sets

More information

CS 6402 DESIGN AND ANALYSIS OF ALGORITHMS QUESTION BANK

CS 6402 DESIGN AND ANALYSIS OF ALGORITHMS QUESTION BANK CS 6402 DESIGN AND ANALYSIS OF ALGORITHMS QUESTION BANK Page 1 UNIT I INTRODUCTION 2 marks 1. Why is the need of studying algorithms? From a practical standpoint, a standard set of algorithms from different

More information

Set and Set Operations

Set and Set Operations Set and Set Operations Introduction A set is a collection of objects. The objects in a set are called elements of the set. A well defined set is a set in which we know for sure if an element belongs to

More information

2.2 Syntax Definition

2.2 Syntax Definition 42 CHAPTER 2. A SIMPLE SYNTAX-DIRECTED TRANSLATOR sequence of "three-address" instructions; a more complete example appears in Fig. 2.2. This form of intermediate code takes its name from instructions

More information

Big-O-ology 1 CIS 675: Algorithms January 14, 2019

Big-O-ology 1 CIS 675: Algorithms January 14, 2019 Big-O-ology 1 CIS 675: Algorithms January 14, 2019 1. The problem Consider a carpenter who is building you an addition to your house. You would not think much of this carpenter if she or he couldn t produce

More information

Searching Algorithms/Time Analysis

Searching Algorithms/Time Analysis Searching Algorithms/Time Analysis CSE21 Fall 2017, Day 8 Oct 16, 2017 https://sites.google.com/a/eng.ucsd.edu/cse21-fall-2017-miles-jones/ (MinSort) loop invariant induction Loop invariant: After the

More information

Chapter 8 Algorithms 1

Chapter 8 Algorithms 1 Chapter 8 Algorithms 1 Objectives After studying this chapter, the student should be able to: Define an algorithm and relate it to problem solving. Define three construct and describe their use in algorithms.

More information

9/19/12. Why Study Discrete Math? What is discrete? Sets (Rosen, Chapter 2) can be described by discrete math TOPICS

9/19/12. Why Study Discrete Math? What is discrete? Sets (Rosen, Chapter 2) can be described by discrete math TOPICS What is discrete? Sets (Rosen, Chapter 2) TOPICS Discrete math Set Definition Set Operations Tuples Consisting of distinct or unconnected elements, not continuous (calculus) Helps us in Computer Science

More information

Agenda. The worst algorithm in the history of humanity. Asymptotic notations: Big-O, Big-Omega, Theta. An iterative solution

Agenda. The worst algorithm in the history of humanity. Asymptotic notations: Big-O, Big-Omega, Theta. An iterative solution Agenda The worst algorithm in the history of humanity 1 Asymptotic notations: Big-O, Big-Omega, Theta An iterative solution A better iterative solution The repeated squaring trick Fibonacci sequence 2

More information

Recursively Enumerable Languages, Turing Machines, and Decidability

Recursively Enumerable Languages, Turing Machines, and Decidability Recursively Enumerable Languages, Turing Machines, and Decidability 1 Problem Reduction: Basic Concepts and Analogies The concept of problem reduction is simple at a high level. You simply take an algorithm

More information

Software Paradigms (Lesson 6) Logic Programming

Software Paradigms (Lesson 6) Logic Programming Software Paradigms (Lesson 6) Logic Programming Table of Contents 1 Introduction... 2 2 Facts... 3 3 Predicates (Structured Terms)... 4 3.1 General Structures... 4 3.2 Predicates (Syntax)... 4 3.3 Simple

More information

CITS2211 Discrete Structures Logic

CITS2211 Discrete Structures Logic CITS2211 Discrete Structures Logic Unit coordinator: Rachel Cardell-Oliver August 6, 2017 Highlights All men are mortal, Socrates is a man, therefore Socrates is mortal. Reading Chapter 3: Logical Formulas

More information

Basic data types. Building blocks of computation

Basic data types. Building blocks of computation Basic data types Building blocks of computation Goals By the end of this lesson you will be able to: Understand the commonly used basic data types of C++ including Characters Integers Floating-point values

More information

Intro. Speed V Growth

Intro. Speed V Growth Intro Good code is two things. It's elegant, and it's fast. In other words, we got a need for speed. We want to find out what's fast, what's slow, and what we can optimize. First, we'll take a tour of

More information

Why study algorithms? CS 561, Lecture 1. Today s Outline. Why study algorithms? (II)

Why study algorithms? CS 561, Lecture 1. Today s Outline. Why study algorithms? (II) Why study algorithms? CS 561, Lecture 1 Jared Saia University of New Mexico Seven years of College down the toilet - John Belushi in Animal House Q: Can I get a programming job without knowing something

More information

Organisation. Assessment

Organisation. Assessment Week 1 s s Getting Started 1 3 4 5 - - Lecturer Dr Lectures Tuesday 1-13 Fulton House Lecture room Tuesday 15-16 Fulton House Lecture room Thursday 11-1 Fulton House Lecture room Friday 10-11 Glyndwr C

More information

Material from Recitation 1

Material from Recitation 1 Material from Recitation 1 Darcey Riley Frank Ferraro January 18, 2011 1 Introduction In CSC 280 we will be formalizing computation, i.e. we will be creating precise mathematical models for describing

More information

Algorithms and Data Structures

Algorithms and Data Structures Algorithms and Data Structures Spring 2019 Alexis Maciel Department of Computer Science Clarkson University Copyright c 2019 Alexis Maciel ii Contents 1 Analysis of Algorithms 1 1.1 Introduction.................................

More information

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

6.080 / Great Ideas in Theoretical Computer Science Spring 2008 MIT OpenCourseWare http://ocw.mit.edu 6.8 / 6.89 Great Ideas in Theoretical Computer Science Spring 28 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

More information

6.001 Notes: Section 4.1

6.001 Notes: Section 4.1 6.001 Notes: Section 4.1 Slide 4.1.1 In this lecture, we are going to take a careful look at the kinds of procedures we can build. We will first go back to look very carefully at the substitution model,

More information

asymptotic growth rate or order compare two functions, but ignore constant factors, small inputs

asymptotic growth rate or order compare two functions, but ignore constant factors, small inputs Big-Oh 1 asymptotic growth rate or order 2 compare two functions, but ignore constant factors, small inputs asymptotic growth rate or order 2 compare two functions, but ignore constant factors, small inputs

More information

SOFTWARE ENGINEERING DESIGN I

SOFTWARE ENGINEERING DESIGN I 2 SOFTWARE ENGINEERING DESIGN I 3. Schemas and Theories The aim of this course is to learn how to write formal specifications of computer systems, using classical logic. The key descriptional technique

More information

for all x, the assertion P(x) is false. there exists x, for which the assertion P(x) is true.

for all x, the assertion P(x) is false. there exists x, for which the assertion P(x) is true. You can t prove a predicate is true because a predicate is not an assertion, you can t prove it is valid as it is not a deduction! If someone asks you to prove P(x), it is not totally clear what they mean.

More information

Admin. How's the project coming? After these slides, read chapter 13 in your book. Quizzes will return

Admin. How's the project coming? After these slides, read chapter 13 in your book. Quizzes will return Recursion CS 1 Admin How's the project coming? After these slides, read chapter 13 in your book Yes that is out of order, but we can read it stand alone Quizzes will return Tuesday Nov 29 th see calendar

More information

Data Structure and Algorithm Midterm Reference Solution TA

Data Structure and Algorithm Midterm Reference Solution TA Data Structure and Algorithm Midterm Reference Solution TA email: dsa1@csie.ntu.edu.tw Problem 1. To prove log 2 n! = Θ(n log n), it suffices to show N N, c 1, c 2 > 0 such that c 1 n ln n ln n! c 2 n

More information

Example: NFA to DFA Conversion

Example: NFA to DFA Conversion CPSC 121 Lecture 36 April 8, 2009 Menu April 8, 2009 Topics: Example: NFA to DFA Conversion Final Reading List Summary The End! Reminders: On-line Quiz 12 deadline 5:00pm TODAY Teaching evaluation survey

More information

(Refer Slide Time: 1:27)

(Refer Slide Time: 1:27) Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture 1 Introduction to Data Structures and Algorithms Welcome to data

More information

Mathematical Logic Part One

Mathematical Logic Part One Mathematical Logic Part One Question: How do we formalize the logic we've been using in our proofs? Where We're Going Propositional Logic (Today) Basic logical connectives. Truth tables. Logical equivalences.

More information

Lecture 5: The Halting Problem. Michael Beeson

Lecture 5: The Halting Problem. Michael Beeson Lecture 5: The Halting Problem Michael Beeson Historical situation in 1930 The diagonal method appears to offer a way to extend just about any definition of computable. It appeared in the 1920s that it

More information

n! = 1 * 2 * 3 * 4 * * (n-1) * n

n! = 1 * 2 * 3 * 4 * * (n-1) * n The Beauty and Joy of Computing 1 Lab Exercise 9: Problem self-similarity and recursion Objectives By completing this lab exercise, you should learn to Recognize simple self-similar problems which are

More information

CPSC 121 Some Sample Questions for the Final Exam Tuesday, April 15, 2014, 8:30AM

CPSC 121 Some Sample Questions for the Final Exam Tuesday, April 15, 2014, 8:30AM CPSC 121 Some Sample Questions for the Final Exam Tuesday, April 15, 2014, 8:30AM Name: Student ID: Signature: Section (circle one): George Steve Your signature acknowledges your understanding of and agreement

More information

CPSC 121: Models of Computation. Module 8: Sequential Circuits

CPSC 121: Models of Computation. Module 8: Sequential Circuits CPSC 121: Models of Computation By the start of class, you should be able to race the operation of a DA (deterministic finitestate automaton) represented as a diagram on an input, and indicate whether

More information

Program Verification & Testing; Review of Propositional Logic

Program Verification & Testing; Review of Propositional Logic 8/24: p.1, solved; 9/20: p.5 Program Verification & Testing; Review of Propositional Logic CS 536: Science of Programming, Fall 2018 A. Why Course guidelines are important. Active learning is the style

More information

Greedy Algorithms 1 {K(S) K(S) C} For large values of d, brute force search is not feasible because there are 2 d {1,..., d}.

Greedy Algorithms 1 {K(S) K(S) C} For large values of d, brute force search is not feasible because there are 2 d {1,..., d}. Greedy Algorithms 1 Simple Knapsack Problem Greedy Algorithms form an important class of algorithmic techniques. We illustrate the idea by applying it to a simplified version of the Knapsack Problem. Informally,

More information

How invariants help writing loops Author: Sander Kooijmans Document version: 1.0

How invariants help writing loops Author: Sander Kooijmans Document version: 1.0 How invariants help writing loops Author: Sander Kooijmans Document version: 1.0 Why this document? Did you ever feel frustrated because of a nasty bug in your code? Did you spend hours looking at the

More information

Catalan Numbers. Table 1: Balanced Parentheses

Catalan Numbers. Table 1: Balanced Parentheses Catalan Numbers Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles November, 00 We begin with a set of problems that will be shown to be completely equivalent. The solution to each problem

More information

COMP 250 Fall recurrences 2 Oct. 13, 2017

COMP 250 Fall recurrences 2 Oct. 13, 2017 COMP 250 Fall 2017 15 - recurrences 2 Oct. 13, 2017 Here we examine the recurrences for mergesort and quicksort. Mergesort Recall the mergesort algorithm: we divide the list of things to be sorted into

More information

MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #2 Examination 12:30 noon, Thursday, March 15, 2012

MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #2 Examination 12:30 noon, Thursday, March 15, 2012 MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #2 Examination 12:30 noon, Thursday, March 15, 2012 Instructor: K. S. Booth Time: 70 minutes (one hour ten minutes)

More information

17/05/2018. Outline. Outline. Divide and Conquer. Control Abstraction for Divide &Conquer. Outline. Module 2: Divide and Conquer

17/05/2018. Outline. Outline. Divide and Conquer. Control Abstraction for Divide &Conquer. Outline. Module 2: Divide and Conquer Module 2: Divide and Conquer Divide and Conquer Control Abstraction for Divide &Conquer 1 Recurrence equation for Divide and Conquer: If the size of problem p is n and the sizes of the k sub problems are

More information

Pseudo code of algorithms are to be read by.

Pseudo code of algorithms are to be read by. Cs502 Quiz No1 Complete Solved File Pseudo code of algorithms are to be read by. People RAM Computer Compiler Approach of solving geometric problems by sweeping a line across the plane is called sweep.

More information

Overview of Data. 1. Array 2. Linked List 3. Stack 4. Queue

Overview of Data. 1. Array 2. Linked List 3. Stack 4. Queue Overview of Data A data structure is a particular way of organizing data in a computer so that it can be used effectively. The idea is to reduce the space and time complexities of different tasks. Below

More information

CS302 Topic: Algorithm Analysis. Thursday, Sept. 22, 2005

CS302 Topic: Algorithm Analysis. Thursday, Sept. 22, 2005 CS302 Topic: Algorithm Analysis Thursday, Sept. 22, 2005 Announcements Lab 3 (Stock Charts with graphical objects) is due this Friday, Sept. 23!! Lab 4 now available (Stock Reports); due Friday, Oct. 7

More information

Time Complexity of an Algorithm

Time Complexity of an Algorithm CPSC 211 Data Structures & Implementations (c) Texas A&M University [ 335] Time Complexity of an Algorithm Time complexity of an algorithm: the function T (n) that describes the (worst-case) running time

More information

Notes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 3 Notes. Class URL:

Notes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 3 Notes. Class URL: Notes slides from before lecture CSE 21, Winter 2017, Section A00 Lecture 3 Notes Class URL: http://vlsicad.ucsd.edu/courses/cse21-w17/ Notes slides from before lecture Notes January 18 (1) HW2 has been

More information

a b c d a b c d e 5 e 7

a b c d a b c d e 5 e 7 COMPSCI 230 Homework 9 Due on April 5, 2016 Work on this assignment either alone or in pairs. You may work with different partners on different assignments, but you can only have up to one partner for

More information

Advanced Operations Research Techniques IE316. Quiz 1 Review. Dr. Ted Ralphs

Advanced Operations Research Techniques IE316. Quiz 1 Review. Dr. Ted Ralphs Advanced Operations Research Techniques IE316 Quiz 1 Review Dr. Ted Ralphs IE316 Quiz 1 Review 1 Reading for The Quiz Material covered in detail in lecture. 1.1, 1.4, 2.1-2.6, 3.1-3.3, 3.5 Background material

More information

Lecture 3: Recursion; Structural Induction

Lecture 3: Recursion; Structural Induction 15-150 Lecture 3: Recursion; Structural Induction Lecture by Dan Licata January 24, 2012 Today, we are going to talk about one of the most important ideas in functional programming, structural recursion

More information

Richard Feynman, Lectures on Computation

Richard Feynman, Lectures on Computation Chapter 8 Sorting and Sequencing If you keep proving stuff that others have done, getting confidence, increasing the complexities of your solutions for the fun of it then one day you ll turn around and

More information

Table of Laplace Transforms

Table of Laplace Transforms Table of Laplace Transforms 1 1 2 3 4, p > -1 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 Heaviside Function 27 28. Dirac Delta Function 29 30. 31 32. 1 33 34. 35 36. 37 Laplace Transforms

More information

CS103 Spring 2018 Mathematical Vocabulary

CS103 Spring 2018 Mathematical Vocabulary CS103 Spring 2018 Mathematical Vocabulary You keep using that word. I do not think it means what you think it means. - Inigo Montoya, from The Princess Bride Consider the humble while loop in most programming

More information

2. Sets. 2.1&2.2: Sets and Subsets. Combining Sets. c Dr Oksana Shatalov, Fall

2. Sets. 2.1&2.2: Sets and Subsets. Combining Sets. c Dr Oksana Shatalov, Fall c Dr Oksana Shatalov, Fall 2014 1 2. Sets 2.1&2.2: Sets and Subsets. Combining Sets. Set Terminology and Notation DEFINITIONS: Set is well-defined collection of objects. Elements are objects or members

More information

CS112 Friday, September 12, 2008

CS112 Friday, September 12, 2008 CS112 Friday, September 12, 2008 Agenda Natural Deduction Questions FOL Translations FOL Interpretations Natural Deduction Questions? First Order Logic Translations Symbolization Key Universe of Discourse

More information

DDS Dynamic Search Trees

DDS Dynamic Search Trees DDS Dynamic Search Trees 1 Data structures l A data structure models some abstract object. It implements a number of operations on this object, which usually can be classified into l creation and deletion

More information

Statistics Case Study 2000 M. J. Clancy and M. C. Linn

Statistics Case Study 2000 M. J. Clancy and M. C. Linn Statistics Case Study 2000 M. J. Clancy and M. C. Linn Problem Write and test functions to compute the following statistics for a nonempty list of numeric values: The mean, or average value, is computed

More information

Midterm 1 Solutions. (i) False. One possible counterexample is the following: n n 3

Midterm 1 Solutions. (i) False. One possible counterexample is the following: n n 3 CS 170 Efficient Algorithms & Intractable Problems, Spring 2006 Midterm 1 Solutions Note: These solutions are not necessarily model answers. Rather, they are designed to be tutorial in nature, and sometimes

More information

Week 12: Running Time and Performance

Week 12: Running Time and Performance Week 12: Running Time and Performance 1 Most of the problems you have written in this class run in a few seconds or less Some kinds of programs can take much longer: Chess algorithms (Deep Blue) Routing

More information

BOOLEAN ALGEBRA AND CIRCUITS

BOOLEAN ALGEBRA AND CIRCUITS UNIT 3 Structure BOOLEAN ALGEBRA AND CIRCUITS Boolean Algebra and 3. Introduction 3. Objectives 3.2 Boolean Algebras 3.3 Logic 3.4 Boolean Functions 3.5 Summary 3.6 Solutions/ Answers 3. INTRODUCTION This

More information

Algorithm Analysis. College of Computing & Information Technology King Abdulaziz University. CPCS-204 Data Structures I

Algorithm Analysis. College of Computing & Information Technology King Abdulaziz University. CPCS-204 Data Structures I Algorithm Analysis College of Computing & Information Technology King Abdulaziz University CPCS-204 Data Structures I Order Analysis Judging the Efficiency/Speed of an Algorithm Thus far, we ve looked

More information

Mathematical Logic Part One

Mathematical Logic Part One Mathematical Logic Part One Question: How do we formalize the logic we've been using in our proofs? Where We're Going Propositional Logic (Today) Basic logical connectives. Truth tables. Logical equivalences.

More information

A-SSE.1.1, A-SSE.1.2-

A-SSE.1.1, A-SSE.1.2- Putnam County Schools Curriculum Map Algebra 1 2016-2017 Module: 4 Quadratic and Exponential Functions Instructional Window: January 9-February 17 Assessment Window: February 20 March 3 MAFS Standards

More information

Fundamental Graph Algorithms Part Three

Fundamental Graph Algorithms Part Three Fundamental Graph Algorithms Part Three Outline for Today Topological Sorting, Part II How can we quickly compute a topological ordering on a DAG? Connected Components How do we find the pieces of an undirected

More information

The Limits of Sorting Divide-and-Conquer Comparison Sorts II

The Limits of Sorting Divide-and-Conquer Comparison Sorts II The Limits of Sorting Divide-and-Conquer Comparison Sorts II CS 311 Data Structures and Algorithms Lecture Slides Monday, October 12, 2009 Glenn G. Chappell Department of Computer Science University of

More information

CS 137 Part 7. Big-Oh Notation, Linear Searching and Basic Sorting Algorithms. November 10th, 2017

CS 137 Part 7. Big-Oh Notation, Linear Searching and Basic Sorting Algorithms. November 10th, 2017 CS 137 Part 7 Big-Oh Notation, Linear Searching and Basic Sorting Algorithms November 10th, 2017 Big-Oh Notation Up to this point, we ve been writing code without any consideration for optimization. There

More information

DOWNLOAD PDF BIG IDEAS MATH VERTICAL SHRINK OF A PARABOLA

DOWNLOAD PDF BIG IDEAS MATH VERTICAL SHRINK OF A PARABOLA Chapter 1 : BioMath: Transformation of Graphs Use the results in part (a) to identify the vertex of the parabola. c. Find a vertical line on your graph paper so that when you fold the paper, the left portion

More information

Computer Science 210 Data Structures Siena College Fall Topic Notes: Complexity and Asymptotic Analysis

Computer Science 210 Data Structures Siena College Fall Topic Notes: Complexity and Asymptotic Analysis Computer Science 210 Data Structures Siena College Fall 2017 Topic Notes: Complexity and Asymptotic Analysis Consider the abstract data type, the Vector or ArrayList. This structure affords us the opportunity

More information

Analysis of Algorithms. CS 1037a Topic 13

Analysis of Algorithms. CS 1037a Topic 13 Analysis of Algorithms CS 1037a Topic 13 Overview Time complexity - exact count of operations T(n) as a function of input size n - complexity analysis using O(...) bounds - constant time, linear, logarithmic,

More information

Remember, to manage anything, we need to measure it. So, how do we compare two implementations? ArrayBag vs. LinkedBag Which is more efficient?

Remember, to manage anything, we need to measure it. So, how do we compare two implementations? ArrayBag vs. LinkedBag Which is more efficient? CS706 Intro to Object Oriented Dev II - Spring 04 Announcements Week 4 Program due Two Weeks! Lab 3-4 required completion this week First web-cat submission Material Evaluation of efficiency Time Analysis

More information

Another Sorting Algorithm

Another Sorting Algorithm 1 Another Sorting Algorithm What was the running time of insertion sort? Can we do better? 2 Designing Algorithms Many ways to design an algorithm: o Incremental: o Divide and Conquer: 3 Divide and Conquer

More information

Boolean algebra. June 17, Howard Huang 1

Boolean algebra. June 17, Howard Huang 1 Boolean algebra Yesterday we talked about how analog voltages can represent the logical values true and false. We introduced the basic Boolean operations AND, OR and NOT, which can be implemented in hardware

More information

SEARCHING, SORTING, AND ASYMPTOTIC COMPLEXITY. Lecture 11 CS2110 Spring 2016

SEARCHING, SORTING, AND ASYMPTOTIC COMPLEXITY. Lecture 11 CS2110 Spring 2016 1 SEARCHING, SORTING, AND ASYMPTOTIC COMPLEXITY Lecture 11 CS2110 Spring 2016 Time spent on A2 2 Histogram: [inclusive:exclusive) [0:1): 0 [1:2): 24 ***** [2:3): 84 ***************** [3:4): 123 *************************

More information

Math Introduction to Advanced Mathematics

Math Introduction to Advanced Mathematics Math 215 - Introduction to Advanced Mathematics Number Theory Fall 2017 The following introductory guide to number theory is borrowed from Drew Shulman and is used in a couple of other Math 215 classes.

More information

Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi

Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture 20 Priority Queues Today we are going to look at the priority

More information