edited by
367 views
0 0 votes

Consider the following non-deterministic automata for a unary language $L \subseteq\{a\}^{*}$ consisting of 11 states with the start state as the unique final state. All transitions shown are on the symbol $a$.

Let $\ell$ be the length of the longest string that is NOT accepted by the above automata.

Which of the following is $\text{TRUE}$ about $\ell?$

  1. $\ell=18$
  2. $\ell=22$
  3. $\ell=23$
  4. $\ell=26$
  5. $\ell$ is not well-defined as there are arbitrary long strings that the automata does not accept.

1 Answer

3 3 votes

This automata recognizes the following language:
\[
(a^5 + a^7)^*
\]

This accepts all strings whose lengths can be expressed as combinations of 5 and 7:  
like \(a^5\), \(a^7\),\(a^{12}\),\(a^{14}\),etc. 

\[
\text{i.e, it accepts all } a^n \text{ such that } n = 5x + 7y,\ x, y \geq 0
\]

so initially I was checking with options 18, 22, 23 and a few larger numbers, trying to find a pattern if answer was \(E\). While searching online for a better way to reason about it, I came across this beautiful result  called the Frobenius Coin Problem, which saved a lot of effort. Proof for anyone interested. 
 

It states:

For positive integers \(x, y\) that are relatively prime, every integer  
\[
n \geq (x - 1)(y - 1)
\]
can be written as \(xa + yb\), for some non-negative integers \(a, b \geq 0\).

So applying it here:
\[
n \geq (5 - 1)(7 - 1) = 4 \cdot 6 = 24
\]
can all be expressed as \(5x + 7y\), and thus  23 is the largest value that cannot be expressed and that would also be the largest \(l\)  that our FA cannot accept.
 

\[
\boxed{l = 23 \text{ is the length of the longest string that is NOT accepted by the above automata.}}
\]
 

 

 

Answer:
Position:
Show:

Related questions

2 2 votes
1 1 answer
398
398 views
Shubham Sharma 2 asked Jun 16, 2025
398 views
Consider the following languages:$L_{1}$ is the set of languages recognised by a deterministic pushdown automaton.$L_{2}$ is the set of languages recognised by a nondeter...
2 2 votes
1 1 answer
355
355 views
Shubham Sharma 2 asked Jun 16, 2025
355 views
The complexity class $\textsf{NP}$ corresponds to the class of languages which can be accepted by some nondeterministic Turing machine in polynomial time.The complexity c...
2 2 votes
1 1 answer
493
493 views
Shubham Sharma 2 asked Jun 16, 2025
493 views
What is the solution to the following recursion?$$\begin{array}{l}T(n)=T\left(\dfrac{n}{2}\right)+T\left(\dfrac{n}{3}\right)+T\left(\dfrac{n}{6}\right)+O(n), \\T(n)=5 \qu...
1 1 vote
1 1 answer
351
351 views
Shubham Sharma 2 asked Jun 16, 2025
351 views
Let $\varphi$ be a propositional formula on $n$ variables, with $n \geq 1$. Consider the following statements.$\varphi$ is satisfiable$\neg \varphi$ is unsatisfiable$\var...