Related questions
Concept explainers
Show that it is undecidable, given the source code of a
not any of the following is true:
(i) Q halts on input 0.
(ii) Q is total – that is, Q(y) halts for all y.
(iii) Q(y) = true for all y.
(iv) The set of y on which Q halts is finite.
(v) There is a y such that Q(y) = y.
(vi) Given a second program R, Q is equivalent to R. That is, even though Q and R
have different source codes, they compute the same partial function – for all y,
either Q(y) and R(y) both halt and return the same answer, or neither halts.
Prove each of these by reducing Halting to them. That is, show to how convert an
instance (P, x) of Halting to an instance of the problem above. For instance, you can
modify P’s source code, or write a new program that calls P as a subroutine. Each
of these is asking for a Turing reduction; your reduction does not necessarily have to
map yes-instances to yes-instances and no-instances to no-instances – all that matters
is that if you could solve the problem, then you could solve Halting.
Step by stepSolved in 2 steps
- Please do Question 1 and 2 in Python, and please show your code This is about hidden markov modelsarrow_forwardProve: For all integers n, if n2 is odd, then n is odd. Use a proof by contraposition, as in Lemma 1.1. Let n be an integer. Suppose that n is even, i.e., n = for some integer k. Then n2 = is also even.arrow_forwardGive English language translations of the following wff if M(x): x is a man W(x): x is a woman i: Ivan p: Peter W(x, y): x works for y (∃x)(W(x) ∧ (∀y)(M(y) → [W(x, y)]')) which one of this answer choices a. No woman works for any man. b. Every woman works for some man. c. Some woman does not work for any man. d. Every woman works for every man.arrow_forward
- Let S be the set of all sentences in English Wikipedia as it existed on Feb 7, 2022 at midnight. Check all true statements about S. O S contains infinitely many sentences. S is a language that can be described using a deterministic finite-state automaton. O S is a language that can be described by a non-deterministic finite-state automaton. OS is a language with a finite alphabet.arrow_forwardLet F be the set of all functions of the form f : N {0,1}. Also, let G be the set of all functions of the form f: {0, 1}* → {a, b}.Then: O (a) |F| = |G| = |N| O (b) |F| = |P(G)| 미 (c) 1지=1P(N)| □しろいしかく (d) 지< IgI, but |F # I9| □ (e) |지= 19| %3D %3D Select all possible options that apply. earrow_forward3. (a) Consider the following algorithm. Input: Integers n and a such that n 20 and a> 1. (1) If 0arrow_forwardA student wants to prove by induction that a predicate P holds for certain nonnegative integers. They have proven that for all integers n ≥ 0 that P(n) → P(3n). Suppose the student has proven P(3). Which of the following propositions can they infer? (The domain for any quantifiers appearing in the answer choices is the natural numbers.) O Vn, P(3+3) O P(n) does not hold for ʼn < 0 P(n) for n = 6, 9, 12,... Vn ≥ 1, P(31)arrow_forwardExplain, with an example why the following definition, would not be suitable or useful: f(n) is Ω( g(n) ) if and only if there exists n0, such that:forall n ≥ n0, there exists c > 0 such that,f(n) ≥ c g(n)arrow_forwardLong chain of friends: You are given a list of people, and statements of the form "x knows y". You are asked to find, is there a chain of k distinct people, such as x1 knows x2, x2 knows x3, and xk-1 knows xk. Prove that this problem is NP-complete by using one of the known NP-complete problems (CLIQUE, 3-SAT, Hamiltonian Path, Hamiltonian Cycle, Independent Set, etc.)arrow_forward10. Apply Djikstra's Algorithm to find a shortest path from A to Z. Be sure to show each step of the algoriothm on a separate picture as discussed in class. Work carefully and pay attention to details. You need to clearly show how you are applying the algorithm. Also be sure to clearly name the verticies of a final shortest path Barrow_forwardI need the algorithm, proof of correctness and runtime analysis for the problem. No code necessary ONLY algorithm. And runtime should be O(n log n) as stated in the question.arrow_forwardConsider the problem of making change for n cents using the fewest number of coins. Assume that we live in a country where coins come in k dierent denominations c1, c2, . . . , ck, such that the coin values are positive integers, k ≥ 1, and c1 = 1, i.e., there are pennies, so there is a solution for every value of n. For example, in case of the US coins, k = 4, c1 = 1, c2 = 5, c3 = 10, c4 = 25, i.e., there are pennies, nickels, dimes, and quarters. To give optimal change in the US for n cents, it is sufficient to pick as many quarters as possible, then as many dimes as possible, then as many nickels as possible, and nally give the rest in pennies. Design a bottom-up (non-recursive) O(nk)-time algorithm that makes change for any set of k different coin denominations. Write down the pseudocode and analyze its running time. Argue why your choice of the array and the order in which you fill in the values is the correct one. Notice how it is a lot easier to analyze the running time of...arrow_forwardarrow_back_iosSEE MORE QUESTIONSarrow_forward_ios
- Text book imageDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationText book imageStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONText book imageDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- Text book imageC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONText book imageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningText book imageProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education