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

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.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

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

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{\} }}\).

Question:Let G = (V, T, S, P) be the phrase-structure grammar with V = {0, 1, A, B, S}, T = {0, 1}, and set of productions P consisting of S โ†’ 0A, S โ†’ 1A, A โ†’ 0B, B โ†’ 1A, B โ†’ 1.

a) Show that 10101 belongs to the language generated by G.

b) Show that 10110 does not belong to the language generated by G.

c) What is the language generated by G?

In Exercises 16โ€“22 find the language recognized by the given deterministic finite-state automaton

Given a deterministic finite-state automaton \({\bf{M = (S,I,f,}}{{\bf{s}}_{\bf{o}}}{\bf{,F)}}\), use structural induction and the recursive definition of the extended transition function f to prove that \({\bf{f }}\left( {{\bf{s, x y}}} \right){\bf{ = f }}\left( {{\bf{f }}\left( {{\bf{s ,x}}} \right){\bf{, y}}} \right)\)for all states \({\bf{s}} \in {\bf{S}}\)and all strings\({\bf{x}} \in {\bf{I}}*{\bf{andy}} \in {\bf{I}}*\).

a) Construct a phrase-structure grammar that generates all signed decimal numbers, consisting of a sign, either + or โˆ’; a nonnegative integer; and a decimal fraction that is either the empty string or a decimal point followed by a positive integer, where initial zeros in an integer are allowed.

b) Give the Backusโ€“Naur form of this grammar.

c) Construct a derivation tree for โˆ’31.4 in this grammar.

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