Write regular expressions of the following languages-  The set of strings that start and end with the same symbols 01. Σ = {0,1,2} The set of strings that contain both substrings ‘101’ and ‘000’. Σ = {0,1} The set of strings having 0 at every 3rd position from the beginning. Σ = {0,1}. For example- 000, 010, 0100100, 110110, etc. The set of strings that do not contain substring ‘10’. Σ = {0,1} The set of strings that do not end with ‘01’. Σ = {0,1}    Following is an example of different ways one can declare variables in some programming language. Write down the regular expression that can generate such variable declarations. Assume that-   All variable names are at most five (previously written as exactly five; both will be considered correct) characters long. Variable names can contain only small letters [a-z], digits [0-9], and two special characters $ (dollar) and _ (underscore).  $ sign can only be used at the beginning.  No names can start with digits. The variable types are integer, real, char, and Boolean only. The word ‘var’ which denotes variable is optional. Ignore any whitespace (space, tab, newline, etc.) Infer the rest of the rules from the code snippets below- var int1 : integer; var foo_1 : boolean; var f2 : real; _ind: char; x, y, z: integer;

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
  •  Write regular expressions of the following languages- 
    1. The set of strings that start and end with the same symbols 01. Σ = {0,1,2}
    2. The set of strings that contain both substrings ‘101’ and ‘000’. Σ = {0,1}
    3. The set of strings having 0 at every 3rd position from the beginning. Σ = {0,1}. For example- 000, 010, 0100100, 110110, etc.
    4. The set of strings that do not contain substring ‘10’. Σ = {0,1}
    5. The set of strings that do not end with ‘01’. Σ = {0,1}

 

  •  Following is an example of different ways one can declare variables in some programming language.
    Write down the regular expression that can generate such variable declarations.
    Assume that-

 

    1. All variable names are at most five (previously written as exactly five; both will be considered correct) characters long.
    2. Variable names can contain only small letters [a-z], digits [0-9], and two special characters $ (dollar) and _ (underscore). 
    3. $ sign can only be used at the beginning. 
    4. No names can start with digits.
    5. The variable types are integer, real, char, and Boolean only.
    6. The word ‘var’ which denotes variable is optional.
    7. Ignore any whitespace (space, tab, newline, etc.)
    8. Infer the rest of the rules from the code snippets below-
      var int1 : integer;
      var foo_1 : boolean;
      var f2 : real;
      _ind: char;
      x, y, z: integer;
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Problems on Dynamic Programming
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education