Jonathan Turner Exam 2-12/4/03

Similar documents
Design and Analysis of Algorithms (Autumn 2017)

Jonathan Turner Exam 2-10/28/03

CS 541 Algorithms and Programs. Exam 2 Solutions. Jonathan Turner 11/8/01

Final Exam : Solutions

Combinatorial Optimization

2. The Laplace Transform

CS 103 BFS Alorithm. Mark Redekopp

Instructors Solution for Assignment 3 Chapter 3: Time Domain Analysis of LTIC Systems

3+<6,&6([DP. September 29, SID (last 5 digits): --

Transfer function and the Laplace transformation

A L A BA M A L A W R E V IE W

Chapter 12 Introduction To The Laplace Transform

Outlines: Graphs Part-4. Applications of Depth-First Search. Directed Acyclic Graph (DAG) Generic scheduling problem.

RUTH. land_of_israel: the *country *which God gave to his people in the *Old_Testament. [*map # 2]

Math 3301 Homework Set 6 Solutions 10 Points. = +. The guess for the particular P ( ) ( ) ( ) ( ) ( ) ( ) ( ) cos 2 t : 4D= 2

COSC 3361 Numerical Analysis I Ordinary Differential Equations (I) - Introduction

Ma/CS 6a Class 15: Flows and Bipartite Graphs

CPSC 211 Data Structures & Implementations (c) Texas A&M University [ 259] B-Trees

( ) ( ) + = ( ) + ( )

Problem Set If all directed edges in a network have distinct capacities, then there is a unique maximum flow.

F (u) du. or f(t) = t

Chapter 5 The Laplace Transform. x(t) input y(t) output Dynamic System

Final Exam Solutions

Analysis of Members with Axial Loads and Moments. (Length effects Disregarded, Short Column )

UNIT #5 EXPONENTIAL AND LOGARITHMIC FUNCTIONS

DEPARTMENT OF ELECTRICAL &ELECTRONICS ENGINEERING SIGNALS AND SYSTEMS. Assoc. Prof. Dr. Burak Kelleci. Spring 2018

ENGR 7181 LECTURE NOTES WEEK 5 Dr. Amir G. Aghdam Concordia University

14.02 Principles of Macroeconomics Fall 2005 Quiz 3 Solutions

where: u: input y: output x: state vector A, B, C, D are const matrices

Additional Exercises for Chapter What is the slope-intercept form of the equation of the line given by 3x + 5y + 2 = 0?

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

S U E K E AY S S H A R O N T IM B E R W IN D M A R T Z -PA U L L IN. Carlisle Franklin Springboro. Clearcreek TWP. Middletown. Turtlecreek TWP.

The Residual Graph. 11 Augmenting Path Algorithms. Augmenting Path Algorithm. Augmenting Path Algorithm

Graphs III - Network Flow

A1 1 LED - LED 2x2 120 V WHITE BAKED RECESSED 2-3/8" H.E. WILLIAMS PT-22-L38/835-RA-F358L-DIM-BD-UNV 37

Shortest Path With Negative Weights

Comparison between the Discrete and Continuous Time Models

02. MOTION. Questions and Answers

Lecture 26 Section 8.4. Mon, Oct 13, 2008

EXERCISE - 01 CHECK YOUR GRASP

Discussion Session 2 Constant Acceleration/Relative Motion Week 03

Decline Curves. Exponential decline (constant fractional decline) Harmonic decline, and Hyperbolic decline.

Minimum Spanning Trees

Solutions to Homework 5

Exponential Functions

Exam 1 Solution. CS 542 Advanced Data Structures and Algorithms 2/14/2013

2. Random Search with Complete BST

The Residual Graph. 12 Augmenting Path Algorithms. Augmenting Path Algorithm. Augmenting Path Algorithm

CHEMISTRY 047 STUDY PACKAGE

, the. L and the L. x x. max. i n. It is easy to show that these two norms satisfy the following relation: x x n x = (17.3) max

Single Correct Type. cos z + k, then the value of k equals. dx = 2 dz. (a) 1 (b) 0 (c)1 (d) 2 (code-v2t3paq10) l (c) ( l ) x.

Lecture 21 : Graphene Bandstructure

XV Exponential and Logarithmic Functions

An undirected graph G = (V, E) V a set of vertices E a set of unordered edges (v,w) where v, w in V

Network Flows: Introduction & Maximum Flow

Control Systems -- Final Exam (Spring 2006)

Physics 240: Worksheet 16 Name

COHORT MBA. Exponential function. MATH review (part2) by Lucian Mitroiu. The LOG and EXP functions. Properties: e e. lim.

Mathematics Paper- II

learning objectives learn what graphs are in mathematical terms learn how to represent graphs in computers learn about typical graph algorithms

FOR MORE PAPERS LOGON TO

1 Finite Automata and Regular Expressions

Poisson process Markov process

û s L u t 0 s a ; i.e., û s 0

V.sin. AIM: Investigate the projectile motion of a rigid body. INTRODUCTION:

Syntactic Complexity of Suffix-Free Languages. Marek Szykuła

Solutions of Sample Problems for Third In-Class Exam Math 246, Spring 2011, Professor David Levermore

Lecture 4: Laplace Transforms

Appendix. Vacuum Technique:

P a g e 5 1 of R e p o r t P B 4 / 0 9

H is equal to the surface current J S

CHAPTER 9 Compressible Flow

a g f 8 e 11 Also: Minimum degree, maximum degree, vertex of degree d 1 adjacent to vertex of degree d 2,...

Evolution Strategies for Optimizing Rectangular Cartograms

EECE 301 Signals & Systems Prof. Mark Fowler

On the convergence of solutions of the non-linear differential equation

Lecture 20: Minimum Spanning Trees (CLRS 23)

TMA4329 Intro til vitensk. beregn. V2017

1 Lecture 13: The derivative as a function.

1 Motivation and Basic Definitions

Exam 1 Solutions. x(x 2) (x + 1)(x 2) = x

Motion In One Dimension. Graphing Constant Speed

Geographic Routing with Constant Stretch in Large Scale Sensor Networks with Holes

Charging of capacitor through inductor and resistor

Nursing Facilities' Life Safety Standard Survey Results Quarterly Reference Tables

2 u Du, k Hu Dv Hu, y H. u Cu j u qu u. Nv. v uy. Cu Hu F A H. qu Cu.. Cu j 1980, u V, v Nu My O k. v u u. A G C. My u v k, 2.5 H v v u / u v u v k y

American International Journal of Research in Science, Technology, Engineering & Mathematics

Physics 111. Exam #1. January 24, 2011

Approximately Inner Two-parameter C0

Wrap up: Weighted, directed graph shortest path Minimum Spanning Tree. Feb 25, 2019 CSCI211 - Sprenkle

Algorithms and Data Structures 2011/12 Week 9 Solutions (Tues 15th - Fri 18th Nov)

CSE 245: Computer Aided Circuit Simulation and Verification

AP Calculus Multiple-Choice Question Collection

1a.- Solution: 1a.- (5 points) Plot ONLY three full periods of the square wave MUST include the principal region.

EXST 7015 Fall 2014 Lab 08: Polynomial Regression

An Introduction to Malliavin calculus and its applications

dt = C exp (3 ln t 4 ). t 4 W = C exp ( ln(4 t) 3) = C(4 t) 3.

ME 391 Mechanical Engineering Analysis

Solutions for HW11. Exercise 34. (a) Use the recurrence relation t(g) = t(g e) + t(g/e) to count the number of spanning trees of v 1

5. An object moving along an x-coordinate axis with its scale measured in meters has a velocity of 6t

Transcription:

CS 41 Algorim an Program Prolm Exam Soluion S Soluion Jonaan Turnr Exam -1/4/0 10/8/0 1. (10 poin) T igur low ow an implmnaion o ynami r aa ruur wi vral virual r. Sow orrponing o aual r (owing vrx o). 0, 0,1 0,100 a 0,98 0,1 j 0,99 g 0, 0, 0, 0, 0, 100 a 100 100 1 g 4 j Auming r ar u o implmn amiil pa algorim, wa i riual apaiy o g rom j o? I nx p in amiil pa algorim a an g rom a o j an i i g a a riual apaiy o, wa i riual apaiy o nx augmning pa? 1-1 -

. (10 poin) T igur low ow an inrmia a in xuion o ig lal prlow-pu algorim. Sow a o algorim ar a o nx wo p in wi a vrx om alan. You n no r-raw nir riual grap, u o ow all g, vri an aoia valu a ar moii y a p.,0 1, ian lal, x riual apaiy 1 0 1,0 1 8,0,,0 1 1,1 1 8,0 0,0,0 1 1, 1 8,0 0 - -

. (0 poin) Suppo w moiy l-ajuing inary ar r o a i prorm play p a mak largr ajumn o r. In pariular, uppo w allow play p own low. y u x E A v v D B x u C C y A B D E Sow a i rank(u)=k=rank(y), w n wr ri o mainain ri invarian ar p an w n or p. Rall a ri invarian ay a a vrx z mu av rank(z)= log (#o nan o z) ri a all im. Sin rank(u)=k, r ar k vri in original ur wi roo u. I rank(y)=k alo, rmainr o r a wr an k vri (in orwi y woul av mor an k +1 nan an n woul av rank grar an k). So ar opraion, vri x an y mu av rank mallr an k. So, w n wo wr ri o mainain ri invarian. Sow a i rank(u)<rank(y), w n wr an 4(rank (u) rank(u)) aiional ri o mainain ri invarian, wr rank (u) i rank o u, ar p i prorm. T numr o aiional ri n o mainain invarian i ( rank ( u) u)) + ( rank ( v) v)) + ( rank ( x) x)) + ( rank ( y) u)) = ( rank ( v) + rank ( x) + rank ( y)) ( rank( u) + rank( v) + rank( x)) ( rank ( u) u)) wr la p i juii y a a u a mall rank or p an larg rank ar p. Sin rank(u)<rank(y) an rank (u)=rank(y), i i <4(rank (u) rank(u)) ri. - -

4. (0 poin) Conir a inary ar r in wi a vrx a an aoia ky an a o. T vri ar orr y ky in uual way (o ky o vri in l ur o a givn vrx x ar rily l an ky o x, an o or). T o ar rprn uing irnial rprnaion w u or rprning pa. Compl ruriv union ar, own low, o a i rurn a la-o vrx rom among o vri wi ky mallr an a givn oun. T ruur o r no i own low alo. la wowaytr { in n; // r in on im {1,...,n} ru no { in k, D, Dm; // ky an irnial o il in l, r; // ini o l an rig ilrn } *v;... } #in l(x) (v[x].l) // you may aum imilar laraion // or rig, ky, Do, Dmin in ar(in, in oun) { // Rurn inx o a la o no rom among o no // in ur wi roo a av ky l an oun. // I r i mor an on u no, pik on wi // mall ky. Rurn Null, i r i no la o no // wi ky l an oun. i ( == Null) rurn Null; l i (l()!= Null && Dmin(l()) == 0) rurn ar(l(),oun); l i (ky() < oun && Do() == 0) rurn ; l i (rig()!= Null && Dmin(rig()) == 0) rurn ar(rig(),oun); l rurn Null; } - 4 -

. (1 poin) How many augmning pa o min-o, augmning pa algorim in in nwork own low ( pair on a g ar apaiy an o). Explain. a a a 1 1 9,4 9, x 1 x x 9,1 9, 9, 1,0 9, 9, 9,1 y 1 y y 9, 9,4 1 1 T algorim in 4 iin augmning pa in i grap. Iniially, i in 9 pa o orm,a 1,x i,y j, 1, wi apaiy 1 an o 0. A i poin g rom o a 1 i aura, a i g rom 1 o. Nx, i in 9 pa o orm, 1,y i,x j, 1, wi o.tn, i in 9 pa o orm,,a 1,x i,y j, 1,, wi o 4. An o or. I oninu in i aion, alway ju aing on uni o low or a augmning pa, in all pa pa roug nral ipari ugrap. Explain ow i xampl an gnraliz o ow a min-o, augmning pa algorim an ak im Ω(n ). To gnraliz xampl, mak a,,, an ain all k vri long, wi g o o 0,,4,... rom o a o a vri an rom a o vri o. Mak g o rom o a o vri an rom a o vri o, qual o 1,,,... Mak apaii o all g inin o an k. Expan nral ipari ugrap o a i a k vri an g rom x vri o y vri wi apaiy 1 an o 0. Aign inini apaiy an 0 o o all or g. In i grap, min-o augmning pa algorim wi in k augmning pa. Sin i u Dijkra algorim o in a augmning pa an in grap a mor an k g, i will ak Ω(k ) im o in a augmning pa. Ti giv a oal o Ω(k ) im o in minimum-o maximum low, wi i Ω(n ), in n=k+. - -

. (1 poin) Sa oniion a mu aii y a prlow in orr or i o aiy laling oniion wi rp o om laling union λ. T igur low ow an inan o min-o max low prolm wi a prlow an a laling. Do i prlow aiy laling oniion, wi rp o lal own? Wy or wy no? 8,,0 8 lal apaiy, o, low 8,,0,,1,1,,,0,1,,4,,1,0 9 4,,0,,,1,0 11 10 4,, i 1 T laling oniion a a vry g (u,v) wi poiiv riual apaiy mu aiy λ(u)+o(u,v) λ(v). T prlow o no aiy laling oniion or g (,), in 11+(-)<9. Givn prlow own low, ir in a laling a aii laling oniion or ow a r i no o lal a aii laling oniion. 8,,8 apaiy, o, low 8,,0,,0,1,,,0,4,,,,1,,1,0 4,,0,1,0 4,, i Ti prlow o no aiy laling oniion or any o lal, in,, orm a ngaiv o yl wi o +( 1)+( )=. - -