Most Popular
1500 questions
13
votes
5 answers
A sufficient and necessary condition about regularity of a language
Which of the following statements is correct?
sufficient and necessary conditions about regularity of a language exist but not discovered yet.
There's no sufficient and necessary condition about regularity of a
language.
Pumping lemma is a…
Gigili
- 2,213
- 3
- 22
- 31
13
votes
5 answers
Proving Equivalence of Two Regular Expressions
Consider the regular expressions
$(1+01)^*(0+\epsilon)$
$(1^*011^*)^*(0+\epsilon) + 1^*(0+\epsilon)$,
where $\epsilon$ is the empty string. I need to determine if these expressions are equivalent. Intuitively it seems they are equivalent because…
Keio203
- 257
- 2
- 6
13
votes
4 answers
Why is tail recursion better than regular recursion?
There is the axiom you should always prefer tail-recursion over regular recursion whenever possible. (I'm not considering tabulation as an alternative in this question).
I understand the idea by why is that the case? Is it only because of the…
AmandaSai98b
- 251
- 2
- 5
13
votes
4 answers
Complexity of recursive Fibonacci algorithm
Using the following recursive Fibonacci algorithm:
def fib(n):
if n==0:
return 0
elif n==1
return 1
return (fib(n-1)+fib(n-2))
If I input the number 5 to find fib(5), I know this will output 5 but how do I examine the…
joker
- 469
- 1
- 5
- 15
13
votes
2 answers
How to encode date as input in neural network?
I am using neural networks to predict a time series.
The question I'm facing now is how do I encode date/time/serial no. of each input set as an input to the neural network?
Should I use 1 of C encoding (used for encoding categories) as described…
Shayan RC
- 633
- 1
- 5
- 11
13
votes
8 answers
Can any known sub-Turing-complete model of computation enumerate precisely the set of prime numbers?
I wish there were more, but the subject pretty much captures my whole question.
Is there a non-Turing-complete model (some constrained term rewriting system or automaton or what have you) which is known to be able to enumerate the prime numbers, all…
Trev
- 316
- 2
- 10
13
votes
5 answers
How can a Turing machine compare two strings without modifying them?
In Sipser's Introduction to the Theory of Computation, the author explains that two strings can be compared by “zigzagging” back and forth between them and “crossing off” one symbol at a time (i.e., replacing them with a symbol such as $x$). This…
Frank
- 335
- 2
- 11
13
votes
1 answer
Overflow safe summation
Suppose I am given $n$ fixed width integers (i.e. they fit in a register of width $w$), $a_1, a_2, \dots a_n$ such that their sum $a_1 + a_2 + \dots + a_n = S$ also fits in a register of width $w$.
It seems to me that we can always permute the…
Aryabhata
- 6,291
- 2
- 36
- 47
13
votes
3 answers
Relation between Russellian type theory and type systems
I recently realized that there is some sort of relation between Russellian type theory and type systems, as found e.g. in Haskell. Actually, some of the notation for types in Haskell seems to have precursors in type theory. But, IMHO, Russell…
Zeus
- 1,712
- 1
- 13
- 15
13
votes
1 answer
Why are all problems in FPTAS also in FPT?
According to the Wikipedia article on polynomial-time approximation schemes:
All problems in FPTAS are fixed-parameter tractable.
This result surprises me - these classes seem to be totally different from one another. FPTAS characterizes problems…
templatetypedef
- 9,302
- 1
- 32
- 62
13
votes
3 answers
Rigorous proof that parametric polymorphism implies naturality using parametricity?
This question asks for an informal explanation of why all polymorphic functions between functors are natural transformations (This is a claim made by Bartosz Milewski). One answer to that question refers to the Theorems for free! paper. However,…
user56834
- 4,244
- 5
- 21
- 35
13
votes
1 answer
Finding maximal factorization of regular languages
Let language $\mathcal{L} \subseteq \Sigma^*$ be regular.
A factorization of $\mathcal{L}$ is a maximal pair $(X,Y)$ of sets of words with
$X \cdot Y \subseteq \mathcal{L}$
$X \neq \emptyset \neq Y$,
where $X \cdot Y = \{xy$ | $x \in X, y \in…
Laura
- 544
- 1
- 3
- 10
13
votes
1 answer
Reductions among Undecidable Problems
Im sorry if this question has some trivial answer which I am missing. Whenever I study some problem which has been proven undecidable, I observe that the proof relies on a reduction to another problem which has been proven to be undecidable. I…
swarnim_narayan
- 474
- 2
- 11
13
votes
3 answers
What is meant by an oracle separation between classes $\mathsf{BPP}$ and $\mathsf{BQP}$?
In these notes about quantum computation by Scott Aronson, he explains that the computation classes $\mathsf{BPP}$ is contained in $\mathsf{BQP}$, but that they are not equal, and
So, the bottom line is that we get a problem -- Simon's problem --…
Mozibur Ullah
- 249
- 2
- 8
13
votes
2 answers
What is the complexity of the emptiness problem for 2-way DFAs?
I'm wondering, what is the time-complexity of determining emptiness for 2-way DFAs? That is, finite automata which can move backwards on their read-only input tape.
According to Wikipedia, they are equivalent to DFAs, though the equivalent DFA might…
Joey Eremondi
- 30,277
- 5
- 67
- 122