instruction stringlengths 0 29.8k ⌀ |
|---|
|asymptotics|proof-techniques|recurrence-relation|master-theorem| |
Assuming you want your general method to be computable, the answer is no. When you consider a CFG that generates a regular language and convert it into a right-linear grammar, the size-increase is not bounded by any computable (or "recursive") function (first shown by Meyer and Fischer in <a href="http://people.csail.m... |
Just ask Bob to multiply the number by 2 or 3 or anything else and xor that number with the number itself. It's doable by hand and reversible if the number is known. No sha, rsa or md5. Just plain maths. |
I know that maximum independent set on cubic triangle-free graphs is NP-complete.
Is it still NP-complete in case we require the independent set to be of size exactly $|V|/2$?
Basiclly, yes instance of independent set problem on cubic triangle-free graphs problem must have exactly $|V|/2$ nodes. |
Independent set on cubic triangle-free graphs |
|complexity-theory|np-complete| |
This is one of my assignments. I am not able to comprehend how to reduce the Turing machine domain to Classical planning domain. My understanding is that we have to essentially perform complexity analysis of classical planning domain. So I have defined these two languages
a) PLAN-EXISTENCE(D) = {P : P is the statem... |
Show that the Turing Machine domain can be viewed as a classical planning domain |
|complexity-theory|turing-machines|artificial-intelligence| |
The context free grammar: (e represents epsilon)
S --> aSb|aSa|bSa|bSb|e
It could generate regular language which means it can be converted to a right linear grammar.
Is there a general rule to convert CFG into a RLG? If there is no general rule, could you please show me how to convert this CFG to a RLG? |
After I learned how to build a suffix array in $O(N)$ complexity, I am interested in discovering the applications of the suffix arrays. One of these is finding the longest common substring between two strings, in $O(N)$ time. I found on the internet the following algorithm:
1. merge the two strings $A$ and $B$ into... |
null |
Consider the context free grammar:
$$S \rightarrow aSb \mid aSa \mid bSa \mid bSb \mid \varepsilon$$
It could generate regular language, which means it can be converted to a right linear grammar.
Is there a general rule to convert CFG into a RLG? If there is no general rule, could you please show me how to conve... |
For part 1, its simple. You need to find the $x$ (as defined below) for which MTTF(system) = 1.20M.
So $1.20 * 10^6 = \frac{1}{[(\frac{1}{6*10^6})*x]} \implies x = 5$.
We can have 5 disks (50 TB) if we want an MTTF(System) = 1.2M.
Part 2 is homework for you. |
Consider the context free grammar:
$$S \rightarrow aSb \mid aSa \mid bSa \mid bSb \mid \varepsilon$$
It could generate regular language, which means it can be converted to a right linear grammar.
Is there a general rule to convert CFG into a RLG?
**Edit:** If there is no general rule, could you please show m... |
Usually, Turing machines are explained to calculate functions $f:A \rightarrow B$, of which decision problems are a special case where $B = \mathbb{B}$. |
You can define two kinds of Turing Machines, transducers and acceptors.
Acceptors have two final states (accept and reject) while transducers have only one final state and are used to calculate functions.
Let $\Sigma$ be the alphabet of the Turing Machine.
Transducers take an input $x \in \Sigma^*$ on an **input... |
Since TMs are equivalent to algorithms, they must be able to perform algoriths like, say, mergesort. But the formal definition allows only for decision problems, i.e, acceptance of languages. So how can we cast the performance of mergesort as a decision problem? |
Can Turing Machines solve non-decision problems? |
|turing-machines| |
I know that maximum independent set on cubic triangle-free graphs is NP-complete.
Is it still NP-complete in case we require the independent set to be of size exactly $|V|/2$?
Basiclly, YES instance of independent set problem on cubic triangle-free graphs problem must have exactly $|V|/2$ nodes. NO instance has ... |
You should show that every Turing machine could be molded as a planning problem and vise versa. As a hint consider that any Turing machine consists of very simple actions (using action tables) and complex action in planning problem could be done by simple Turing machine.
|
You can encode the tape symbols, the head position and state of the TM, the execution of transitions using states:
symb(i,x) : i-th cell of the tape contains symbol x
head(i,q) : head is over cell i in state q
exec(i,q,x) : execute the transition at i-th cell in state q over symbol x
accept ... |
In order to show that the computation of a Turing machine can be modeled as a planning problem, you can encode the tape symbols, the head position and state, and the execution of a transition using states:
symb(i,x) : i-th cell of the tape contains symbol x
head(i,q) : head is over cell i in state q
... |
null |
To elucidate on the discussion in the comments, it matters what you're measuring growth relative to.
As mentioned by @Kaveh, $O(mn)$ is not linear in both at the same time, but is linear if one is a constant and the other one grows.
On the other hand, $O(m+n)$ would likely be considered linear. Intuitively, if... |
null |
Can we study programming languages in the context of linguistics? Do programming languages evolve naturally in similar ways to natural languages?
Although full rationality, and mathematical consistency is essential to programming languages, there still is the need (especially modern languages) to make them readable... |
Are programming languages becoming more like natural languages? |
|untagged| |
|programming-languages|natural-language-processing| |
Not really, no. Programming languages have become more like natural languages only in the sense of “words we have in english” (*sic*).
A key feature of programming languages is that they are not ambiguous. When you write a program and execute it, it has a well-defined meaning, which is its behavior. If you want to w... |
Computer languages tend to do well with terseness and precision, somewhat like mathematical notation, which has shown no particular inclination to evolve towards natural language (that I'm aware of) over the past few thousand years.
I also doubt that if you communicated with your infant exclusively in Haskell f... |
null |
I'm sort of new, but very interested to the field of computing and complexity theory, and I want to clarify my understanding about how to class problems, and how strongly the problems relate to the machine being used to solve them.
**My Understanding**
- Standard Turing Machine - a Turing Machine which has a fin... |
P, NP and specialised Turing Machines |
|turing-machines|complexity-classes|turing-completeness| |
Let $\mathcal{A}$ be a problem in $\text{NP} \cap \text{co}$-$\text{NP}$.
Now assume we can reduce another problem $\mathcal{B}$ to it using Cook reduction.
What conclusions can we draw about $\mathcal{B}$? Does this question even make sense?
I'm asking because from what I understand Cook reductions differ fro... |
If $A \in NP \cap co-NP$ and $B$ is Cook reducible to $A$, what can we say about $B$? |
|reductions| |
Can anyone tell me the difference between the following in data mining? I am taking a class this semester and the professor is using the terms so frequently, I don't know what these mean anymore.
- Data point
- attribute
- feature
|
Difference between Data point, attribute, feature? |
|data-mining| |
Let's start by proving that the maximum independent set is of size at most $|V|/2$. Let $I$ be an independent set. For each vertex $v$, let $\alpha(v)$ be the number of its neighbors in $I$. If $\alpha(v) \geq 1$, then we know that $v \notin I$. Since the graph is cubic, $\sum_v \alpha(v) = 3|I|$. Since $\alpha(v) \leq... |
If $\mathcal{A} \in \mathrm{NP} \cap \mathrm{co\text{-}NP}$, then there is a witness for $x \in \mathcal{A}$ as well as for $x \notin \mathcal{A}$. In other words, if I give you a computation with oracle to access to $\mathcal{A}$, I can convince that I didn't lie about the oracle answers by giving the appropriate witn... |
null |
I just recently started learning in a CS context (as opposed to a programming context) about simple recursive functions, along with the combinatorial applications, and techniques such as Backtracking and Divide et Impera.
The example problem that I chose for my questions is the n queens problem (given n queens and a... |
Why does backtracking work the way it does? |
|recursion| |
Your understanding is very good! You can also find more info in a text if your are interested, e.g. Sipser's Intro to the Theory of Computation.
There is this idea called the Church-Turing Thesis that says anything that can be computed somehow, can be computed using a Turing Machine. (It's not provable, but just an ... |
Nice question/homework!
Stated in another way: $\mathsf{NP}$ is not closed under Cook reductions (assuming $\mathsf{P}\neq \mathsf{NP}$).
How about $\mathsf{NP}\cap\mathsf{coNP}$? Is $\mathsf{NP}\cap\mathsf{coNP}$ closed under Cook reductions? Is the only reason that $\mathsf{NP}$ is not closed under Cook reduct... |
Algorithms and machines are not defined in your question and I don't think they are needed to ask what you want to ask.
Complexity classes are defined using Turing machines. That is their definition. If you want to prove anything you have to use these definitions. Anything about any other model is unrelated unless y... |
Algorithms and machines are not defined in your question and I don't think they are needed to ask what you want to ask.
Complexity classes are defined using Turing machines. That is their definition. If you want to prove anything you have to use these definitions. Anything about any other model is unrelated unless y... |
We focus on studying the decision problems in undergrad complexity theory courses because they are simpler and also questions about many other kinds of computations problems can be reduced to questions about decision problems.
However there is nothing in the definition of Turing machine by itself that restricts it t... |
An attribute is usually synonymous with feature, both of which refer to a single dimension. A data point probably refers to a complete record. That is, a data point is a collection of features.
For example, imagine we have a bunch of data on people and we want to classify each one as being male or female. Specifical... |
null |
|regular-languages|context-free|formal-grammars| |
|algorithms|recursion|backtracking| |
|complexity-theory|reductions|np| |
Let $\mathcal{A}$ be a problem in $\text{NP} \cap \text{co}$-$\text{NP}$.
Now assume we can reduce another problem $\mathcal{B}$ to it using Cook reduction.
What conclusions can we draw about $\mathcal{B}$? Does this question even make sense?
I'm asking because from what I understand Cook reductions differ fro... |
Problems that are Cook-reducible to a problem in NP $\cap$ co-NP |
|complexity-theory|computability|terminology|turing-machines|complexity-classes| |
I'm sort of new, but very interested to the field of computing and complexity theory, and I want to clarify my understanding about how to class problems, and how strongly the problems relate to the machine being used to solve them.
**My Understanding**
- Standard Turing Machine - a Turing Machine which has a fin... |
|terminology|turing-machines| |
You can define two kinds of Turing Machines, transducers and acceptors.
Acceptors have two final states (accept and reject) while transducers have only one final state and are used to calculate functions.
Let $\Sigma$ be the alphabet of the Turing Machine.
Transducers take an input $x \in \Sigma^*$ on an **input... |
|terminology|data-mining| |
Just a trivial note to underline that the *efficient simulation* of a Turing machine means not only that it can simulate the *computation* of a Turing machine and vice versa efficiently (polynomial time slowdown); but also that its *input/output must be efficiently converted* from one model to the other.
A trivial e... |
Machine language is very precise, while a human-written text can usually be interpreted in many different ways (some poetic text for example).
What is more and more evolved is patterns matching, for example when you write some ugly code a compiler can help you proposing several possible solutions and then throw some... |
You should only care about *intended interpretation*. I don't like the concept of the *extended interpretation*. The latter is only included to make precise the concept of quantification, but I think it makes things more confusing instead.
Before understanding what an intended interpretation is, you should really ... |
null |
> for example 1 and 2 relative to 3 are placed correctly, but 1 relative to 2 is placed incorrectly?
You have already tested that 1 and 2 are placed correctly, otherwise you wouldn't call `backtrack(3)`.
Recall that `sol[i] = j` means that the queen in column $i$ is put at row $j$. By calling `backtrack(k+1)` yo... |
Carl Mummert's comment nailed it.
1. My understanding (correct me if I am wrong) of the Church-Turing thesis is the idea that anything that can be computed can be computed by a Turing Machine.
2. And also, if a Turing Machine could compute if another Turing Machine would halt or not on an input (halting problem... |
There isn't any evidence that the human brain is in fact anything more than a Turing machine. In fact, it seems like the entire universe can be simulated on a (sufficiently large) Turing machine.
Humans are "smart" because of smart algorithms that are cleverly written in neurons so computer scientists can't steal or... |
null |
A exactly grammar equivalent to **G1** is following:
S → X S Y
S → X A Y
X → a | b
Y → c | d
A → fA | gA | ^
Where `^` is a null symbol (epsilon)
|
Suppose that we expand our idea of context free grammar rules to allow regular expressions of terminals on the right hand side. For example
G1:
S → (a + b) S (c + d)
S → (a + b) A (c + d)
A → (f+g)*
then the language of G1 is the following:
(a+b)^n (f+g)* (c+d)^n
Give a standard C... |
CFG with regular expression terminals on RHS |
|regular-expressions|automata| |
There isn't any evidence that the human brain is in fact anything more than a Turing machine. In fact, it seems like the entire universe can be simulated on a (sufficiently large) Turing machine.
Humans are "smart" because of smart algorithms that are cleverly written in neurons so computer scientists can't steal or... |
The fixed-point combinator FIX (aka the Y combinator) in the (untyped) lambda calculus ($\lambda$) is defined as:
FIX $\triangleq \lambda f.(\lambda x. f~(\lambda y. x~x~y))~(\lambda x. f~(\lambda y. x~x~y))$
I understand its purpose and I can trace the execution of its application perfectly fine; **I would like ... |
Clear, intuitive derivation of the fixed-point combinator (Y combinator)? |
|lambda-calculus| |
1. It is easy to define what it means for a Turing Machine to compute a function: The input is written on the tape at the beginning, and the output is whatever is on the tape when the machine halts (if it halts).
2. Most complexity classes we introduce initally, like $\mathsf{P}$, are defined for decision problems. ... |
From your comments, it seems that you are incorrectly calculating the number of loops. And since I do not where to start from for you, I will start from a basic level - please ignore whatever you know or find obvious. I am also going to assume that the semi-colons after each for loop are not present - otherwise in many... |
Is there an efficient algorithm to check that a sequence of characters is a concatenation of palindromes? The only thing that comes to my mind is the naive solution:
1. k = 1
2. Split string into k substrings (all possibilities) and check
3. k++
4. repeat
Note: the answer is trivially yes if le... |
null |
A exactly grammar equivalent to **G1** is following ( say G2) :
S → X S Y
S → X A Y
X → a | b
Y → c | d
A → fA | gA | ^
Where `^` is a null symbol (epsilon)
exactly equivalent means L(**G1**) = L(**G2**) that is language of G1 and G2 are same( *every string i... |
Suppose that we expand our idea of context free grammar rules to allow regular expressions of terminals on the right hand side. For example, consider $G_1$:
$\begin{align*}
S & \rightarrow (a \mid b) S (c \mid d) \\
S & \rightarrow (a \mid b) A (c \mid d) \\
A & \rightarrow (f \mid g)^*
\end{align*}
$
Then... |
1. It is easy to define what it means for a Turing Machine to compute a function: The input is written on the tape at the beginning, and the output is whatever is on the tape when the machine halts (if it halts).
2. Most complexity classes we introduce initally, like $\mathsf{P}$, are defined for decision problems. ... |
The general answer is pretty straightforward: if you have a grammar rule of the form $S \rightarrow {\alpha}r{\beta}$, where $r$ is a regular expression over the set of nonterminals, change this production to $S \rightarrow {\alpha}S'{\beta}$, find a right-regular grammar with start symbols $S'$ generating $L(r)$ (ther... |
null |
Although they are similar in that the asked questions are similar, they are quite distinct in terms complexity. The main difference is that natural language is inherently ambiguous (even at the level of words). It is even not clear what is meant by a word? In the world of programming languages however, a variety of def... |
Algorithms and machines are not defined in your question and I don't think they are needed to ask what you want to ask.
Complexity classes are defined using Turing machines. That is their definition. If you want to prove anything you have to use these definitions. Anything about any other model is unrelated unless y... |
Although they are similar in that the asked questions are similar, they are quite distinct in terms of complexity. The main difference is that natural language is inherently ambiguous (even at the level of words). It is even not clear what is meant by a word? In the world of programming languages however, a variety of ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.