Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

question 1,2 and 3 please Question 1 Give a regular expression for each of the following languages over ={0,1,2}. 1. Strings that contain the substring

question 1,2 and 3 please
image text in transcribed
Question 1 Give a regular expression for each of the following languages over ={0,1,2}. 1. Strings that contain the substring "012". A string s is a substring of a string t if s 's characters occur in t in a continuous order. For example, "00120" is valid, but "01120" is invalid. 2. Strings that contain the subsequence "012". A string s is a subsequence of a string t if s 's characters occur in t in the same order but they are not required to be continuous. For example, "00120" and "01120" are valid, but "0210" is invalid. Question 2 Draw a DFA, preferably minimal, for each of the languages in Question 1. Question 3 Give a CFG for each of the following languages over ={0,1,2}. 1. Strings that have the pattern {0n1m2kk=n+m}. 2. (extra 5 points) Decimal integers that are multiples of 3 . Hint: a decimal integer is a multiple of 3 if the sum of the digit values is a multiple of 3 . Question 4 Consider the following grammar. EE or T I T TT and NF I NF NFnotNF I F F(E)tf (a) Construct a parse tree for the sentence: not(tandnotf)ort (b) Transform the grammar into one that contains no left-recursive productions and is suitable for top-down parsing

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions