http:^^www.cs.washington.edu^education^courses^431^96s^bboard.shtml
来自「This data set contains WWW-pages collect」· SHTML 代码 · 共 1,486 行 · 第 1/4 页
SHTML
1,486 行
possible to reply to them.-jayram.-- Jayram S. Thathachar jayram@cs.washington.eduDepartment of CSE http://www.cs.washington.edu/homes/jayramUniversity of Washington +1 206 616-1843 (vox)Box 352350, Seattle, WA 98195 +1 206 543-2969 (fax)<hr size=4><a name="833507671001">Date: Thu, 30 May 1996 18:54:27 -0700 (PDT)From: <b>Larry Roske <roske@lynx.cs.washington.edu></b>To: cse431@lynx.cs.washington.eduSubject: <b>HW #5 #7 part (3)</b></a>The hint suggests using the TM M_SAT as a subroutine todetermine if x1=0 or x1=1 is "part" of a satisfying assignment.Since M_SAT accepts strings w in SAT, and SAT consists offormulas with satisfying assignments for all variables,can't we use M_SAT to test for a particular assignment to all of thevariables at one time, e.g. x1=0, x2=1, x3=0, etc.?Ah ha! I think this is because we would have to try eachpermutation of assignments which would create an exponentialtime computation?--Larry<hr size=4><a name="833509703001">Date: Thu, 30 May 1996 19:28:16 -0700 (PDT)From: <b>Jayram Thathachar <jayram@curie.cs.washington.edu></b>To: Larry Roske <roske@lynx.cs.washington.edu>cc: cse431@lynx.cs.washington.eduSubject: <b>Re: HW #5 #7 part (3)</b></a>On Thu, 30 May 1996, Larry Roske wrote:> The hint suggests using the TM M_SAT as a subroutine to> determine if x1=0 or x1=1 is "part" of a satisfying assignment.> > Since M_SAT accepts strings w in SAT, and SAT consists of> formulas with satisfying assignments for all variables,> can't we use M_SAT to test for a particular assignment to all of the> variables at one time, e.g. x1=0, x2=1, x3=0, etc.?> > Ah ha! I think this is because we would have to try each> permutation of assignments which would create an exponential> time computation?> > --Larry> > That's right. BTW, for those of you who were there during the office hours, the general definition of self-reducibility that I gave is completely wrong. I said that L is self-reducible if there is a poly-time reduction f such that x \in L iff f(x) \in L *and* |f(x)|<|x|.The correct definition is that L is self-reducible if there is a poynomialtime algorithm that can use the subroutine P for L as a black-box but anycalls P(y) made to P must use a y smaller in length than x. What follows is an explanation of why the definition I gave is wrong and is irrelevant to the hw problem in question. The definition that I gave is something else. If you think about it, byapplying f repeatedly, that is, let y=f(f(...(x)...)) so that y becomessmall enough, in constant time I can determine if y is in L andconclude if x is in L. Computing y takes only polynomial time since I haveto apply f at most |x| times so L must be in P if it is self-reducible.-jayram.<hr size=4><a name="833512165001">Date: Thu, 30 May 1996 20:09:20 -0700 (PDT)From: <b>Jayram Thathachar <jayram@curie.cs.washington.edu></b>To: cse431@csSubject: <b>hint for UHAMPATH</b></a>Let's see. The only help I can give here is the following. This is a hint if you are using HAMPATH to reduce to UHAMPATH.Let G' be the undirected graph obtained from G.Suppose we want to make sure that in G', when entering avertex u, we always do so from a vertex x such that x->u is an edge in G. And while leaving u, we always use a vertex y such that u->y is an edge in G. Can you enforce this condition by adding extra vertices and making sure that any hamiltonian path in G' must obey this rule?-jayram.--Jayram S. Thathachar jayram@cs.washington.eduDepartment of CSE http://www.cs.washington.edu/homes/jayramUniversity of Washington +1 206 616-1843 (vox)Box 352350, Seattle, WA 98195 +1 206 543-2969 (fax)<hr size=4><a name="833512652001">Date: Thu, 30 May 1996 20:17:28 -0700 (PDT)From: <b>Jayram Thathachar <jayram@curie.cs.washington.edu></b>To: cse431@csSubject: <b>hw4</b></a>On the problem of P being closed under star, two of you came up with anice observation of what the fill-in-the-table algorithm was doing andI thought I'd share it with you. Let L be the language in P and we want to show that L^* is in P. For aninput w=a_1 a_2 ... a_n, suppose we define a directed graph G on{1,2,...,n+1} as follows: there is an edge from i to j iff a_i ... a_{j-1}is in L. Then, w is in L^* iff there is a path from 1 to n+1 in G.The table algorithm that I gave in the solution set was just doing bfs on this graph.--Jayram S. Thathachar jayram@cs.washington.eduDepartment of CSE http://www.cs.washington.edu/homes/jayramUniversity of Washington +1 206 616-1843 (vox)Box 352350, Seattle, WA 98195 +1 206 543-2969 (fax)<hr size=4><a name="833520727001">Date: Thu, 30 May 1996 22:32:04 -0700From: <b>fineman@grizzly (Dan Fineman)</b>To: cse431@csSubject: <b>A little end-of-the-quarter thought</b></a>Every Horse has an Infinite Number of Legs (proof by intimidation):Horses have an even number of legs. Behind they have two legs, and infront they have fore-legs. This makes six legs, which is certainly anodd number of legs for a horse. But the only number that is both evenand odd is infinity. Therefore, horses have an infinite number oflegs. Now to show this for the general case, suppose that somewhere,there is a horse that has a finite number of legs. But that is ahorse of another color, and by the [above] lemma ["All horses are thesame color"], that does not exist. <hr size=4><a name="833573118001">Date: Fri, 31 May 1996 13:05:12 -0700From: <b>jayram@hobbes (Jayram Thathachar)</b>To: cse431@csSubject: <b>solutions for the 3-COLOR and UHAMPATH</b></a>It looks like I'll get to them after the office hours. Bearwith me for this inconvenience. I have the solutions forthe 4th and 7th problem ready.-jayram.<hr size=4><a name="833587822001">Date: Fri, 31 May 1996 17:10:17 -0700From: <b>jayram@hobbes (Jayram Thathachar)</b>To: cse431@csSubject: <b>hot off the oven</b></a>Solutions to the hw will be available outside Larry's door in about15-20mts. Your hws should have been handed in by now. I'll alsoe-mail the solutions to 3-COLOR and UHAMPATH soon and finallyeverything should be on the web later this evening.-jayram.<hr size=4><a name="833589342001">Date: 31 May 1996 17:14 PDTFrom: <b>Larry Ruzzo <ruzzo@quinault.cs.washington.edu></b>To: cse431@csSubject: <b>Midterm solution</b></a>a few copies will also be available outside my door, and it should be on the web already.<hr size=4><a name="833590988001">Sender: jayram@cs.washington.eduDate: Fri, 31 May 1996 18:03:03 -0700From: <b>Jayram Thathachar <jayram@cs.washington.edu></b>To: cse431@csSubject: <b>hw5 solutions</b></a>Solutions to hw5 are available outside Larry's door.-jayram.-- Jayram S. Thathachar jayram@cs.washington.eduDepartment of CSE http://www.cs.washington.edu/homes/jayramUniversity of Washington +1 206 616-1843 (vox)Box 352350, Seattle, WA 98195 +1 206 543-2969 (fax)<hr size=4><a name="833605482001">Sender: jayram@cs.washington.eduDate: Fri, 31 May 1996 22:04:36 -0700From: <b>Jayram Thathachar <jayram@cs.washington.edu></b>To: cse431@csSubject: <b>solutions to 3-COLOR and UHAMPATH</b></a>For those of you who were unable to pick up the solutions outsideLarry's door.********************************************************************Solution sketches to 3-COLOR and UHAMPATH********************************************************************3-COLOR is NP-complete:3-COLOR is in NP via a verifier that, in polynomial time, using acoloring of the vertices of the graph as a certificate, can verifythat the coloring is a valid 3-coloring of G.We will reduce 3CNF-SAT to 3-COLOR. Let \phi be a 3-CNF formula.The graph that we build in polynomial time has the vertex set{T,F,O} \union Set of literals \union Set of Clauses \union othervertices.Here are the edges in G, classified by their type: O(a) /\ / \ / \ / \ /--------\ T F(b) For each variable x: O /\ / \ / \ / \ _ x /--------\ x(c) (The OR-gadget) For each clause C = p \or q \or rO___________C_____________F| /\| / \| / \| / \| /--------\| | ||_______| | /\ | / \ | / \ | / \ | /--------\ | | | | | | | | | | p q rIn any valid 3-coloring, because of edges of type (a), the vertices T,F and O get the 3 different colors. Let the colors that they getitself be named T, F and O. Therefore, each vertex gets colored T, For O in any legal 3-coloring.Because of edges of type (b), for any variable x, x and not(x) getdifferent colors in {T,F}. Thus, a legal 3-coloring can always be usedto define an assignment of 0-1 values to the variables.Finally, the OR-gadget satisfies the following property:Suppose in the OR-gadget corresponding to the clause C=p \or q \or r,p, q, and r are each constrained to get colors from {T,F}. Then, there is a legal 3-coloring of the OR-gadget with the clause getting colored T iff at least one of p, q, r is colored T.This can be checked by trying out the various combinations of colorassignments to the nodes in the gadget. (You may find it easier to workwith the OR-gadget given in the book for 2 literals and then get it towork for 3).Thus the formula is satisfiable iff every clause is satisfied by someassignment iff there is a legal 3-coloring of G.*****************************************************************UHAMPATH is NP-completeTo show that UHAMPATH belongs to NP, the verifier takes the encodingof hamiltonian path as a certificate and verifies that the certificateindeed corresponds to a hamiltonian path in the input graph.We will reduce HAMPATH to UHAMPATH as follows:Suppose <DG,s,t> is an instance of HAMPATH. Let DG=(V,E)We will create a undirected graph UG as follows:The vertex set for UG is {v_i, v_m, v_o : v \in V} U {s',t'}Informally, we will force any hamiltonian path between s' and t'in UG to always correspond to a directed path in G (the subscripts forthe vertices refer to ``in'', ``middle'' and ``out'').The edges for UG are(a) For each vertex v in V, v_i ----- v_m ------ v_o(b) For each edge u-->v in E, u_o ----- v_i(c) An edge s'----s_i and an edge t_o----t'Claim: There is a hamiltonian path in DG from s to t iff there ishamiltonian path from s' to t' in UG.Proof: One direction is easy. Given a hamiltonian path in DG, we caneasily construct a hamiltonian path in UG. For example, ifs-->a--->b--->t was the hamiltonian path in DG, the hamiltonian pathin UG is s'--s_i--s_m--s_o--a_i--a_m--a_o--b_i--b_m--b_o--t_i--t_m--t_o--t'Now for the other direction. In any hamiltonian path in UG, for eachvertex v of DG, the vertices v_i, v_m, v_o must occur consecutively as v_i, v_m, v_o or as v_o, v_m, v_i because v_m is an interior vertex inthe path and v_m is connected to v_i and v_o only.Because the path begins with s', the initial segment must bes'--s_i--s_m--s_o. There are no edges from v_o to u_o in UG, for anyvertices v and u in DG, so the only way this path can be extended to ahamiltonian path in UG is for it to have the form s'--s_i--s_m--s_o--(A1)--(A2)-- ... --(Ak)--t_i--t_m--t_o--t',where each (Aj) is an abbreviation for the (sub)path v_i--v_m--v_o forsome vertex v in DG. Moreover, for each vertex v of DG, there isexactly one j such that (Aj) corresponds to v. Suppose aj is thevertex in DG corresponding to (Aj).This can easily be transformed to a hamiltonian path in DG: s-->a1-->a2--> ... -->a_k-->t-- Jayram S. Thathachar jayram@cs.washington.eduDepartment of CSE http://www.cs.washington.edu/homes/jayramUniversity of Washington +1 206 616-1843 (vox)Box 352350, Seattle, WA 98195 +1 206 543-2969 (fax)<hr size=4><a name="833606680001">Sender: jayram@cs.washington.eduDate: Fri, 31 May 1996 22:24:36 -0700From: <b>Jayram Thathachar <jayram@cs.washington.edu></b>To: cse431@csSubject: <b>class web</b></a>The solutions to hws 4 and 5 are on the class web as well. Good luck with the final!!!-jayram.-- Jayram S. Thathachar jayram@cs.washington.eduDepartment of CSE http://www.cs.washington.edu/homes/jayramUniversity of Washington +1 206 616-1843 (vox)Box 352350, Seattle, WA 98195 +1 206 543-2969 (fax)</pre></body><hr><hr><address>jayram@cs.washington.edu (Last Update: <!-- see man strftime for full formatting options--> 03/26/96)</address></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?