Given two regular expressions r1 and r2, construct a decision procedure to determine whether the language of r1 is contained in the language r2; that is, the language of r1 is a subset of the language of r2.

Answers

Answer 1

Answer:

Test if L(M1-2) is empty.

Construct FA M2-1 from M1 and M2 which recognizes the language L(>M2) - L(>M1).

COMMENT: note we use the algorithm that is instrumental in proving that regular languages are closed with respect to the set difference operator.

Test if L(M2-1) is empty.

Answer yes if and only if both answers were yes.

Explanation:

An algorithm must be guaranteed to halt after a finite number of steps.

Each step of the algorithm must be well specified (deterministic rather than non-deterministic).

Three basic problems:

Given an FA M and an input x, does M accept x?

Is x in L(M)

Given an FA M, is there a string that it accepts?

Is L(M) the empty set?

Given an FA M, is L(M) finite?

Algorithm for determining if M accepts x.

Simply execute M on x.

Output yes if we end up at an accepting state.

This algorithm clearly halts after a finite number of steps, and it is well specified.

This algorithm is also clearly correct.

Testing if L(M) is empty.

Incorrect "Algorithm"

Simulate M on all strings x.

Output yes if and only if all strings are rejected.

The "algorithm" is well specified, and it is also clearly correct.

However, this is not an algorithm because there are an infinite number of strings to simulate M on, and thus it is not guaranteed to halt in a finite amount of time.

COMMENT: Note we use the algorithm for the first problem as a subroutine; you must think in this fashion to solve the problems we will ask.

Correct Algorithm

Simulate M on all strings of length between 0 and n-1 where M has n states.

Output no if and only if all strings are rejected.

Otherwise output yes.

This algorithm clearly halts after a finite number of steps, and it is well specified.

The correctness of the algorithm follows from the fact that if M accepts any strings, it must accept one of length at most n-1.

Suppose this is not true; that is, L(M) is not empty but the shortest string accepted by M has a length of at least n.

Let x be the shortest string accepted by M where |x| > n-1.

Using the Pumping Lemma, we know that there must be a "loop" in x which can be pumped 0 times to create a shorter string in L.

This is a contradiction and the result follows.

COMMENT: There are more efficient algorithms, but we won't get into that.

Testing if L(M) is finite

Incorrect "Algorithm"

Simulate M on all strings x.

Output yes if and only if there are a finite number of yes answers.

This "algorithm" is well specified and correct.

However, this is not an algorithm because there are an infinite number of strings to simulate M on, and thus it is not guaranteed to halt in a finite amount of time.

COMMENT: Note we again use the algorithm for the first problem as a subroutine.

Correct Algorithm

Simulate M on all strings of length between n and 2n-1 where M has n states.

Output yes if and only if no string is accepted.

Otherwise output no.

This algorithm clearly halts after a finite number of steps, and it is well specified.

The correctness of the algorithm follows from the fact that if M accepts an infinite number of strings, it must accept one of length between n and 2n-1.

This builds on the idea that if M accepts an infinite number of strings, there must be a "loop" that can be pumped.

This loop must have length at most n.

When we pump it 0 times, we have a string of length less than n.

When we pump it once, we increase the length of the string by at most n so we cannot exceed 2n-1. The problem is we might not exceed n-1 yet.

The key is we can keep pumping it and at some point, its length must exceed n-1, and in the step it does, it cannot jump past 2n-1 since the size of the loop is at most n.

 This proof is not totally correct, but it captures the key idea.

COMMENT: There again are more efficient algorithms, but we won't get into that.

   Other problems we can solve using these basic algorithms (and other algorithms we've seen earlier this chapter) as subroutines.

       COMMENT: many of these algorithms depend on your understanding of basic set operations such as set complement, set difference, set union, etc.

Given a regular expression r, is Lr finite?

Convert r to an equivalent FA M.

COMMENT: note we use the two algorithms for converting a regular expression to an NFA and then an NFA to an FA.

Test if L(M) is finite.

Output the answer to the above test.

Given two FAs M1 and M2, is L(M1) = L(M2)?

Construct FA M1-2 from M1 and M2 which recognizes the language L(>M1) - L(>M2).

COMMENT: note we use the algorithm that is instrumental in proving that regular languages are closed with respect to the set difference operator.

Test if L(M1-2) is empty.

Construct FA M2-1 from M1 and M2 which recognizes the language L(>M2) - L(>M1).

COMMENT: note we use the algorithm that is instrumental in proving that regular languages are closed with respect to the set difference operator.

Test if L(M2-1) is empty.

Answer yes if and only if both answers were yes.


Related Questions

Which of the following CALL instructions writes the contents of EAX to standard output as a signed decimal integer?
a. call WriteInteger
b. call WriteDec
c. call WriteHex
d. call WriteInt

Answers

Answer:

d. call WriteInt

Explanation:

Required

Instruction to write to decimal integer

Of the 4 instructions, the call WriteInt instruction is used write to a decimal integer.

This is so, because the WriteInt instruction writes a signed decimal integer to standard output.

This implies that the output will have a sign (positive or negative) and the output will start from a digit other than 0 (i.e. no leading zero)

Ten examples of an interpreter

Answers

Answer:

Some popular examples of today's interpreters are:

Interpreter of PythonInterpreter for RubyPerl performerInterpreter for PHPMATLAB UCSD Pascal

Explanation:

An interpreter executes the commands directly in an object code or a machine code, written in a program or a scripting language.

The Interpreter can be referred to as system software that can read and execute the programme instead of interpreting programmes. This interpretation includes high-level source code, pre-compiled programmes and scripts.

It is important to note that the interpreter translates programme by programme line, meaning that one statement is translated on one go. This feature makes it easy for programmers to check any line on debugging but slows the whole programme running time.

How are dates and times stored by Excel?​

Answers

Answer:

Regardless of how you have formatted a cell to display a date or time, Excel always internally stores dates And times the same way. Excel stores dates and times as a number representing the number of days since 1900-Jan-0, plus a fractional portion of a 24 hour day: ddddd. tttttt

Explanation:

mark me as BRAINLIEST

follow me

carry on learning

100 %sure

Dates are stored as numbers in Excel and count the number of days since January 0, 1900. Times are handled internally as numbers between 0 and 1. To clearly see this, change the number format of cell A1, B1 and C1 to General. Note: apparently, 42544 days after January 0, 1900 is the same as June 23, 2016

The _________ attack exploits the common use of a modular exponentiation algorithm in RSA encryption and decryption, but can be adapted to work with any implementation that does not run in fixed time.
A. mathematical.
B. timing.
C. chosen ciphertext.
D. brute-force.

Answers

Answer:

chosen ciphertext

Explanation:

Chosen ciphertext attack is a scenario in which the attacker has the ability to choose ciphertexts C i and to view their corresponding decryptions – plaintexts P i . It is essentially the same scenario as a chosen plaintext attack but applied to a decryption function, instead of the encryption function.

Cyber attack usually associated with obtaining decryption keys that do not run in fixed time is called the chosen ciphertext attack.

Theae kind of attack is usually performed through gathering of decryption codes or key which are associated to certain cipher texts

The attacker would then use the gathered patterns and information to obtain the decryption key to the selected or chosen ciphertext.

Hence, chosen ciphertext attempts the use of modular exponentiation.

Learn more : https://brainly.com/question/14826269

computer is an ............. machine because once a task is intitated computer proceeds on its own t ill its completion.​

Answers

Answer:

I think digital,versatile

computer is an electronic digital versatile machine because once a task is initiated computer proceeds on its own till its completation.

Other Questions
find the equation of the line passing through points A(3,4) and B(1,10) Thang decided to borrow $90 from his local bank to help pay for a car. His loan was for 3 years at a simple interest rate of 40%. How much interest will Thang pay? The character Peyton Farquhar in Ambrose Bierce's "An Occurrence at Owl Creek Bridge" possesses characteristics most closely related to which literary movements? (Choose two). NextUnit Pre TestSubmit Test20Type the correct answer in each box. Use numerals instead of words. If necessary, use / for the fraction bar(s)The equation of a line is 2[v+ 1) = 10x* 3.The yuntercept of the line isand the slope of the line is !!!10 POINTS I KNOW IT IS NOT ENOUGH BUT PLEASE ANSWER! AND IF YOU CAN SHOW AT LEAST A LITTLE WORK THAT WOULD BE GREAT I NEED TO SHOW WORK!!! Jason combines the two intermediate steps shown. 2 equations. First: upper N subscript 2 (g) plus upper O subscript 2 (g) right arrow 2 upper N upper O (g). Second: 2 upper N upper O (g) plus upper O subscript 2 (g) right arrow 2 upper N upper O subscript 2 (g). Which best describes what Jason should do with the oxygen molecules? What is the cube root of -1,000p12q3?O-1004O - 10ptaO 1004O 10pta Which of the following items requires an internalcooking temperature of 165 F?a. Pork chopsb. Injected meats c. Raw Eggsd. poultry Neglecting air resistance and the weight of the propellant, determine the work done in propelling a five-ton satellite to a height of (a) 100 miles above Earth and (b) 300 miles above Earth. What does a low number on the pH scale say about a solution?A. The solution is neutral.B. The solution is a base.C. The solution is changing.D. The solution is an acid. If 12 girls can sweep a room in 20hours, how many hours will it take 8 girls to perform the same task, assuming they are sweeping at the same rate? Software and technology that allow people to work together on a task are known as How do enzymes function in biological reactions? Observe los datos de la siguiente tabla y resuelva. x -2 -1 0 1 2 3 y 1 3 5 7 9 11 Based on the Pythagorean theorem , find the missing length for each of the given right triangles Which of the following numbers is to the left of 5 2/3 A. 5 5/6B. 5 3/4C.5 7/12D.5 11/12 The senior classes at High School A and High School B planned separate trips to Yellowstone National Park. The senior class at High School A rented and filled 9 vans and 14 buses with 710 students. High School B rented and filled 13 vans and 5 buses with 371 students. Each van and each bus carried the same number of students. Find the number of students in each van and in each bus. Which ratio is not equivalent to 3:6?a. 1:2b. 4:10c. 10:20d. 15:30 Lydiagrace33Image attachedA) 1 point Write an inequality for this graph . Use the shift key and the key or key to type the < or > symbol . *B) Water boils when the temperature is at least 212 degrees F. Which inequality shows this situation ?C) When the temperature drops below 50 degrees F , crickets usually stop chirping . Which inequality shows this situation ? D) Explain the difference between the meaning of a closed circle and an open circle on a graph of an inequality . Which is the correct way to say "Luisa sees the tree."?Luisa ve al rbol.Luisa ve el rbol.Luisa ve a rbol.Luisa ve rbol.