Skip to main content

TA ASSIGNMENT 2 PART 1

Theory of Automata

Assignment #2

Part #1

Regular Expression # 1

The set of strings over {A..Z,a..z} that contain the word "main".
Let <letter> = A | B | ... | Z | a | b | ... | z <letter>* main <letter>*

Regular Expression # 2

The set of strings over {A..Z,a..z} that contain 3 x's.
<letter>* x <letter>* x <letter>* x <letter>*

Regular Expression # 3

The set of strings over {a,b} that even number of a's and odd number of b's.
((a+b)(a+b))*b+(b)((a+b)(a+b))*

Regular Expression # 4

The set of strings over {a,b} that contain no combination of ba
a*b*

Regular Expression # 5

The set of strings over {a,b} that contain consecutive two ab
(a+b)*abab(a+b)* 




Comments

Popular posts from this blog

Theory of Automata Assignment #2 Part #2 Regular Expression # 6 The set of strings over {a,b} that contain at least two a's or exactly two b's. (a+b)*(a)(b*)a(a+b)*+a*b(a*)b(a*) Regular Expression # 7 The set of strings over {a,b} that contain even length but not multiple of 3 (aa*)(aaa^) Regular Expression # 8 The language over {a,b}contains exactly one double letter.   (ε + b)(ab) ∗aa(ba) ∗(ε + b) + (ε + a)(ba) ∗ bb(ab) ∗(ε + a)

Data Types in C++

Hello azumavenger welcome to my blog. Today we are going to talk about the data types. Data Types in C++ Actually the data type tells the compiler or the interpreter that in which mean the programmer intends to use the data. That sounds confusing right? Well their is nothing to be confused of, most of the people use the word data type and they know what it is but they can't explain it in simple words.  Lets have an example. A student Kutbud'deen wrote the following code #include <iostream> using   namespace  std; void  main() {   int  var1 = 0; //integer    char  var2 =  '0' ; //character   if  (var1 == 0){ cout <<  "var1" ; }   else   if  (var2 == 0){ cout <<  "var2" ; }   else  { cout <<  "no one" ; }   system( "pause" ); } The...

TA ASSIGNMENT 1 PART 3

Theory of Automata Assignment #1 Part #3 Recursive Definition #11: Language of Expressions having at least one operator defined on  Σ ={+,-,*,/,a,b}  Step 1#- a+b ,a*b,a/b and a-b are in L Step 2#- If x is in L then x+x,x-x,x*x,x/x is also in L Step 3#- No words except generated above can be considered as member of Language. Recursive Definition #12: Language of string starting and ending on different alphabet defined on  Σ ={a,b} Step 1#- ab and ba are in L Step 2#- If x is in L then axb,and bxa are also in  Σ*.   Step 3#- No words except generated above can be considered as member of Language. Recursive Definition #13: Language of even numbers Step 1#- 0 and 2 are in L Step 2#- If x is in L then x+2 and x-2 is also in L .   Step 3#- No words except generated above can be considered as member of Language. Recursive Definition #14: Language of negative integers d...