Automata Theory
Construct a regular expression for the set of bit strings in which every odd bit is 1.
For example, these are in the language:
10 (OK: 1 in position 1)
111 (OK: 1 in positions 1 and 3)
10101 (OK: 1 in positions 1, 3, and 5)
101111 (OK: 1 in positions 1, 3, and 5)
ϵ (OK: There are no odd positions)
And these are not in the language:
0111 (BAD: position 1 is not a 1)
110 (BAD: position 3 is not a 1)
011001 (BAD: position 1 is not a 1 (nor is position 5))
Regular Expression: (1(0+1))*
Explanation
Odd bit is 1
Even bit can be any of 0 and 1: (0+1)
Any number of occurrences of above can come. So, * is used
Automata Theory Construct a regular expression for the set of bit strings in which every odd...
Theory of computation.
Please show all work.
Construct a TG for the language of all strings where characters in odd numbered positions (i.e., the 1^st, 3^rd, 5^th, etc. characters) must be the letter "a". convert your TG from problem 3 into a regular expression (show the steps that you take).
1. Use a Regular Expression to define the set of all bit strings
of one or more 0's followed by only a 1.
2. Use a Regular Expression to define the set of all bit string
of two or more symbols followed by three or more 0's.
3. Are these two grammars the same?
a. S-> aSb|ab|λ
b. S-> aAb|ab A->aAb|λ
4. Use the process of elimination to find the language of the
following FA: (see picture for diagram)
5....
Construct a regular expression that recognizes the following language of strings over the alphabet {0 1}: The language consisting of the set of all bit strings that contain two or three symbols.
Automata Theory Give a context-free grammar producing the following language over Σ = {0, 1}: {w : every odd position of w is 1 and w = wR} (HINT: All strings in the language will be of odd length).
Basic compiler question: Construct a regular expression for the regular language representing the set of strings where the number of b’s is a multiple of 3 and there can be any number of a’s. The alphabet is {a,b}
Construct a regular expression that recognizes the following language of strings over the alphabet {0 1}: The language consisting of the set of all bit strings that start with 00 or end with 101 (or both). Syntax The union is expressed as R|R, star as R*, plus as R+, concatenation as RR. Epsilon is not supported but you can write R? for the regex (R|epsilon).
Automata Theory - Finding a regular expression for each of the following languages over {a,b} or {0,1}: I've written the solution . Please show steps on how to approach the problems that I mentioned in parentheses. The ones where I put my own regular expression check and see if it's still right. Thanks Strings with .... odd # of a's ---> (b*ab*ab*)b*ab* even # of 1's ---> 0*(10*10*)* ---> my answer was 0*10*10* (is this still right?) start & end...
1. Write regular expressions to capture the following regular languages: (a) The set of binary strings which have a 1 in every even position. (Note: odd positions may be either 0 or 1.) (b) The set of binary strings that do not contain 011 as a substring. (c) Comments in Pascal. These are delimited by (* and *) or by { and }, and can contain anything in between; they are NOT allowed to nest, however. 2. Write a DFA...
Write down the regular expressions for the following set of strings over {a, b}: 1.Strings that contain no more than one occurrence of the string aa. 2.All strings containing aba: 3.All strings of odd length 4.A string in this language must have at least two a's. 5.All strings that begin with a, and have an even number of b Bonus - All strings with “a” at every odd position
****** Theory of Computing ********* 1. Provide a regular expression for “all even length strings of b’s”. 2. List all words of length 4 in Language((a+b)* a). Also, provide an English description of this language.