instruction stringlengths 0 29.8k ⌀ |
|---|
null |
null |
It seems the author of the book is a little careless at this point.
His definition of context-sensitive is that "the right-hand side of a rule must never be shorter than the left-hand side" together with a specific assumption that enables us to generate the empty string.
He states "The grammars in Examples 9–1 and ... |
It seems that in your context there can be prefixes or suffixes added to the substrings you care about, so for example you want the strings $w$ and $\alpha v \beta$ to be similar if $v$ and $w$ are themselves similar, with some penalty that depends on the length of the extra characters in $\alpha$ and $\beta$. This ca... |
Can you please help identify the deterministic time complexities of the following flavors of the bounded halting problem?
$$
H1 = \{ (\langle M \rangle, w, t) \mid \text{$M$ accepts $w$ in time at most $t$} \}
$$
$$
H2 = \{ (\langle M \rangle, t) \mid \forall \text{$w$, $M$ accepts $w$ in time at most $t$} \}
$... |
Discrepancy in Time-Complexity of Bounded Halting Problem |
|complexity-theory|time-complexity|complexity-classes| |
null |
No one seems to be addressing your actual question, though @vonbrand comes close. Importantly, you need to understand that statements using big-O notation (and the related notations) are not statements about *algorithms* but actually statements about *functions*. In the context of algorithm analysis, we often want to s... |
Maybe this is an odd question. One thing that always bugs me is that computability problems are written in all caps, and in such an "awkward" way. *SAT, 3-SAT, COLORING, 3-COLORING, PARITION, CLIQUE, VERTEX COVER*. Etc. They're not proper titles, just single words which don't mean much on their own.
Is there any rea... |
Why are computability problems always written in full caps? |
|complexity-theory|computability|np-complete|np|decision-problem| |
Maybe this is an odd question. It has always bugged me that computability problems are written in all caps, and in such an "awkward" way. *SAT, 3-SAT, COLORING, 3-COLORING, PARITION, CLIQUE, VERTEX COVER*. Etc. They're not proper titles, just single words which don't mean much on their own.
Is there any reason for t... |
Maybe this is an odd question. It has always bugged me that computability problems are written in all caps, and in such an "awkward" way. *SAT, 3-SAT, COLORING, 3-COLORING, PARTITION, CLIQUE, VERTEX COVER*. Etc. They're not proper titles, just single words which don't mean much on their own.
Is there any reason for ... |
null |
After the Cook-Levin Theorem Richard Karp realized that the complexity of computational problems could be compared.
His paper was prepared in a type-writer font, and used underlining and all-caps for emphasis.
Printing technology at the time.
Karp, R.M. (1972). Reducibility among Combinatorial Problems. In: Miller... |
I have been trying to understand how this ( L = {a^m b^n c^p d^q | m*n=p+q, where m, n, p, q ≥ 0}) language is CSL?
I first encountered this question [here](https://gateoverflow.in/204109/gate-cse-2018-question-35).
Also, how can it be CSL if the corresponding language generate Epsilon? (from m, n, p, q **≥** 0) ... |
How is this language Context Sensitive L = {a^m b^n c^p d^q | m*n=p+q, where m, n, p, q ≥ 0}? |
|complexity-theory|formal-grammars|context-sensitive| |
How to get an estimation of an O(n) function to modern multi-core CPU time? For instance, how can I find the time it takes to run an algorithm in a 4-core/8-core CPU when I know its O(n) ? I searched on google I find nothing about my question... |
How to get a time estimation of an O(n) function to modern multi-core CPU time? |
|big-o-notation| |
The language does not satisfy the pumping lemma.
Let $p\geq 1$, and consider the word $w=a^pb^pc^{p^2}$. Note that $w\in L$ and $|w|>p$.
Hence, there exists a partition $w=xuyvz$, such that $0<|uv|\leq |uyv|\leq p$, and for all $i\geq 0$ it holds that $w_i=xu^iyv^iz\in L$.
Denote $n_\sigma=\#_\sigma(uv)$ for all... |
The answer to this question is not trivial.
First of all, let's talk about asymptotical analysis: if you have a (small) constant number of cores $k$, e.g. $k=8$ or $k=16$, even if your application has an ideal speedup of $k$, the asymptotic execution time is still $O(\frac{n}{k})=O(n)$. Thus, asymptotical analysis d... |
The answer to this question is not trivial.
First of all, let's talk about asymptotical analysis: if you have a (small) constant number of cores $k$, e.g. $k=8$ or $k=16$, even if your application has an ideal speedup of $k$, the asymptotic execution time is still $O(\frac{n}{k})=O(n)$. Thus, asymptotical analysis d... |
Is the language $L=\{1^n2^n3^m : n\neq m\}$ context free?
I checked and it satisfies the pumping lemma (Right?). Does it also satisfy Ogden's lemma, or any other test for being non-context free?
|
Is 1^n2^n3^m n\neq m context free? |
|formal-languages|context-free|formal-grammars| |
The simplest answer to the question that I can think of is that, if X is Turing-complete programming language then it must be possible to write a program in X to convert programs written in X to Turing-complete language Y, the Y must also be Turing-compete here, now just replace the X with English and Y with any progra... |
Big-O tells you an upper limit for the execution time up to a constant factor. And the difference in execution time between a Zuse Z3 and today’s leader in the top 500 supercomputer list is also just a constant factor. So Big-O tells you nothing about the execution time.
If instead of Big-O you examine a problem mu... |
Consider the problem of finding the shortest-path distances from an origin vertex to all other vertices in a digraph. Normally in Dijkstra's algorithm, we visit the vertex whose shortest distance from the origin found so far is least, and that distance is set permanently as the shortest-path distance to that vertex. In... |
Running time of variant of Dijkstra's algorithm |
|time-complexity|runtime-analysis|shortest-path|weighted-graphs|dijkstras-algorithm| |
Consider the problem of finding the shortest-path distances from an origin vertex to all other vertices in a digraph. Normally in Dijkstra's algorithm, we visit the vertex whose shortest distance from the origin found so far is least, and that distance is set permanently as the shortest-path distance to that vertex. In... |
null |
Sadly, there is no clear consensus on what $\delta$-reduction is, other than the Greek letter $\delta$ being similar to the Latin "d" which also happens to be the first letter of "definition".
Indeed, the two definitions you give are both intuitively "replace a symbol $f$ by its definition $F$", where $F$ is uncurri... |
How are you intuitively able to tell the Big-Oh of the functions and what order they are on?
$$f(n)=3^n$$
$$g(n)=5^{3log_3{n}}$$
Note this is $5$ raised to $3log_3n$
$$h(n)=1024^{log_2n}$$ |
From these functions, how to determine which grows faster without graphing? |
|complexity-theory|time-complexity|asymptotics|big-o-notation| |
Sadly, there is no clear consensus on what $\delta$-reduction is, other than the Greek letter $\delta$ being similar to the Latin "d" which also happens to be the first letter of "definition".
Indeed, the two definitions you give are both intuitively "replace a symbol $f$ by its definition $F$", where $F$ is uncurri... |
I'm late for the party, but anyway... Let $p$ and $q$ be two points, such that the distance $d$ between them is maximum over all the pairs of points in the given point set. All the *other* points must be inside the **intersection of two disks** with radius $d$ - one disk with center in the point $p$ and another disk wi... |
The exponential of a logarithm is a power ($a^{b\log_c n}=e^{b\log a\log n/\log c}=n^{b\log a/\log c}$), so the exponential "wins".
To decide between the last two, you cannot spare the comparison of the exponents.
>!$$5^{3/\log 3}=125^{1/\log3}<1024^{1/\log 2}.$$ |
In the area of discrete mathematics, sets are usually typeset in capital letters. The above problem classes are sets of problems, e.g. SAT is the set of all boolean satisfiability problems.
Thus, the notation is probably consistent with what you are used to from set theory.
|
No, they are not equal but (a+b)* and (a*b*)* are equal. |
No, $(ab)^*=\{\epsilon,ab,abab,abababa\cdots\}$. The length is always even. |
null |
No, they are not equal but (a+b)\* and (a\*b\*)\* are equal. |
Can you please help identify if the two following variants of the bounded halting problem are in different deterministic complexity classes?
$$
H1 = \{ (\langle M \rangle, w, t) \mid \text{$M$ accepts $w$ in time at most $t$} \}
$$
$$
H2 = \{ (\langle M \rangle, t) \mid \forall \text{$w$, $M$ accepts $w$ in time... |
null |
Can you please help identify if the two following variants of the bounded halting problem are in different deterministic complexity classes?
$$
H1 = \{ (\langle M \rangle, w, t) \mid \text{$M$ accepts $w$ in time at most $t$} \}
$$
$$
H2 = \{ (\langle M \rangle, t) \mid \forall \text{$w$, $M$ accepts $w$ in time... |
null |
I am studying Structural Semantics for programming languages and I have come to this proof that I can not achieve.
[![Structural Op semantics for while][1]][1]
[1]: https://i.stack.imgur.com/jBfOp.png
Whith these rules plus Splitting and No interference, I am trying to get a proof.
I tried:
s0 in... |
Show that if <S1;S2,s> => * s', it is not necessarily the case that <S1,s> =>* s' |
|programming-languages|operational-semantics| |
I am studying Structural Semantics for programming languages and I have come to this proof that I can not achieve.
[![Structural Op semantics for while][1]][1]
[1]: https://i.stack.imgur.com/jBfOp.png
Whith these rules plus Splitting and No interference, I am trying to get a proof.
I tried:
s0 in... |
null |
I think it's simply that the Wikipedia page is a bit sloppy as it seems to be referring to $H_1$ (based on the text), even though I agree with you in that it could read as if it was talking about $H_2$. It is indeed true that $H_1$ is EXP-complete. About the status of $H_2$, I would also guess 2EXP-completeness, but th... |
I was able to use Heap's algorithm for generating permutations and I was able to solve the duplicates problem by looking at all the results and filtering out duplicates myself using a HashSet in Java.
But I was wondering if there is a way to change the code for Heap's algorithm which handles duplicates while generat... |
How to handle duplicates with Heap's algorithm for permutations? |
|algorithms|permutations| |
null |
Knowing that the theoretical complexity of an algorithm is $O(n)$ tells you very little. Because
- it is only an upper bound, there is no guarantee that it is tight;
- the conversion to real-world times depends on the "hidden constant", which you don't know,
- more importantly, the usual models of computation ... |
Knowing that the theoretical complexity of an algorithm is $O(n)$ tells you very little. Because
- it is only an upper bound, there is no guarantee that it is tight;
- the conversion to real-world times depends on the "hidden constant", which you don't know,
- more importantly, the usual models of computation ... |
null |
probably a couple decades too late to ask this question, but does anyone know anything/have detailed documentation about the hardware/design underlying the ALU unit in the early MIPS R2000 CPU?
Ideally I am looking for a circuit diagram like the following:
[![desired example][1]][1]
I don't need/am already fam... |
R2000 ALU Design |
|computer-architecture|mips| |
The proof you give is a counterexample of the reciprocal. That is, you're giving an example where $\langle S_1, s\rangle \Rightarrow^* s'$ but not $\langle S_1; S_2, s\rangle \Rightarrow^* s'$.
To prove the original statement, you would need to find an $s'$ such that $\langle S_1; S_2, s\rangle \Rightarrow^* s'$ but... |
To analyze the running time of loops, we need to know how many times the loop executes, and then we write the total time as the sum of the time needed for each execution. When a "for" loop is determined by an index that starts at one number, ends at another, and increments once per execution, this is easy, and can be t... |
I think there is a slightly better algorithm, depending on the relative sizes on the upper bound $B=10^5$ and $N$.
The proposed algorithm proceeds like the usual DP algorithm, scanning the array from left to right, and at each array position $i$ you it computes what is the array position $j < i$ that maximizes the v... |
I have been trying to understand how this ( L = {a^m b^n c^p d^q | m*n=p+q, where m, n, p, q ≥ 0}) language is CSL?
I first encountered this question [here](https://gateoverflow.in/204109/gate-cse-2018-question-35).
Would be grateful if you could provide some intuition for identifying class of such language.
T... |
What you're looking for is unlikely to have ever existed.
The R2000 ALU was almost certainly not designed in terms of gates, but either in a high-level synthesis language such as Verilog, or in terms of individual transistors.
John Hennessy, the main designer and one of the founders of MIPS, co-wrote two books on... |
When you include an header, you declare to the compiler that you defined the functions found in the header somewhere. The compiler doesn't know where but it trusts you to provide those definitions during linking.
During compilation, the compiler compiles every source file independently. Each source file has to be se... |
{"OriginalQuestionIds":[161540],"Voters":[{"Id":6553,"DisplayName":"Pseudonym"}]} |
{"Voters":[{"Id":6553,"DisplayName":"Pseudonym"}]} |
null |
[Jaro-Winkler distance][1] could be what I need, as it has a performant implementation with permissive license (https://pypi.org/project/jarowinkler/)
[1]: https://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance |
null |
null |
Knowing that the theoretical complexity of an algorithm is $O(n)$ tells you very little. Because
- it is only an upper bound, there is no guarantee that it is tight;
- the conversion to real-world times depends on the "hidden constant", which you don't know,
- more importantly, the usual models of computation ... |
I have been trying to understand how the language $L = \{a^m b^n c^p d^q \mid m*n=p+q\}$) is context-sensitive?
I first encountered this question [here](https://gateoverflow.in/204109/gate-cse-2018-question-35).
Would be grateful if you could provide some intuition for identifying class of such language.
Thank... |
How is $\{a^m b^n c^p d^q \mid m*n=p+q\}$ context sensitive? |
To answer the question "why is the linked algorithm correct?", first of all notice that it works for *directed* graphs.
We want to show that the shortest cycle containing $s$ consists of a shortest path from $s$ to some vertex $v$ plus the edge $(v,s)$ such that $d(s,v) + w(v,s)$ is minimized.
Let $C = \langle s... |
null |
To answer the question "why is the linked algorithm correct?", first of all notice that it works for *directed* graphs.
We want to show that the shortest cycle containing $s$ consists of a shortest path from $s$ to some vertex $v$ plus the edge $(v,s)$ such that $d(s,v) + w(v,s)$ is minimized.
Let $C = \langle s... |
c + n - 2cn is always negative for c , n >1 so T(n) < cn2 |
null |
From what I know, the classic way of constructing a KD-tree is with alternating dimensions and finding median at each level. In my dataset, I have a lot of duplicated points, and I want to incorporate the duplicates' filtering inside the creating of the KD-tree. However, I am not sure how to proceed.
1. Obvious op... |
Fast construction of a static KD-tree without duplicates |
|data-structures|kd-tree| |
You can use hashing to detect duplicates at insertion time.
Assume you have your elements in an array $A[1,\dots,n]$. When inserting $A[i]$, you can apply an hash function $f$ to $A[i]$.
- If there is no collision, you push the pair $(A[i], i)$ in your hash table $T$ at position $i$, i.e. $T\bigl[f\bigl(A[i]\bigr... |
null |
The first work that talks about formalizing seems to be:
1. Xi, Hongwei, Chiyan Chen, and Gang Chen. “Guarded Recursive Datatype Constructors.” In Proceedings of the 30th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, 224–35. POPL ’03. New York, NY, USA: Association for Computing Machinery, 200... |
null |
There is an obvious construction of linear codes from graphs, where each codeword is a cycle in the graph. Physical bits are edges in the graph, and constraints are vertices.
This has been used in the construction of good LDPC codes with expander graphs by Sipser and Spielman [1], but their construction uses Tanner ... |
What are the best parameters possible from a binary linear LDPC code where each parity-check matrix is the incidence matrix of a graph? |
|graphs|error-correcting-codes| |
I have two JFrame windows equipped with various components including JButtons and I want the actionPerformed methods for the buttons to send data between the two windows so that one can update the other. Thankfully, I've already got all the button code and everything figured out. The problem is when I try to send a sig... |
Java: Non-static Communication. Ex: Type1 X; Type2 Y; X$\leftrightarrow$Y |
|java|static-analysis| |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.