instruction
stringlengths
0
29.8k
⌀
null
Given 2 recursive - decidable languages $L_1$ and $L_2$ is the problem $L_1 \subset L_2$ solvable - decidable? Since both $L_1$ and $L_2$ are recursive - decidable there exist Turing Machines say $M_1$ and $M_2$ that decide them. Say that the problem stated is solvable then there exists a Turing Machine $M_3$ t...
Is the Proper Subset problem decidable?
|formal-languages|turing-machines|undecidability|
The following is a modification of your approach that works. The idea is, $M$ on $w$ does not halt iff $M$ on $w$ does not halt in $n$ steps for every $n$. ---- Given $\langle M,w\rangle$, $M_5$ will do the following. - Construct TM $M^o$ which on every input accepts immediately. $L(M^o) = \Sigma^*$. - Constru...
The following is a modification of your approach that works. The idea is, $M$ on $w$ does not halt iff $M$ on $w$ does not halt in $n$ steps for every $n$. ---- Given $\langle M,w\rangle$, $M_5$ will do the following. - Construct TM $M^o$ which on every input accepts immediately. $L(M^o) = \Sigma^*$. - Constru...
I have found utility in state machines that do not have the complexity of recursion: no self or ancestral transitions. Is there a name for this sub-category of FSMs? Are they commonly used or considered broadly useful?
Finite State Machine without recursion
|finite-automata|
The following is a modification of your approach that works. The idea is, $M$ on $w$ does not halt iff $M$ on $w$ does not halt in $n$ steps for every $n$. As in the question, a Turing machine responds with **YES** or **NO** means it accepts or rejects respectively. ---- Given $\langle M,w\rangle$, $M_5$ will...
Given 2 recursive - decidable languages $L_1$ and $L_2$ is the problem $L_1 \subset L_2$ solvable - decidable? Since both $L_1$ and $L_2$ are recursive - decidable there exist Turing Machines say $M_1$ and $M_2$ that decide them. Say that the problem stated is decidable then there exists a Turing Machine $M_3$ th...
Is the problem of Proper Subset of decidable languages decidable?
|formal-languages|turing-machines|undecidability|halting-problem|
null
null
From [wikipedia][1] > A formal grammar that contains left recursion cannot be parsed by a LL(k)-parser or other naive recursive descent parser unless it is converted to a weakly equivalent right-recursive form [1]: https://en.wikipedia.org/wiki/Left_recursion#:~:text=A%20formal%20grammar%20that%20cont...
First question on this forum. When I'm using a proxy in a browser (not on the whole system) what happens to DNS requests? What I mean is, are DNS requests going through the proxy as well, or are they being handled separately, thus exposing your my IP? Does it depend on how a proxy server is configured, or does all pro...
What happens to DNS requests when using a proxy?
|ip|
|finite-automata|terminology|
null
I have a graph whose edges can be very efficiently represented as a set of cartesian products between various sets of nodes. Is there a name for such a representation? And secondly. I want to enumerate the maximal cliques in this graph. Intuitively the more compact representation of the graph should improve performa...
Finding maximal cliques in a graph represented as a collection of cartesian products of nodes
|graphs|combinatorics|
The following is a modification of your approach that works. The idea is, $M$ on $w$ does not halt iff $M$ on $w$ does not halt in $n$ steps for every $n$. As in the question, a Turing machine responds with **YES** or **NO** means it accepts or rejects respectively. ---- Given $\langle M,w\rangle$, $M_5$ will...
If $n \neq 2m$ then either $n < 2m$ or $n > 2m$. A grammar for the former case is: $$ S_1 \to XY \mid aXY\\ X \to aaXb \mid \varepsilon \\ Y \to bY \mid b; $$ where $X$ generates all words of the form $a^{2k} b^k$ for some positive $k$. A grammar for the latter case is: $$ S_2 \to ZX \mid Z\\ X \to aaX...
null
If $n \neq 2m$ then either $n < 2m$ or $n > 2m$. A grammar for the former case is: $$ S_1 \to XY \mid aXY\\ X \to aaXb \mid \varepsilon \\ Y \to bY \mid b $$ where $X$ generates all words of the form $a^{2k} b^k$ for some positive $k$. A grammar for the latter case is: $$ S_2 \to ZX \mid Z\\ X \to aaXb...
> How much overhead does this process add? The process is nowhere near as bad as you made it out to be, more on that next, but there is a more general misconception that I think underlies this question: it presumes that "taking time" while processing an instruction adds overall overhead. That is mostly not the case,...
When i tried to find the time complexity of this recurrence relation with the master theorem, I got log^2n, but I'm told that it's logn. Can someone explain this to me. Thanks.
The master theorem soution to T(n) : T(n/4) + logn
|algorithms|time-complexity|recurrence-relation|master-theorem|
When i tried to find the time complexity of this recurrence relation with the master theorem, I got log^2n, but I'm told that it's logn. I used the masters theorem, for this case.. a=b^k (1=4^0) ... This means that this is a case 2 in the masters theorem. Then p in this case is 1 since log^1n. So the answer for case ...
The following is a modification of your approach that works. The idea is, $M$ on $w$ does not halt iff $M$ on $w$ does not halt in $n$ steps for every $n$. As in the question, a Turing machine responds with **YES** or **NO** means it accepts or rejects respectively. ---- Given $\langle M,w\rangle$, $M_5$ will...
null
Decision trees [1] are a class of hierarchical control structures that might be what you are looking for. [1] Decision tree in Wikipedia, https://en.wikipedia.org/wiki/Decision_tree
null
I have difficulties in proving that for the given language: $E V E N_{T M}=\{\langle M\rangle: M$ is a TM s.t. $|w|$ is even for all $w \in L(M)\}$. prove that: $E V E N_{T M} \in coRE$ I've tried to look at $(E V E N_{T M})^\complement$ and prove that : $(E V E N_{T M})^\complement \in RE$ by build...
The language of all machines that accepts strings of even length
|turing-machines|rice-theorem|
null
The trick required to construct the TM for $(EVEN_{TM})^C$ is that a TM can simulate finitely many TMs in each step, like so: L = [] for word w with |w| odd: start simulation of M on w add the simulation to L for each simulation S in L: simulate S one more s...
null
The following is a modification of your approach that works. The idea is to construct $L_1$ so that it is empty if and only if the given $M$ halts on the given $w$. We can then use $M_3$ to check whether $L_1$ is empty. As in the question, a Turing machine responds with **YES** or **NO** means it accepts or reje...
The following is a modification of your approach that works. The idea is to construct $L_1$ so that it is not empty if and only if the given $M$ halts on the given $w$. Then use $M_3$ to check whether $L_1$ is empty. As in the question, a Turing machine responds with **YES** or **NO** means it accepts or rejects...
I've been spending time strengthening my ability to conduct inductive proofs and made one for the mergesort algorithm - specifically the merge part, as the entirety of the algorithm is comparatively trivial with an assumption that merge functions properly. I would like another pair of eyes on my proof to know if my arg...
Consolidating my proof for the merge step of mergesort
|correctness-proof|induction|check-my-answer|
I have recently finished reading the section on Distributed Systems in OSTEP. For NFS, they briefly mention the cache consistency problem and say how it is solved for reads by maintaining an attribute cache (though there will be inconsistency if any reads occur between attribute updates) and that for writes it is "solv...
Write-Ordering Problem, Idempotency in Distributed File Systems
|operating-systems|distributed-systems|computer-networks|concurrency|filesystems|
null
One implementation in Python is available here: [Decimal Reed-Solomon implementation][1] [1]: https://github.com/elvis-epx/sdr/tree/master/rs
One implementation in Python is available here: [Decimal Reed-Solomon implementation][1] See also the article: [Reed-Solomon using decimal numbers][2] [1]: https://github.com/elvis-epx/sdr/tree/master/rs [2]: https://epxx.co/artigos/edc2_en.html
null
null
I have a graph whose edges can be very efficiently represented as a set of complete biparti graphs (that may share nodes). Is there a name for such a representation? And secondly. I want to enumerate the maximal cliques in this graph. Intuitively the more compact representation of the graph should improve performanc...
Finding maximal cliques in a graph represented as a collection of complete biparti graphs
I'd like to start by clarifying I'm by no means an expert in any of this, so take everything I say with a grain of salt. Convex and Non-convex Optimization are subfields of mathematical optimization that focus on minimising convex and non-convex functions respectively. That is, finding the global minimum of function...
What's the difference between "convex/non-convex optimization" and "quadratic programming"?
|optimization|terminology|quadratic-programming|
No, [quadratic programming](https://en.wikipedia.org/wiki/Quadratic_programming) does not cover all optimization problems. Quadratic programming is limited to the case where the objective function is quadratic and the constraints are linear functions. If you have an optimization function where the objective functio...
We need to partition an undirected graph into connected subgraphs of size between $2$ and $k$, where $k$ is an integer. When $k=2$, the problem is equivalent to the [perfect matching problem][1] which is known to be solvable in polynomial time. When $k=3$, the problem is similar to the [partition into triangles p...
null
I was thinking about this question and thought about it for quite a while but couldn't come up with an answer. The task is to count the number of *cycles* formed by *distinct* numbers from $\{1, 2, \cdots, N\}$ such that every adjacent number sums to / differs to some property, e.g. a prime. I don't have a particula...
Dynamic Programming: Counting *cycles* consisting of distinct numbers
|algorithms|graphs|dynamic-programming|
given the following languages: - $INFINITE_{T M}=\{\langle M\rangle: M$ is a TM with $|L(M)|=\infty\}$. - $R E G_{T M}=\{\langle M\rangle: M$ is a TM with $L(M) \in \mathrm{REG}\}$. prove the following reduction: $I N F I N I T E_{T M} \leq_m R E G_{T M}$ would love for some help, got no clue for now :)
Mapping Reduction from INFINTE to REG
|turing-machines|rice-theorem|
Mapping Reduction from INFINITE to REG
Given a language $L$ that is recursive prove that $Prefix(L) = \{ x \ | \ xv \in L\}$ is recursively enumerable. My first attempt at this was to try and formulate an algorithm in pseudocode. Prefix-Recogniser(x) for v in Σ*: w = xv if L-Decider(w) -> YES: return Y...
Proving that $Prefix(L)$ is recursively enumerable
|formal-languages|turing-machines|turing-recognizable|
null
null
given the following languages: - $INFINITE_{T M}=\{\langle M\rangle: M$ is a TM with $|L(M)|=\infty\}$. - $R E G_{T M}=\{\langle M\rangle: M$ is a TM with $L(M) \in \mathrm{REG}\}$. prove the following reduction: $I N F I N I T E_{T M} \leq_m R E G_{T M}$ I'm having difficulties, building the $M_f$ machine ...
given the following languages: - $INFINITE_{T M}=\{\langle M\rangle: M$ is a TM with $|L(M)|=\infty\}$. - $R E G_{T M}=\{\langle M\rangle: M$ is a TM with $L(M) \in \mathrm{REG}\}$. prove the following reduction: $I N F I N I T E_{T M} \leq_m R E G_{T M}$ I'm having difficulties, building the $M_f$ machine ...
Here is a proof tree in natural deduction of the wanted implication, using $\Gamma = \{\neg(p\land q), p , q\}$: $$\dfrac{ \dfrac{ \dfrac{ \dfrac{ \dfrac{ \dfrac{}{\Gamma\vdash p}\text{ax} \quad \dfrac{}{\Gamma\vdash q}\text{ax} }{\Gamma\vdash p\land q}\land_i \quad\dfrac{}{\Gamma\vdash \neg(p\land q)}\text{ax...
null
The problem can be equivalently stated as follows: *Can a graph be partitioned into vertex disjoint paths of lengths $3$*? The problem is shown to be $\mathsf{NP}$-hard (see [Theorem 1 here][1]). [1]: https://core.ac.uk/download/pdf/82153605.pdf
Quicksort is O(n log n) average case, and O(n^2) worst case. The worst case occurs if one side of the pivot contains all of the elements and the other side contains none. However, I think the worst case would also occur if there is only one element on one side of the pivot each time and the rest on the other side. Is t...
When does Quicksort go from O(n log n) to O(n^2)?
|algorithms|asymptotics|big-o-notation|
The problem can be equivalently stated as follows: *Can a graph be partitioned into vertex disjoint paths of lengths $3$*? The problem is shown to be $\mathsf{NP}$-hard (see [Theorem 1 here][1]). Note that the proof is given for $k$-partition problem. However, it holds for your problem as well. In the proof, ...
The following is a modification of your approach that works. The idea is to construct language $L_1$ so that it is not empty if and only if the given $M$ halts on the given $w$. Then use $M_3$ to check whether $L_1$ is empty. As in the question, a Turing machine responds with **YES** or **NO** means it accepts o...
null
Suppose that we are given a graph $G = (V,E)$ and a number $n$. The problem is to find an independent set $I$ with $|I| = n$, such that number of vertices covered by $I$ is maximized (that is, the number of vertices adjacent to at least on vertex from $I$). My question is: is there an approximation of this problem, whi...
Budgeted Independent Vertex Cover
|graphs|np-hard|approximation|
# The Question # A [regular expression][1], such as `AL+[EYI]+`, represents a set of strings. ``` alleys = { “ALY”, “ALLEY”, “ALLY”, “ALLEE”, et cetra... } ``` Let $\mathbb{AS}$ be the set of all strings $\sigma$ such that there exist natural numbers $x_{1}, x_{2}, x_{3}$ s...
What algrorithm computes a mutally exclusive partitioning from two regulair expressions?
|algorithms|regular-expressions|strings|substrings|string-matching|
Though purely functional programming languages, such as Haskell, is commonly thought to have no side-effects, there is a caveat: **Recursive calls may hang.** I considered this to be undesirable, and thought about what if I force every recursive call to halt. Formally, for every recursive call, the fixpoint combi...
How much is decidability compromised within this restriction of the fixpoint combinator?
|halting-problem|haskell|decidability|fixed-point|
Red-black trees are defined to have the following invariants: * The nodes are in sorted order (it is a binary search tree). * The root is black, and leaves are black. * Every red node has black children. * Every path to the root passes through the same number of black nodes. There is also an obvious "empty...
Completeness of red-black tree operations
|algorithm-analysis|trees|binary-search-trees|red-black-trees|
I'm working my way through Leino's "Program Proofs" and I was following as far as the semantics of variable assignment, but I'm not quite sure why this is a valid Hoare triple: {forall x::Q} var x; {exists x :: P} where P is the weakest precondition and Q is the strongest postcondition. I'm not following why all...