This preview shows pages 1–4. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 15750Midterm 2Page 1 of 915750:Practice Midterm 2Name:Email:InstructionsFill in the box above with your name, and your email address.Do it, now!This exam is open book: That is, you may use two books (Kozen and CLRS), any handoutsfrom class, and your notes.Clearly mark your answers in the allocated space. If need be, use the back of a page for scratchspace. If you have made a mess, cross out the invalid parts of your solution, and circle the onesthat should be graded.Scan the test first to make sure that none of the 9 pages are missing. The problems are ofvarying difficulty, you might wish to pick off the easy ones first.With each problem requiring you to present an algorithm make sure include the following threebullets: Algorithm: Correctness: and Timing:You have 80 minutes. Good luck.130230330430E.C.3012015750Midterm 2Page 2 of 9Problem 1:Solving Linear Systems to Find the Hitting Time (30 pts)Consider the following weighted graph.1v1v2v3v4121Show how to setup the linear system to find the hitting time fromv1tov4.Do not solve thesystem.What value from the solution is your hitting time?Solution:The linear system will just be to solve for voltages using the Laplacian. LetCi=jiCijandC=iCi.Lv=111421231112v=C1C2C3C4C143210(1)We solve this linear system under the constraint thatv4= 0. The voltagesviin the solution to thislinear system correspond to the hitting timeshi,4. Thus, the desired solution is simplyv1.Viewing as a Circuit.We derived in class using Kirchhoffs laws thatLv=I. In words, this saysthat the residual current at nodeiisIi= (Lv)i, theith component of the vectorI. Therefore, acircuit corresponding to the equation above is the following: for each nodei, we injectCiunits ofcurrents, and at node 4, we take outC=iCiunits. Note that the circuit cannot hold any current,so we take out exactly the amount of current we inject in.15750Midterm 2Page 3 of 9Problem 2:Longest Path in a DAG (30 pts)LetG= (V,E) be a directed acyclic graph andsandtbe two distinguished vertices ofG. At eachvertex of this graph are some number of tokens and as you visit the vertex you can collect it tokens....
View
Full
Document
This document was uploaded on 11/03/2009.
 Spring '09

Click to edit the document details