instruction
stringlengths
0
29.8k
⌀
The "corresponding NFA", as you call it, for $a^+ ∪ (ab)^+$ is not your $$→ q_0,\quad q_0 \overset{a}→ q_0,\quad q_0 \overset{a}→ q_1,\quad q_1 \overset{b}{→} q_2,\quad q_1 →,\quad q_2 → q_0,\quad q_2 →,$$ but this $$→ q_0,\quad q_0 \overset{a}→ q_1,\quad q_0 \overset{a}→ q_2,\quad q_1 \overset{b}→ q_3,\quad q_2 \ov...
Let $G=(V,E)$ be an unweighted directed acyclic graph with a set $V$ of vertices and a set $E$ of edges. The all-pairs shortest path problem can be solved efficiently using the Floyd-Warshall algorithm. The new objective is to find a subset of maximum cardinality $S \subseteq V$ such that for every pair of vertices $v$...
Check factor graphs which may solve both questions https://en.m.wikipedia.org/wiki/Factor_graph
Given $N$ a whole number and a set $S$ of divisors of N, where no repetition is allowed. Decide if there is a combination of divisors with a product equal to $N$. - Remove non-divisors from $S$. - Remove duplicates from S by using set() in python. - Treat $S$ as list of non-duplicates and sort from smallest to ...
in $\epsilon$-NFA (NFAs involving $\epsilon$ transitions) when we have $\epsilon$ transitions, I understand it as where can we go if we don't read any symbol from the input tape, then I think every state $q$ from which we are considering transition must belong to $\delta(q,\epsilon)$ because if we don't read anything, ...
in NFA is every state itself contained in set generated by transition function when considering epsilon transition from that state?
|finite-automata|nondeterminism|
**Lemma 1.** *The problem is NP-complete and NP-hard to approximate within a factor of $n^{1-\epsilon}$ for any $\epsilon>0.$* However there is a bicriteria approximation algorithm: **Lemma 2.** *In poly time one can compute a set $S_k$ achieving minimum distance $k$, with size at least the maximum size of any se...
There is no way this is at an appropriate level for students just graduating from high school. Save it for much more advanced students. It requires considerable mathematical sophistication -- and probably understanding of what automata are -- even to understand what an automatic group is and why one should care about...
All the solutions for $w$ the weight function on the (vertices of the) tree $T=(V, E)$ can be obtained combining [Mahyar's](https://cs.stackexchange.com/a/167180/71751) and [Nathaniel´s](https://cs.stackexchange.com/a/167181/71751) answers in this way: 1. Pick any arbitrary numbers $S$ and $S'$. 2. For a bipartitio...
null
null
I have read that Ethereum can theoretically support large documents (1 MB), but that such transactions would be very expensive and they risk not being validated. Most blockchain document services I have found assign a hash to a document then put the hash on the blockchain, but I am wondering if any blockchain ledge...
Is there any current public blockchain technology that allows users to post a publicly viewable document directly on a blockchain?
|blockchain|
null
I have this language , le langage L={ a ^ s * b ^ t * c ^ m / where s >= t or s >= m } I cant find a grammar for this language please help me Grammar like S -> aS……
Comp theory course
|regular-languages|
|regular-languages|context-free|
{"OriginalQuestionIds":[18524],"Voters":[{"Id":755,"DisplayName":"D.W."}]}
What theoretical concept lies behind the strong restriction of acquire semantics - to reads, and release semantics - to writes? (With papers titles and authors, if possible.) Is it related to provision of correctness of more complex approaches than lock-based synchronization (as lock-free, wait-free algorithms)? ...
Why not make this a bit formal and let's do the following exercise: For a given NFA, $M = (Q, \Sigma, \delta, q_0, F)$, let us construct another NFA $M' = (Q, \Sigma, \delta', q_0, F)$ where $\delta'$ is the same as $\delta$ with additional $\epsilon$-transition self-loop on every state. We would like to prove these...
Here is one possible approach. With $f(n) = an + bn^2$ we have, $C = (i-j)(a + b(i+j))$. Given any $C$, find a factor of it. Let $C = \alpha\beta$ with $\alpha \le \beta$. Now we have to solve for $i - j = \alpha$ and $a + b(i+j) = \beta$. Given any $C$ we have to only enumerate upto $\sqrt{C}$ to get all integral fact...
I have a dataset with 1055 samples and 168 features. I want to remove some features in order to train a model on my dataset. The model should output a binary field (either 0 or 1 that is known). Some features are fake, since some of them have been generated randomly and added to the dataset . I want to only keep the re...
*[EDIT: The hardness result (Lemma 1) as currently written is for undirected graphs, so doesn't apply to OP's problem, which is for directed acyclic graphs.]* ----- **Lemma 1.** *The problem is NP-complete and NP-hard to approximate within a factor of $n^{1-\epsilon}$ for any $\epsilon>0.$* However there is a ...
The answer depends on what you mean by $\delta(q,\epsilon)$. First possibility is that $\delta$ specifies the transitions (the arrows in the state diagram). In that case we have $\delta(q_i,\epsilon) =\{q_j\}$ to indicate the single edge. The other possibility is that $\delta$ specifies computations, sometimes ca...
*[EDIT: Both results below are for undirected graphs, so don't apply to OP's problem, which is for directed acyclic graphs.]* ----- **Lemma 1.** *The problem is NP-complete and NP-hard to approximate within a factor of $n^{1-\epsilon}$ for any $\epsilon>0.$* However there is a bicriteria approximation algorith...
*[EDIT: updated answer to apply to directed acyclic graphs.]* **Lemma 1.** *This problem is equivalent, under approximation-preserving poly-time reductions, to Maximum Independent Set in undirected graphs.* Independent Set is NP-complete and NP-hard to approximate within a factor of $n^{1-\epsilon}$ (for any $\ep...
null
An interesting application of partial polygon matching is symmetry detection in building footprints [![enter image description here][1]][1] [1]: https://i.stack.imgur.com/w3Oxz.png
null
null
Let $G=(V,E)$ be an unweighted directed acyclic graph with a set $V$ of vertices and a set $E$ of edges. The all-pairs shortest path problem can be solved efficiently using the Floyd-Warshall algorithm. The new objective is to find a subset of maximum cardinality $S \subseteq V$ such that for every pair of vertices $v$...
Prove\Disprove\Prove that equivalent to $NP=P$ or $NP\ne P$ given $L_1 \in P$ , $L_2 \in NP$ is $L_1 \cup L_2 \in P$? Obviously $L_1 \cup L_2 \in NP$ because NP is closed under union and $P \subseteq NP$ so $L_1 \in NP$ as well. I tried to assume in contradiction that $L_1 \cup L_2 \in P$ and build a $TM$ for ...
$L1\in P$ , $L2\in NP$, is it possible that $L1\cap L2 \in P$
|complexity-theory|np|
$L_1\in P$ , $L_2\in NP$, is it possible that $L_1\cap L_2 \in P$
>Starting from a vertex of an unknown, finite, strongly connected directed graph, we want to 'get out' (reach the vertex of the labyrinth called 'end'). Each vertex has two exits (edge which goes from vertex in question to an other one), one exit is labeled 'a', the other exit is labeled 'b'. >We have limitless '...
Graph labyrinth solving sequence
|graphs|formal-languages|regular-languages|search-algorithms|graph-traversal|
See this answer first (https://cs.stackexchange.com/questions/86422/proving-worst-case-running-time-is-in-omegan2) When proving \Omega(n^2) for insertion sort worst-case running time, why do we need to pick some example for which running time is proportional to n^2 ? Why can't we simply rely on the same input that ...
Proving worst-case running time is Ω(2) for insertion sort
|algorithms|asymptotics|proof-techniques|
Benchmarking typically consists of getting the current CPU time, executing text code a large number of times, and then subtracting the new CPU time from the previous one. However when you benchmark code multiple times, the results tend to vary either slightly to significantly each time. You will very likely not get the...
Why do benchmark results vary at all?
|cpu|performance|benchmarking|
See this answer first: https://cs.stackexchange.com/questions/86422/proving-worst-case-running-time-is-in-omegan2 When proving Ω(2) for insertion sort worst-case running time, why do we need to pick some example for which running time is proportional to n^2 ? Why can't we simply rely on the same input that was used...
See this answer first: https://cs.stackexchange.com/questions/86422/proving-worst-case-running-time-is-in-omegan2 When proving Ω(^2) for insertion sort worst-case running time, why do we need to pick some example for which running time is proportional to n^2 ? Why can't we simply rely on the same input that was use...
Proving worst-case running time is Ω(^2) for insertion sort
See this answer first: https://cs.stackexchange.com/questions/86422/proving-worst-case-running-time-is-in-omegan2 When proving $Ω(^2)$ for insertion sort worst-case running time, why do we need to pick some example for which running time is proportional to n^2 ? Why can't we simply rely on the same input that was u...
Proving worst-case running time is $Ω(^2)$ for insertion sort
null
|algorithms|graphs|formal-languages|search-algorithms|graph-traversal|
Let $(G_1, s_1, t_1), (G_2, s_2, t_2), \dots, (G_m, s_m, t_m)$ be an enumeration of all strongly connected directed graphs $G_i$ in which every vertex has out-degree 2 (the corresponding edges labelled $a,b$), and there are two distinguished vertices: a start vertex $s_i$ and an end vertex $t_i$. The algorithm proce...
I would suggest checking exact definitions of asymptotic notations, to say informally: $\Omega(f(n))$ is set of functions that are lower bounded by $f(n)$, while $O(f(n))$ are set of functions upper bounded by f(n), so when you have some example that runs in $O(n^2)$ it doesn't mean that it can't run in constant time, ...
I would suggest checking exact definitions of asymptotic notations, to say informally: $\Omega(f(n))$ is set of functions that are lower bounded by $f(n)$, while $O(f(n))$ are set of functions upper bounded by $f(n)$, so when you have some example that runs in $O(n^2)$ it doesn't mean that it can't run in constant time...
See this answer first: https://cs.stackexchange.com/questions/86422/proving-worst-case-running-time-is-in-omegan2 When proving $Ω(^2)$ for insertion sort worst-case running time, why do we need to pick some example for which running time is proportional to n^2 ? Why can't we simply rely on the same input that is us...
See this answer first: https://cs.stackexchange.com/questions/86422/proving-worst-case-running-time-is-in-omegan2 Understanding the linked answer for insertion sort makes me want to make the following statement. Prove that my statement is incorrect. If you find $(())$ for worst case running time of an algorithm u...
See this answer first: https://cs.stackexchange.com/questions/86422/proving-worst-case-running-time-is-in-omegan2 Understanding the linked answer for insertion sort makes me want to make the following statement. Prove that my statement is incorrect. If you find $(y)$ for worst case running time of an algorithm us...
See this answer first: https://cs.stackexchange.com/questions/86422/proving-worst-case-running-time-is-in-omegan2 Understanding the linked answer for insertion sort makes me want to make the following statement. Prove that my statement is incorrect. If you find $(y)$ for worst case running time of an algorithm us...
See this answer first: https://cs.stackexchange.com/questions/86422/proving-worst-case-running-time-is-in-omegan2 Understanding the linked answer for insertion sort makes me want to make the following statement. Prove that my statement is either incorrect or correct. If you find $(y)$ for worst case running time ...
See this answer first: https://cs.stackexchange.com/questions/86422/proving-worst-case-running-time-is-in-omegan2 Understanding the linked answer for insertion sort makes me want to make the following statement. Prove that my statement is either incorrect or correct. If you find $(y)$ for worst case running time ...
See this answer first: https://cs.stackexchange.com/questions/86422/proving-worst-case-running-time-is-in-omegan2 Statement: Understanding the linked answer for insertion sort makes me want to make the following statement. Prove that my statement is either incorrect or correct. Word of caution: If you find $(y)...
See this answer first: https://cs.stackexchange.com/questions/86422/proving-worst-case-running-time-is-in-omegan2 Understanding the linked answer for insertion sort makes me want to make the following statement. Prove that my statement is either incorrect or correct. Statement: If you find $(y)$ for worst case r...
See this answer first: https://cs.stackexchange.com/questions/86422/proving-worst-case-running-time-is-in-omegan2 Understanding the linked answer for insertion sort makes me want to make the following statement. Prove that my statement is either incorrect or correct. Statement: If you find $(y)$ for worst case r...
See this answer first: https://cs.stackexchange.com/questions/86422/proving-worst-case-running-time-is-in-omegan2 Understanding the linked answer for insertion sort makes me want to make the following statement. Prove that my statement is either incorrect or correct. Statement: If you find $(y)$ for worst case r...
null
See this answer first: https://cs.stackexchange.com/questions/86422/proving-worst-case-running-time-is-in-omegan2 Understanding the linked answer for insertion sort makes me want to make the following statement. Prove that my statement is either incorrect or correct. Statement: If you find $(y)$ for worst case r...
See this answer first: https://cs.stackexchange.com/questions/86422/proving-worst-case-running-time-is-in-omegan2 Understanding the linked answer for insertion sort makes me want to make the following statement. Prove that my statement is either incorrect or correct. Statement: If you find $(y)$ for worst case r...
null
I've found that counting sort is usually faster than mergesort or quicksort as long as `k` (the absolute difference between the largest and smallest element) is within an order of magnitude of `n` (the length of the list). Personally I would only use counting sort if `k` was within `2*n`, and only if I really needed t...
See this answer first: https://cs.stackexchange.com/questions/86422/proving-worst-case-running-time-is-in-omegan2 Understanding the linked answer for insertion sort leads me to the following statement. Prove that the statement is either incorrect or correct. Statement: If you find $(y)$ for worst case running ti...
See this answer first: https://cs.stackexchange.com/questions/86422/proving-worst-case-running-time-is-in-omegan2 Understanding the linked answer for insertion sort leads to the following statement. Prove that the statement is either incorrect or correct. Statement: If you find $(y)$ for worst case running time ...
For concreteness, here's the specific problem description: suppose we have a set $S$ of $n$ items $a_1, a_2, \ldots, a_n$ with weights $w_1, w_2, \ldots, w_n$ respectively. The goal is to select a subset of size $k$ such that the probability of selecting the subset $a_{i_1}, a_{i_2}, \ldots, a_{i_k}$ is exactly $\dfrac...
Is there a linear-time algorithm for randomly sampling weighted combinations?
|time-complexity|combinatorics|randomness|
null
null
null
I believe that to answer this question you need to use concept of Turing degrees. We know that if L is undecidable, Then there is some least k which L is recursively enumerabe using a Turing machine with an oracle for 0^{k} but L is not decidable with this oracle. We use this fact to show that L' s complement i...
Your assumption that the clock rate is constant is wrong. My computer at home can at any time switch each core to one of 15 different clock speeds. Your assumption that the same operation always takes the same time is wrong. The total processor state is extremely complicated and not exactly reproducible. The bench...
null
Set $x_1 = x$ and $x_{n+1} = B x_n$, where $x ∈ \{B, C, K, W\}$; and note that - up to η-equivalence, $x_n = x_{n+1} I$, since $B f I = f = B I f$ under η-equivalence. We can then also write $x_0 = x I$. The combinators $\{B, C, K, W\}$ are given by the rules $$I x = x,\quad B x y z = x (y z),\quad C x y z = x z y,\qu...
null
null
Simply put, benchmark would return the **same, exact number if the cpu is in the same state every time the code is benchmarked.** <hr> **What does cpu state mean?** It means the **context of the cpu at that instance of time, which would include registers, cache, pipeline and much more**. To add on, the **OS would ...
Those immersed in real-world software problems, continually confront the absence of dimensioned quantities in programming langauges. This absence appears in the foundation of mathematics! The absence of support afflicts even Wolfram's Mathematica, which has a bug-riddled subsystem to deal with what it calls "Quanti...
Mathematical Foundation for Dimensioned Quantities?
|mathematical-foundations|philosophy|
From what I have seen on YouTube such as https://youtu.be/Kzx88YBF7dY?si=5j9tzjMFGCn3aCXW, We have: **Halt**: program x input ---> yes halt/ no halt and **opposite** : halt if Halt returns no halt, and, looping if Halt returns yes halt so the input of opposite should also be : program x input right? not just ...
confusion with the proof of halting problem
|halting-problem|
null
Unless I am mistaken, the answer to your original question "Given $L_1 \in P$, $L_2 \in NP$ is $L_1 \cup L_2 \in P?$" is "not generally, unless $P=NP$" since we can take $L_1 = \emptyset$. Similarly, if we take $L_1 = \Sigma^*$ (the language of all words over the alphabet in question) then $L_1 \cap L_2 = L_2$ so $L_1 ...
The video pretty clearly shows that ```OPPOSITE``` takes one input ```program``` and calls ```HALT(program, program)``` So ```OPPOSITE``` takes its input, copies it, and feeds both the input and the copy to ```HALT```. Does that clear your confusion?
There is a very simple $O(n \log k)$ algorithm described in *Weighted random sampling with a reservoir* by Pavlos S. Efraimidis and Paul G. Spirakis, which can be summarized as: > Associate value $r_i^{1/w_i}$ to $a_i$, where $r_i$ is an independent random uniform value on $[0, 1]$. Sort the elements by their associ...
Proving tight bound Θ for worst-case running time of an algorithm without proving lower bound Ω
See this answer first: https://cs.stackexchange.com/questions/86422/proving-worst-case-running-time-is-in-omegan2 Understanding the linked answer for insertion sort leads to the following statement. Prove that the statement is either incorrect or correct. Statement: If you find $(y)$ for worst case running time ...
See this answer first: https://cs.stackexchange.com/questions/86422/proving-worst-case-running-time-is-in-omegan2 Understanding the linked answer for insertion sort leads to the following statement. Prove that the statement is either incorrect or correct. Statement: If you find $(y)$ for worst case running time ...