Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. Problem 1)
  2.  
  3. so make an outside function that correlates between a and a compliment. so it kinda connects the two in a way, and what this functon should do is if u have an input within A, it should be be able to map out a value not in A when you apply the function
  4.  
  5. <=m is a transitive relation
  6.  
  7. A transitive relation is defined as a relation for if all elements a, b, c in X, whenever a is related to b and b is related to c, then a is also related to c.
  8.  
  9. In this language, A is reducible to B only if there is a function that takes all elements in A and returns elements in B.
  10.  
  11. if they are compliments, you know when to halt in both cases so you can decide whether or not it is in the language
  12.  
  13. Problem 2)
  14.  
  15. reduce etm into disjoint
  16. intesrsection of two languages that dont accept anything
  17.  
  18.  
  19. Problem 3) Algorithm to decide triangle:
  20.  
  21.  
  22. On any input:
  23.  
  24. For every combination of 3 vertices in the input (for example, A, B, C), return true if G contains all edges that create a cycle (AB, BC, CA). If the entire input is exhausted and the algorithm has not returned true, return false.
  25.  
  26. This algorithm runs in polynomial time. This is because there are v^3 amount of vertices (V = # of vertices), and so the runtime for enumerating each vertex is O(n^3). To verify that there exists the 3 edges (AB, BC, CA), it takes O(E) time where E is the number of edges. Because the algorithm runs in O(EV^3), it runs in polynomial time. Because it runs in polynomial time, it exists in P.
  27.  
  28. Problem 4)
  29.  
  30. x1 can be true or false. so the way id go about it is ask them what happens if x1 is set to true or false. ask them if x1 is set to true or false and ask whether its satisfiable. if i ask the genie, im gonna give you x1 = True, and he tells me its true, i have to do something in response to that. n queries.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement