Most Popular
1500 questions
12
votes
2 answers
Intersection and union of a regular and a non-regular language
Let $L_1$ be regular, $L_1 \cap L_2$ regular, $L_2$ not regular. Show that $L_1 \cup L_2$ is not regular or give a counterexample.
I tried this: Look at $L_1 \setminus (L_2 \cap L_1)$. This one is regular. I can construct a finite automaton for…

Kevin
- 129
- 1
- 2
- 4
12
votes
1 answer
How do I construct a doubly connected edge list given a set of line segments?
For a given planar graph $G(V,E)$ embedded in the plane, defined by a set of line segments $E= \left \{ e_1,...,e_m \right \} $, each segment $e_i$ is represented by its endpoints $\left \{ L_i,R_i \right \}$. Construct a DCEL data structure for…

com
- 3,179
- 2
- 24
- 38
12
votes
2 answers
Is computational power of Neural networks related to the activation function
It is proven that neural networks with rational weights has the computational power of the Universal Turing Machine Turing computability with Neural Nets. From what I get, it seems that using real-valued weights yields even more computational power,…

K.Steff
- 221
- 1
- 5
12
votes
4 answers
Why store self and parent links (. and ..) in a directory entry?
Consider an filesystem targeted at some embedded devices that does little more than store files in a hierarchical directory structure. This filesystem lacks many of the operations you may be used to in systems such as unix and Windows (for example,…

Gilles 'SO- stop being evil'
- 43,613
- 8
- 118
- 182
12
votes
3 answers
Time complexity of base conversion
Why can't arbitrary base conversion be as fast as converting from base $b$ to base $b^k$ ?
Seems to be a big time complexity difference! I am also interested in reading material about it.
Old. Original detailed question
Conversion between…

Hernan_eche
- 703
- 1
- 7
- 23
12
votes
1 answer
Is an infinite union of context-free languages always context-free?
Let $L_1$, $L_2$, $L_3$, $\dots$ be an infinite sequence of context-free languages, each of
which is defined over a common alphabet $Σ$. Let $L$ be the infinite union of $L_1$, $L_2$, $L_3$, $\dots $;
i.e., $L = L_1 \cup L_2 \cup L_3 \cup \dots $.
Is…

Gigili
- 2,193
- 3
- 21
- 31
12
votes
4 answers
Evaluating the average time complexity of a given bubblesort algorithm.
Considering this pseudo-code of a bubblesort:
FOR i := 0 TO arraylength(list) STEP 1
switched := false
FOR j := 0 TO arraylength(list)-(i+1) STEP 1
IF list[j] > list[j + 1] THEN
switch(list,j,j+1)
switched…

Sim
- 591
- 1
- 5
- 14
12
votes
5 answers
Converting a digraph to an undirected graph in a reversible way
I am looking for an algorithm to convert a digraph (directed graph) to an undirected graph in a reversible way, ie the digraph should be reconstructable if we are given the undirected graph. I understand that this will come in expense of the…

Heterotic
- 391
- 1
- 2
- 12
12
votes
2 answers
Smallest DFA that accepts given strings and rejects other given strings
Given two sets $A,B$ of strings over alphabet $\Sigma$, can we compute the smallest deterministic finite-state automaton (DFA) $M$ such that $A \subseteq L(M)$ and $L(M) \subseteq \Sigma^*\setminus B$?
In other words, $A$ represents a set of…

D.W.
- 159,275
- 20
- 227
- 470
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
- 383
- 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
2 answers
Fast hashing: combination of different techniques to identify changes in a file?
I want to create a fast way to detect whether a file might or might not be the same. For almost 100% sureness I would use an existing hash algorithm, e.g. SHA256.
However, the files are expected to be huge video files with several GB, so calculating…

Thomas Weller
- 261
- 2
- 9
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
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
2 answers
Tiling an orthogonal polygon with squares
Given an orthogonal polygon (a polygon whose sides are parallel to the axes), I want to find the smallest set of interior-disjoint squares, whose union equals the polygon.
I found several references to slightly different problems, such as:
Covering…

Erel Segal-Halevi
- 5,994
- 1
- 23
- 59