Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Show that \(\left\{ {{1^p}\mid p\;\;\;prime} \right\}\) is not regular. You may use the pumping lemma given in Exercise 22 of Section 13.4.

Short Answer

Expert verified

It is shown & proved that \(\left\{ {{1^p}\mid p\;\;\;prime} \right\}\) is not regular

Step by step solution

Achieve better grades quicker with Premium

  • Unlimited AI interaction
  • Study offline
  • Say goodbye to ads
  • Export flashcards

Over 22 million students worldwide already upgrade their learning with Vaia!

01

Definition

Pumping lemma: If \(x\) is a string in \(L{\rm{(}}M{\rm{)}}\) with \(L{\rm{(}}x{\rm{)}} \ge |S|\), then there are strings \(u,v\) and \(w\) in \({I^*}\) such that \(x = uvw,{\bf{ }}L{\rm{(}}uv{\rm{)}} \le |S|\) and \(l{\rm{(}}v{\rm{)}} \ge 1\) and \(u{v^i}w \in L{\rm{(}}M{\rm{)}}\) for \(i = 0,1,2, \ldots \)

02

Proving by contradiction

Given:

\(M = \left( {S,I,f,{s_0},F} \right)\)is a deterministic finite-state automaton

\(L{\rm{(}}M{\rm{)}} = \)Language recognized by \(M\)

\(P = \left\{ {{1^p}\mid p\;\;\;prime} \right\}\)

To proof: is not regular\(P\)

PROOF BY CONTRADICTION

Let us assume, for the sake of contradiction, that \(P\) is regular.

Since \(P\) is regular, there exists some deterministic finite-state automaton \(M = \left( {S,I,f,{s_0},F} \right)\) that generates \(P\).

Let \(k = \left| S \right|\). Let us consider the string \(x = {1^{{p_k}}}\) with \({p_k}^{th}\) \({k^{th}}\) prime.

\(l\left( {{1^{{p_k}}}} \right) \ge l\left( {{1^k}} \right) = k = |S|\)

03

Using the pumping lemma

By the pumping lemma, there then exist strings \(u,v\) and \(w\) in \({I^*}\) such that \(x = uvw,L(uv) \le |S|\) and \(l(v) \ge 1\) and \(u{v^i}w \in L{\rm{(}}M{\rm{)}}\) for \(i = 0,1,2, \ldots \)

Let \(v\) consist of \(m\) ones with \(m\) a positive integer, thus \(v = {1^m}\).

However, then \(M\) also generates \({1^{{p_k} + pm}}\) for all positive integers \(p\) (as \(u{v^i}w \in L{\rm{(}}M{\rm{)}}\)). This then implies that \({p_K} + p{\bf{ }}m\) is a prime for all positive integers \(p\).

This is impossible, because the difference between successive primes increases more and more (as there are \(n - 1\) nonprimes from \(n{\bf{ }}! + 2\) and \(n{\bf{ }}! + n\)), while the difference between successive terms \({p_K} + p{\bf{ }}m\) increases consistently by \(m\), and thus at some point one of the elements \({p_K} + p{\bf{ }}m\) is not a prime. Thus, you have derived a contradiction.

It implies that the assumption which is " \(P\) is regular" is incorrect.

Hence, \(P\) is not regular.

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

a)what is the language generated by a phrase-structure grammar G?

b)What is the language generated by the grammar Gwith vocabulary{S,0,1}, set of terminals T= {0,1}, starting symbol S, and productions Sโ†’000S, Sโ†’1?

c)Give a phrase-structure grammar that generates the set \({\bf{\{ 0}}{{\bf{1}}^{\bf{n}}}{\bf{|n = 0,1,2}}....{\bf{\} }}\).

Give production rule in Backus-Naur form for an identifier if it can consist of

a. One or more lower case letters.

b. At least three but no more than six lowercase letter

c. One to six uppercase or lowercase letters beginning with an uppercase letter.

d. A lowercase letter, followed by a digit or an underscore, followed by three or four alphanumeric characters (lower or uppercase letters and digits.)

Let V = {S, A, B, a, b} and T = {a, b}. Find the language generated by the grammar (V, T, S, P) when theset P of productions consists of

\(\begin{array}{*{20}{l}}{{\bf{a) S }} \to {\bf{ AB, A }} \to {\bf{ ab, B }} \to {\bf{ bb}}{\bf{.}}}\\{{\bf{b) S }} \to {\bf{ AB, S }} \to {\bf{ aA, A }} \to {\bf{ a, B }} \to {\bf{ ba}}{\bf{.}}}\\{{\bf{c) S }} \to {\bf{ AB, S }} \to {\bf{ AA, A }} \to {\bf{ aB, A }} \to {\bf{ ab, B }} \to {\bf{ b}}{\bf{.}}}\\{{\bf{d) S }} \to {\bf{ AA, S }} \to {\bf{ B, A }} \to {\bf{ aaA, A }} \to {\bf{ aa, B }} \to {\bf{ bB, B }} \to {\bf{ b}}{\bf{.}}}\\{{\bf{e) S }} \to {\bf{ AB, A }} \to {\bf{ aAb, B }} \to {\bf{ bBa, A }} \to {\bf{ \lambda , B }} \to {\bf{ \lambda }}{\bf{.}}}\end{array}\)

a) Explain what the productions are in a grammar if the Backusโ€“Naur form for productions is as follows:

\(\begin{array}{*{20}{l}}{{\bf{ < expression > :: = }}\left( {{\bf{ < expression > }}} \right){\bf{ }}\left| {{\bf{ < expression > + < expression > }}} \right|}\\\begin{array}{c}{\bf{\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;}}\,\,\,\,{\bf{ < expression > * < expression > |}}\\\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,{\bf{ < variable > }}\end{array}\\{\,\,\,\,\,\,\,\,\,{\bf{ < variable > :: = xly}}}\end{array}\)

b) Find a derivation tree for \(\left( {{\bf{x*y}}} \right){\bf{ + x}}\) in this grammar.

Show that the set \(\left\{ {{{\bf{1}}^{{{\bf{n}}^2}}}\left| {{\bf{n = 0,1,2,}}...} \right.} \right\}\) is not regular using the pumping lemma from Exercise 22.

See all solutions

Recommended explanations on Math Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free