Most Popular
1500 questions
12
votes
2 answers
Master theorem not applicable?
Given the following recursive equation
$$ T(n) = 2T\left(\frac{n}{2}\right)+n\log n$$ we want to apply the Master theorem and note that
$$ n^{\log_2(2)} = n.$$
Now we check the first two cases for $\varepsilon > 0$, that is whether
$n\log n \in…
Joachim
- 223
- 1
- 2
- 6
12
votes
2 answers
Examples of context-free languages with a non-context-free complements
Context-free languages are not closed under complementation. In the lectures we have been given the same argument as here on Wikipedia: For
$$A = \{\mathtt a^n \mathtt b^n \mathtt c^m;~m, n ∈ ℕ_0\}\quad\text{and}\quad B = \{\mathtt a^m \mathtt b^n…
k.stm
- 393
- 1
- 3
- 11
12
votes
2 answers
An oracle to separate NP from coNP
How to prove that $\mathsf{NP}^A \neq \mathsf{coNP}^A$ ? I am just looking for a such oracle TM $M$ and a recursive language $L(M) = L$ for which this holds.
I know the proof where you show that there is an oracle $A$ such that $\mathsf{P}^A \neq…
stewenson
- 351
- 2
- 6
12
votes
3 answers
If $L$ is context-free and $R$ is regular, then $L / R$ is context-free?
I'm am stuck solving the next exercise:
Argue that if $L$ is context-free and $R$ is regular, then $L / R = \{ w \mid \exists x \in R \;\text{s.t}\; wx \in L\} $ (i.e. the right quotient) is context-free.
I know that there should exist a PDA that…
Dommicentl
- 221
- 2
- 4
12
votes
2 answers
Reconstructing Graphs from Degree Distribution
Given a degree distribution, how fast can we construct a graph that follows the given degree distribution? A link or algorithm sketch would be good. The algorithm should report a "no" incase no graph can be constructed and any one example if…
singhsumit
- 223
- 1
- 5
12
votes
1 answer
How to prove that a constrained version of 3SAT in which no literal can occur more than once, is solvable in polynomial time?
I'm trying to work out an assignment (taken from the book Algorithms - by S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani, Chap 8, problem 8.6a), and I'm paraphrasing what it states:
Given that 3SAT remains NP-complete even when restricted to…
TCSGrad
- 602
- 7
- 15
12
votes
1 answer
What is complexity class $\oplus P^{\oplus P}$
What does the complexity class $\oplus P^{\oplus P}$ mean? I know that $\oplus P$ is the complexity class which contains languages $A$ for which there is a polynomial time nondeterministic Turing machine $M$ such that $x \in A$ iff the number of…
stewenson
- 351
- 2
- 6
12
votes
1 answer
Algorithm to test whether a language is regular
Is there an algorithm/systematic procedure to test whether a language is regular?
In other words, given a language specified in algebraic form (think of something like $L=\{a^n b^n : n \in \mathbb{N}\}$), test whether the language is regular or not.…
D.W.
- 167,959
- 22
- 232
- 500
12
votes
2 answers
A variant of the halting problem for subsets of Turing machines
Suppose we have some subset $S$ of Turing machines with the property that, for every partial recursive function, at least one machine in $S$ computes that function.
Question: for any such subset $S$, can we prove it is impossible to build a halting…
Mike Battaglia
- 1,071
- 6
- 19
12
votes
3 answers
Why is a program operating system dependent?
I understand that processors belonging to different architectures have different instruction set and therefore a program compiled for one processor (hardware platform) can't run on a processor with different ISA.
But why is a compiled program…
vimalathithan17
- 129
- 7
12
votes
1 answer
How to find a "short" walk that visits all vertices of a strongly connected directed graph
I am interested in the following algorithmic problem:
Given a strongly connected directed graph $G$, I want a "short" (see below for what I mean by short) walk that starts with an arbitrary vertex $s$ and contains all vertices of $G$.
Deciding if…
Michal Dvořák
- 777
- 3
- 15
12
votes
5 answers
pick K random integers without repetition
Suppose we've to pick $K (\le N)$ random integers in the range $[0, N - 1]$ for very large $N$ such that there is no repetition, while also deterministically minimizing the number of calls made to the $rand()$ function. How would we do it?
Assume…
bihariforces
- 333
- 2
- 7
12
votes
3 answers
Minimum number of clues to fully specify any sudoku?
We know from this paper that there does not exist a puzzle that can be solved starting with 16 or fewer clues, but it implies that there does exist a puzzle that can be solved from 17 clues. Can all valid sudoku puzzles be specified in 17 clues? If…
Kevin
- 1,082
- 10
- 22
12
votes
4 answers
Operations under which the class of undecidable languages isn't closed
Do there exist undecidable languages such that their union/intersection/concatenated language is decidable? What is the physical interpretation of such example because in general, undecidable languages are not closed under these operations?
What can…
user1284
12
votes
3 answers
Is Big-Theta a more accurate description of worst case run time than Big-O?
Question I was asked: Does it make a difference if I say "The worst case run time is $O(n^2)$ vs the worst case run time is $\Theta(n^2)$?"
To me, the only difference is that when we say $O(n^2)$, the function may also be $O(n)$, we do not know. But…
Carter Falkenberg
- 143
- 1
- 6