instruction
stringlengths
0
29.8k
⌀
*F* = { ⟨*M*⟩ : *M* is a turing machine which stops on every input in no more than 50 steps }. I need to decide whether *F* is decidable or recursive enumerable. This "50 steps" part immediate turns the **R** sign for me, I know that if it was for specific input it was decidabl...
Is the set of Turing machines which stop in at most 50 steps on all inputs, decideable?
null
If M stops in no more than 50 steps, than the positions M can reach on the normally infinite tape are limited. Thus the infinite tape can be simulated by a finite one. This means that the tape can be simulated by a finite automaton. It follows that a turing machine M that stops in no more than 50 steps is bisimilar to...
I'd like your help with proving that the following $L$ is decidable iff $P=NP$: $L=\{\langle M \rangle| L(M) \in NP\setminus P \}$. If $P=NP$ I get that it's the language of empty Turing machines, isn't it? so It's $Co-RE$ problem and not as the requested, so I got confused.. I know that in order to show $P=N...
For $L=\{\langle M \rangle| L(M) \in NP\setminus P \}$, Show that $L$ is decidable iff $P=NP$
|np-complete|undecidability|p-vs-np|polynomial-time|
I'd like your help with proving that the following $L$ is decidable iff $P=NP$: $L=\{\langle M \rangle| L(M) \in NP\setminus P \}$. If $P=NP$ I get that it's the language of empty Turing machines, isn't it? so It's $\text{co-RE}$ problem and not as the requested, so I got confused.. I know that in order to sh...
I'd like your help with proving that the language $$L=\{\langle M \rangle \mathrel| L(M) \in \mathrm{NP}\smallsetminus \mathrm{P} \}$$ is decidable iff $\mathrm{P}=\mathrm{NP}$. If $\mathrm{P}=\mathrm{NP}$, I get that it's the language of empty Turing machines. So $L$ is a $\text{co-RE}$ problem — but that's...
How to show that the set of machines which accept languages in $\mathrm{NP}\smallsetminus\mathrm P$, is decidable only if $\mathrm P=\mathrm{NP}$?
|undecidability|p-vs-np|
null
There are two cases to consider. 1. Assume that $\text{P=NP}$. Then $L=\{\langle M\rangle \mid L(M)\in \emptyset\}=\emptyset$. The empty language is decidable; as no word belongs to it, it is trivial to decide whether a word belongs to it or not. 2. Assume that $\text{P}\neq\text{NP}$. Now your result follows dir...
Let's consider the more general problem of machines which stop after at most $N$ steps, for some $N \geqslant 1$. As swegi remarks in an earlier response, if the machine stops after at most $N$ steps, then only the cells $0,1,\ldots,N$ on the tape are significant. Define $$ \mathcal C_N = Q \times [N{+}1] \times \...
null
Let's consider the more general problem of machines which stop after at most $N$ steps, for some $N \geqslant 1$. (The following is a substantial simplifcation of a previous version of this answer, but is effectively equivalent.) As swegi remarks in an earlier response, if the machine stops after at most $N$ steps, ...
I am self-learning [proof assistants][1] and decided to start on some basic proofs and work my way up. Since proofs are based on other proofs and so form a hierarchy, is there a repository of the hierarchy of proofs? I know I can pick a particular proof-assistant and analyze its library to extract its hierarchy, how...
null
Normally, classes at universities have prerequisite lists. If there are some courses on the list you haven't taken, you should ask the professor whether you really need them. Discrete math courses can vary dramatically in what you really need to understand them. You may or may not need to have done proofs; (some di...
To show that the language is $\Pi^0_2$ complete you have to show two things: 1. The language is $\Pi^0_2$ 2. Every $\Pi^0_2$ language is many-one reducible to your language To show that your language is $\Pi^0_2$, informally, you need to know two things: (1) quantifiers over strings count the same as quantifie...
What I'm trying to do is generating [Motzkin_number][1] mod with a large number 10^14 + 7(not prime), and it needs to compute the `n` Motzkin number as fast as possible. From wiki, the formula for **Motzkin number** is defined as following: ![enter image description here][2] My initial approach is to use the second...
How to compute linear recurrence using matrix with fraction coefficients?
|computability|optimization|recurrence-relation|
What I'm trying to do is generating [Motzkin number][1] mod with a large number $10^{14} + 7$ (not prime), and it needs to compute the $n$th Motzkin number as fast as possible. From Wikiedia, the formula for the $n$th Motzkin number is defined as following: ![enter image description here][2] My initial approach...
null
null
I am trying to teach myself different approaches to software verification. I have read some articles. As far as I learned, Propositional logic with temporal generally uses model checking with SAT solvers (in ongoing - reactive systems), but what about First Order Logic with temporal? Does it use theorem provers? Or it ...
FOL Verification
|formal-methods|sat-solvers|
If $M$ stops in no more than 50 steps, than the positions $M$ can reach on the normally infinite tape are limited. Thus the infinite tape can be simulated by a finite one. This means that the tape can be simulated by a finite automaton. It follows that a turing machine $M$ that stops in no more than 50 steps is bisimi...
|computability|undecidability|p-vs-np|
|computability|undecidability|
*F* = { ⟨*M*⟩ : *M* is a turing machine which stops on every input in no more than 50 steps }. I need to decide whether *F* is decidable or recursive enumerable. This "50 steps" part immediate turns the **R** sign for me, I know that if it was for specific input it was decidabl...
Preface: I asked this question yesterday, so don't assume I know what I'm talking about. This should get you on the right path (I hope), but don't take it as fact. Remember to read the comments below. Much of the original answer is incorrect, but the tips from helpful and more experienced people below should help cl...
What I'm trying to do is generate [Motzkin numbers][1] mod a large number $10^{14} + 7$ (not prime), and it needs to compute the $n$th Motzkin number as fast as possible. From Wikipedia, the formula for the $n$th Motzkin number is defined as following: $\qquad \displaystyle \begin{align} M_{n+1} &= M_n + \sum_{i=...
|algorithms|recurrence-relation|efficiency|integers|
In the article [Parsing Expressions by Recursive Descent by Theodore Norvell (1999)](http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm) the author starts with the following grammar for arithmetic expressions: E --> E "+" E | E "-" E | "-" E | E "*" E | E "/" E | E "^" E | "(" E ")" | v which is quite bad, bec...
null
What I mean by a "symbolic regular expression" (if there already is a different name for this I'm not aware of it) is a regular expression that may include exponents that are symbolic arithmetic expressions. Example 1: $a^k|b^*$ means "either $k$ copies of $a$ or zero or more copies of $b$". Example 2: $a^{k+1}...
How to disambiguate symbolic regular expressions
|formal-languages|reference-request|regular-languages|regular-expressions|ambiguity|
I am trying to teach myself different approaches to software verification. I have read some articles. As far as I learned, propositional logic with temporal generally uses model checking with SAT solvers (in ongoing - reactive systems), but what about first order Logic with temporal? Does it use theorem provers? Or can...
You only need to notice that the number of paths from one node to the target node is the sum of the number of paths from its children to the target. You know that this algorithm will always stop because your graph doesn't have any cycles. Now, if you save the number of paths from one node to the target as you visit ...
null
Is Category Theory useful for learning functional programming?
null
null
I'm learning Haskell and I'm fascinated by the language. However I have no serious math or CS background. But I am an experienced software programmer. I want to learn category theory so I can become better at Haskell. Is this a good strategy? What category theory should I learn to provide a good basis for und...
|functional-programming|category-theory|
I'm learning Haskell and I'm fascinated by the language. However I have no serious math or CS background. But I am an experienced software programmer. I want to learn category theory so I can become better at Haskell. Is this a good strategy? Which topics in category theory should I learn to provide a good ba...
I'm learning Haskell and I'm fascinated by the language. However I have no serious math or CS background. But I am an experienced software programmer. I want to learn category theory so I can become better at Haskell. Is this a good strategy? Which topics in category theory should I learn to provide a good ba...
null
First order logic is undecidable, so SAT solving does not really help. That said, techniques exist for bounded model checking of first order formulas. This means that only a fixed number of objects can be considered when trying to determine whether the formula is true or false. Clearly, this is not complete, but if a c...
Why does the splay tree rotation algorithm take into account both the parent and grandparent node?
null
|reference-request|formal-methods|sat-solvers|software-verification|
Introduction into first order logic Verification
Introduction into first order logic verification
**Background:** Some people consider Software Engineering as a branch of Computer Science, while others consider that they are, or should be, separate. The former stance seems to be well presented in written works. On Wikipedia, Software Engineering [is classified as Applied Computer Science][1], along with, e.g., Arti...
What different lines of reasoning and traditions leads to the conclusion that Software Engineering is or isn't part of Computer Science?
|software-engineering|
Your matrix formulation doesn't work- you need to use different $n$s in the matrices. One idea to rescue your original approach is as follows. First, factor $10^{14} + 7 = 98794607 \times 1012201$ (only the second factor is prime). It is enough to compute $M_n$ modulo the two factors. The first factor is smaller tha...
From Moldable and Castable Polygons by Rosenbloom. Given the vertices of the polygon in clockwise order, 2-moldability can be determined in O(n) time, 2-castability can be determined in O(n log n) time.
> I can not help but think: this is divide & conquer, plain and simple! M/R is not divide & conquer. It does not involve the repeated application of an algorithm to a smaller subset of the previous input. It's a pipeline (a function specified as a composition of simpler functions) where pipeline stages are alternat...
From Moldable and Castable Polygons by Rappaport and Rosenbloom. Given the vertices of the polygon in clockwise order, 2-moldability can be determined in O(n) time, 2-castability can be determined in O(n log n) time.
Call a family of sets $\mathcal{F} = \{S_1, \dotsc, S_k\}$ "diverse" if each set $S_i \in \mathcal{F}$ has at least one unique element. What are possible approaches for finding the largest diverse set $S$ in a family of sets $\mathcal{F}$? One approach is to solve a modified set packing problem. Suppose $\mathcal{...
null
I'm learning Haskell and I'm fascinated by the language. However I have no serious math or CS background. But I am an experienced software programmer. I want to learn category theory so I can become better at Haskell. Which topics in category theory should I learn to provide a good basis for understanding Haskel...
{"Voters":[{"Id":207,"DisplayName":"Uday Reddy"},{"Id":31,"DisplayName":"Dave Clarke"},{"Id":41,"DisplayName":"Kaveh"},{"Id":5,"DisplayName":"Ken Li"},{"Id":98,"DisplayName":"Raphael"}]}
|programming-languages|functional-programming|category-theory|
After reading your question the only way I could see and had enough knowledge to tie the topics together was to give a hi-level set of articles that drill down from software verification ending up with trying to unite model checking and theorem proving. Hopefully my comment did that: Take a look at [Software verific...
From [Moldable and Castable Polygons](http://dx.doi.org/10.1016/0925-7721(94)90020-5) by Rappaport and Rosenbloom (1994). Given the vertices of the polygon in clockwise order, 2-moldability can be determined in O(n) time, 2-castability can be determined in O(n log n) time.
I have this question from an old exam I'm trying to solve: > For an integer $c>1$, and the following four three problem: > >1.**Input: Turing machine M** > > **Question: Is it true that for every input $x$, M does not pass the $|x|+c$ position when it running on $x$?** >2.**Input: Turing machine M** > >...
Which languages are decidable?
|undecidability|
I have this question from an old exam I'm trying to solve: > For an integer $c>1$, and the following four three problem: > >1.**Input: Turing machine M** > > **Question: Is it true that for every input $x$, M does not pass the $|x|+c$ position when it running on $x$?** >2.**Input: Turing machine M** > >...
|turing-machines|undecidability|
null
I have these questions from an old exam I'm trying to solve. For each problem, the input is an encoding of some Turing machine $M$. > For an integer $c>1$, and the following four three problem: > > 1. Is it true that for every input $x$, M does not pass the $|x|+c$ position when it running on $x$? > > 2. Is it...
|undecidability|
null
I have these questions from an old exam I'm trying to solve. For each problem, the input is an encoding of some Turing machine $M$. > For an integer $c>1$, and the following four three problem: > > 1. Is it true that for every input $x$, M does not pass the $|x|+c$ position when it running on $x$? > > 2. Is it...
null
Here's partial answer regarding your third question. In fact, perhaps Brzozowski's algorithm really doesn't outperform all the other algorithms so clearly in DFA minimization. In [1], the authors investigate the practical performance of DFA/NFA minimization algorithms. The algorithms are Hopcroft's, Brzozowski's, an...
null
One might base such a decision on the kind of education and training expected of practitioners. A good source for investigating differences and similarities in this direction might be the ACM curriculum guidelines for computing professions, including CS and SwE. http://www.acm.org/education/curricula-recommendations ...
null
They way to deal with those questions is to consider the **configurations** of a TM, that is, the tuple of it's state, head position and the (non-blank) tape. (See the Wikipedia page of [Turing Machine](https://en.wikipedia.org/wiki/Turing_machine).) Note the following fact: if a machine never gets to cell number $i...
{"Voters":[{"Id":157,"DisplayName":"Ran G."}]}
(Right answer, but to the wrong question, might be revised later) They way to deal with those questions is to consider the **configurations** of a TM, that is, the tuple of it's state, head position and the (non-blank) tape. (See the Wikipedia page of [Turing Machine](https://en.wikipedia.org/wiki/Turing_machine).) ...
One might base such a decision on the kind of education and training expected of practitioners. A good source for investigating differences and similarities in this direction might be the [ACM curriculum guidelines](http://www.acm.org/education/curricula-recommendations) for computing professions, including CS and SwE....
null
I'm going to try and keep it short and sweet. There is an informal correspondence between Haskell programs and certain classes of categories, which can be made more formal with some work. This correspondence is known as the Curry-Howard-Lambek correspondence and relates: 1. Haskell *types* with *[objects][1]* of th...
|computability|turing-machines|undecidability|
Is it decidable whether a TM reaches some position on the tape?
I have these questions from an old exam I'm trying to solve. For each problem, the input is an encoding of some Turing machine $M$. > For an integer $c>1$, and the following three problems: > > 1. Is it true that for every input $x$, M does not pass the $|x|+c$ position when running on $x$? > > 2. Is it true t...
I have these questions from an old exam I'm trying to solve. For each problem, the input is an encoding of some Turing machine $M$. > For an integer $c>1$, and the following three problems: > > 1. Is it true that for every input $x$, M does not pass the $|x|+c$ position when running on $x$? > > 2. Is it true t...
The Litvin book is also pretty good, as is the Princeton Guide. I have had APCS students use all 3 and wind up nickeling the test.
null
> Is calculus required or will precalculus do just fine? No. Calculus deals with calculating the slope at any point on a *continuous* curve or calculating the area under a *continuous* curve. Since continuous ranges (uncountably infinite) and discrete ranges (finite or countably infinite) are opposites, calculus i...