Do not turn this page until you have received the signal to start. Please fill out the identification section above. Good Luck!

Size: px
Start display at page:

Download "Do not turn this page until you have received the signal to start. Please fill out the identification section above. Good Luck!"

Transcription

1 CSC 373H5 F 2017 Midterm Duration 1 hour and 50 minutes Last Name: Lecture Section: 1 Student Number: First Name: Instructor: Vincent Maccio Do not turn this page until you have received the signal to start. Please fill out the identification section above. Good Luck! This test consists of 6 questions and 8 pages total (including this one). When you receive the signal to start, please make sure that your copy is complete. The midterm is graded out of a total of 30 marks. Page 1

2 1. Prove or disprove the following using the formal definition of O( ). (a) n 10 n + 10 = O( n) [2] SOL: n 10 n + 10 n n = n = O( n) (b) 5 n = O(3 n ) [2] SOL: 5 n = (5/3) n 3 n Therefore, c, (5/3) n 3 n > c3 n when n > log 5/3 c, which implies 5 n O(3 n ) 2. Consider a connected graph G = (V, E) and two weight functions w 1 (e) and w 2 (e), such that w 2 (e) = w 1 (e) + 1. Prove or disprove the following: Dijkstra s algorithm will return the same shortest path under both weight functions. [2] SOL: False. Consider the graph G = (V, E), where V = {s, 1, 2, 3, 4}, E = {(s, 1), (s, 4), (1, 2), (2, 3), (3, 4)}, and w(s, 4) = 4 and w(e) = 1 for all other edges. Page 2

3 3. Recall the following three problems we saw in class: (a) The job scheduling problem (b) Minimum spanning tree (c) Single source shortest path For each of the problems, give a plausible but incorrect greedy algorithm. Formally disprove its correctness. [3] SOL: Any greedy but incorrect solution was accepted, as long as it was clearly stated and shown incorrect. Some typical examples would be: (a) Job scheduling: Take shortest job (b) MST: Take the first V 1 smallest weighted edges (c) Shortest Path: Take the least weighted edge as long as it doesn t create a cycle Page 3

4 4. Consider the following knapsack problem with total capacity C = 6 and the set of items: Item 1 = (1, 2) Item 2 = (2, 7) Item 3 = (3, 10) Item 4 = (4, 13) where Item i = (w i, v i ) denotes that the ith item has a weight of w i and a value v i. Determine the maximum value of the knapsack one could achieve by using dynamic programming algorithm seen in lecture. Show all your steps (clearly one could solve this problem by inspection but that s not the point). (a) Define the subproblems, how they relate to each other, the base case, and how you would determine the max possible value from the subproblems [3] (b) Give the full table of the subproblems showing each subproblem s numeric value; use the same ordering of items as they were given to you [3] SOL: S(i, c) is the maximum value possible for a knapsack problem with available capacity c and access to the first i items. If w i > c then S(i, c) = S(i 1, c) otherwise S(i, c) = max(s(i 1, c), v i + S(i 1, c w i )). The base cases are S(0, c) = 0 and S(i, 0) = 0. The final answer is S(n, C) = S(4, 6). See the lecture slide for an example of the table. Page 4

5 5. You re going on a road trip down a long straight stretch of highway. You re starting at location 0, and want to arrive at location D (think of your final destination as Dkm down the highway). On a full tank of gas your car can travel distance d before it stops. Along the highway there are gas stations at locations g 1, g 2, g 3..., g n 1, g n. Assume that for all i, g i 1 < g i, g i g i 1 < d, and that D g n < d. You wish to plan ahead and come up with a set of gas stations to stop at such that the number of stops you need to make is minimized. Construct a greedy algorithm which solves this problem and formally prove its correctness. You may describe your algorithm in plain english if you wish. [7] SOL: Let the greedy algorithm be one which always chooses the next farthest gas station possible. That is, the largest possible g i which is less than d units always from the current location. Let A G and A be ordered sets of gas stations returned by the greedy algorithm and some optimal solution respectively. Moreover, let A G i be the partial solution of the greedy algorithm such that it s the set of gas stations returned by the greedy solution after considering the first i gas stations. Prove there exists an optimal solution which agrees with the greedy solution via inductions. Base Case: A G 0 = {}, trivially all optimal solutions agree. Inductive Hypothesis: There s an optimal policy A which agrees with A G i 1. Proof: Consider gas station g i. Case 1) A G i includes g i but A does not. This is a contradiction since from the inductive hypothesis the last gas station both A G i and A stopped are the same. And if A G i includes g i there is no g j > g i which can be reached on the current tank of gas, therefore, if A does not stop at g i it will run out of gas. Case 2) A G i excludes g i but A does not. From the definition of the greedy algorithm, there exists a g j > g i which can be reached on the current tank of gas. Again from the inductive hypothesis the last gas station both A G i and A stopped are the same. Therefore, the optimal algorithm can instead stop at g j rather than g i, and moreover because g j > g i, the next gas station A would have stopped at after g i is still in range. Therefore, there exists an optimal policy which agrees with A G i. Page 5

6 6. Imagine you re running a consulting company and you are currently determining a work schedule for one of your employees. Each week i, you can assign your employee a low paying job, granting you profit l i, or a high paying job granting you profit h i. Here s the catch, if you assign your employee a high paying job in week i, then they need to take off week i 1 in order to prep. Assume your planning the schedule for n weeks into the future. Construct a dynamic programming algorithm which returns to you the maximum amount of profit you could achieve. (a) Define the subproblems, how they relate to each other, the base case, and how you would determine the maximum possible profit from the subproblems; assume that in the first week you cannot assign your employee a high profit job. How many subproblems need to be solved (roughly). [6] (b) Now consider the added option of a super high paying job each week granting profit H i, but to schedule that in week i your employee needs to take off weeks i 1 and i 2. How does this change your algorithm? How many subproblems now need to be solved (roughly)? [2] SOL: Let S(i) be the maximum possible profit one can achieve for the first i weeks. Base Cases: S(0) = 0, and S(1) = l 1 By definition the final answer is S(n). S(i) = max(s(i 1) + l 1, S(i 2 ) + h i ) The number subproblems one would need to solve is roughly n. When expanding the options for the super high paying jobs the definition of the subproblem changes to The number of subproblems is still roughly n. S(i) = max(s(i 1) + l 1, S(i 2) + h i, S(i 3) + H i ). Page 6

7 Use this page for rough work, clearly label which questions things correspond to. Page 7

8 Use this page for rough work, clearly label which questions things correspond to. Page 8

University of California Berkeley CS170: Efficient Algorithms and Intractable Problems November 19, 2001 Professor Luca Trevisan. Midterm 2 Solutions

University of California Berkeley CS170: Efficient Algorithms and Intractable Problems November 19, 2001 Professor Luca Trevisan. Midterm 2 Solutions University of California Berkeley Handout MS2 CS170: Efficient Algorithms and Intractable Problems November 19, 2001 Professor Luca Trevisan Midterm 2 Solutions Problem 1. Provide the following information:

More information

CS325: Analysis of Algorithms, Fall Final Exam

CS325: Analysis of Algorithms, Fall Final Exam CS: Analysis of Algorithms, Fall 0 Final Exam I don t know policy: you may write I don t know and nothing else to answer a question and receive percent of the total points for that problem whereas a completely

More information

Algorithms Exam TIN093 /DIT602

Algorithms Exam TIN093 /DIT602 Algorithms Exam TIN093 /DIT602 Course: Algorithms Course code: TIN 093, TIN 092 (CTH), DIT 602 (GU) Date, time: 21st October 2017, 14:00 18:00 Building: SBM Responsible teacher: Peter Damaschke, Tel. 5405

More information

Efficient Algorithms and Intractable Problems Spring 2016 Alessandro Chiesa and Umesh Vazirani Midterm 2

Efficient Algorithms and Intractable Problems Spring 2016 Alessandro Chiesa and Umesh Vazirani Midterm 2 CS 170 Efficient Algorithms and Intractable Problems Spring 2016 Alessandro Chiesa and Umesh Vazirani Midterm 2 Name: SID: GSI and section time: Write down the names of the students around you as they

More information

Lecture 6: Greedy Algorithms I

Lecture 6: Greedy Algorithms I COMPSCI 330: Design and Analysis of Algorithms September 14 Lecturer: Rong Ge Lecture 6: Greedy Algorithms I Scribe: Fred Zhang 1 Overview In this lecture, we introduce a new algorithm design technique

More information

Algorithms: Lecture 12. Chalmers University of Technology

Algorithms: Lecture 12. Chalmers University of Technology Algorithms: Lecture 1 Chalmers University of Technology Today s Topics Shortest Paths Network Flow Algorithms Shortest Path in a Graph Shortest Path Problem Shortest path network. Directed graph G = (V,

More information

Greedy Algorithms. Kleinberg and Tardos, Chapter 4

Greedy Algorithms. Kleinberg and Tardos, Chapter 4 Greedy Algorithms Kleinberg and Tardos, Chapter 4 1 Selecting breakpoints Road trip from Fort Collins to Durango on a given route. Fuel capacity = C. Goal: makes as few refueling stops as possible. Greedy

More information

Greedy Homework Problems

Greedy Homework Problems CS 1510 Greedy Homework Problems 1. Consider the following problem: INPUT: A set S = {(x i, y i ) 1 i n} of intervals over the real line. OUTPUT: A maximum cardinality subset S of S such that no pair of

More information

2 Representing Motion 4 How Fast? MAINIDEA Write the Main Idea for this section.

2 Representing Motion 4 How Fast? MAINIDEA Write the Main Idea for this section. 2 Representing Motion 4 How Fast? MAINIDEA Write the Main Idea for this section. REVIEW VOCABULARY absolute value Recall and write the definition of the Review Vocabulary term. absolute value NEW VOCABULARY

More information

Preparing for the CS 173 (A) Fall 2018 Midterm 1

Preparing for the CS 173 (A) Fall 2018 Midterm 1 Preparing for the CS 173 (A) Fall 2018 Midterm 1 1 Basic information Midterm 1 is scheduled from 7:15-8:30 PM. We recommend you arrive early so that you can start exactly at 7:15. Exams will be collected

More information

CS 6901 (Applied Algorithms) Lecture 3

CS 6901 (Applied Algorithms) Lecture 3 CS 6901 (Applied Algorithms) Lecture 3 Antonina Kolokolova September 16, 2014 1 Representative problems: brief overview In this lecture we will look at several problems which, although look somewhat similar

More information

CS60007 Algorithm Design and Analysis 2018 Assignment 1

CS60007 Algorithm Design and Analysis 2018 Assignment 1 CS60007 Algorithm Design and Analysis 2018 Assignment 1 Palash Dey and Swagato Sanyal Indian Institute of Technology, Kharagpur Please submit the solutions of the problems 6, 11, 12 and 13 (written in

More information

Knapsack and Scheduling Problems. The Greedy Method

Knapsack and Scheduling Problems. The Greedy Method The Greedy Method: Knapsack and Scheduling Problems The Greedy Method 1 Outline and Reading Task Scheduling Fractional Knapsack Problem The Greedy Method 2 Elements of Greedy Strategy An greedy algorithm

More information

CS 561, Lecture: Greedy Algorithms. Jared Saia University of New Mexico

CS 561, Lecture: Greedy Algorithms. Jared Saia University of New Mexico CS 561, Lecture: Greedy Algorithms Jared Saia University of New Mexico Outline Greedy Algorithm Intro Activity Selection Knapsack 1 Greedy Algorithms Greed is Good - Michael Douglas in Wall Street A greedy

More information

1.225 Transportation Flow Systems Quiz (December 17, 2001; Duration: 3 hours)

1.225 Transportation Flow Systems Quiz (December 17, 2001; Duration: 3 hours) 1.225 Transportation Flow Systems Quiz (December 17, 2001; Duration: 3 hours) Student Name: Alias: Instructions: 1. This exam is open-book 2. No cooperation is permitted 3. Please write down your name

More information

University of Toronto Department of Electrical and Computer Engineering. Final Examination. ECE 345 Algorithms and Data Structures Fall 2016

University of Toronto Department of Electrical and Computer Engineering. Final Examination. ECE 345 Algorithms and Data Structures Fall 2016 University of Toronto Department of Electrical and Computer Engineering Final Examination ECE 345 Algorithms and Data Structures Fall 2016 Print your first name, last name, UTORid, and student number neatly

More information

Problem set 1. (c) Is the Ford-Fulkerson algorithm guaranteed to produce an acyclic maximum flow?

Problem set 1. (c) Is the Ford-Fulkerson algorithm guaranteed to produce an acyclic maximum flow? CS261, Winter 2017. Instructor: Ashish Goel. Problem set 1 Electronic submission to Gradescope due 11:59pm Thursday 2/2. Form a group of 2-3 students that is, submit one homework with all of your names.

More information

CS1800 Discrete Structures Spring 2018 February CS1800 Discrete Structures Midterm Version A

CS1800 Discrete Structures Spring 2018 February CS1800 Discrete Structures Midterm Version A CS1800 Discrete Structures Spring 2018 February 2018 CS1800 Discrete Structures Midterm Version A Instructions: 1. The exam is closed book and closed notes. You may not use a calculator or any other electronic

More information

Design and Analysis of Algorithms April 16, 2015 Massachusetts Institute of Technology Profs. Erik Demaine, Srini Devadas, and Nancy Lynch Quiz 2

Design and Analysis of Algorithms April 16, 2015 Massachusetts Institute of Technology Profs. Erik Demaine, Srini Devadas, and Nancy Lynch Quiz 2 Design and Analysis of Algorithms April 16, 2015 Massachusetts Institute of Technology 6.046J/18.410J Profs. Erik Demaine, Srini Devadas, and Nancy Lynch Quiz 2 Quiz 2 Do not open this quiz booklet until

More information

Today s Outline. CS 561, Lecture 15. Greedy Algorithms. Activity Selection. Greedy Algorithm Intro Activity Selection Knapsack

Today s Outline. CS 561, Lecture 15. Greedy Algorithms. Activity Selection. Greedy Algorithm Intro Activity Selection Knapsack Today s Outline CS 561, Lecture 15 Jared Saia University of New Mexico Greedy Algorithm Intro Activity Selection Knapsack 1 Greedy Algorithms Activity Selection Greed is Good - Michael Douglas in Wall

More information

Algorithm Design Strategies V

Algorithm Design Strategies V Algorithm Design Strategies V Joaquim Madeira Version 0.0 October 2016 U. Aveiro, October 2016 1 Overview The 0-1 Knapsack Problem Revisited The Fractional Knapsack Problem Greedy Algorithms Example Coin

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURE 7 Greedy Graph Algorithms Shortest paths Minimum Spanning Tree Sofya Raskhodnikova 9/14/016 S. Raskhodnikova; based on slides by E. Demaine, C. Leiserson, A. Smith,

More information

Econ 172A, Fall 2012: Final Examination Solutions (I) 1. The entries in the table below describe the costs associated with an assignment

Econ 172A, Fall 2012: Final Examination Solutions (I) 1. The entries in the table below describe the costs associated with an assignment Econ 172A, Fall 2012: Final Examination Solutions (I) 1. The entries in the table below describe the costs associated with an assignment problem. There are four people (1, 2, 3, 4) and four jobs (A, B,

More information

CS 6783 (Applied Algorithms) Lecture 3

CS 6783 (Applied Algorithms) Lecture 3 CS 6783 (Applied Algorithms) Lecture 3 Antonina Kolokolova January 14, 2013 1 Representative problems: brief overview of the course In this lecture we will look at several problems which, although look

More information

Econ 172A, Fall 2012: Final Examination Solutions (II) 1. The entries in the table below describe the costs associated with an assignment

Econ 172A, Fall 2012: Final Examination Solutions (II) 1. The entries in the table below describe the costs associated with an assignment Econ 172A, Fall 2012: Final Examination Solutions (II) 1. The entries in the table below describe the costs associated with an assignment problem. There are four people (1, 2, 3, 4) and four jobs (A, B,

More information

Section 11.1 Distance and Displacement (pages )

Section 11.1 Distance and Displacement (pages ) Name Class Date Section 11.1 Distance and Displacement (pages 328 331) This section defines distance and displacement. Methods of describing motion are presented. Vector addition and subtraction are introduced.

More information

-5(1-5x) +5(-8x - 2) = -4x -8x. Name Date. 2. Find the product: x 3 x 2 x. 3. Solve the following equation for x.

-5(1-5x) +5(-8x - 2) = -4x -8x. Name Date. 2. Find the product: x 3 x 2 x. 3. Solve the following equation for x. Name Date CC Algebra 2 Period Units 1-5 Review Due Tuesday, January 3, 2017 Answer all of the following questions. The number of each question corresponds to the lesson in which it was covered. Copying

More information

Midterm 2. DO NOT turn this page until you are instructed to do so

Midterm 2. DO NOT turn this page until you are instructed to do so University of California Berkeley Handout M2 CS170: Efficient Algorithms and Intractable Problems November 15, 2001 Professor Luca Trevisan Midterm 2 DO NOT turn this page until you are instructed to do

More information

CS 580: Algorithm Design and Analysis

CS 580: Algorithm Design and Analysis CS 580: Algorithm Design and Analysis Jeremiah Blocki Purdue University Spring 2018 Announcement: Homework 1 due soon! Due: January 25 th at midnight (Blackboard) Recap: Graphs Bipartite Graphs Definition

More information

CSE101: Design and Analysis of Algorithms. Ragesh Jaiswal, CSE, UCSD

CSE101: Design and Analysis of Algorithms. Ragesh Jaiswal, CSE, UCSD Course Overview Material that will be covered in the course: Basic graph algorithms Algorithm Design Techniques Greedy Algorithms Divide and Conquer Dynamic Programming Network Flows Computational intractability

More information

Algorithms and Data Structures 2016 Week 5 solutions (Tues 9th - Fri 12th February)

Algorithms and Data Structures 2016 Week 5 solutions (Tues 9th - Fri 12th February) Algorithms and Data Structures 016 Week 5 solutions (Tues 9th - Fri 1th February) 1. Draw the decision tree (under the assumption of all-distinct inputs) Quicksort for n = 3. answer: (of course you should

More information

Math 1: Calculus with Algebra Midterm 2 Thursday, October 29. Circle your section number: 1 Freund 2 DeFord

Math 1: Calculus with Algebra Midterm 2 Thursday, October 29. Circle your section number: 1 Freund 2 DeFord Math 1: Calculus with Algebra Midterm 2 Thursday, October 29 Name: Circle your section number: 1 Freund 2 DeFord Please read the following instructions before starting the exam: This exam is closed book,

More information

Chapter 4. Greedy Algorithms. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Chapter 4. Greedy Algorithms. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. Chapter 4 Greedy Algorithms Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. 1 4.1 Interval Scheduling Interval Scheduling Interval scheduling. Job j starts at s j and

More information

FINAL EXAM PRACTICE PROBLEMS CMSC 451 (Spring 2016)

FINAL EXAM PRACTICE PROBLEMS CMSC 451 (Spring 2016) FINAL EXAM PRACTICE PROBLEMS CMSC 451 (Spring 2016) The final exam will be on Thursday, May 12, from 8:00 10:00 am, at our regular class location (CSI 2117). It will be closed-book and closed-notes, except

More information

AP PHYSICS 1 UNIT 4 / FINAL 1 PRACTICE TEST

AP PHYSICS 1 UNIT 4 / FINAL 1 PRACTICE TEST AP PHYSICS 1 UNIT 4 / FINAL 1 PRACTICE TEST NAME FREE RESPONSE PROBLEMS Put all answers on this test. Show your work for partial credit. Circle or box your answers. Include the correct units and the correct

More information

Welcome to CPSC 4850/ OR Algorithms

Welcome to CPSC 4850/ OR Algorithms Welcome to CPSC 4850/5850 - OR Algorithms 1 Course Outline 2 Operations Research definition 3 Modeling Problems Product mix Transportation 4 Using mathematical programming Course Outline Instructor: Robert

More information

Econ 172A, Fall 2012: Final Examination (I) 1. The examination has seven questions. Answer them all.

Econ 172A, Fall 2012: Final Examination (I) 1. The examination has seven questions. Answer them all. Econ 172A, Fall 12: Final Examination (I) Instructions. 1. The examination has seven questions. Answer them all. 2. If you do not know how to interpret a question, then ask me. 3. Questions 1- require

More information

NATIONAL UNIVERSITY OF SINGAPORE CS3230 DESIGN AND ANALYSIS OF ALGORITHMS SEMESTER II: Time Allowed 2 Hours

NATIONAL UNIVERSITY OF SINGAPORE CS3230 DESIGN AND ANALYSIS OF ALGORITHMS SEMESTER II: Time Allowed 2 Hours NATIONAL UNIVERSITY OF SINGAPORE CS3230 DESIGN AND ANALYSIS OF ALGORITHMS SEMESTER II: 2017 2018 Time Allowed 2 Hours INSTRUCTIONS TO STUDENTS 1. This assessment consists of Eight (8) questions and comprises

More information

Introduction to the Simplex Algorithm Active Learning Module 3

Introduction to the Simplex Algorithm Active Learning Module 3 Introduction to the Simplex Algorithm Active Learning Module 3 J. René Villalobos and Gary L. Hogg Arizona State University Paul M. Griffin Georgia Institute of Technology Background Material Almost any

More information

Chapter 4. Greedy Algorithms. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Chapter 4. Greedy Algorithms. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. Chapter 4 Greedy Algorithms Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. 1 4.1 Interval Scheduling Interval Scheduling Interval scheduling. Job j starts at s j and

More information

Solutions to the Midterm Practice Problems

Solutions to the Midterm Practice Problems CMSC 451:Fall 2017 Dave Mount Solutions to the Midterm Practice Problems Solution 1: (a) Θ(n): The innermost loop is executed i times, and each time the value of i is halved. So the overall running time

More information

MT 1810 Calculus II Course Activity I.7: Velocity and Distance Travelled

MT 1810 Calculus II Course Activity I.7: Velocity and Distance Travelled MT 1810 Calculus II, CA I.7 P a g e 1 MT 1810 Calculus II Course Activity I.7: Velocity and Distance Travelled Name: Purpose: To investigate how to calculate the distance travelled by an object if you

More information

E Mathematics Operations & Applications: D. Data Analysis Activity: Data Analysis Rocket Launch

E Mathematics Operations & Applications: D. Data Analysis Activity: Data Analysis Rocket Launch Science as Inquiry: As a result of activities in grades 5-8, all students should develop Understanding about scientific inquiry. Abilities necessary to do scientific inquiry: identify questions, design

More information

Lecture 2- Linear Motion Chapter 10

Lecture 2- Linear Motion Chapter 10 1 / 37 Lecture 2- Linear Motion Chapter 10 Instructor: Prof. Noronha-Hostler Course Administrator: Prof. Roy Montalvo PHY-123 ANALYTICAL PHYSICS IA Phys- 123 Sep. 12 th, 2018 Contact Already read the syllabus

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURE 5 Greedy Algorithms Interval Scheduling Interval Partitioning Guest lecturer: Martin Furer Review In a DFS tree of an undirected graph, can there be an edge (u,v)

More information

This means that we can assume each list ) is

This means that we can assume each list ) is This means that we can assume each list ) is of the form ),, ( )with < and Since the sizes of the items are integers, there are at most +1pairs in each list Furthermore, if we let = be the maximum possible

More information

IS 709/809: Computational Methods in IS Research Fall Exam Review

IS 709/809: Computational Methods in IS Research Fall Exam Review IS 709/809: Computational Methods in IS Research Fall 2017 Exam Review Nirmalya Roy Department of Information Systems University of Maryland Baltimore County www.umbc.edu Exam When: Tuesday (11/28) 7:10pm

More information

1 Basic Definitions. 2 Proof By Contradiction. 3 Exchange Argument

1 Basic Definitions. 2 Proof By Contradiction. 3 Exchange Argument 1 Basic Definitions A Problem is a relation from input to acceptable output. For example, INPUT: A list of integers x 1,..., x n OUTPUT: One of the three smallest numbers in the list An algorithm A solves

More information

Page Points Score Total: 100

Page Points Score Total: 100 Math 1130 Spring 2019 Sample Midterm 2a 2/28/19 Name (Print): Username.#: Lecturer: Rec. Instructor: Rec. Time: This exam contains 10 pages (including this cover page) and 9 problems. Check to see if any

More information

Page Points Score Total: 100

Page Points Score Total: 100 Math 1130 Spring 2019 Sample Midterm 3c 4/11/19 Name (Print): Username.#: Lecturer: Rec. Instructor: Rec. Time: This exam contains 10 pages (including this cover page) and 10 problems. Check to see if

More information

CSE 417. Chapter 4: Greedy Algorithms. Many Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

CSE 417. Chapter 4: Greedy Algorithms. Many Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. CSE 417 Chapter 4: Greedy Algorithms Many Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. 1 Greed is good. Greed is right. Greed works. Greed clarifies, cuts through,

More information

CMPSCI 311: Introduction to Algorithms Second Midterm Exam

CMPSCI 311: Introduction to Algorithms Second Midterm Exam CMPSCI 311: Introduction to Algorithms Second Midterm Exam April 11, 2018. Name: ID: Instructions: Answer the questions directly on the exam pages. Show all your work for each question. Providing more

More information

Math 112 Group Activity: The Vertical Speed of a Shell

Math 112 Group Activity: The Vertical Speed of a Shell Name: Section: Math 112 Group Activity: The Vertical Speed of a Shell A shell is fired straight up by a mortar. The graph below shows its altitude as a function of time. 400 300 altitude (in feet) 200

More information

Lesson 7: Slopes and Functions: Speed and Velocity

Lesson 7: Slopes and Functions: Speed and Velocity Lesson 7: Slopes and Functions: Speed and Velocity 7.1 Observe and Represent Another way of comparing trend lines is by calculating the slope of each line and comparing the numerical values of the slopes.

More information

Family Name (Please print Given Name(s) Student Number Practical Group in BLOCK LETTERS) as on student card Code (eg. FxA)

Family Name (Please print Given Name(s) Student Number Practical Group in BLOCK LETTERS) as on student card Code (eg. FxA) Family Name (Please print Given Name(s) Student Number Practical Group in BLOCK LETTERS) as on student card Code (eg. FxA) PHY131H1F Term Test version 1 Tuesday, October 2, 2012 Duration: 80 minutes Aids

More information

Use your hypothesis (the mathematical model you created) from activity 4.1 to predict the man s position for the following scenarios:

Use your hypothesis (the mathematical model you created) from activity 4.1 to predict the man s position for the following scenarios: 4.1 Hypothesize Lesson 4: The Moving Man An object is moving in the positive direction at constant velocity v. It starts at clock reading t = 0 sec, at a position x 0. How would you write a function that

More information

Discrete Wiskunde II. Lecture 5: Shortest Paths & Spanning Trees

Discrete Wiskunde II. Lecture 5: Shortest Paths & Spanning Trees , 2009 Lecture 5: Shortest Paths & Spanning Trees University of Twente m.uetz@utwente.nl wwwhome.math.utwente.nl/~uetzm/dw/ Shortest Path Problem "#$%&'%()*%"()$#+,&- Given directed "#$%&'()*+,%+('-*.#/'01234564'.*,'7+"-%/8',&'5"4'84%#3

More information

CS173 Lecture B, November 3, 2015

CS173 Lecture B, November 3, 2015 CS173 Lecture B, November 3, 2015 Tandy Warnow November 3, 2015 CS 173, Lecture B November 3, 2015 Tandy Warnow Announcements Examlet 7 is a take-home exam, and is due November 10, 11:05 AM, in class.

More information

Lesson 12: Position of an Accelerating Object as a Function of Time

Lesson 12: Position of an Accelerating Object as a Function of Time Lesson 12: Position of an Accelerating Object as a Function of Time 12.1 Hypothesize (Derive a Mathematical Model) Recall the initial position and clock reading data from the previous lab. When considering

More information

The Purpose of Hypothesis Testing

The Purpose of Hypothesis Testing Section 8 1A:! An Introduction to Hypothesis Testing The Purpose of Hypothesis Testing See s Candy states that a box of it s candy weighs 16 oz. They do not mean that every single box weights exactly 16

More information

CS103 Handout 08 Spring 2012 April 20, 2012 Problem Set 3

CS103 Handout 08 Spring 2012 April 20, 2012 Problem Set 3 CS103 Handout 08 Spring 2012 April 20, 2012 Problem Set 3 This third problem set explores graphs, relations, functions, cardinalities, and the pigeonhole principle. This should be a great way to get a

More information

Spring 2018 IE 102. Operations Research and Mathematical Programming Part 2

Spring 2018 IE 102. Operations Research and Mathematical Programming Part 2 Spring 2018 IE 102 Operations Research and Mathematical Programming Part 2 Graphical Solution of 2-variable LP Problems Consider an example max x 1 + 3 x 2 s.t. x 1 + x 2 6 (1) - x 1 + 2x 2 8 (2) x 1,

More information

D1 Discrete Mathematics The Travelling Salesperson problem. The Nearest Neighbour Algorithm The Lower Bound Algorithm The Tour Improvement Algorithm

D1 Discrete Mathematics The Travelling Salesperson problem. The Nearest Neighbour Algorithm The Lower Bound Algorithm The Tour Improvement Algorithm 1 iscrete Mathematics The Travelling Salesperson problem The Nearest Neighbour lgorithm The Lower ound lgorithm The Tour Improvement lgorithm The Travelling Salesperson: Typically a travelling salesperson

More information

Math 38: Graph Theory Spring 2004 Dartmouth College. On Writing Proofs. 1 Introduction. 2 Finding A Solution

Math 38: Graph Theory Spring 2004 Dartmouth College. On Writing Proofs. 1 Introduction. 2 Finding A Solution Math 38: Graph Theory Spring 2004 Dartmouth College 1 Introduction On Writing Proofs What constitutes a well-written proof? A simple but rather vague answer is that a well-written proof is both clear and

More information

Optimization Prof. A. Goswami Department of Mathematics Indian Institute of Technology, Kharagpur. Lecture - 20 Travelling Salesman Problem

Optimization Prof. A. Goswami Department of Mathematics Indian Institute of Technology, Kharagpur. Lecture - 20 Travelling Salesman Problem Optimization Prof. A. Goswami Department of Mathematics Indian Institute of Technology, Kharagpur Lecture - 20 Travelling Salesman Problem Today we are going to discuss the travelling salesman problem.

More information

CS781 Lecture 3 January 27, 2011

CS781 Lecture 3 January 27, 2011 CS781 Lecture 3 January 7, 011 Greedy Algorithms Topics: Interval Scheduling and Partitioning Dijkstra s Shortest Path Algorithm Minimum Spanning Trees Single-Link k-clustering Interval Scheduling Interval

More information

2/18/2019. Position-versus-Time Graphs. Below is a motion diagram, made at 1 frame per minute, of a student walking to school.

2/18/2019. Position-versus-Time Graphs. Below is a motion diagram, made at 1 frame per minute, of a student walking to school. Position-versus-Time Graphs Below is a motion diagram, made at 1 frame per minute, of a student walking to school. A motion diagram is one way to represent the student s motion. Another way is to make

More information

Algorithms: COMP3121/3821/9101/9801

Algorithms: COMP3121/3821/9101/9801 NEW SOUTH WALES Algorithms: COMP3121/3821/9101/9801 Aleks Ignjatović School of Computer Science and Engineering University of New South Wales TOPIC 4: THE GREEDY METHOD COMP3121/3821/9101/9801 1 / 23 The

More information

CS 580: Algorithm Design and Analysis

CS 580: Algorithm Design and Analysis CS 58: Algorithm Design and Analysis Jeremiah Blocki Purdue University Spring 28 Announcement: Homework 3 due February 5 th at :59PM Midterm Exam: Wed, Feb 2 (8PM-PM) @ MTHW 2 Recap: Dynamic Programming

More information

Newton s Third Law and Conservation of Momentum 1 Fall 2017

Newton s Third Law and Conservation of Momentum 1 Fall 2017 Introduction Newton s Third Law and Conservation of omentum 1 Fall 217 The purpose of this experiment is to study the forces between objects that interact with each other, especially in collisions, and

More information

Math 164 (Lec 1): Optimization Instructor: Alpár R. Mészáros

Math 164 (Lec 1): Optimization Instructor: Alpár R. Mészáros Math 164 (Lec 1): Optimization Instructor: Alpár R. Mészáros Midterm, October 6, 016 Name (use a pen): Student ID (use a pen): Signature (use a pen): Rules: Duration of the exam: 50 minutes. By writing

More information

Quiz 3 Reminder and Midterm Results

Quiz 3 Reminder and Midterm Results Quiz 3 Reminder and Midterm Results Reminder: Quiz 3 will be in the first 15 minutes of Monday s class. You can use any resources you have during the quiz. It covers all four sections of Unit 3. It has

More information

University of New Mexico Department of Computer Science. Final Examination. CS 561 Data Structures and Algorithms Fall, 2006

University of New Mexico Department of Computer Science. Final Examination. CS 561 Data Structures and Algorithms Fall, 2006 University of New Mexico Department of Computer Science Final Examination CS 561 Data Structures and Algorithms Fall, 2006 Name: Email: Print your name and email, neatly in the space provided above; print

More information

You have 3 hours to complete the exam. Some questions are harder than others, so don t spend too long on any one question.

You have 3 hours to complete the exam. Some questions are harder than others, so don t spend too long on any one question. Data 8 Fall 2017 Foundations of Data Science Final INSTRUCTIONS You have 3 hours to complete the exam. Some questions are harder than others, so don t spend too long on any one question. The exam is closed

More information

2. To receive credit on any problem, you must show work that explains how you obtained your answer or you must explain how you obtained your answer.

2. To receive credit on any problem, you must show work that explains how you obtained your answer or you must explain how you obtained your answer. Math 50, Fall 2011 Test 3 PRINT your name on the back of the test. Directions 1. Time limit: 1 hour 50 minutes. 2. To receive credit on any problem, you must show work that explains how you obtained your

More information

Checkpoint Questions Due Monday, October 1 at 2:15 PM Remaining Questions Due Friday, October 5 at 2:15 PM

Checkpoint Questions Due Monday, October 1 at 2:15 PM Remaining Questions Due Friday, October 5 at 2:15 PM CS103 Handout 03 Fall 2012 September 28, 2012 Problem Set 1 This first problem set is designed to help you gain a familiarity with set theory and basic proof techniques. By the time you're done, you should

More information

(tree searching technique) (Boolean formulas) satisfying assignment: (X 1, X 2 )

(tree searching technique) (Boolean formulas) satisfying assignment: (X 1, X 2 ) Algorithms Chapter 5: The Tree Searching Strategy - Examples 1 / 11 Chapter 5: The Tree Searching Strategy 1. Ex 5.1Determine the satisfiability of the following Boolean formulas by depth-first search

More information

Section Notes 8. Integer Programming II. Applied Math 121. Week of April 5, expand your knowledge of big M s and logical constraints.

Section Notes 8. Integer Programming II. Applied Math 121. Week of April 5, expand your knowledge of big M s and logical constraints. Section Notes 8 Integer Programming II Applied Math 121 Week of April 5, 2010 Goals for the week understand IP relaxations be able to determine the relative strength of formulations understand the branch

More information

Linear Algebra FALL 2013 MIDTERM EXAMINATION Solutions October 11, 2013

Linear Algebra FALL 2013 MIDTERM EXAMINATION Solutions October 11, 2013 Name: Section Number: Linear Algebra FALL MIDTERM EXAMINATION Solutions October, Instructions: The exam is 7 pages long, including this title page The number of points each problem is worth is listed after

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURE 6 Greedy Algorithms Interval Scheduling Interval Partitioning Scheduling to Minimize Lateness Sofya Raskhodnikova S. Raskhodnikova; based on slides by E. Demaine,

More information

Proof methods and greedy algorithms

Proof methods and greedy algorithms Proof methods and greedy algorithms Magnus Lie Hetland Lecture notes, May 5th 2008 1 Introduction This lecture in some ways covers two separate topics: (1) how to prove algorithms correct, in general,

More information

Position-versus-Time Graphs

Position-versus-Time Graphs Position-versus-Time Graphs Below is a motion diagram, made at 1 frame per minute, of a student walking to school. A motion diagram is one way to represent the student s motion. Another way is to make

More information

Discrete Optimization 2010 Lecture 2 Matroids & Shortest Paths

Discrete Optimization 2010 Lecture 2 Matroids & Shortest Paths Matroids Shortest Paths Discrete Optimization 2010 Lecture 2 Matroids & Shortest Paths Marc Uetz University of Twente m.uetz@utwente.nl Lecture 2: sheet 1 / 25 Marc Uetz Discrete Optimization Matroids

More information

Practice Test Answer and Alignment Document Mathematics: Grade 7 Performance Based Assessment - Online

Practice Test Answer and Alignment Document Mathematics: Grade 7 Performance Based Assessment - Online The following pages include the answer key for all machine-scored items, followed by the rubrics for the hand-scored items. - The rubrics show sample student responses. Other valid methods for solving

More information

Divide and Conquer Algorithms. CSE 101: Design and Analysis of Algorithms Lecture 14

Divide and Conquer Algorithms. CSE 101: Design and Analysis of Algorithms Lecture 14 Divide and Conquer Algorithms CSE 101: Design and Analysis of Algorithms Lecture 14 CSE 101: Design and analysis of algorithms Divide and conquer algorithms Reading: Sections 2.3 and 2.4 Homework 6 will

More information

UNIVERSITY OF YORK. MSc Examinations 2004 MATHEMATICS Networks. Time Allowed: 3 hours.

UNIVERSITY OF YORK. MSc Examinations 2004 MATHEMATICS Networks. Time Allowed: 3 hours. UNIVERSITY OF YORK MSc Examinations 2004 MATHEMATICS Networks Time Allowed: 3 hours. Answer 4 questions. Standard calculators will be provided but should be unnecessary. 1 Turn over 2 continued on next

More information

Quiz Number 1 PHYSICS January 30, 2009

Quiz Number 1 PHYSICS January 30, 2009 Instructions Write your name, student ID and name of your TA instructor clearly on all sheets and fill your name and student ID on the bubble sheet. Solve all multiple choice questions. No penalty is given

More information

Lab 3 Acceleration. What You Need To Know: Physics 211 Lab

Lab 3 Acceleration. What You Need To Know: Physics 211 Lab b Lab 3 Acceleration Physics 211 Lab What You Need To Know: The Physics In the previous lab you learned that the velocity of an object can be determined by finding the slope of the object s position vs.

More information

Math 283 Spring 2013 Presentation Problems 4 Solutions

Math 283 Spring 2013 Presentation Problems 4 Solutions Math 83 Spring 013 Presentation Problems 4 Solutions 1. Prove that for all n, n (1 1k ) k n + 1 n. Note that n means (1 1 ) 3 4 + 1 (). n 1 Now, assume that (1 1k ) n n. Consider k n (1 1k ) (1 1n ) n

More information

Introducing Proof 1. hsn.uk.net. Contents

Introducing Proof 1. hsn.uk.net. Contents Contents 1 1 Introduction 1 What is proof? 1 Statements, Definitions and Euler Diagrams 1 Statements 1 Definitions Our first proof Euler diagrams 4 3 Logical Connectives 5 Negation 6 Conjunction 7 Disjunction

More information

1) Find the equations of lines (in point-slope form) passing through (-1,4) having the given characteristics:

1) Find the equations of lines (in point-slope form) passing through (-1,4) having the given characteristics: AP Calculus AB Summer Worksheet Name 10 This worksheet is due at the beginning of class on the first day of school. It will be graded on accuracy. You must show all work to earn credit. You may work together

More information

Section 11.3 Rates of Change:

Section 11.3 Rates of Change: Section 11.3 Rates of Change: 1. Consider the following table, which describes a driver making a 168-mile trip from Cleveland to Columbus, Ohio in 3 hours. t Time (in hours) 0 0.5 1 1.5 2 2.5 3 f(t) Distance

More information

CSEP 521 Applied Algorithms. Richard Anderson Winter 2013 Lecture 1

CSEP 521 Applied Algorithms. Richard Anderson Winter 2013 Lecture 1 CSEP 521 Applied Algorithms Richard Anderson Winter 2013 Lecture 1 CSEP 521 Course Introduction CSEP 521, Applied Algorithms Monday s, 6:30-9:20 pm CSE 305 and Microsoft Building 99 Instructor Richard

More information

6. DYNAMIC PROGRAMMING I

6. DYNAMIC PROGRAMMING I 6. DYNAMIC PROGRAMMING I weighted interval scheduling segmented least squares knapsack problem RNA secondary structure Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley Copyright 2013

More information

UNIT 28 Straight Lines: CSEC Revision Test

UNIT 28 Straight Lines: CSEC Revision Test UNIT 8 Straight Lines: UNIT 8 Straight Lines ( ). The line segment BC passes through the point A, and has a gradient of. (a) Express the equation of the line segment BC in the form y = mx + c. ( marks)

More information

Chapter 2: Representing Motion. Click the mouse or press the spacebar to continue.

Chapter 2: Representing Motion. Click the mouse or press the spacebar to continue. Chapter 2: Representing Motion Click the mouse or press the spacebar to continue. Chapter 2 Representing Motion In this chapter you will: Represent motion through the use of words, motion diagrams, and

More information

Dynamic Programming ACM Seminar in Algorithmics

Dynamic Programming ACM Seminar in Algorithmics Dynamic Programming ACM Seminar in Algorithmics Marko Genyk-Berezovskyj berezovs@fel.cvut.cz Tomáš Tunys tunystom@fel.cvut.cz CVUT FEL, K13133 February 27, 2013 Problem: Longest Increasing Subsequence

More information

Physics I Exam 1 Spring 2015 (version A)

Physics I Exam 1 Spring 2015 (version A) 95.141 Physics I Exam 1 Spring 015 (version A) Section Number Section instructor Last/First Name (PRINT) / Last 3 Digits of Student ID Number: Answer all questions, beginning each new question in the space

More information

Project Management Prof. Raghunandan Sengupta Department of Industrial and Management Engineering Indian Institute of Technology Kanpur

Project Management Prof. Raghunandan Sengupta Department of Industrial and Management Engineering Indian Institute of Technology Kanpur Project Management Prof. Raghunandan Sengupta Department of Industrial and Management Engineering Indian Institute of Technology Kanpur Module No # 07 Lecture No # 35 Introduction to Graphical Evaluation

More information

Greedy Algorithms My T. UF

Greedy Algorithms My T. UF Introduction to Algorithms Greedy Algorithms @ UF Overview A greedy algorithm always makes the choice that looks best at the moment Make a locally optimal choice in hope of getting a globally optimal solution

More information