RegExp of strings Contains at least three 1s 

RegExp of strings Contains at least three 1s or three 0sRegExp of strings Contains at least three 1s

Regular expression : (0+1)*111(0+1)*

Acceptable strings(part of the lagnuage)

These strings must be accepted by our Regular expression.

  • 3 strings of length 1 ={ no string of length 1}
  • 3 strings of length 2 ={no  strings}
  • 3 strings of length 3 ={111,  no more strings}
  • 3 strings of length 4 ={1111 ,0111 ,1110 , no more strings}
  • 3 strings of length 7 ={0101111 , 1110101 , 1111010 , and many more possible strings}
  • 3 strings of length 10 ={1010111101 , 0110101111 , 0011001110 , …. and many more possible strings }
  • 3 strings of length 15 ={110001100111010 , 000011101101010 , 101001111010011 , …. and many more possible strings }
  • 3 strings of length 20 ={ 11111000110111001100 , 01010101010111101111 , 00110011010111010011 , …. and many more possible strings }
  • 3 strings of length 25 = {0111111111111111111111111 , 1111011101111110000111011 , …. and many more possible strings }
  • Many more similar strings.

Rejectable strings(not part of the lagnuage)

These strings must be rejected by our Regular expression.

  • 3 strings of length 1 ={0,1 , no more strings }
  • 3 strings of length 2 ={01 ,10 , 11 , ….. and many more possible strings }
  • 3 strings of length 3 ={101 , 010 , 001, and many more possible strings }
  • 3 strings of length 4 ={1100 , 0101 , 1001, ….. and many  more possible strings }
  • 3 strings of length 7 ={1100000 , 1010000 , 0000011, ….. and many more possible strings}
  • 3 strings of length 10 ={0011000000 ,1000000010 ,0000000011, ….. and many more strings }
  • 3 strings of length 15 ={000000000000110,001010000000000,100000000000000, and many more possible strings }
  • 3 strings of length 20 = {10000010000000000000 , 00000000000000000010,11000000000000000000, ….and many more possible strings }
  • 3 strings of length 25 = { 1000001000000000000000000,1100000000000000000000000,1000000001000000000000000, …. And many more possible strings }
  • Many more similar strings.

 

RegExp of strings Contains at least three 1s or three 0’s

Regular expression : (0+1)*111(0+1)* +  (0+1)*000(0+1)*


RegExp of strings Contains at least three bs

Regular expression : (a+b)*bbb(a+b)*

Acceptable strings(part of the lagnuage)

These strings must be accepted by our Regular expression.

  • 3 strings of length 1 ={ no string of length b}
  • 3 strings of length 2 ={no  strings}
  • 3 strings of length 3 ={bbb,  no more strings}
  • 3 strings of length 4 ={bbbb ,abbb ,bbba , no more strings}
  • 3 strings of length 7 ={ababbbb , bbbabab , bbbbaba , and many more possible strings}
  • 3 strings of length 10 ={bababbbbab , abbababbbb , aabbaabbba , …. and many more possible strings }
  • 3 strings of length 15 ={bbaaabbaabbbaba , aaaabbbabbababa , babaabbbbabaabb , …. and many more possible strings }
  • 3 strings of length 20 ={ bbbbbaaabbabbbaabbaa , ababababababbbbabbbb , aabbaabbababbbabaabb , …. and many more possible strings }
  • 3 strings of length 25 = {abbbbbbbbbbbbbbbbbbbbbbbb , bbbbabbbabbbbbbaaaabbbabb , …. and many more possible strings }
  • Many more similar strings.

Rejectable strings(not part of the lagnuage)

These strings must be rejected by our Regular expression.

  • 3 strings of length 1 ={a,b , no more strings }
  • 3 strings of length 2 ={ab ,ba , bb , ….. and many more possible strings }
  • 3 strings of length 3 ={bab , aba , aab, and many more possible strings }
  • 3 strings of length 4 ={bbaa , abab , baab, ….. and many  more possible strings }
  • 3 strings of length 7 ={bbaaaaa , babaaaa , aaaaabb, ….. and many more possible strings}
  • 3 strings of length 10 ={aabbaaaaaa ,baaaaaaaba ,aaaaaaaabb, ….. and many more strings }
  • 3 strings of length 15 ={aaaaaaaaaaaabba,aababaaaaaaaaaa,baaaaaaaaaaaaaa, and many more possible strings }
  • 3 strings of length 20 = {baaaaabaaaaaaaaaaaaa , aaaaaaaaaaaaaaaaaaba,bbaaaaaaaaaaaaaaaaaa, ….and many more possible strings }
  • 3 strings of length 25 = { baaaaabaaaaaaaaaaaaaaaaaa,bbaaaaaaaaaaaaaaaaaaaaaaa,baaaaaaaabaaaaaaaaaaaaaaa, …. And many more possible strings }
  • Many more similar strings.

 

RegExp of strings Contains at least three b’s or three a’s

Regular expression : (a+b)*bbb(a+b)* + (a+b)*aaa(a+b)*

Latest posts by Prof. Fazal Rehman Shamil (see all)

Buy advertisement space on T4Tutorials

For more details email [email protected]