Questions tagged [finite-sets]
39 questions
36
votes
3 answers
Pumping lemma for simple finite regular languages
Wikipedia has the following definition of the pumping lemma for regular langauges...
Let $L$ be a regular language. Then there exists an integer $p$ ≥ 1
depending only on $L$ such that every string $w$ in $L$ of length at
least $p$ ($p$ is…
Phil Wright
- 943
- 1
- 10
- 13
11
votes
5 answers
Is there a known method for constructing a grammar given a finite set of finite strings?
From my reading it seems that most grammars are concerned with generating an infinite number of strings. What if you worked the other way around?
If given n strings of m length, it should be possible to make a grammar that will generate those…
Gustav Bertram
- 270
- 3
- 12
6
votes
1 answer
Computing the complement of a set
Suppose I have a set $A$ of elements in $\{1, \ldots, n\}$, given as an unordered list.
I would like to compute the complement of $A$, i.e., I would like to produce an unordered list of entries in $\{1, \ldots, n\}$ but not in $A$.
One way to do…
Kiyal M.
- 63
- 3
6
votes
2 answers
Spanning tree in a graph of intersecting sets
Consider $n$ sets, $X_i$, each having $n$ elements or fewer, drawn among a set of at most $m \gt n$ elements. In other words
$$\forall i \in [1 \ldots n],~|X_i| \le n~\wedge~\left|\bigcup_{i=1}^n X_i\right| \le m$$
Consider the complete graph $G$…
Arthur B
- 353
- 2
- 8
5
votes
2 answers
Finding the k-th smallest rational number efficiently
Consider the following set:
$S := \left\{\frac{a}{b} \colon a \in \{1,\ldots,A\}, b \in \{1,\ldots,B\} \right\}$
$S$ is the set of all rational numbers that can be represented by two integers $a$ and $b$ that are bounded by $A \geq 1$ and $B \geq…
user1742364
- 642
- 4
- 12
5
votes
0 answers
Is there a polynomial-time algorithm to minimize regular expressions without Kleene closures/stars?
I have read that minimizing regular expressions is, in general, PSPACE-complete. Is it known whether minimizing regular expressions without the Kleene closure (star, asterisk) is in P?
The language of any such regular expression would be guaranteed…
csstudent1999
- 51
- 2
4
votes
1 answer
Finite languages are Turing decidable - contradiction
Let's say that I define the language $L$ over the alphabet $\{0, 1\}$ to be a language containing only one word, $w$, where:
$$ w =
\begin{cases}
1 & \text{if the continuum hypothesis is true}\\
0 & \text{otherwise.}
…
SebiSebi
- 143
- 3
4
votes
1 answer
How many words are in this sets?
I have problems to determine the size of the following sets in dependancy of the parameters $m, n>0$:
$$M_{m,n}=\{a^iwa^{m-i}\mid 0\le i \le m,\;w\in\{a,b\}^n\}$$
It is easy to see that $|M_{m,n}|\le (m+1)\cdot 2^n$ since there are $m+1$…
Danny
- 1,004
- 5
- 10
4
votes
0 answers
Finding all sets which are not subsets of other sets
I have a set of sets, for example
{
{1, 2, 3},
{1, 2},
{2},
{2, 4}
}
I want to find all sets which are not subsets of another set. For example, {2} and {1, 2} are both subsets of {1, 2, 3}, so my answer would just be {1, 2, 3} and {2, 4}. Let's…
Daniel M.
- 141
- 4
4
votes
1 answer
Complexity of a decision problem: system of linear equations over finite field with restricted solutions
I have a system of linear equations over a finite field $\mathbb F_p \cong \mathbb Z_p$, and I'm interested in the decision problem of whether there exists a solution where all of the variables $x_i$ are in the set $\{0, 1\} \subset \mathbb F$. In…
Peter Kagey
- 143
- 5
4
votes
2 answers
Regular language as finite union of periodic sets
Is it true that every regular language can be expressed as a finite union of periodic sets? In other words, if $L$ is regular, then do there exist finite sets $A_1,\dots,A_n,B_1,\dots,B_n$ such that
$$L = A_1 \cdot B_1^* \cup \cdots \cup A_n \cdot…
D.W.
- 167,959
- 22
- 232
- 500
3
votes
1 answer
Compact mapping from an involuted set
Let $S$ be a set (say positive integers $\leq$ N) and $f$ an involution ($f$ is bijective, $f\cdot f=id$, e.g. xor with a constant). $g$ is a idempotent mapping choosing an arbitrary representative element in each $f$ mapped pairs. For example…
Piezoid
- 133
- 4
3
votes
2 answers
Given many partial orders, check them for consistency and report any that are not consistent
Inputs. I am given a finite set $S$ of symbols. I know there should exist some total order $<$ on $S$, but I'm not given this ordering and it could be anything.
I am also given a collection of assertions. Each assertion takes the form…
D.W.
- 167,959
- 22
- 232
- 500
3
votes
1 answer
Deciding whether a set of relations can be composed to the empty relation
Is there an efficient algorithm to solve the following decision problem?
Given a finite set $S$ and a set of relations $\mathcal R$ from $S$ to $S$, determine whether there is any sequence of relations $r_1,r_2,\ldots,r_k\in\mathcal R$ such…
Milo Brandt
- 83
- 7
3
votes
0 answers
Minimal regular expression from minimal NFA for finite language in polynomial time?
Given a minimal NFA for a finite language, is there a polynomial-time algorithm to find a minimal regular expression for the same language?
This question is based on a recent question regarding minimization of regular expressions for finite…
Patrick87
- 12,924
- 1
- 45
- 77