Which of the following must be finite and which may be infinite?

Solution:
(a)
The language generated by a regular grammar may be infinite.
Explanation: Regular grammar can generate finite language as well as infinite also so in some cases it can also generate infinite language so the answer will be that the language generated by a regular grammar may be infinite.
For example (a+b)* is a regular expression and the
language L ={
,a,b,aa,bb,ab,ba........}
so this language is infinite.
(b)
The set of nonterminals in regular grammar is always finite.
Explanation: When we define some regular grammar then we have some set of terminals, nonterminals and set of productions.
Nonterminals are the generating symbols that are generally written on the left side of productions.
Example: A -> a/b (production rule) here A is nonterminal and {a,b} are set of terminals .
(c)
The number of regular grammars that generates a given set of strings may be infinite.
Explanation: There may be an infinite number of regular grammar that can produce the same set of strings and the structure of regular grammar can be different.
(d)
The length of a derivation based on a regular grammar may be infinite.
Explanation: When we are generating an infinite length string from the set of productions for the given grammar in that case when we try to produce the string through derivation then the length of derivation may be infinite.
(e)
The number of terminal symbols in regular grammars are always finite.
Explanation: When we define some regular grammar then we have some set of terminals, nonterminals and set of productions.
terminals are always written on the right side of productions.
Example: A -> a/b (production) here A is nonterminal and {a,b} are set of terminals so basically number of terminals are always finite for the given grammars.
(f)
The number of productions in regular grammar is always finite.
Explanation: When we define some regular grammar then we have some set of terminals, nonterminals, set of productions.
A production contains a set of terminals and nonterminals.
A -> Aa/b (Production rule) so in any regular grammar number of productions are always finite.
(g)
The length of string generated by a regular grammar may be infinite.
Explanation: Regular grammar can generate finite-length strings as well as infinite length string.
For example (a+b)* is a regular expression and the
language L ={
,a,b,aa,bb,ab,ba........}
there will be many strings of infinite lengths.
Which of the following must be finite and which may be infinite? 2. Which of the...
Automata: solve a - e
2. (10+10+10+10+10-50 points) Agrammar is a 4-tuple G, G-ON,E,11,L$) where N is a finite set of nonterminal symbols Σ is a finite set of terminal symbols is a finite set of rules S is the starting symbol Let N- (S, T s-{a, b, c} s-> ab aT >aaTb aT-ac S is the starting symbol. (a 10 points) Prove that the given grammar G is a context sensitive grammar. (b-10 points) What is the language L-...
A grammar is a 4-tuple G, G = (Ν, Σ, Π, Σ, S) where, Ν is a finite set of nonterminal symbols, Σ is a finite set of terminal symbols, Π is a finite set of rules,S is the starting symbol. Let, Ν = {S, T} Σ = {a, b, c} Π = { S -> aTb S -> ab aT -> aaTb aT -> ac } S is the starting symbol. A) Prove that the given grammar G is...
1. Consider the alphabet {a,b,c}. Construct a finite automaton that accepts the language described by the following regular expression. 6* (ab U bc)(aa)* ccb* Which of the following strings are in the language: bccc, babbcaacc, cbcaaaaccbb, and bbbbaaaaccccbbb (Give reasons for why the string are or are not in the language). 2. Let G be a context free grammar in Chomsky normal form. Let w be a string produced by that grammar with W = n 1. Prove that the...
3. For each of the following languages, . State whether the language is finite or infinite. . State whether the language is regular or nonregular. . If you claim the language is regular: give a DFA (graphical representation) that recog- nizes the language. . If you claim that the language is not regular, describe the intuition for why this is so. Consider the following languages (a) [8 marks] The language of 8 bit binary strings that begin and end with...
Use left-factoring to find an equivalent LL(k) grammar for the following grammar where k is as small as possible. Fill out the following blanks S rightarrow abA A rightarrow ab| Lambda Solution: The language generated by the given grammar is: L = _____ The given grammar is _____ By factoring ab out from S rightarrow abA | abcS, the given grammar can be converted to _____ _____ _____ (1) This grammar can also be written as _____ _____ _____ (2)...
Construct context-free grammars that generate the given set of
strings. If the grammar has more than one variable, we will ask to
write a sentence describing what sets of strings expect each
variable in the grammar to generate. For example, if the grammar
was:
I could say "C generates binary strings of length one, E
generates (non-empty) even length binary strings, and O generates
odd length binary strings." It is also fine to use a regular
expression, rather than English,...
Construct context-free grammars that generate the given set of
strings. If the grammar has more than one variable, we will ask to
write a sentence describing what sets of strings expect each
variable in the grammar to generate. For example, if the grammar
was:
I could say "C generates binary strings of length one, E
generates (non-empty) even length binary strings, and O generates
odd length binary strings." It is also fine to use a regular
expression, rather than English,...
Solve the E question..
Gr 114 D. Con vert the given grammar to an equivalent non-deterministic finite automata. 31. The grammar in Exercise 26. 32. The grammar in Exercise 28. 33. The grammar in Exercise 29. 34. The grammar in Exercise 30. E. The following grammar is not regular. Convert it to an equiva lent regular grammar. What h the language of the grammar? E. The following regular grammars are incorrect. Debug and correct them. 37. Binary numbers divisible by...
For each of the following, construct context-free grammars that generate the given set of strings. If your grammar has more than one variable, we will ask you to write a sentence describing what sets of strings you expect each variable in your grammar to generate. For example, if your grammar were: S → EO E → EE CC 0+ EC C+01 We would expect you to say “E generates (non-empty) even length binary strings; O generates odd length binary strings;...
Part A) Construct an NFA (non-deterministic finite automata) for
the following language.
Part B) Convert the NFA from the part A into a DFA
L- E a, b | 3y, z such that yz, y has an odd number of 'b' symbols, and z begins with the string 'aa') (Examples of strings in the language: x = babbaa, and x = abaabbaa. However, x-bbaababaa is not in the language.)
L- E a, b | 3y, z such that yz, y...