Problem Detail: Clearly there aren’t any undecidable problems in NP. However, according to Wikipedia: NP is the set of all decision problems for which the instances where the answer is “yes” have [.. proofs that are] verifiable in polynomial time by Read More …
Category: Uncategorized
Finding the height of a d-ary heap
Problem Detail: I would like to find the height of a d-ary heap. Assuming you have an Array that starts indexing at $1$ we have the following: The parent of a node $i$ is given by: $leftlfloorfrac{i+1}{d}rightrfloor$ The $d$ children of Read More …
Can all permutations of a set or string be generated in O(n log n) time?
Problem Detail: I was looking over this question requesting an algorithm to generate all permutations of a given string. A comment in the answer caught my eye: It might seem that it can take O(n) time per permutation, but if you Read More …
HALF CLIQUE – NP Complete Problem
Problem Detail: Let me start off by noting this is a homework problem, please provide only advice and related observations, NO DIRECT ANSWERS please. With that said, here is the problem I am looking at: Let HALF-CLIQUE = { $langle G Read More …
Difference between DPDA and NPDA?
Problem Detail: What are the major differences between Deterministic Push Down Automata and Non-deterministic Push Down Automata? Which one is faster and how? Also what are the drawbacks of DPDA with respect to NPDA. Can anyone quote an example and explain Read More …
Rule of thumb to know if a problem could be NP-complete
Problem Detail: This question was inspired by a comment on StackOverflow. Apart from knowing NP-complete problems of the Garey Johnson book, and many others; is there a rule of thumb to know if a problem looks like an NP-complete one? I Read More …
Pizza commercial claim of 34 million combinations
Problem Detail: A pizza commercial claims that you can combine their ingredients to 34 million different combinations. I didn’t believe it, so I dusted off my rusty combinatorics skills and tried to figure it out. Here’s what I have so far: Read More …
Is finding the longest path of a graph NP-complete?
Answered By : Juho First, it is easy to see that the problem is in $text{NP}$. The longest path is a Hamiltonian one since it visits all vertices. Indeed, there is a straightforward reduction from $text{HAM-PATH}$ to it. For details and Read More …
are NP Complete languages closed under any regular operations?
Answered By : David Richerby For all of the examples in this answer, I’m taking the alphabet to be ${0,1}$. Note that the languages $emptyset$ and ${0,1}^*$ are definitely not NP-complete. The class of NP-complete languages is not closed under intersection. Read More …
Is the set of Turing machines which stop in at most 50 steps on all inputs, decideable?
Answered By : Niel de Beaudrap Let’s consider the more general problem of machines which stop after at most $N$ steps, for some $N geqslant 1$. (The following is a substantial simplifcation of a previous version of this answer, but is Read More …