instruction
stringlengths
0
29.8k
⌀
I have a general question about mapping reductions. I have seen several examples of reducing functions to $A_{TM}$ where $A_{TM} = \{\langle M, w \rangle : \text{ For } M \text{ is a turing machine which accepts string } w\}$ which is great for proving undecidability. But say I want to prove unrecognizability ins...
Mapping Reductions to Complement of Atm
|reductions|
A [question was posted on Stack Overflow][1] asking for an algorithm to solve this problem: > I have a matrix (call it A) which is nxn. I wish to select a subset > (call it B) of points from matrix A. The subset will consist of n > elements, where one and only one element is taken from each row and > from each co...
I have a general question about mapping reductions. I have seen several examples of reducing functions to $A_{TM}$ where $A_{TM} = \{\langle M, w \rangle : \text{ For } M \text{ is a turing machine which accepts string } w\}$ which is great for proving undecidability. But say I want to prove unrecognizability ins...
My organization wants to maintain multiple copies of data in order to preserve access in the case of localized disasters as well as for the purpose of long term preservation. Are there accepted formal models for determining the appropriate variety of media (eg tape, disk) and their placement in the network? Are current...
Let's take $L_{\emptyset}=\{ \langle M \rangle \mid L(M) = \emptyset \}$, that is, all the machines that accept no word (i.e., whose language is empty). Now we show the reduction $\overline{A_{TM}} \le L_\emptyset$. The reduction is done by taking an input $(\langle M \rangle,w)$ of $\overline{A_{TM}}$ and convertin...
|computability|reductions|
null
Consider the following version of the Clique problem where the input is of size $n$ and we're asked to find a clique of size $k$. The restriction is that the decision procedure cannot change the input graph into any other representation and cannot use any other representation to compute its answer, other than $log(n^k)...
Restricted version of the Clique problem?
|complexity-theory|time-complexity|
I'm working through Simon Peyton Jones' "The Implementation of Functional Programming Languages" and on page 20 I see: <pre> IF TRUE ((&#955;p.p) 3) &#8596; IF TRUE 3 (per &#946; red) (1) &#8596; (&#955;.IF TRUE 3 x) (per &#951; red) (2) &#8596; (&#955;x.3) ...
Reduction rule for IF?
|lambda-calculus|
The reduction rule you ask for is the usual one for IF statements. It consists of two rules: > IF TRUE $a$ $b$ $\to$ $a$ > IF FALSE $a$ $b$ $\to$ $b$
The reduction rule you ask for is the usual one for IF statements. It consists of two rules: > IF TRUE $a$ $b$ $\to$ $a$ > IF FALSE $a$ $b$ $\to$ $b$ In both the call-by-value (strict) and call-by-need (lazy) settings, both $a$ and $b$ can be arbitrary expressions. They need not be values.
How can I prove that the language that the operator $A$ defines for regular language $L$ is a context free language. $A(L)= \{ w_1w_2: |w_1|=|w_2|$ and $w_1, w_2^R \in L \}$, where $x^R$ is the reversed form of $x$. I understand that since $L$ is regular so does $L^R$.also on my way for a CFG I can reach $w_1$ b...
Is the following example correct about if `inference` algorithm is `soundness` and `completeness`? Thanks. Suppose we have needles a, b, c in a haystack, and have also an inference algorithm that is designed to find needles. `sound` - Only needles a, b and c are obtained. `complete` - Needles a, b and c are ob...
Example of Soundness & Completeness of Inference
|logic|
You have almost got it right, but your definition of soundness is not quite right. I would say that the inference algorithm is sound if _everything returned is a needle_ (hence some needles may be missed) and complete if _all needles are returned_ (hence some hay may be returned too).
Is the following example correct about whether an _inference_ algorithm is _sound_ and _complete_? Suppose we have needles a, b, c in a haystack, and have also an inference algorithm that is designed to find needles. - _sound_ - Only needles a, b and c are obtained. - _complete_ - Needles a, b and c are obtai...
It's a known fact that every LTL formula can be expressed by a Büchi $\omega$-automaton. But, apparently, Büchi automata are a more powerful, expressive model. I've heard somewhere that Büchi automata are equivalent to linear-time $\mu$-calculus (that is, $\mu$-calculus with usual fixpoints and only one temporal operat...
null
This sounds like you are asking whether or not the [NP-complete clique problem](http://en.wikipedia.org/wiki/Clique_problem#NP-completeness) can be done with logarithmic space. This is unknown, but a positive answer would imply that $P = NP$ since $L \subseteq P \subseteq NP$. See L [on wikipedia](http://en.wikipedi...
This sounds like you are asking whether or not the [NP-complete clique problem](http://en.wikipedia.org/wiki/Clique_problem#NP-completeness) can be done with logarithmic space. One tape of the deterministic Turing machine is read only and stores the input graph. The other tape is bounded so that there's $k \lg n$ space...
This sounds like you are asking whether or not the [NP-complete clique problem](http://en.wikipedia.org/wiki/Clique_problem#NP-completeness) can be done with logarithmic space. Using Turing machines, one tape is read only and stores the input graph. The other tape is bounded so that there's $c \lg n$ space available fo...
|lambda-calculus|term-rewriting|operational-semantics|
The reduction rule you ask for is the usual one for IF statements. It consists of two rules: > IF TRUE $a$ $b$ $\to$ $a$ > IF FALSE $a$ $b$ $\to$ $b$ In both the call-by-value (strict) and call-by-need (lazy) settings, both $a$ and $b$ can be arbitrary expressions. They need not be values. Rules of this kin...
null
This sounds like you are asking whether or not the [NP-complete clique problem](http://en.wikipedia.org/wiki/Clique_problem#NP-completeness) can be done with logarithmic space. Using Turing machines, one tape is read only and stores the input graph. The other tape is bounded so that there's $c \lg n$ space available fo...
Consider the following version of the Clique problem where the input is of size $n$ and we're asked to find a clique of size $k$. The restriction is that the decision procedure cannot change the input graph into any other representation and cannot use any other representation to compute its answer, other than $\log(n^k...
null
I'm working through Simon Peyton Jones' "The Implementation of Functional Programming Languages" and on page 20 I see: <pre> IF TRUE ((&#955;p.p) 3) &#8596; IF TRUE 3 (per &#946; red) (1) &#8596; (&#955;x.IF TRUE 3 x) (per &#951; red) (2) &#8596; (&#955;x.3) ...
The reduction rule you ask for is the usual one for IF statements. It consists of two computation rules and one context rule: > $\text{IF TRUE}$ $a$ $b$ $\to$ $a$ > $\text{IF FALSE}$ $a$ $b$ $\to$ $b$ > $\dfrac{a\to a'}{\text{IF}~a\ b\ c\to \text{IF}~a'\ b\ c}$ In both the call-by-value (strict) and call-by...
The reduction rule you ask for is the usual one for IF statements. It consists of two computation rules and one context rule: > $\text{IF TRUE}$ $a$ $b$ $\to$ $a$ > $\text{IF FALSE}$ $a$ $b$ $\to$ $b$ > $\dfrac{a\to a'}{\text{IF}~a\ b\ c\to \text{IF}~a'\ b\ c}$ In both the call-by-value (strict) and call-by...
So it seems you are intrigued about the relationship between the *informedness* of a heuristic function and its *pruning power*. This is a well-known relationship established in the literature from the 80s (see for example [Pearl, Judea. Heuristics, Addison-Wesley, 1984](http://books.google.es/books?id=0XtQAAAAMAAJ...
I read [on the site][1] on how to use the pumping lemma but still I don't what is wrong with way I'm using it for proving that the following language is not a regular language: $L$={$a^ib^jc^k |$ if $ i=1$ so$ j=k $} for $i\neq1$ the language is obviously regular but in the case which $i=1$ , we get that the lan...
$L$={$a^ib^jc^k |$ if $ i=1$ so$ j=k $} and irregularity
|formal-languages|regular-languages|
null
The pumping lemma can only be used to show that a language is not regular, not that it is regular. This is, I think, the fundamental misunderstanding here... that you are unable to use the pumping lemma to prove a language irregular does not constitute a proof of irregularity. A language is regular if, equivalently,...
The pumping lemma can only be used to show that a language is not regular, not that it is regular. This is, I think, the fundamental misunderstanding here... that you are unable to use the pumping lemma to prove a language irregular does not constitute a proof of irregularity. A language is regular if, equivalently,...
I read [on the site][1] on how to use the pumping lemma but still I don't what is wrong with way I'm using it for proving that the following language is not a regular language: $L = \{a^ib^jc^k \mid \text{if } i=1 \text{ then } j=k \}$ for $i\neq1$ the language is obviously regular but in the case which $i=1$ , w...
Irregularity of $\{a^ib^jc^k \mid \text{if } i=1 \text{ then } j=k \}$
null
I'm assuming that the language is like David Lewis posted in the comments. $$L=\{ a^ib^jc^k : (i=1 \text{ & }j=k>=0) \text{ | } (i \neq 1 \text{ & } j,k >= 0)\}$$ This language is not regular, but **cannot** be proven non-regular using the pumping lemma because you can always pump the first character. If your divis...
Not yet mentioned in the answers/comments: - [Extensible programming][1] on Wikipedia the survey: - [Modern Extensible Languages][2] by D. Zingaro (2007) and - [The Java Syntactic Extender (JSE)][3] whitepaper by J. Bachrach [1]: http://en.wikipedia.org/wiki/Extensible_programming [2]: http://...
Let me give this question a try. I am not sure I do fully understand it so I was considering to post a comment but in the end, I preferred to try an explanation. Hope it helps! Raphael already suggested a solution (so I voted up his comment) which works even if you only store states instead of nodes. To make it clea...
That list would be endless ... I will just try to provide a number of representative examples according to different criteria: **Best-first search** (BFS): they are *complete*, i.e., they are guaranteed to find a solution provided that one exists and they are *admissible*, i.e., they are guaranteed to find the optim...
Here you are a number of considerations. The first two are taken from the **wonderful** PhD by Andreas Junghanns (now back to Industry in Berlin, Germany and happy to count him among my friends :) ): **Breadth-First Search**: If you are just standing in front of a furniture and something valuable (say a coin, or a r...
Nicholas already provided a perfect answer. However, let me address your original attempt to use depth-first search. First, either Dijkstra (which works fine with unweighted nodes as noted by Nicholas Mancuso) or breadth-first search incur in exponential waste of your memory. Their advantage, however, is that they n...
null
This sounds like you are asking whether or not the [NP-complete clique problem](http://en.wikipedia.org/wiki/Clique_problem#NP-completeness) can be solved in logarithmic space. Using Turing machines, one tape is read only and stores the input graph. The other tape is bounded so that there's $c \lg n$ space available fo...
I'm making a graduate thesis about proving correctness of program for multiplying 2 matrices using Hoare logic. For doing this, I need to generate the invariant for nested loop for this program: for i = 1:n for j = 1:n for k = 1:n C(i,j) = A(i,k)*B(k,j) + C(i,j); ...
Invariant For Nested Loop in Matrix Multiplication Program
|logic|
|algorithms|loop-invariants|correctness-proof|
I'm trying to write a spell-checker which should work with a pretty large dictionary. I really want an efficient way to index my dictionary data to be used using a [Damerau-Levenshtein][1] distance to determine which words are closest to the misspelled word. I'm looking for a data structure who would give me the bes...
Efficient data structures for building a fast spell checker
|data-structures|optimization|
I'm assuming that the language is like David Lewis posted in the comments. $$L=\{ a^ib^jc^k : (i=1 \text{ & }j=k>=0) \text{ | } (i \neq 1 \text{ & } j,k >= 0)\}$$ This language is not regular, but **cannot** be proven non-regular using the standard version of the regular pumping lemma (as seen in the Sipser text or...
As $L$ is regular, it is generated by a right-linear grammar for which all rules have the form $A \to aB$, $A \to a$ or $A \to \varepsilon$ (showing this is an easy exercise). So without loss of generality, we assume that $G=(N,T,\delta,S)$ with $\mathcal{L}(G)=L$ has this form. Now we construct a new grammar that g...
As $L$ is regular, it is generated by a right-linear grammar for which all rules have the form $A \to aB$, $A \to a$ or $A \to \varepsilon$ (showing this is an easy exercise). So without loss of generality, we assume that $G=(N,T,\delta,S)$ with $\mathcal{L}(G)=L$ has this form. Now we construct a new grammar that g...
You need the line `C(i:j) = 0` just before the innermost loop; otherwise, the code is incorrect. Assuming that line is in place, here is the invariant just _before_ the assignment in the innermost loop: \begin{align*} C_{IJ} &= \sum_{k=1}^{n} A_{Ik}B_{kJ} & \text{for all $I$ and $J$ such that $1\le I < i$ and $1\l...
null
This problem can be solved by maximum matching algorithm in weighted bipartite graph, such as Kuhn-Munkres algorithm or minimum cost flow algorithm. Imagine a bipartite graph $G$, whose two disjoint point sets are $A$ and $B$. Each vertex $a_i \in A$ corresponds to a row, and each vertex $b_j \in B$ corresponds to a...
When I was a student, I saw a problem in a digital systems/logic design textbook, about N soldiers standing in a row, and want to shoot at the same time. A more difficult version of the problem was that the soldiers stand in a general network instead of a row. I am sure this is a classical problem, but I cannot remembe...
All soldiers should shoot at the same time
|algorithms|
I am not sure this problem has a specific name. The problem itself, is strictly related to *finite state automata*. Here, each soldier is a finite automaton; you know that the next state of each soldier depends on its current state and the current states of its two neighbors (except for the first and last soldier). The...
I am not sure this problem has a specific name. The problem itself, is strictly related to *finite state automata*. Here, each soldier is a finite automaton; you know that the next state of each soldier depends on its current state and the current states of its two neighbors (except for the first and last soldier). The...
I'm making a graduate thesis about proving correctness of program for multiplying 2 matrices using Hoare logic. For doing this, I need to generate the invariant for nested loop for this program: for i = 1:n for j = 1:n for k = 1:n C(i,j) = A(i,k)*B(k,j) + C(i,j); ...
The problem is known as [Firing squad synchronization problem][1]. The problem itself, is strictly related to *finite state automata*. Here, each soldier is a finite automaton; you know that the next state of each soldier depends on its current state and the current states of its two neighbors (except for the first and...
The reduction rule you ask for is the usual one for IF statements. It consists of two computation rules and one context rule: > $\text{IF TRUE}$ $a$ $b$ $\to$ $a$ > $\text{IF FALSE}$ $a$ $b$ $\to$ $b$ > $\dfrac{a\to a'}{\text{IF}~a\ b\ c\to \text{IF}~a'\ b\ c}$ In both the call-by-value (strict) and call-by...
I'm working through Simon Peyton Jones' "The Implementation of Functional Programming Languages" and on page 20 I see: <pre> IF TRUE ((&#955;p.p) 3) &#8596; IF TRUE 3 (per &#946; red) (1) &#8596; (&#955;x.IF TRUE 3 x) (per &#951; red) (2) &#8596; (&#955;x.3) ...
[*previously appearing in cstheory, it was closed there and introduced here instead*] Given an edge-weighted graph $G=(V,E)$ the problem of finding the shortest path is known to be in P ---and indeed a simple approach would be Dijkstra's algorithm which can solve this problem in $O(V^2)$. A similar problem is to fin...
Target-Value Search (& II)
|search-algorithms|
So it seems you are intrigued about the relationship between the *informedness* of a heuristic function and its *pruning power*. This is a well-known relationship established in the literature from the 80s (see for example [Pearl, Judea. Heuristics, Addison-Wesley, 1984](http://books.google.es/books?id=0XtQAAAAMAAJ...
[*previously appearing in cstheory, it was closed there and introduced here instead*] Given an edge-weighted graph $G=(V,E)$ the problem of finding the shortest path is known to be in P ---and indeed a simple approach would be Dijkstra's algorithm which can solve this problem in $O(V^2)$. A similar problem is to fin...
null
This sounds like you are asking whether or not the [NP-complete clique problem](http://en.wikipedia.org/wiki/Clique_problem#NP-completeness) can be solved in logarithmic space. Using Turing machines, one tape is read only and stores the input graph. The other tape is bounded so that there's $c \lg n$ space available fo...
null
|algorithms|complexity-theory|search-algorithms|
I can understand the importance that computer scientists or any software development related engineers should have understood the study of basic logics as a basis. But is there any tasks/jobs that explicitly require the knowledge about these, other than the tasks that require any kind of knowledge representation? I...
Reason to learn propositional & predicate logic
|logic|
I can understand the importance that computer scientists or any software development related engineers should have understood the study of basic logics as a basis. But is there any tasks/jobs that explicitly require the knowledge about these, other than the tasks that require any kind of knowledge representation us...
Logic is fundamental to all theoretical computer science. Without learning these, you won't be able to grasp programming language semantics, Turing machines and computability, and so on. Even reasoning about your programs will be more difficult without it. Certainly, trying to do a mathematical proof of some CS concept...
I tend to like [Unification][01] and anything related to it. If you don't know propositional & predicate logic, then you are skipping the basics of logic. If you have an interest in anything [listed][01], then it would be like having an interest in math and skipping addition and multiplication. Logic is not just for AI...
Logic is fundamental to all theoretical computer science. Without learning these, you won't be able to properly grasp programming language semantics, Turing machines, logic programming, computability, and so on. Even reasoning about your programs will be more difficult without it. Certainly, trying to do a mathematical...
The pumping lemma can only be used to show that a language is not regular, not that it is regular. This is, I think, the fundamental misunderstanding here... that you are unable to use the pumping lemma to prove a language irregular does not constitute a proof of irregularity. A language is regular if, equivalently,...
The pumping lemma can only be used to show that a language is not regular, not that it is regular. This is, I think, the fundamental misunderstanding here... that you are unable to use the pumping lemma to prove a language irregular does not constitute a proof of irregularity. A language is regular if, equivalently,...
the analytic study of ways in which information is efficiently and effectively stored to and retrieved from computer systems.
A very simple approach for question 2 is the following. Sort the edges by capacity. Remove the edge with lowest capacity, and check if there is still a path from $s$ to $t$. If there is, move on the edge with the second lowest capacity, and so on. At some point, we will disconnect $s$ from $t$ by removing an edge of...
A very simple approach for question 2 is the following. Sort the edges by capacity. Remove the edge with lowest capacity, and check if there is still a path from $s$ to $t$. If there is, move on the edge with the second lowest capacity, and so on. At some point, we will disconnect $s$ from $t$ by removing an edge of...