instruction stringlengths 35 29.1k |
|---|
On one hand, Horn-SAT is known to be tractable in linear time - where Horn-SAT is the problem of deciding whether a given set of propositional Horn clauses (with at most one positive literal) is satisfiable or not.
On the other hand, Double-SAT is NP-complete (see this post : Proving Double-SAT is NP-complete) - where ... |
I need some help in understanding the 'Tabu Search' Algorithm. (Wikipedia)
I miss a simple explanation to Tabu Search. Anyway, I'm trying to refer to available resources and build an understanding.
This is what I'm trying to 'digest':
Tabu Search is an improvement over the Hill Climbing algorithm (Ref-1).
The problem... |
Upon reading Do source code optimizers exist? I knew that such programs existed but the ones I have worked with use a set of rules to drive a transformation algorithm. Ira Baxter provided a link to the tools running the algorithms with his answer but what I was more after from the question was the rules. In the commen... |
When I was studying Comp Sci, we had Garey & Johnson as a course textbook, with a large collection of NP-Complete problems. But by that time you could also have a look at the Compendium of NP Optimization Problems, online.
However, it seems the 'Compendium' site has not seen any updates in several years. Is that indeed... |
What type of algorithm would you suggest me to use for this problem? I want to implement an algorithm that minimize the total distance in a graph (TSP) but for only X nodes. Also, we can go as many times we want on every vertices and/or edges. Let's say, on my graph, that I want the minimum distance for visiting every ... |
I am working on my thesis which involves using ant based techniques for graph clustering. I am testing the algorithm currently and I was wondering if there is a way that I can visualize the clusters of a given graph.
In this case, I have the graph as a file and another file corresponding to the clustering where each no... |
I have a multi-label classification problem, in which each input sample has a set of zero or more output labels.
I have a multi-class classifier which, for every input sample, returns a certain score for each of the output labels.
One way to use this multi-class classifier for multi-label classification is to calculate... |
I came across following question:
There is a building with N floors. We have a balls of same property and have a breaking point of X floor. i.e, If ball dropped from X+1 floor then the ball will break. if ball is dropped from X or less than X then it wont break. Now design an algorithm to find X if N is given.
My Solut... |
Given any infinite regular language $L$, how can I prove that $L$ can be partitioned into 2 disjoint infinite regular languages $L_1, L_2$? That is: $L_1 \cup L_2 = L$, $L_1 \cap L_2 = \varnothing$, and $L_1$ and $L_2$ are both both infinite and regular.
So far, I thought of:
using the pumping lemma such that
$$ \beg... |
What is an $O(n \log n)$ algorithm to find how big the largest subset of $n$ axis-aligned rectangles (in the plane) that contain a common point is? Perhaps by reducing this to a problem with such runtime?
An $O(n^{3})$ algorithm could be
for each of the n rectangles
for each of the 4 sides of the rectangle
... |
Let $X = \{\langle M \rangle\ |\ M\text{ is a finite state machine and }L(M) = \emptyset\}$ where $\langle M \rangle$ is an encoding of the
machine $M$. Is $X$ Turing decidable? Why or why not?
|
$$ (\neg A \wedge \neg C) \vee (\neg A \wedge D) \vee (\neg A \wedge B) \vee (\neg B \wedge \neg C) $$
can simplify down to
$$ (\neg A \wedge D) \vee (\neg A \wedge B) \vee (\neg B \wedge \neg C) $$
I've computed the truth tables for the two expressions, and they're the same. But I'm supposed to prove it without using... |
So I recently had a problem where I had to create a regular language. After consulting my professor on my solution he told me it was close to correct but to check my definition of a regular language. I am somewhat lost on why my solution is not regular?
From my understanding it meets the requirements of being a right ... |
Consider the following grammar, where $ [ \ ] \ | \ , \ $ are terminal symbols
$
\begin{eqnarray}
L \rightarrow [ \ ] \qquad(1) \\
L \rightarrow [ \ H\ T\ ] \qquad(2) \\
H \rightarrow L \qquad (3) \\
H \rightarrow L\ ,\ H \qquad (4) \\
T \rightarrow |\ L \qquad(5) \\
T \rightarrow \epsilon \qquad (6)
\end{eqnarray}
... |
Imagine that we have an array like structure A with n elements all of which are initially 0.
($A[i]=0$)
What is a data structure that supports the following operations:
1) Given an element A[i]=0 set A[i] to 1 in O(1) worst case
2) Given the index i return A[i] in O(1) worst case
3) Given the index i retrun the smalles... |
Given the following:
$$\{ w\#x \mid w^R \text{ is a substring of $x$, with $x$ and $w \in \Sigma^*$} \}$$
What does $w\#x$ denote?
|
I am interested in simulating any turing machine with a turing machine that is allowed only to move right. I guess that it should be pretty standard material and likely it is trivial (or known to be false). Does anyone have a pointer to a reference?
|
The intersection of a context free language L with a regular language M, is said to be always context free. I understood the cross product construction proof, but I still don't get why it is context free but not regular.
The language generated by such an intersection has strings that are accepted both by a PDA and a D... |
It is known that 3-SAT belong to - NP-Complete complexity problems, while 2-SAT belong to P as there is known polynomial solution to it.
So you can state that there is no such reduction from 3-SAT to 2-SAT unless $P=NP$.
I am looking for strong proof for this state, regardless NP belong to P or not.
|
Given $A,B$ regular languages with $A \prec B$. Prove the existence of $C\in L_{\text{regular}}$ so that: $A \prec C \prec B$.
Here, $A\prec B$ stands for: $A\subset B $ and $B\setminus A $ is infinite.
I tried to go for: $C=\overline{B} \cup A$ and some other options but it didn't work out.
|
I am trying to figure out if there exists a DFA $M$ with $k+2$ states (for every $k\in \mathbb{N}$ ) so that every automaton which accepts $L(M)^R$ has at least $2^k$ states.
I am trying to find an example of such a DFA, any help?
|
I have a question: Every Decision problem has a method, turing machine or algorithm to solve it? If the answer is not, Could show me any example?
|
From wikipedia:
"Typically, a cache-oblivious algorithm works by a recursive divide and conquer algorithm, where the problem is divided into smaller and smaller subproblems. Eventually, one reaches a subproblem size that fits into cache, regardless of the cache size."
(Is this recursive subdivision manual, or automated... |
I have been doing a little reading up on bubble sort and have read on wikipedia that it's complexity is measured as $\Theta(n^2)$
This bubble sort however is slightly more efficient. I thought this would be the best place to ask how I would work out this particular implementations complexity seeing that the number of i... |
I'm learning about Logic; I've devised a few sentences to convert into logic to test myself and see if i've grasped the topic. It would be of great help if you could tell me if i'm doing it right!
Every student who likes chocolate is smart:
(Every student) (who likes chocolate) (is smart)
∀x ∈D, [Like (Student (x), c... |
I am doing an assignment for my 1st year langauges and automata class. I have been having trouble with the last question which is this: Create a Turing machine that acccepts more a's than b's. I think I am supposed to pair the a's and b's together and then do some more but I can't wrap my head around it. Would help gre... |
Can we solve an EXPTIME-complete problem in polynomial time given 2^N processors?(N is the size of input).
|
I am trying to reduce 3-sat to 2-sat. With my reduction, I can find one assignment that satisfies them both, but there are some assignments that satisfy only the 3-sat.
Does it make my reduction invalid? Is 3-sat required to be equal-satisfiable to 2-sat to call it a reduction?
|
I'm reading a definition of PSPACE and say: are the decision problems solvable in polynomial space on a Deterministic Turing Machine. My question is: Why NP is in PSPACE?. I have a doubt beccause for example a SAT problem is solvable in Non-Deterministic Turing Machine and SAT $\in NP$ and not in $P$.
|
What books would you recommend for someone starting B.Sc in Computer Science?
My Personal Info:
I am currently looking at B.Sc in Computer Science (Games), which is computer science, accept for the last year which is tailored more towards game dev.
I have a fair bit of programming experience with Unity and other thing... |
I have written an algorithm for clustering data-points with their nearest neighbours with a Euclidean distance metric. I estimate its complexity to be $\mathcal{O}(n \times k)$ for $n$ data-points with $k$ genuine clusters. The dimension $d$ of the data results in $\mathcal{O}(e^d)$ complexity, though I believe this ca... |
I was given a graph problem with 3 different questions and 1 set of answers. The problem is described below. The problem that I'm having is that it seems to me that the answer to all the questions is the same. I keep trying to find a caveat but I don't see one. What am I missing?
Here is the problem
Undirected graph $G... |
I am trying to prove problem 1.59 in Sipser's book: Introduction to the theory of computation , 2nd Edition.
Let $M=(Q,\Sigma,\delta,q_0,A)$ be a DFA and let $q'$ be a state of $M$ called its "home". A Synchronizing sequence for $M$ and $q'$ is a string $s\in \Sigma^*$ where $\delta (q,s)=q'$ for every $q\in Q$. (We a... |
I'm quite stuck trying to answer this. The problem of finding the size of the maximum independent set in a tree using dynamic programming is well documented and many solutions are around.
I've been trying to use a similar technique (ie. recursing through the childred and then the grandchildren of a node) to find the nu... |
Is it possible to represent the algorithm proposed by Adleman to solve the Hamiltonian problem in a probabilistic Turing Machine?
See also Computing with DNA
|
I was taught that when a reference is mapped to a cache block, X, for the first time, the word is stored in the cache block, bearing a tag and index that helps identify it for future reads. Then, when a later reference is deemed to have the same tag and index for cache block X, the value inside the cache block is retu... |
Like the title says, we have the alphabet $\Sigma = \{a,b,c\}$ and the question is asking for the regular expression of the language $L$ that has the property that all strings in $L$ have at least two consecutive $a$'s but no consecutive $b$'s.
By attempt at a solution was this, where $aaa^+$ stands for $aaa(aaa)^*$:
... |
I do not understand the following options in windows. Could any one explain
|
I need to evaluate a polynomial of degree n at the n cube roots of unity. Simple evaluation would take $O(n^2)$ time. I know that polynomial evaluation can be done in $O(n\log n)$ time using FFT.
But the problem that I am facing is this. FFT only works when $n$ is a power of 2. If I extend my polynomial by appending ze... |
On this page describing the precursor to the Scala language - the pizza language - they refer to it having both case classes and pattern matching - and then imply that these taken together provide algebraic types.
Is this the case? To provide algebraic types - do you combine case classes and pattern matching?
|
I can say that $x * y$ is a problem, but I can also say that $x * y$ is an algorithm for finding a rectangle area.
I have been reading Wikipedia about an algorithm and a problem, but I am not sure about their definitions. Could you please explain it to me in more detail?
|
Suppose that a processor can address directly up to 4 Gigabyte main memory and can operate words with size 32 bit. Find how big should be the size of the "MAR" (memory address registers), "MDR" (memory data registers) and accumulator registers in this computer?
My answer: MDR is 32 bit wide since it exchanges data not ... |
Let $ G=(V,E) $ be a directed graph with a real weight function $w$ defined on the edges and $ a,b \in V$. Let $\alpha$ denote the minimal weight of all paths from $a$ to $b$ and $\beta$ denote the minimal weight of all paths from $b$ to $a$. How do you find two paths $l_1,l_2$ such that:
$l_1=(a,v_1,..,v_n,b)$
$l_2=... |
I was a little confused between these three terms Multitasking, Multithreading and Multiprogramming
Although every one means executing different lines of codes, and for every one we need something like Task State Segment or context to store data for that particular thread/task.
I am missing something, can anyone give ... |
I have a rough idea that the time complexity is O(mn) where m and n are based on the length of signals, as per this http://en.wikipedia.org/wiki/Dynamic_time_warping.
How can I determine the time complexity of the following code (source)
function [Dist,D,k,w,rw,tw]=dtw3(t,r)
%
% [Dist,D,k,w,rw,tw]=dtw(r,t,pflag)
%
% D... |
I been reading Wikipedia for polynomial time, and it says:
An algorithm is said to be of polynomial time if its running time is
upper bounded by a polynomial expression in the size of the input for
the algorithm, i.e., $T(n) = O(n^k)$ for some constant $k$.
My questions are:
Why do we have addition and multiplic... |
According to Wikipedia, the Independent Set problem is a special case of the Set Packing problem. But, it seems to me that these problems are equivalent.
The Independent Set search problem is: given a graph $G(V,E)$ and an integer $n$, find $n$ vertices no two of which are adjacent.
The Set Packing search problem is: g... |
There are n collections of M sets.
Pick a single set from each collection,
such that all n picked sets are pairwise disjoint.
This problem can be converted to the standard Set Packing problem in the following way: add a unique element $e_i$ to all $M$ sets in each collection $C_i$. Then find a set packing of size $n$ ... |
Wiki define Polynomial time as fallow:
An algorithm is said to be of polynomial time if its running time is
upper bounded by a polynomial expression in the size of the input for
the algorithm, i.e., $T(n) = O(n^k)$ for some constant $k$
I understand that in general speaking the difference between Polynomial time ... |
The algorithm (from here) -
Create a set S of remaining possibilities (at this point there are 1296). The first guess is aabb.
Remove all possibilities from S that would not give the same score of colored and white pegs if they were the answer.
For each possible guess (not necessarily in S) calculate how many possib... |
It is proven by Time hierarchy theorem that EXPTIME-complete do not belong to P even if we do not know if NP belong to P.
Before I read wiki, I found EXPTIME algorithm for solving 3-sat, the brute algorithm $O(2^n)$. Could I announced then, that there could not be polynomial solution for 3-sat?
Time hierarchy theorem ... |
If L is regular and M is non regular; then L.M is necessarily not regular. Is this true or false? And why?
I feel its false
|
I am interested in the properties of a class of bipartite graphs $G(X \cup Y, E)$ where all nodes in $X$ are 3-regular, all nodes in $Y$ are 2-regular, and $|X|=|2Y/3|$. First, Is this a well known class of graphs? Secondly,
Is there an example of intractable computational problem restricted to this class of bipartite... |
There seems to be a classification of processes in IT. For example, "business process" refers to the collection of tasks done by organization members / software systems to achieve a goal.
If a process is completely automated and carried out by software (no people involved) what is the process called? Say we have a Web ... |
I'm a little confused by Wikipedia's definition of a regular language:
The collection of regular languages over an alphabet $\Sigma$ is defined recursively as follows:
The empty language $\emptyset$ is a regular language.
For each $a \in \Sigma$ ($a$ belongs to $\Sigma$), the singleton language ${a}$ is a regular lan... |
I have the expression:
\begin{equation}
|Q|f(n)|\Gamma|^{f(n)}
\end{equation}
Here is my solution to convert the above into an asymptotic expression:
$|Q| = 2^l$ for some $l\in\mathbb{R}$
$|\Gamma| = 2^k$ for some $k\in\mathbb{R}$
Therefore we have $2^lf(n)(2^k)^{f(n)} = f(n)2^{kf(n)+l} = f(n)2^{O(f(n))}$
Is this co... |
I am currently working on the following task:
A language L = {< M> | M(x) = x^2} is given. Now I need to show, that this language is not decidable.
By the way, < M> is the Gödel number
But right now, I don't know how to deal with that task. Honestly, this is the first time that I am working with this kind of task.
I w... |
Background
I am learning assistance, Coq, on my own. So far, I have completed reading Yves Bertot's Coq in a Hurry. Now, my goal is to prove some basic results concerning the natural numbers, culminating with the so-called division algorithm. However, I have encountered some setbacks on my way towards that goal. In par... |
I'm wondering about the result of this program as I get confused when it comes to lexical scoping and dynamic scoping.
fun bar() {
int a = 2
void foo(int b) {
b = b * a;
a = a - b
}
{
int a = 10;
foo(a);
print a;
}
}
There are a couple of questions of what program... |
I am wondering if given the time complexity of an NP-Complete problem or at least some information about it for example if $ SAT\in Time(2^{sqrt(n)})$ (hypothetically) could I assume that all languages in NP (which are clearly polynomial time reducible to SAT) are also $\in Time(2^{sqrt(n)})$
I believe the answer is fa... |
Is $L = \{w_1cw_2 : w_1, w_2 \in \{a, b\}^* , w_1 \neq w_2 \}$ a CFL?
In my opinion it is not since if we want to know the inequality of $w_1$ and $w_2$ we must be aware of their equality and that is not a $CFG$.
|
I know that the set partitioning problem defined like this:
Given $$S = \left\{ x_1, \ldots x_n \right\}$$ find $S_1$ and $S_2$ such that $S_1 \cap S_2 = \emptyset$, $S_1 \cup S_2 = S$ and $\displaystyle\sum_{x_i \in S_1} x_i=\sum_{x_i \in S_2} x_i.$
is NP-complete. But I don't understand why (or am not even sure if)... |
Today I've heard about fascinating metagame paradox. I tried to come up with an explanation via Turing Machines formalization (below). Do you know what is the solution to the paradox? (the post content: definition - proposed solution - conclusion)
Something is a game iff:
G1. Two players
G2. Players alternate
G3. The g... |
How could we prove the following modified Pumping Lemma:Let the language L has an infinite number of words, then there are words $x,y,z \epsilon \Sigma ^{*}$, so that $|xz|\leq |\Sigma_{k}|$, and each word $xy^{(i)}z, i\geq0 $ is in L.
Could you give me a hint how to begin?
|
I am interested in reductions from 3-CNF boolean expressions to similar restricted forms. For example, I am interested in knowing how to reduce a 3-CNF formula to another 3-CNF formula where each variable appears in at most $b$ clauses. I observed this is used in MAX-SAT so I am interested in knowing such reductions. I... |
There's an f(n) such that f(n) != O(f(n/2))
so by the definition of big O notation:
for f(n) = n^2 the statement is false, because there is a constant c such that n^2 = c*(n^2/2)
Which f(n) will work?
My guess is f(n) = 2. is that correct?
|
If bits are the base unit of information, why are bytes treated like the base unit?
For example, usually values are expressed in Mega/Giga/Tera/Exa bytes instead of bits. I am aware that bits are sometimes used (e.g. sometimes for internet speed), but generally to me it seems like bytes are used as if they are the bas... |
What is the difference between minimum spanning tree algorithm and a shortest path algorithm?
In my data structures class we covered two minimum spanning tree algorithms (Prim's and Kruskal's) and one shortest path algorithm (Dijkstra's).
Minimum spanning tree is a tree in a graph that spans all the vertices and total... |
Let $M$ be a finite set of even cardinality. Define $C=\{\{a,b\}:a,b \in M, a \neq b\}$ the set of all pairs over $M$. Let $w:C \rightarrow \mathbb{R}^+_0$ be a function.
Now find $C' \subset C$ with the following constraints:
$$
\bigcup C' = M \\
\forall x,y \in C': x \cap y = \emptyset \\
\sum_{x \in C'}w(x) \text{ m... |
I've been trying for quite some extended time to find a construction so that I can formally demonstrate that a deterministic PDA is closed under complementation. However, it happens that every idea I got has something that at the end does not fit. Could you give me a hand?
The main problem happens with the ε-moves. A P... |
Given a collection of $n$ numbers, $S$, the question is to decide whether all the elements of $S$ are distinct from each other. If they are distinct from each other (no two of them are the same), print "Yes". Otherwise print "No".
I know the worst case time complexity of this question is $\Theta \left ( n\log n \right ... |
I have a question asking about a language L with the property: there is a TM that decides L in time O(n^2013 / (log(n))^2012), and if there is a TM that decides L in time O(n^2012.9).
My confusion comes from the first big O given, from what I understand the numerator would dominate as the TM grows towards infinity, so ... |
I am having an extremely tough time with this homework question, wondering if anyone could help me (for all you theory aficionados, this one's for you).
There is a language $L$ with the following property: There is a Turing machine that decides $L$ in time $O(n^{2013}/\log^{2012} n)$, but there is no Turing machine tha... |
Let Two-Solutions-SAT be the language of Boolean formulas that have exactly two distinct satisfying assignments. Show Two-Solutions-SAT is co-NP-hard.
I know how to show that the complement of Two-Solutions-SAT is in NP, it's relatively easy to create a nondeterministic polynomial time TM that decides it.
My problem co... |
Others have studied the following question: given a set of words $w_1,w_2,\dots \in \Sigma^*$, find a regular grammar (or a context-free grammar) that generates all of those words, is "natural" in some sense, and is as small as possible. In the special case where we have a single word $w \in \Sigma^*$, if the grammar ... |
I've had this little doubt bothering me since four semesters now, so I've come here to resolve it. Theoretical CS was probably not the right place to ask.
Coming to the question, my old coursebook (Theory of Computer Science - Automata, Languages and Computation (Eastern Economy Edition) by KLP Mishra) details the conv... |
Let $L$ be a given Context Free Language over the alphabet $\{a,b\}$. Now consider $$L_1=L-\{xyx\ |\ x,y\in\{a,b\}^*\}$$
I know that $\{xyx\ |\ x,y\in\{a,b\}^*\}$ is not Context Free (by using pumping lemma).
Based on that can we affirmatively say that $L_1$ will NEVER be Context Free (can't use closure property here, ... |
Consider the following very simple computer program:
for i = 1 to n:
y[i] = x[p[i]]
Here $x$ and $y$ are $n$-element arrays of bytes, and $p$ is an $n$-element array of words. Here $n$ is large, e.g., $n = 2^{31}$ (so that only a negligible fraction of the data fits in any kind of cache memory).
Assume that $p$ co... |
Generally (perhaps always) in programming languages, unary operators have the highest precedence. In some langauges, such as Standard ML, one can dynamically change the precedence of binary operators at run time.
But what if we have a language where binary operators had higher precedence than unary ones? Do such lang... |
Show that the set $K^{c}$ = $\lbrace M \mid M(M) \text{ diverges} \rbrace$ is not recursively enumerable.
This question is essentially asking to show that the set of turing machines which diverge when run on their own code is not RE.
My idea is to attempt to reduce this problem to something which is the complement of... |
I was reading Wikipedia's entry on Kolmogorov Complexity (thanks to this question), which states:
It can be shown that the Kolmogorov complexity of any string cannot be more than a few bytes larger than the length of the string itself.
Why would you ever need anything more than the string itself to describe it?
|
Some claim that dynamically typed languages are in reality statically typed, unityped languages. This would imply to me that this one type should be expressible as a static, finite type expression, so can anyone provide such an expression? You can make whatever assumptions you need to make about the base types in the l... |
Given a weighted digraph $G=V,E$, and a weight function, $d(u,v)$, one can normally use Dijkstra's algorithm to obtain the shortest path. What I am interested in, is how to obtain the $2^{nd}$-shortest path, the $3^{rd}$-shortest, and so on.
Questions:
Is there an efficient algorithm to get the i-th-most-shortest-path... |
Consider the following problem: given a set of $m$ red points and $n$ blue points in the plane, find a minimum length cycle that separates the red points from the blue points. That is, the red points are inside the cycle and the blue points are outside the cycle, or vice versa. This problem is called the red blue separ... |
While reading a passage in an older textbook I came upon this problem which I am having difficulty in justifying whether its true or false. Is this possible?
If some problem $A$ is NP-hard, and if that problem $A$ can be reduced to problem $B$, and there exists some polynomial-time algorithm which solves $B$, then P=N... |
Suppose we need to find a tight asymptotic bound on the worst case run time of the following program
t = 0;
for i = 0 to n-1 do
for j = i+1 to n-1 do
for k = j+1 to n-1 do
t++;
I can't for the life of me figure out what the run-time would be. I have a feeling it would have n! in there somewhere, but I can'... |
I am having a bit of difficulty understanding the order of precedence in boolean logic for the OR operation. Take this example:
Assume the following regular expression:
((a(b+))+(a|c))|a|c
Why is it that this accepts the strings:
a
c
abba
abbabbba
abbabbc
etc
But when I flip it around and use the regular expression
a... |
Recently, I am reading papers about dichotomy. I do not understant what condition can be called as a dichotomy? What is the meaning of "a question is either in P or in NP-complete"? (assume P $\neq$ NP)
For example, I've known the Schaefer's dichotomy theorem, in which a dichotomy about "whether a class of SAT is in P"... |
This problem is from the book [1]. In case of being closed as a duplication of that in [2], I first make a defense:
The accepted answer at [2] is still in dispute.
The proof given by @eh9 is based on Kruskal's algorithm.
I am seeking for a proof independent of any MST algorithms.
Problem: Let $T$ be an MST of graph... |
I need to process queries to Hash various ranges of a character array. I am currently using the Arrays.hashCode from the standard java library. But the problem is that this method is too slow. Also my array remains the same throughout the process of hashing, I only am changing the range. To deal with this, I have to ma... |
I have a question on my homework causing some confusion.
If L is a strict subset of L', and L' is a member of Co-NP, is L a member of Co-NP? True of False
Now I understand what belonging to Co-NP. Essentially means instead of deciding a yes instance we're deciding a no instance of the decidable problem. I'm stuck ... |
Let $A$ be a set of integers: $A=\left \{ x_1, x_2...x_n \mid 10<x_i<100\right \}$
A valid permutation $x_{i_1}x_{i_2}...x_{i_n}$ is a permutation that holds the following property:
For every adjacent numbers $x_{i_j}x_{i_{j+1}}$, the unit's digit of $x_{i_j}$ is equal to the ten's digit of $x_{i_{j+1}}$.
For example, ... |
I'm having trouble with this particular language: $$\{a^i b^j c^k \mid i+j \le k\}$$
If it's not context-free, I don't know how to correctly apply the Pumping Lemma for CFLs; if it is context-free, I don't know how to create a context-free grammar that generates this language.
Which one applies? Can you help me out?
|
The proof in my textbook, that $E_{TM}$ can be decided by oracle machine $O^{A_{TM}}$, uses a Turing machine $P$ such that for an input $w$:
$P$ runs the Turing machine $M$ on all strings of $\Sigma^*$
If $M$ accepts the string, $P$ accepts
$O^{A_{TM}}$ then asks the oracle if $<P,w> \in A_{TM}$
I can't seem to under... |
I was thinking of radix sort, and at a sudden thought that it uses de facto the paradigm of dynamic programming, but I soon changed my mind to greedy algorithm. Is it really a greedy algorithm?
|
SSUM is the same as the Subset Sum Problem with the only additional requirement is all the numbers must be unique in the subset.
To prove it's NP complete, the verifier is quite easy to construct being the same as one for the Subset Sum except you add the additional requirement of making sure all numbers are unique. ... |
I'm trying to understand reduction, this is from my textbook and is not a homework problem or even any exercise, just trying to understand an example they present.
This is the reduction they give:
PROOF We let R be a TM that decides REGULARTM and construct TM S to
decide ATM . Then S works in the following manner.
S =... |
Are NP or P closed under subtraction? Im having a hard time deciding whether they are or aren't.
Question was edited
Original question:
Im having some hard time figuring out what languages are closed under subtraction.
Say you have 2 languages A, B ∈ NP. Is A\B ∈ NP? what about P?
Commenters:
My original question was e... |
This is a practice problem I've come up with in order to study for an exam I have in a couple of hours.
Again, here's the problem: Show T(n) = 2T(n-1) + k is O(2^n) where k is some positive constant.
First of all, 2^n is indeed the upperbound, right? Since I've made this problem up myself, I'm not 100% sure, but from w... |
I am reading Subgraph isomorphism problem
I am having trouble understanding how they prove that the subgraph isomorphism problem is NP-Complete using the Hamiltonian cycles problem in the article.
Can someone help me explain what is happening in more laymen terms?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.