Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. Graded Problem (Page limit: 1 sheet; 2 sides) Suppose you have been shown a new programming language that allows you to express the following:

image text in transcribed

4. Graded Problem (Page limit: 1 sheet; 2 sides) Suppose you have been shown a new programming language that allows you to express the following: Any single symbol in the English alphabet set [A, B., Z is expressible. These are considered strings of length 1 . A special expression also exists that denotes the empty string. Given some two expressions that can express some two subsets S and T of strings, you can form an expression that expresses its union S U T, its concatenation S-T = {zy l z E s, y E T). Finally, if s is a subset of strings already known to be expressible, there is a particularly powerful expressionery device that allows you to express the following (possibly infinite set of strings) =te, si,s182 , . . . , s182 n , ls, where s1,82.. E S (they are not necessarily distinct, i.e., repetitions are allowed), and s182 denotes the concatenation of s1 and s2, and similarly for s,82 Now suppose we are given directed graph of n vertices, where every (directed) edge is labeled by one or more of the letters in {A, B,..., Z]. Use the idea of Dynamic Programming to show that an expression can be found in this programming language that expresses the set of all string that would lead a path from vertex 1 to vertex Tt. (Hint: First show that you can express the subset of such paths from any i to any j that does not pass through any vertex. Then consider all paths from i to j that pass through vertices among11,... ,k.) 4. Graded Problem (Page limit: 1 sheet; 2 sides) Suppose you have been shown a new programming language that allows you to express the following: Any single symbol in the English alphabet set [A, B., Z is expressible. These are considered strings of length 1 . A special expression also exists that denotes the empty string. Given some two expressions that can express some two subsets S and T of strings, you can form an expression that expresses its union S U T, its concatenation S-T = {zy l z E s, y E T). Finally, if s is a subset of strings already known to be expressible, there is a particularly powerful expressionery device that allows you to express the following (possibly infinite set of strings) =te, si,s182 , . . . , s182 n , ls, where s1,82.. E S (they are not necessarily distinct, i.e., repetitions are allowed), and s182 denotes the concatenation of s1 and s2, and similarly for s,82 Now suppose we are given directed graph of n vertices, where every (directed) edge is labeled by one or more of the letters in {A, B,..., Z]. Use the idea of Dynamic Programming to show that an expression can be found in this programming language that expresses the set of all string that would lead a path from vertex 1 to vertex Tt. (Hint: First show that you can express the subset of such paths from any i to any j that does not pass through any vertex. Then consider all paths from i to j that pass through vertices among11,... ,k.)

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

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions