 . So, far we have defined alphabets strings some string operations and then we have defined formally a language, we have given some examples of language also. So, next we will discuss some properties of languages, some properties we have already discussed. For example, the usual satiric properties with respect to union, intersection, complement, difference, etcetera hold even in the context of languages, so we are interested in some other properties with respect to the newly introduced operations, concatenation, cling closure and positive closure, we find that concatenation of languages associative, we have already shown it, that means if L1, L2 and L3 are languages, then L1 concatenation, L2, L3 is equivalent to L1 concatenation L2 and concatenation L3, we have already shown it, now we know that concatenation of strings is not commutative in general, that is why concatenation of languages is also not commutative, that means for two languages L1 and L2, we cannot say that L1 concatenation L2 is equal to L2 concatenation L1, they are not identical, because in general, we know that if x and y are two strings, then x concatenation of y is not identical to y concatenation x, they are not identical and hence L1 concatenation L2 is not equivalent to L1, L2 concatenation L1, then it is very easy to see that if L is any language, then if it is concatenated with the language containing singleton epsilon from both sides, left side and right side, then it is equal to L, because every string when concatenated with epsilon from left or right give the string itself, that is if x is a string, then epsilon x equal to x epsilon is equal to x, therefore every string if L is a language, every string the language whatever it may be, so if you concatenate with epsilon from both sides, you give the string itself, therefore the language is not going to be changed, hence we get L epsilon equal to epsilon L equal to L, then if we concatenate a language with the empty set of phi from both sides L phi or phi L, it is going to give phi, so you can prove it suppose that L phi is not equal to phi, then there must be a string which will belong to L phi, therefore we can write x as x1 x2 for some strings x1 belonging to L and x2 belonging to phi, this is the definition of your concatenation, but phi being the empty set there cannot be any string that belongs to phi, so therefore our original assumption that x belongs to L phi must belong, so therefore L phi must be empty, similarly you can show that x also does not belong to there cannot be any string x belong to phi L and hence the result L phi equal to phi L equal to phi, it must be an empty set, let us see some distributive properties, for example you can show that L1 concatenation with L2 union L3 is equal to L1 L2 union L1 L3, that means concatenation distributes over union, similarly L1 union L2 concatenation L3 is equal to L1 L3 union L2 L3, let us give a proof of the second one, proof of the first one is exactly similar to the second one, suppose also what we are going to show is that L1 union L2 concatenation L3 equal to L1 L3 union L2 L3, now suppose string x belongs to L1 union L2 L3, so in short second this implies that we can write x as x1 x2 for some x1 belonging to L1 L2 L1 union L2 and some x2 belonging to L3, this implies x equal to x1 x2 for some x1 belonging to L1 or x1 belonging to L2 since x1 belongs to L1 or L2 and for some x2 belonging to L3, now this implies x equal to x1 x2 for some x1 belonging to L1 and x2 belonging to L3 or x1 belonging to L2 and x2 belonging to L3, now from this according to the definition we can say that x equal to or x belongs to L1 L1 L3 or x belongs to L2 L3, so this implies that x belongs to L1 L3 union L2 L3, so this one way is quite clear, now let us show the other part the converse part, suppose x belongs to L1 L3 union L2 L3, now this implies x belongs to, so this implies x belongs to L1 L3 or x belongs to L2 L3 that means we can write x as some x3 x4 such that x3 belongs to L1 or x3 belongs to L1 or x3 belongs to L2 and x4 belongs to L3, so according to the definition we can write it like this, therefore we can write that x belongs to since x3 belongs to L1 or x3 belongs to L2 and x4 belongs to L3, therefore we can say that x belongs to L1 union L2 and concatenation with L3, hence L1 union L2 from this two can say that L1 and L2 L3 equal to L1 L3 union L2 L3, so hence the proof, let us see some more properties, so all these properties are numbered, so there are six properties in the sequence, so if L1 is subset of L2 and L3 is subset of L4 then L1 concatenation L3 is subset of L2 L4 is easy to prove, similarly the other few results are also easy to prove say property 7 is 5 star is singleton epsilon, so cling closure of singleton epsilon is equal to singleton epsilon and if epsilon belongs to L then L star equal to L plus is a positive closure, so cling closure equal to positive closure if epsilon belongs to L, so next property is L star L equal to L L star equal to L plus, we will just provide the proof of this, we are going to give proof of L L star equal to L star L equal to L star L plus, suppose x belongs to L star L then we can write x as sum y z, we can write that x equal to y z for sum y belong to L star and z belonging to L, but since y belongs to L star this implies that this y can be written as y 1 y 2 sum y n with y i belonging to L, so this for all i we can write that y as y 1 y 2 up to y n for sum y i belong to L, so for x can be written as y z which is equal to y 1 y 2 up to y n concordation with z which is nothing but y 1 then y 2 concordation with y n and z, but this belongs to L L star according to the definition, the converse is exactly similar that means L star L equal to L L star, further when x belongs to L star L as above we have x equal to y 1 y 2 up to y 1 z is clearly in L plus, so this belongs to in L plus on the other hand x belongs to L plus implies that x equal to x 1 x 2 up to m up to x m with m greater than equal to 1, so this is the definition of positive closure and here every x i belongs to L for all i, now let us write x dash as x 1 x 2 up to say x m minus 1, so that we can write x as x dash x m, so this x we can write as x dash m, here note that x dash belongs to L star by definition particularly when m equal to 1, if m equal to 1 then x dash equal to epsilon, because whenever m equal to 1 it goes from there is no string, so it is the epsilon does x belongs to L star L, therefore L plus is equal to L star L, so this is the proof for the property, now let us see L star whole star equal to L star, so we can use similar concepts to prove this property and some other similar properties, for example L star L star equal to L star L 1 L 2 star, concurrentation with L 1 is equal to L 1, concurrentation with L 2 L 1 star, let us give a proof for this property, so we want to prove that L 1 L 2 whole star L 1 equal to L 1 L 2 L 1 whole star, first let string x belongs to L 1 L 2 star L 1, then we can write x as concurrentation of two strings y z, where y belongs to where y can be written as y 1 y 2 have to say some y n this belongs to L 1 L 2 star and z belongs to L 1, now in this case where y equal to y 1 y 2 y n which belongs to L 1 L 2 star every y i belong to L 1 L 2 is a concurrentation of a string from L 1 and another string from L 2, now each y i as you said can be written in the form u i some string from L 1 and v i some string for v 2 some string from L 2 that means u i belongs to L 1 and v i belongs to L 2, now you know that the string v i u i plus 1 belongs to L 2 L 1, so it is quite clear that u i belongs to L 1 and v i belongs to L 2, therefore v i and u i plus 1 must belong to L 2 L 1, now we can write x as y z which is equal to y 1 y 2 to y n z which is nothing but u 1 v 1 because y 1 can be written as u 1 v 1 y 2 can be written as u 2 v 2 and so on up to u n v n then z, now this can be written as u 1 since it avoids concurrentation avoids associative very law concurrent of strings so u 1 v 1 u 2 v 2 u 3 and so on up to v n so u 1 v 1 u 2 v 2 u 3 u n v n z, now v 1 u 2 v 2 u 3 is all belongs to L 2 L 1 eventually the v n z belongs to L 2 L 1 since z belongs to L 1 and v n belongs to L 2, so therefore again u 1 belongs to L 1, so therefore this belongs to L 1 concurrentation L 2 L 1 star because there is a concurrentation from string from concurrention strings from L 2 L 1, therefore we starting from x belongs to L 1 L 2 star L 1 we have found that x belongs to L 1 L 2 L 1 star similarly we can show the converse that means if x belongs to L 1 concurrentation L 2 L 1 star it will belong to L 1 L 2 star concurrentation L 1, therefore the property L 1 L 2 star concurrent with L 1 is equivalent to L 1 L 2 L 1 whole star holds good, let us see some more properties L 1 union L 2 star equal to L 1 star L 2 star whole star, this proof for this can be taken as an exercise, so far we have provided many properties, so up to 14 properties of languages similarly one can produce many other properties using the various operations, now we will see how languages can be represented using finite information that means finite representation of languages, we are mainly interested in a finite representation of a language, if a person is proficient in a particular language it does not mean that he produce all the sentences of the language, basically what we expect is that using a finite amount of information one will be able to validate or construct different strings in the language that means by giving a finite amount of information all the strings of a language shall be enumerated or validated, for example if you see the case of compiler, the compiler can validate any program which is nothing but a string from the program language using only a finitely many instructions incorporated in it, so let us have a look at the languages for which finite representation is possible, given an alphabet sigma the languages with single string x and phi can have finite representation, for example suppose for a language containing a single string x, so x is a finite representation and for the empty set, so empty set itself is a finite representation and any finite language can also be given a finite representation simply by enumerating all the strings in it, so those are the finite representations for the different languages, therefore the giving finite representation for infinite language is a non trivial problem, if the language is finite we can always enumerate the strings and which will be a finite representation for the language, so let us see how to give a finite representation for an infinite language, so in this context the operations on languages may be helpful, we will see that various operations that we have discussed so far may be used to give this kind of representation, for example using clean star operation we can have finite representation for some infinite languages, for example you consider the language say the language l which is the empty string epsilon, then suppose a b a b a b a b a b a b a b a b a b a b a b and so on, that means the repetition those strings we are conducting a b with a b finitely many times, now we can find this language or this language can be constructed as a clean closure of the language say a b, that means we consider language a b and take the clean closure of it, we get this language l, suppose this l 1 we say that we see that l 1 star is exactly l, that means this infinite languages can be represented as a clean closure of this language l 1, now if we have this if we represent this language as simply a b then clean closure of this is nothing but the language l, so that is how we represent infinite language using finite information, now to give finite representation for languages one way first look at the individual languages, namely the phi singleton epsilon and a because we cannot divide those languages further these are the basis elements, the singleton a for every a belong to sigma, these are all basis elements suppose one to construct the language containing the singleton x for some string x belong to sigma star, we can use the operation concatenation over the basis elements, just take the example suppose you have x equal to a b a that means the language a b a containing the string only a b a, so this is the language l, so what we can do is that we can consider the language containing singleton a is a basis element, then singleton b then we concatenate this to language a and b, we get a language containing only the only string a b then again concatenate with a, so this will give the language containing the single string a b a, so therefore this language can be constructed by taking concatenation of three languages which are the basis elements, any finite language over sigma say x 1, x 2 up to x n over x its x i is a string over sigma star can be obtained by considering the union of this singleton elements x 1 union x 2 and so on that means we can consider the operations cling closure concatenation and union to apply on the basis elements to construct any kind of languages, now we look at the aspects of considering operations over basis elements to represent a language, this is one of the aspects but there are many other aspects to give final representation, we will consider those aspects later on, now the class of languages that we get by applying union concatenation and cling closure for finitely many times on the basis elements is known as a regular languages, the corresponding final representation are known as regular expressions, now let us define regular expressions over an alphabet sigma recursively as follows, we consider phi epsilon and a for every a beyond the sigma to be regular expressions, representing the languages phi the singleton epsilon and a respectively that means if we have phi we say that is a regular expression and this represents a language phi, if we have a regular expression sigma epsilon then this represents the language contain the singleton epsilon and for every element a belonging to sigma for any element I belong to sigma a is a regular expression and it denotes or represents the language containing a single string of length 1 which is a itself. So, this is the basis case for the definition of a regular expressions, now if r and s are regular expressions representing the languages capital R and capital S respectively then so are the following r plus s representing the language r union s then r concatenation s or simply r s represent a language r concatenation s and r star represent the language capital r star, in a regular expression we keep a minimum number of parenthesis which are required to avoid ambiguity in expressions. For example, if r plus s t is a regular expression then actually this represents the language r union s concatenation or r union s concatenation t. So, in this case we have some precedence rule normally clean closure has more precedence highest precedence then we have the precedence for concatenation and then for union. Therefore, in this case so this language can be even by the regular expression r plus s t because in this case the concatenation has highest precedence and then we have precedence for union and if r is a regular expression then the language represent by r is noted by l r. So, if 5 is a regular expression then we write that l phi the language represent by phi is phi similarly epsilon is a regular expression l of epsilon is the singleton epsilon similarly l of a is a itself. Similarly, if r is a regular expression the corresponding regular expression l r may be some set capital r and so on and language l is said to be regular if there is a regular expression r such that l equal to l r because we get the regular expression by applying finitely many operations from union concatenation and clean closure over the basis elements and that is how we define a regular language. So, a regular language over an alphabet sigma is the one that can be obtained from the empty set singleton epsilon and a for singleton a for every a within the sigma by finitely many applications of union concatenation and clean closure. And the smallest class of languages over an alphabet sigma which contains phi singleton epsilon singleton a and is closed with substitute union concatenation and clean closure is a class of all regular languages over sigma so this can be seen from the definition. Now, let us give some examples of regular expressions and how can we construct regular expressions. So, already we have seen that the language phi singleton epsilon and singleton a for every a within the sigma they are all finite chance and are regular consider a to the n for n can be equal to 0. So, this set this set is regular as it can be represent by the regular expression a star because so a star basically it represents applying a clean closure to the language a. So, if we apply this clean closure to this a the language contain a singleton a then we get epsilon a a a a a and so on. So, this is nothing but a to the n n greater than or equal to 0 when equal to 0 it will get epsilon when n equal to 1 we get a when n equal to we get to a a and so on. So, therefore, a to the n can be represent by using a star and hence this set is a regular set. Similarly, sigma star the set of all strings over an alphabet sigma is regular for instance if sigma is the set containing a 1 a 2 a n and sigma is written as a 1 plus a 2 plus a 3 plus a n whole star. For example, if sigma equal to say a b then sigma star equal to a or b whole star. So, you can represent like this therefore, sigma star is a regular set let us consider the language the set of all strings over a b which contain a b as sub string. I can show that this set is a regular set for instance we can write this set as all the strings x 1 to a b star such that a b is a sub string of x and then this can written as y a b z for some y z belonging to sigma star say here y and z may be any string from a b. So, any string from a b can written as a b whole star and this also a b whole star. So, we can write this as a concatenation of three languages is a b a b star and a b star. Now, this can represent as a plus b whole star a b a plus b star. So, this is a regular expression for the given for the given language and hence this set is regular. Let us consider language over 0 1 that contains 0 1 or 1 0 as sub string. This can also be shown to be regular because you can write it as the set of all string x such that 0 1 is sub string of x union all string over x so that 1 0 is sub string of x. Now, this can written as some y 0 1 z for some y z belonging to sigma star union u 1 0 v for some u v belonging to sigma star is nothing but sigma star 0 1 sigma star because y z may be anything from sigma star union sigma star 1 0 sigma star because u v may be anything from sigma star. Therefore, this is a regularization because sigma star 0 1 and 1 0 are regular and we have expressed this language L using operations concatenation cling closure concatenation and union over the regular sets sigma star 0 1 and 1 0. Therefore, this L must be a regular set. So, in fact we can write it as 0 plus 1 star with sigma star 0 1 0 plus 1 star plus which means union 0 plus 1 star 1 0 0 plus 1 star. So, this is a regular expression representing the given language L. Similarly, the set of all strings over a b which do not contain a b as a sub string one can easily see that this can be written as b to the m a to the m for some m n greater than equal to 0 because a b cannot occur as a sub string. Therefore, if any b occurs it must precede any occurrence of b's. Therefore, this can be written as a regular expression which is nothing which is b star a star. Therefore, this language the set of all strings over a b which do not contain a b as a sub string can be written by the regular expression b star a star and hence this is a regular language. Similarly, we can construct regular expressions for many other languages. For example, let us consider the alphabet 0 1 a set of all strings over this alphabet where number of say 1's is at least 2. That means there are at least 2 occurrence of 1 in every string in the language. Let us define a language like this the set of all strings containing over 0 1 where the numbers of 1's is at least 1. So, since at least 2 so since 1 must occur at least 2 times but before that there may be any string over 0 1 depending by x before the first occurrence of 1 1 after that also there may be any string over 0 1 which is written as y then the second 1 and after the second 1 again we have string over 0 1 which contain any numbers of 0's and 1's. So, therefore, a typical string in the language can be written by x 1 y 1 z and here x y z may be any string over 0 1. Therefore, the corresponding regular expression will be 0 plus 1 star which is basically x then 1 again 0 plus 1 star again 1 this 0 plus 1 star represents this y and finally, for just again 0 plus 1 star. So, this 1 and this 1 represents that at least 2 times will be there in any string and other than this 2 there may be any strings over 0 1 in any other places. So, this is a regular expression for the given language L. Similarly, if we define a language over the same alphabet suppose set of all strings over 0 1 having at most 2 occurrences of 1. So, this one was for at least 2 occurrences of 1's at least 2 occurrences, but now the for the language where we have say at most 2 occurrences of 1's in such a case there can be at most 2 occurrences of 1's. So, therefore, before this 1 there may be any string of over 0's and 1's also sorry any string of 0's, but there cannot be any 1 after this again we may have any strings of 0's and then we can have it is again 1 more 1 and after that also we can have any occurrence of 0's string of 0's. So, there will be 2 occurrences of 1's this is the string for exactly 2 occurrences of 1's the set of all strings over 0 1 which have exactly 2 occurrences of 1's. So, if you should have at most 2 occurrences of 1's then we should incorporate the case where the strings of the form where there is at least at most 1 1 0 star 0 star and only strings of 0's. So, this will cover the case where there is no 1's this regular expression cover the case where there is only 1 1 and this will cover the case where there is at most 2 1's. So, this may the union of all these 3 hence since we can express it using this regular expression therefore, the language is a regular one. Now, just consider the language the set of all strings of over a b which contain odd number of a's. Now, it is easy to see that it can be represented as a regular form x belonging to a b star such that number of occurrence of a's in x is equal to twice and plus 1 for some n, but writing a regular expression for this language is little bit tricky. So, we will postpone it to a letter point where we construct a regular grammar for the language. So, regular grammar is another representation finite parenthesis for a language. So, even though it is tricky to write a regular expression it is very easy to write a regular grammar or construct a regular grammar for a given language. So, regular grammar is a tool to generate exactly the class of regular languages. Then again consider the set of all strings over a b which contain odd number of a's and even number of b's. Again, we can write this set in set below form as x belonging to a b star such that number of a's in x equal to twice and plus 1 then odd for some n and number of b's in x equal to twice m for some m. Writing a regular expression for this languages more trickier than the previous example and we can use some other tool like say finite automata to construct this kind of or to accept this kind of languages. This again finalize yet again under tool to represent regular languages. Now, let us see the equivalence of regular expressions. We say that two regular expressions r 1 and r 2 as equivalent if they represent the same language and we denote it like r 1 equivalent to r 2. We use this symbol to represent the equivalence of two regular expressions. So, this means that l of r 1 is equal to l of r 2. Let us consider the regular expressions 1 0 plus 1 whole star and 1 0 star 1 star star. We can show that these two regular expressions are equivalent from property 14 that we have already discussed regarding a property of languages is nothing but l 1 union l 2 star equal to l 1 star l 2 star whole star. So, it is a property 14 that we have already discussed for languages. So, if you consider property 14 then assuming l 1 to be 1 0 and l 2 to be 1 we get exactly 1 0 union 1 whole star to be equal to 1 0 star 1 star whole star. Now, since 1 0 and 1 represent the regular languages 1 0 singleton 1 0 and singleton 1 respectively from the above equation we get that 1 0 plus 1 whole star is exactly equivalent to 1 0 star 1 star whole star. So, we can use the properties of languages to show that the corresponding regular expressions are equivalent. That means these properties holds good for all languages since those properties hold good for all languages by specializing those properties to regular languages and in turn replacing by the corresponding regular expressions we get the following identities for regular expressions r epsilon is equivalent to epsilon r is equivalent to r. That means we have considered the property l 1 concatenation with epsilon is equivalent to or equal to epsilon concatenation with l 1 which is exactly l 1. So, if l 1 suppose r is a regulation for l 1 and epsilon is a regulation for the singleton epsilon this is equivalent to singleton epsilon and the corresponding regulation for l 1 is r this is equivalent to r. So, this equivalence we have got from the properties of this language. Similarly, by replacing the language by regular expressions in the properties of languages we get different kinds of equivalence for regular expressions. For example, say r 1 r 2 is not equivalent to r 1 r 2 r 1 in general. Similarly, r 1 concatenation r 2 r 3 not equivalent to or equivalent to r 2 r 1 r 2 concatenation r 3 r 5 is equivalent to 5 r is equivalent to 5. 5 star is epsilon and so on. You can just reproduce these properties from the equations of regular expressions from the properties of languages. Just consider this identity of regular expressions. We can use or prove this identity by using the equivalence of regular expressions. For example, say b plus s star b star plus epsilon b is equivalent to b plus s star b star plus b plus epsilon b is equivalent to b plus s star b star b plus b star b. So, in this case simply this b plus we have concatenated s star b star and concatenated epsilon we have got this result. Similarly, this b is concatenated with this term and this term. Now, this can be written as b plus s star b plus hence this can be written as b plus s star b plus because b plus b a subset of b plus s star b plus. Therefore, we have got the first one b plus s star b star plus epsilon b is equivalent to b plus s star b plus. Similarly, one can observe that b b star s star plus epsilon b plus can be equivalent to b star s star b plus. Similarly, you can show that these two regular expressions are equivalent by using the following step. So, in the first step we have got from this expression this equivalence expression from this we can use the regular expression properties to get eventually this expression and finally, this can be written as b plus s star. Now, if l is dependent by a regular expression r that is l r equal to r then we may simply use r instead of l r to indicate the language. So, for given a language say l r say r is a regular expression we know that l r is the corresponding language dependent by r but simply we can write r to represent the language itself. So, this is sort of notation for dependent language for language dependent by a regular expression r.