Given any strings u and x (with u notequalto element), define #u(x) to be the nu
ID: 3825363 • Letter: G
Question
Given any strings u and x (with u notequalto element), define #u(x) to be the number of times u occurs as a substring of x. For example, if u = 010 and x = 01010 then #u(x) = 2 because two occurrences are counted even though they overlap. Using the Myhill-Nerode technique (not the Pumping Lemma), prove that two the following languages are not regular-and give a regular expression for the one that is regular. L_1 = {x element {0, 1}*: #00 (x) > #11 (x)}. L_2 = {x element {0, 1}*: #01 (x) > #10(x)}. L_3 = {x0y: #0 (x) = #1(y)}.Explanation / Answer
#include #include char str[100], sub[100]; int count = 0, count1 = 0; void main() { int i, j, l, l1, l2; printf(" Enter a string : "); scanf("%[^ ]s", str); l1 = strlen(str); printf(" Enter a substring : "); scanf(" %[^ ]s", sub); l2 = strlen(sub); for (i = 0; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.