instruction
stringlengths
0
29.8k
⌀
Take $L_1=\{0\cdot x:x\in \Sigma^*\}\cup \{1\cdot x: x\in A_{TM}\}$ and $L_2=\{1\cdot x:x\in \Sigma^*\}\cup \{0\cdot x: x\in A_{TM}\}$. Clearly both languages are in $RE\setminus R$. However, their union contains $\{0\cdot x\}\cup \{1\cdot x\}=\Sigma^*\setminus\{\epsilon\}$, and therefore equals $\Sigma^*\setminus \...
I worked with OP on this problem. This is what we found. The problem solved by Gusfield in the paper ["Three Fast Algorithms for Four Problems in Stable Marriage"][1] does indeed include a solution to this problem. It should be noted, however, that the algorithm for building the graph of rotations contains an error ...
null
null
Let us assume that $L_1$ and $L_2$ are both computably enumerable, and that $L_1 \cap L_2$ and $L_1 \cup L_2$ are decidable. I claim that $L_1$ is decidable, too. Given some $w \in \Sigma^*$, I want to determine whether $w \in L_1?$. I proceed as follows: 1. First, I test whether $w \in L_1 \cup L_2$. If not, I ...
The Bucheim-Walker algorithm is used for drawing trees. However, there are many real-world examples where Directed Cyclic Graphs would benefit from such an algorithm (e.g. family trees with intermarriage or incestual relationships, dependency graphs, etc.). Can the algorithm be modified to support DCGs? If so, how? ...
> Proove or Disproove > $ \exists L_1 , L_2 \in RE \setminus R $ > such that $ L_1 \cup L_2 \in R $ and $ L_1 \cap L_2 \in R $ I tried to use the languages [![enter image description here][1]][1] but the intersection not in R right ? [1]: https://i.stack.imgur.com/GWqwY.png
proof or disproof if $ L_1 \subseteq L_2 $ then $ L_1 \leq L_2 $ I tried to think with HP and the empty language because HP is in RE and the empty language is in R but how do I prove this does not always happen? I don't understand whats the formal way to write it down
proof or disproof if $ L_1 \subseteq L_2 $ then $ L_1 \leq L_2 $
|formal-languages|turing-machines|
> Proove or Disproove > $ \exists L_1 , L_2 \in RE \setminus R $ > such that $ L_1 \cup L_2 \in R $ and $ L_1 \cap L_2 \in R $ I tried to use the languages [![enter image description here][1]][1] the union is $ \sigma^* $ and the intersection is empty language but I am really not sure if that really a...
Consider an alphabet $\Sigma$, and let $w_1, w_2, w_3, \ldots$ denote all words in $\Sigma^*$ in *minlex* order, that is, for all $i < j$, one of the following holds: (1) either $|w_i| < |w_j|$, or (2) both $w_i$ and $w_j$ are of the same length, yet $w_i$ comes before $w_j$ in the lexicographic order. For example, $b ...
The claim essentially says that if $L_1$ is included in $L_2$, then $L_2$ is harder than $L_1$, which clearly cannot be correct as the biggest language w.r.t containment is very simple. So you can take $L_1$ to be the halting problem, and $L_2$ to be $\Sigma^*$. Proceed from there.
The claim essentially says that if $L_1$ is included in $L_2$, then $L_2$ is harder than $L_1$, which clearly cannot be correct as the biggest language w.r.t containment is very simple. So you can take $L_1$ to be the halting-problem, and $L_2$ to be $\Sigma^*$. Proceed from there.
null
Is $L =$ { $\langle M \rangle$ | $M$ moves left on at least one input } decidable? What would the proof look like? Intuitively, I would say it's undecidable: We cannot predict if a given TM ever reaches an accepting transition on a specific input, let alone predicting if it would reach some transition $\delta(q,a) ...
$L =$ { $\langle M \rangle$ | $M$ moves left on at least one input }
|turing-machines|undecidability|decidability|
The language $L'$ is decidable. Consider the operation of a TM $M$ on an input $w$. If $M$ does not move its head to the left when it runs on $w$, then after $|w|-1$ steps, $M$'s head reaches the first blank tape cell and it enters some state $q_1$. When in $q_1$ and $M$ reads a blank, it moves to the right and enters ...
The language $L'$ is decidable. Consider the operation of a TM $M$ on an input $w$. If $M$ does not move its head to the left when it runs on $w$, then after $|w|-1$ steps, $M$'s head reaches the first blank tape cell and it enters some state $q_1$. When in $q_1$ and $M$ reads a blank, it moves to the right and enters ...
The language $L'$ is decidable. Consider the operation of a TM $M$ on an input $w$. If $M$ does not move its head to the left when it runs on $w$, then after $|w|-1$ steps, $M$'s head reaches the first blank tape cell and it enters some state $q_1$. When in $q_1$ and $M$ reads a blank, it moves to the right and enters ...
The language $L'$ is decidable. Consider the operation of a TM $M$ on an input $w$. If $M$ does not move its head to the left when it runs on $w$, then after $|w|-1$ steps, $M$'s head reaches the first blank tape cell and it enters some state $q_1$. When in $q_1$ and $M$ reads a blank, it moves to the right and enters ...
|complexity-theory|satisfiability|3-sat|constraint-satisfaction|sat-solvers|
null
Given a graph with $n$ vertices and $m$ edges, $m \le {n \choose 2}$, we index the vertices from 1 to $n$, and denote every edge by $(l,r)$ where $1\le l < r \le n$. Find the maximum $k$ such that there is a matching consisting of $k$ edges satisfying $l_1<l_2<...<l_k$ and $r_1<r_2<...<r_k$. This can also be though...
null
null
Consider, over a finite set of boolean variables $X$, a [Boolean system in CNF][1] (conjunctive normal form) whose clauses only contain non-negated literals. Assume the following "planarity & connectedness restrictions": the variables are the vertices of a planar graph whose faces have degree 4 and the variables in...
Positive boolean satisfiability problem : finding minimal solutions
|optimization|satisfiability|planar-graphs|
null
what you are looking for is the "exponential mechanism". See https://www.cis.upenn.edu/~aaroth/Papers/privacybook.pdf. It is a very general mechanism, which includes one-sided noise as a special case.
Problem Description ============== I have two sets of 2D points with flavours: Noisy points $$p_i = (x_i, y_i, f_i) : p_i \in N : |N|\approx 10^8 $$ and true points $$p_{t_i} = (x_{t_i}, y_{t_i}, f_{t_i}) : p_{t_i} \in T : 10^6 \lt |T| \lt 10^7.$$ Each noisy point $p_i$ has been generated by adding errors $...
Clustering 2D points with flavour
|runtime-analysis|probability-theory|clustering|euclidean-distance|space-partitioning|
null
Concerning the general question *Could two such “versions” of a language, where one version asks about any input and the other about a specific input, differ in decidability?*: They sure can. E.g., consider $L=\{\langle M\rangle:\text{$M$ halts}\}$ and $L'=\{\langle M,n\rangle:\text{$M$ halts in $n$ steps}\}$ (where...
There is a directed acyclic graph with **M** edges. There is only one connected component. An edge from a to b means value of node a is strictly greater than value of node b. What is the total number of combinations of node values such that maximum value of any node is **C** ?
Total combinations in DAG with upper bound on node value
|algorithms|graphs|dynamic-programming|dag|topological-ordering|
There is a directed acyclic graph with **M** edges. There is only one connected component. An edge from a to b means value of node a is strictly greater than value of node b. What is the total number of combinations of node values such that value of any node is between 1 to **C** ?
The following is a simple counter-example. Let $V = \{a,b,c,d\}$ be a vertex set with all the initial distances set to arbitrarily value $D$. There are the following directed edges with weights: 1. $w(a,b) = -3$ 2. $w(b,c) = 1$ 3. $w(c,a) = 1$ 4. $w(b,d) = -3$ Then the edge $(b,d)$ relaxes in the $1$s...
There is such a circuit with exactly $2^{2^n}$ nodes (which is, of course, minimal possible). I’m assuming arbitrary nodes in the circuit can be designated as output nodes, including input nodes and nodes of nonzero fan-out; otherwise you would have to copy them, leading to at most double the size. Start with the $n...
There is such a circuit with exactly $2^{2^n}$ nodes (which is, of course, minimal possible). I’m assuming arbitrary nodes in the circuit can be designated as output nodes, including input nodes and nodes of nonzero fan-out; otherwise you would have to copy them, leading to at most double the size. Start with the $n...
null
null
There is a directed acyclic graph with **M** edges. There is only one component (If they were undirected edges all nodes will be reachable will from one to another). An edge from a to b means value of node a is strictly greater than value of node b. What is the total number of combinations of assigning natural numbers ...
null
null
I am very interested in the following questions, which sprang out from the topological study of loops in surfaces and their intersection numbers. Consider, over a finite set of boolean variables $X$, a [Boolean system in CNF][1] (conjunctive normal form) whose clauses only contain non-negated literals. Assume the...
I think you are almost there: the intuition about using the max-flow is correct. In your graph model one thing lacking is the constraint on minimum students that a class must have(for this to be a feasible solution). A correct model(on which an appropriate max flow algorithm would give us the answer on existence...
For cases where recursion is used as well as memoization (so that a number of subtrees of what would otherwise be the overall recursive call tree are each replaced to be `O(1)`), I am wondering what the resulting runtime is (such as whether it is the same as the corresponding dynamic programming approach), or really, h...
Calculating Runtime Complexity: Recursion + Memoization vs Dynamic Programming (with example)
|runtime-analysis|dynamic-programming|recursion|big-o-notation|memoization|
null
Thanks to Trebor for explaining the procedure. Here is Python code which uses explicit indexing in order to match the original expression. For simplicity it replaces the function `f` with an array-—so `f(i)` becomes `f[i]`. In order to get the dependent product of the arrays of indices, I use `itertools.product()...
> Proof or Disproof > > if $ L $ is a Regular language then it has to be that $ L\leq HP $ $ HP=\{<M,x> | M \ halts \ on \ x \} $ Regular language is a language that can be expressed with a regular expression or a deterministic or non-deterministic finite automata I know that HP is in RE\R and I know the r...
Proof or Disproof if $ L $ is a Regular language then it has to be that $ L\leq HP $
|formal-languages|turing-machines|
null
I think you are almost there: the intuition about using the max-flow is correct. In your graph model one thing lacking is the constraint on minimum students that a class must have(for this to be a feasible solution). A correct model(on which an appropriate max flow algorithm would give us the answer on existence...
> Proof or Disproof > > if $ L $ is a Regular language then it has to be that $ L\leq HP $ $ HP=\{<M,x> | M \ halts \ on \ x \} $ Regular language is a language that can be expressed with a regular expression or a deterministic or non-deterministic finite automata I know that HP is in RE\R and I know the r...
From your attempt, I see that you got the intuition, but you need to define the reduction formally, and then prove that it works. In your solution, it is not clear how $M'$ is defined, and what is $M_{regular}$ -- for me, I just saw your thoughts/attempts, not a proof. [Here][1], I showed that every non-trivial lang...
From your attempt, I see that you got the intuition, but you need to define the reduction formally, and then prove that it works. In your solution, it is not clear how $M'$ is defined, and what is $M_{regular}$ -- for me, I just saw your thoughts/attempts, not a proof. [Here][1], I showed a slightly more general res...
From your attempt, I see that you got the intuition, but you need to define the reduction formally, and then prove that it works. In your solution, it is not clear how $M'$ is defined, and what is $M_{regular}$ -- for me, I just saw your thoughts/attempts, not a proof. [Here][1], I showed a slightly more general cla...
null
Suppose a generalized version of k-SAT where the usual clauses (disjunctions of literals) are generalized to arbitrary Boolean functions of k variables. (For example, $(x \oplus (y \land z)), ((x \land z) \lor (y \land z))$ and $(x \implies z)$ could be generalized clauses for k = 3.)(Just a note: there are $2^{2^k}$...
The "parent" of the problem you're looking at is sometimes called Weighted Satisfiability (WSAT, particularly in parameterized complexity) or Min-Ones (though this is normally an optimization version, but near enough). These problems have the "at most $k$ variables set to true" restriction as their defining feature. ...
I considered the Euler circle problem to decide this. The polynomial reduction is: I add a new vertex in the graph: - If the degree of each vertex is even, then I connect all the vertices with this new vertex - Otherwise, I only connect the vertices with an odd number of degrees to the new vertex Is this a correct...
The problems in the P class can be polynomially reduced to its complement and vica versa?
|complexity-theory|complexity-classes|
No. Take $A = \emptyset$ and $B = \{0\}$. A reduction $f$ from $A$ to $B$ is the function $f(x) = \varepsilon$ since $x \not\in A$ (regardless of the choice of $x$) and $\varepsilon\not\in B$. However $0 \not\in \overline{B}$ and there is no function $g$ such that $g(0) \not\in \overline{A} = \Sigma^*$, hence there i...
The claim is false. $\emptyset$ cannot be reduced to its complement $\Sigma^*$.
The claim is false. $\emptyset$ cannot be reduced to its complement $\Sigma^*$ (and vice-versa). However, if you restrict yourself to languages $L$ such that $L \not\in \{ \emptyset, \Sigma^*\}$ then it is true that $L \le \overline{L}$. To see this let $n$ be any fixed element of $L$ and let $y$ be any fixed elemen...
The claim is false. There are several ways to show it. Note that if $\overline{B} \leq_m \overline{A}$, then $B\leq_m A$ (this is what you've shown). Hence, if by contradiction the claim is true, then we can write it as $A \leq _m B \to B\leq_m A$, which is clearly wrong. Why? because it simply says "if $B$ is harder ...
|complexity-theory|reductions|complexity-classes|
I have proved that $\overline{A}\le\overline{B}$ is true, but I have no idea how to prove or disprove the opposite direction.
$A$ and $B$ two decision problems.If $A\le\ B$ then $\overline{B}\le\overline{A}$ is true?
The claim is false. There are several ways to show it. Note that if $\overline{B} \leq_m \overline{A}$, then $B\leq_m A$ (this is what you've shown). Hence, if by contradiction the claim is true, then we can write it as $A \leq _m B \to B\leq_m A$, which is clearly wrong. Why? because it simply says "if $B$ is harder ...
null
$L_1$ = {$a^nb^mc^xd^y$|$n=m$ or $x=y$} $L_2$ = {$a^nb^xc^md^y$|$n=m$ or $x=y$} For $L_1$: - Push a's - Now pop the same number of b's , Given n=m - If Stack is empty and x=y=0 accept the Langauge - else push c's and pop d's - If Stack is empty accept the Langauge It's DCFL and also CFL. ...
Is the Given Languages CFL or DCFL?
|automata|pushdown-automata|
The claim is false. There are several ways to show it. Note that if $\overline{B} \leq_m \overline{A}$, then $B\leq_m A$ (this is what you've shown). Hence, if by contradiction the claim is true, then we can write it as $A \leq _m B \to B\leq_m A$, which is clearly wrong. Why? because it simply says "if $B$ is harder ...
$L_1$ = {$a^nb^mc^xd^y$|$n=m$ or $x=y$} $L_2$ = {$a^nb^xc^md^y$|$n=m$ or $x=y$} For $L_1$: - Push a's - Now pop the same number of b's , Given n=m - If Stack is empty and x=y=0 accept the Langauge - else push c's and pop d's - If Stack is empty accept the Langauge It's DCFL and also CFL. ...
In stack languages (e.g. PostScript, Forth), return values are passed on the stack - zero, one, even a variable number. Python supports tuples of values there, frequently used "without tuple syntax", but creating a tuple regardless (garbage if not kept but unpacked immediately). Is there any non-stack language ...
Returning more than one value from a function without overhead
|programming-languages|
Your argument for $L_1$ isn't quite correct, but the core idea can indeed be adapted to obtain a deterministic pushdown automaton for $L_1$. I don't know why the answer key claims that the language is non deterministic context-free; that is probably something to take up with whoever provided that key. For the second...
null
null
Swift allows a single return value. However, a “tuple”, including one with unnamed components, is one of the basic types (struct, class, enum, tuple and closure; int, double, string and arrays are really structs) so that is not a problem. For a tuple, obviously it’s a bigger value than a single value and needs more cod...
null
null
The SAT is in NP, I suppose that the complement of the halting problem is in coNP-hard. I suppose the answer is no because SAT is not in coNP, but I am not sure.
The SAT problem can be reduced to the complement of the halting problem?
|complexity-theory|complexity-classes|
A PTIME reduction from $\text{SAT}$ to $\overline{HALT_{TM}}$ operates as follows. On input $\varphi$, the reduction outputs $\langle M, \varphi\rangle$, where $M$ is a constant TM that operates as follows. On input $\varphi$, $M$ goes over all assignments to variables of $\varphi$, and checks whether $\varphi$ is sati...
{"Voters":[{"Id":77862,"DisplayName":"Bader Abu Radi"}],"DeleteType":1}
{"Voters":[{"Id":77862,"DisplayName":"Bader Abu Radi"}]}