 All right, welcome back everyone from our long break. I know you all miss me, so I'm very happy to be back here with you on this glorious Wednesday. Let's try to tell you. I read the source coordinator today. No, I didn't. Okay, so any questions on project one before we get started? So some people ask just in case you're wondering, yes, homework one hasn't been assigned yet because we haven't covered enough to assign homework. You know, when that happens, I'll assign it. I'll make sure you have enough time to complete it. Any else? Any other questions? All right, so where we left off, we were trying to define the syntax of regular expressions, right? And why are we trying to define the syntax of regular expressions? Because it's what we're going to write other grammars from. Yeah, because we're going to use regular expressions to define tokens in a grammar. We're going to use tokens to take the input bytes into our interpreter or compiler and basically try to make some kind of sense out of them. So regular expression is either the empty set, the epsilon, A where A is an element of the alphabet, R1 bar R2 where R1 and R2 are both regular expressions, R1 dot R2 where R1 and R2 are regular expressions, parentheses surrounded by R where R is a regular expression, and R star where R is a regular expression. So let's look at some of these. Okay, this is the first time I'm using this thing, so no promises, but it's going to work well. Okay, so let's say we have an alphabet of, what do you guys think of one? Zero. No, too much. Three letters. Zero. A, B, C. A, B, and C are three letters. We'll go with A and B, because that's what I want to do in the first place. All right. So we have a sigma is the set containing A and B. So now we want to say, okay, what are some regular expressions that we can write about this? So we could do, could we write, I don't know, is this a regular expression? Yes. Why? Because it's A, which is some element of the alphabet. Exactly. So rule three here, right? A is some element of the alphabet. Okay. So that's a regular expression. What about A bar B? Let's do, let's just do, I told you this thing is weird, but it's better than writing on the board. Okay. What about this? Does it be? Yup. That's also a regular expression. Also a regular expression. Why? Because it's also a regular expression. Rule three, right? What about this? No. No? Why not? Because it's not in the alphabet. Yeah, it's not in the alphabet, right? So our regular expressions are only containing two symbols, A and B. So now what if I have, let's say A bar B. Is that a regular expression? Yes. C. Yes. Because rule four, right? And then I can, and I know, so rule four says only if each side of the bar is a regular expression, right? So it evaluated this whole thing's regular expression and what I have to first evaluate. Left side, then right side. Yeah, the left side is a regular expression and we know it's just A by itself, a regular expression. Yeah. And we know just B by itself is a regular expression. Over here. So there we're good. What about, is that a regular expression? Yeah. Rule five. Can catnate it together? Rule five. Rule five says they have to be separated by a dot. Nope. I don't see a matching rule. I don't see a matching rule, so nope. So no, correct? So yeah, right now we don't have a way to deal with this, right? So it's not in there, so that's stuff. So that is not a regular expression. We can do, if we did a dot B, is that a regular expression? Yeah. What about A dot B? Nope. Is this a regular expression? Yes. You can break it down and apply each one of these rules in turn to this. Mm-hmm. Is that a regular expression? Yes. What does that mean? It's just a rule made up, right? Yeah. So right now we're just defining syntax, right? Just like in a programming language. Syntax just means what it looks like. What's a valid regular expression? What this means, we're going to get into in a second, right? So make sure we all know exactly what a regular expression looks like what a regular expression does not look like. So if I did, I don't know. Is that a regular expression? No. No. It fails on the A. Yeah. This bang symbol is not, it's not in our alphabet so it's not part of our alphabet and it's not in any of our special symbols here, right? The special symbols are the bar, the dot, parentheses, and a star. Questions? What is or is not? This is definitely not. Also we can have the dot and this bar next to each other, right? If we had something like a dot star B. Is that a regular expression? No. No. So we first take it, maybe with the bar, and then we say, okay, this has to be a regular expression and this has to be a regular expression. We say, okay, is B a regular expression? Yes. Yeah. Is A dot a regular expression? Yes. Oh wait, no, by itself. By itself, yeah. Right, exactly. There has to be something to the right of it, so. Do I have a question? Yes. On the other slide. Sure. You have commas in there? But only on lines 4, 5, and 6. There's explanation commas. Okay. I don't know. Good question. Okay, so now we go on. Alright, so it's semantic meaning, right? What do they mean? So we're going to use a regular expression and we're going to want it to say that a regular expression defines a language. So what's a language? A set of rules made up. It also, a set of rules made up, what's another way that we've been using to represent languages? Yeah, it's a set. Well, so sigma star, right, is the set of all possible strings made up of that alphabet, right? So a language makes a subset of that, right? So it's just a set of all strings. So we're talking about languages here. It's just a set of all possible strings. And we're going to say that a regular expression defines a language. And that language is the set of strings that the regular expression describes. So, and we're going to call use L as kind of a function to say the language described by the regular expression R, right? So here L is just a function and R is the regular expression R. So now we get into the semantics of what these things actually mean. So the language described by the regular expression of the empty set is the empty set, right? So the regular expression is the empty set and the language described by that is going to be the empty set as well. And the language described by Epsilon, the empty string, is the set containing Epsilon. So what's the difference between those two Epsilon's there? Why are they different colors? One of them is a string. Which one? The one on the right. The one on the right, why? Because that's what you told us earlier. That is what I told you earlier. It also follows from this definition up top, right? So a regular expression, so we know L of R, so if you try to type check this, right? L of R, R has to be a regular expression. So we know the thing in the parenthesis there is a regular expression. And then the language defined by R is a set of strings, right? So we know on the right-hand side we have to have a set of strings. Any questions there? So these base cases are pretty easy. The second base case is also fairly easy as well. So if we have the language defined by a regular expression when it's that rule three, so just a single element of our alphabet, we're going to say that that matches, that describes the language that is the set containing just that symbol A. So this applies for every symbol in our alphabet, right? Okay, so we get these base cases, right? So a regular expression that just has A describes the second containing A. Yeah. So you said the string for the second case was the one in parenthesis or the one on the right-hand side? What is it? A set of all strings. Okay, so if you want a parenthesis, right? It's what? Say that again. So the set of all strings is the one on the right. On the right side. Yeah, exactly. So there's two ways to look at it. One is using this, right? So L of R here. So I'm saying R is a regular expression. So that means anything inside of L has to be a regular expression. Okay. And then it describes a language which is a set of strings. Okay. So that's on the right. So it helps when you're doing even this math kind of thing to try and like type check it in your brain, like do these things make sense of what's coming into the function and what's going out. So that says a set of regular expressions. The blue A is a set of regular expressions. The blue A, the blue A is a string. So it's the set containing just the string A. So this regular expression is defining a language. So on the right is a language. And this just happens to be the language that has one word in it that is a blank one, or one string that's a blank one. Okay. So now we've matched our three kind of base cases. Now we want to say, okay, what do those other symbols do, like the bar and the dot? Right? We know how to write them. We know what they look like. What do they actually mean? So they're actually fairly simple-ish. So the bar just means that we're going to union those two sets together so that we take the language described by the left-hand side and the language described by the right-hand side, we take those and we union those sets together. So if I have the language described by A and the language described by B here and I have the bar between them, what's the result of that union going to be? So say R1 is A and R2 is B. Or it's the union of the set of R1. It would be the set of A and R2. Yeah. The second-taining A, B. Right? So the language described by the regular expression A is going to give me the second-taining A. The language described by the regular expression B is going to give me the second-taining B. I'm unioning those two sets. Take all the elements from both sets and I'm going to have the second-taining A and B. Yes. So this, just like the previous definition, is a recursive definition. Okay. And the concatenation, let's try to describe it, but the idea is we're going to, the dot is going to be our concatenation operator. So it's going to be the symbols concatenated together. So when you see this with sets here, we're talking about every, every string in the language described by R1 and that set concatenated with all the strings in the language described by R2. So let's look at an example. So is that every possible combination? Yes. So let's say we have here A or B, right? So we have our sigma is the second-taining A and the second-taining B, right? So is A or, is A bar B a regular expression? Yes. Yeah. So what does this mean? So when I say, what's the language described by this, right? It's the set. Yeah. Well, I can just apply these rules, right? So I say, okay, it's first, I know it's the language described by A, union, the language described by B, right? So what's the language described by A? A. The second-taining A, right? Yeah. Oh, sorry. Sometimes I mess up this one. Okay, union and what's the language described by regular expression B? Second-taining B. Second-taining B. Yeah, what's the second-taining A union with the second-taining B? The second-taining A union. Yeah, perfect. Okay. Now let's look at the language containing A dot B. Okay. Is that dot dot dot supposed to be at the bottom or can you put that down? Yeah, it's, sorry, the way I draw it is a little bit bottom. We can kind of use both, but I'll try to be a little more precise. So it's a period. Yeah. One of those things that honestly doesn't matter when you do other, if you look at regular expressions in other classes, they're actually defined in symbols differently, but I use this syntax because this is more closer to what actual regular expressions look like in programming languages. So we have the language described by A concatenated or the dot operator with the language described by B. So we just did this up top, so it should be really easy. What's the language described by A? The second-taining A. Second-taining A. And dotted with the language described by B. Which is? Second-taining B. Yeah, the second-taining B. All right. So this concatenation operator, every, yeah. Is it assumed by default that empty string is part of all sets unless specifically like not included? No, it must be included. It has to, it has to explicitly be included into a set. So, for instance, the language, so if we wanted to ask, well, let's finish this and then I'll get to that. Okay. So what we're going to do is we take every element of the first set and we concatenate it with every element of the right set. So there's only one element. So we take A concatenated with B. And so this is the string containing A, B. So it describes a string of length two, right? Whereas this OR defines a string of length one. Okay. Let's look at your question. So the question is, so I asked you something like, is Epsilon in, is it an element of or not an element of the language described by let's say the regular expression A? Right. So that could be a question that you get asked. So is Epsilon in there or does it match the empty string? Yeah, exactly. So we have Epsilon here and what you describe by A which is the second containing A. A is, Epsilon is clearly not in this set. So it is not contained within it. All right. So then we can look at a slightly more complicated. So let's look at it, do a quick, let's say A or B, all of I, what do you want, A or B? We don't have a city. Oh, okay. So B or A? B. B or A. So we just break this down, right? We say, okay, so we know how to do the dot is the language described by A or B dotted with, the candidate with the language described by B or A. We know A or B, right? We just did it up there. So what was that? Second containing A and B. Dotted with, so let's say we haven't done this one yet. So we have the language described by B, union with the language described by A. Okay. The language described by B is the second containing B, right? Union with the second containing A. This is actually a very good example. Dotted with, okay, so what's B, the second containing B, union with the second containing A? The second containing B. Does it matter what the order is? Does the order matter in sets? No. No. Right, yeah, the sets only care about if something is there or not there. So this is exactly the same as, well, the other way. My name starts with an A, so I want to draw that first. Okay. Right, so these are the exact same sets. Okay, so we want to, we take every string in the first set, right, we do the catnation operator, and we want to add every possible combination of sets of strings in the right set. So what are the strings that are going to be in here? A, A. A, A. B. A, B. B, A. B, A. B. Yeah, so this is the set. So the way you can kind of, so I, you know, you have to play with these and kind of do some of these exercises so that you can get a feel for regular expressions and what they mean. Huh? Be involved in homework 1. But the way to read this is, so the bars are or, so the language described by this regular expression is an A or a B concatenated or followed by a B or an A. Like, all possible strings. So I know it has to be length 2 because there's no excellence in here. They're all length 2. And I know the first character or first symbol is either an A or B and the second symbol has to be either a B or an A. And that's how you can, that's how you read that. Alright, questions on those already? So, okay, we look at some examples. These are pretty easy. A or B, A, B. We have A, B, C. Right, we can just apply this rule the same. So we take A, B on the left. We have a union with the language described by C. So now here I'm using an alphabet of A, B and C. So I have the language described by A, B union with the language described by C which is A, B, C. Now here's what I can get into. So let's say I do want, I can use the empty string, right? Because this is one of the rules, right? This is, the empty string is a valid radius, right? So here I'm saying, okay, the language described by A or the empty set. So what's going to be in this eventual set? Close it. Yeah, it's not containing A and epsilon, right? So you just apply this rule, you say, okay, I know it's the language described by A, union with the language described by epsilon. What's the language described by epsilon? The set containing the empty string. Yeah, exactly. So you have the second containing A, union with the second containing the empty string. We know how to do set union. You can do A and epsilon. If I do something like the second containing epsilon or epsilon, what's that going to be? Yeah, the second containing epsilon, right? So the other thing about sets, so order doesn't matter in sets. And the number of times something is insert. You can only have an element once in a set. So those are the two main properties of a set. So is the second containing epsilon equal to the empty set? No. How do you know? Epsilon is the empty string. Yeah. So is the second containing epsilon the same thing as the empty set? No. No, because they have different, how many elements are in the set on the left? One. How many elements are in the set on the right? Zero. Yeah, so it definitely can't be equal. So does that mean it was completely pointless to use the empty set in any regular expression here? Completely pointless. I can't say no. Yeah, the empty set's going. You use epsilon. Epsilon comes up frequently. As far as the empty set, I don't know if it's a good question. So the language is an empty set, is an empty set? Yes. Okay, so we looked at concatenation. Okay, we already went over this kind of a little bit more informally. So the idea is we define two sets of strings, we define the dot operator on two sets of strings, right? So the language described by R1 returns a set of strings, and the language described by R2 returns a set of strings. So we're defining an operator here to perform this concatenation. So we say, okay, generally, if we have two sets of strings, A and B, then we can find an operator A dot B that takes for all x's in A and for all y's in B concatenates them together in the order x, y. That's one of the examples that we did. Right, we take every element from x, and for each element, we append each element from y to make a new string. So that's just exactly what this says in a more precise definition. Okay, so some examples, like we saw. So if A is the second-taining A, A, and B, and B is the second-taining A and B, then what's going to be in the resulting set here? A, A, B. A, A, B? B, A, A. B, A. B, A, A. A, A. And B, B, A, B. A, A, A. So A, A, A. And then A. Oh, A, A, B. And then B, A, A. B, A, B, B. Yeah, exactly. So everything on the left always has to, whatever the resulting strings are, they have to start with everything on the left. Right, that's the way to think about it. Yes, this is why, so for, or for the bar, order doesn't matter at all. But for here, we're concatenating strings together. So it doesn't matter in order that you concatenate the string together? Yeah, it makes different strings. Yeah, it makes different strings, right? You've done this in programming languages, right? You're trying to concatenate a string together to make some output. It matters in order that you concatenate them in, otherwise it's not going to work right. Cool. Yeah, let's make sure that's right. Yeah, so then we know that, there's no, so A, B, right, the string A, B is not in A.B here. Because the string has to either start with A, A, or B, right? And so A, this is another self-check, that A, B can never be in this A.B set. So if we had done B.A. If we did B.A. So if we did B.A, one of the strings that are going to be in there. That's three A's, yeah? A, B, B, A, B, A, A, B, A, B, A, B, A, B, B. Yeah, so some of them are going to be the same, right? These two are the same. But this is going to be flipped. And this is going to be flipped, right? Okay, so now we're going to make it slightly more complicated. Let's add an epsilon to the set on the left. So what are the strings that are going to be in here in this concatenation? It's going to be the same as above, except it's also going to include single A and single B. Why? Well, okay, technically it includes epsilon concatenated with A, epsilon concatenated with B, which is simple, why that? A, B, A. Right, so yeah, that's why we're going under the definitions of epsilon, the M2 string, right? We said if epsilon is concatenated with any string, it's just that string again, right? So epsilon concatenated with A is A. A concatenated with epsilon is also A. Yeah, so we just do the same thing, right? This doesn't change anything about how we do this operation. We take all the strings on the left and concatenate them with all the strings on the right. So we're going to get A, A, A. A, A, B. B, A, B, B. And then epsilon concatenated with A is A and epsilon concatenated with B is B. Makes sense? So how do I read this? Let's say I read this. A or B concatenated with C. Yes, but how do I apply these rules? It depends on how you define them. Language of A or language of B concatenated with the language of C. So one way would be the language of A far language of B all concatenated with the language of C. We've got to install the problem here. What's the order of operations? Yeah, what do you mean by order of operations? Do we go left to right, or do we concatenate? Right, so the question is, is this really, the language is described by A, or the language is described by B, that whole thing dotted with the language is described by C, or is it the other way around? Is that defining the rules, or how do you... We're going to get to it. Let's look and see, does it actually make a difference, or are we just being advantageous? Are these the two possible ways we could do this? There can also be the language of A or B in parentheses, just A or B in the same parentheses. Instead of separating them. You can have three sets of parentheses. Yeah, could you just have the first half A or B in parentheses, concatenate with the language of C. You mean like, isn't this one doing that? A or B concatenated with the results of that? Yeah, but I'm saying is there a difference between zap parentheses and then if you were to write L in one parentheses, right, A where... No, no, because where you say L just splits it out. Yeah, I mean actually I guess you're right. This should be a union here. If I'm doing it like this. Yeah, that's a good point. Let's install this part. Okay, so here we have two different possibilities, right? So do these have different sets? So what's... So let's take... Let's do this one first, right? So this one is going to be... Let's see. What's the language described by A? Second containing A. Second containing A, union with... What's the language described by B concatenated with the language described by C? B concatenated with C. B, C. And then union of these two things together? The second containing A is all of B. Okay, now let's take this one. Let's do the same thing, okay? So what's the language described by A, union with the language described by B? Second containing A. And concatenated with the language described by C? Second containing A. Second containing A, C. A, C. D, C. Oh, A, C, D, C. That would be fine. Okay, so are these two sets the same? Absolutely not, right? But none here that moves things. It's not like it. Okay, yeah. So these two sets are not the same, so we need to define which ones we mean. Just like in math, if you have A plus B times C, do you know how to parse this? Do you know what operation happens first? Multiplication. Multiplication, right? B is multiplied by C and then added to A. Right, because that's completely different than A plus B multiplied by C. Yes. So in regular expressions, do the parentheses do the same thing in changing precedents? Yes. So is there like a please excuse right here and some kind of thing for regular expressions? Is there one? Like one of those acronym things you remember the operator precedents thing? No, but if you want to create one, I will support that and I will teach it next time I use this class. I'll take it something. All right, shit. Every. All right. Okay, so we have to define the operator precedents. Right, because we need to know, like yes, we could write parentheses everywhere, but that is incredibly annoying, right? You could do that in math, but we have two dimensions. Okay, so we have to define some kind of operator precedents, which we've done this. So what we're going to define is that dot or concatenation has a higher precedence than the bar. So I guess it's actually pretty easy because there's really only one. Is that for real or is this just an example? No, this is for real. For real. This is what we'll be using. And it's how regular expressions are written when you write them normally in programming languages. Okay, so now we see this. We know exactly what it is. L, A, or B dot C. So which operator happens, let's say, first? B dot C. B dot C. Yeah, exactly. And we have the language described by B dot C unioned with the language described by A, which is the second-hand A unioned with the second-hand B C, which is A comma B C. Questions there? Are we done with your questions? Yeah. Where does the star come from? Where does the star come from? Where do the stars come from? Okay, we have to find the other ones, right? So we go back to the definitions here, right? So we have, we've done slide nine. Yeah, slide nine. Thank you. Hard to read when they're so tiny. Okay, we've done one through five, right? But we needed to find six and seven. So that's when we'll get to... So, yeah, this is incredibly simple. It just means the language described by the parentheses with R is the language defined by R, right? But it helps... So when we see something like this, we know that, okay, A or B happens together, right? And the result of that is concatenated with C. So this is going to be parsed. The language described by A or B concatenated with the language described by C. And so what's the language described by A or B? What's that? Secondary A or B. Yeah, the secondary A, well, A and B, right? Concatenated with the secondary C, which is ACBC. Our last one, right? We have that star, that funky star. So everything up to here, I don't know, fairly simple. Maybe you agree, maybe you don't, but... Something tells me it's going to stop. Yeah, wow. It's only slightly more complicated. But yeah, it's either concatenation or... Right? So it can be either... So that's the way to read this is... Okay, this defines strings where it starts with A or B and it's followed by a C. So A or B followed by a C. Okay, then we get to the star. Yes, it's one of the guys who worked on regular discussions. I believe it's Cleany, is how you pronounce that. Call it Mr. Clean. If you were involved, that would be quite a picture of him. Make a mean with him like cleaning things like a star. All right. Okay, so the question is, what is this star represents? So let's go with... All right, before I give you this definition, let's go with some intuition here. Okay. So a star we're going to think of as meaning zero or more times. Whatever that regular expression is. So if I have the language described by A star, so this is going to be whatever's inside the star, right? So whatever the star is being applied to, in this case it's the regular expression A, can occur zero or any number of times. So if it occurs zero times, what string would that match in? Empty string. Empty string, yeah, epsilon, right? And if it happens one time, if it happens two times, it happens three times. So it's... I have a feeling this is going to make everything much better. Or interesting, otherwise we wouldn't have this to be kind of boring and useless. Right? So yeah, so now, so is this set finite? Did I just stop because I was bored? I don't want to just put four dots here. So it's an infinite set, right? So any string of any number of As is in this set. Including A. Including the empty string. Including the empty string, yeah, that's the important thing. So I think of it as like zero or more. So basically this gives us the infinite expandability that things apply with A. So the star is going to only apply to... it's going to have very high precedence. The high precedence, we're going to talk about it, but it's pretty clear. You can think of it like an exponent, right? It's only applied to that symbol. Otherwise you have to put it in parentheses. So if we had A concatenated with B star, how do I do this? Well, I can break it down, right? Applying all those rules. So I can first say, okay, I know this is the language described by A concatenated with the language described by B star. So what's the language described by A? The second convenient. Yeah, the second convenient. Possibly does a hundred times, so that's good. Okay, concatenated. What's the language described by B star? The second convenient. The second convenient. That's not enough to keep going. B, et cetera, et cetera. All right, that's good. All right, so how are we going to do this? What's this resulting set? Set concatenating A, A, B, A, B, B, et cetera, et cetera. We don't have to put et cetera, et cetera, et cetera. That's fine. Okay, so yeah, right? So we have A. So this makes sense when we read this the way we were reading it, right? What about the empty set? What about the empty string? Yes, epsilon? Yeah, isn't that in the last... Isn't that... So we had A, so the concatenation operator, right? Is A concatenated with everything in this set? Oh, I see, okay, guys. Exactly. So A concatenated with epsilon is... Okay. And A concatenated with B is AB. A concatenated with ABB is ABB. A concatenated with BBB is ABBB. So that is an important thing to note. So epsilon does come in when we use a star, but if we have a concatenation operator, right, then this concatenation operator... Sorry, this star operator... But if we have this concatenation, this says, hey, the language described by this regular expression, all of the strings start with an A and are followed by any number of Bs. Zero or more Bs. Yes, concatenation order matters. So the full order of operation has parentheses then the star, then the dot, then the bar. Yes, but that may be wrong. We'll look at it in a second. Just because it messes up some of the things we'll do later, but don't worry about it too much. So what you're telling me is that it's exactly like any other language where it has rules that... Exactly. Otherwise, it would be too easy. For instance, to show that concatenation matters, right, if we had B star dot A, right, this is going to be the language defined by B star dotted with the language defined by A. So this is going to be... Let's just go to the end. So if B star is zero or more times, it's going to be epsilon, and epsilon concatenated with A is A. And then if it's one time, it'll be B concatenated with A. So even though these sets are both infinite sets, they are different, right? They have one element in common, which is A. So you can think of this describes all the set of all strings that have zero or more B's followed by one A at the end, where the other way was one A at the beginning followed by zero or more B's. Well, the order within the sets... Don't matter. Yeah, the order within the sets don't matter. The order within each individual set. Within the larger set. Which order of this set? So inside the sets, the order does not matter. But when you apply the order on the left or the right-hand side, the concatenation operator does matter. Because here we're concatenating A dot this. Here we're concatenating the infinite B set with the secantating A. So... Oh, sorry. A and B A are not sets. A and B A are strings. Okay, so the order within the strings matters. Yes, exactly. Yes, good point. If you have a set that is infinitely expanding before they're the finite thing at the end, like this one, for example, how can you computationally guarantee that there is in fact an A at the end of that? It's easy. So the kind of question is, if you give me any string S, can I say if S is inside of the language defined by B star dot A? Give me any string, right? You have to give me a finite string, right? Otherwise it would make sense. You can't give me an infinite string. But yeah, if you give me any finite string, I can just say, okay, how many B's are there? Are there... Is it all B's followed by one A? If so, then say yes. Otherwise, say no. The first time I see something that's not an A or B, I can say no. The first time I see a B followed by something that's not an A or a C, or if there's more after that B, B, B, A, okay, if I add B, B, A, A, right? That's not in this set because there's an extra A here, right? Okay, exactly. Any other questions on the star? Two, way to think about it. The other way to think about it is it's the empty set unioned with the language described by R, unioned with the language described by R, catnayed with the language described by R, catnayed with the language described by R, catnayed with the language described by R, right? That's how you can get it itself. So another way to define this, we can say that, okay, we'll define a new operator on the language of this L function. We'll call L zero of R be the empty set. And we can say that L i, so you give me any i, I can say that, okay, it's defined as L i minus one, union, sorry, catnayed with L R, the language described by R, right? So we already know how to do the language described by R, right? That's what we've done. And we're adding this exponentiation operator, you know, this different operator to here. So this is a recursive definition, right? But we have our base case, we have L zero. And so we say, okay, from any L i, I know how to calculate it. I just go back. And so we can say that L star is the union of all of these L i's for i greater than or equal to zero. And so these examples fall out, right? So we can say, okay. So the language described by A or B star. So what is this? So somebody read this in English, what does this say? What is it? The language A follows by zero. Followed by? Yeah. Language defined. They are A or A or A. And number of these. Right. So A or zero or more B's. Right. So is the empty string going to be in this resulting set? Yes. Yes. Yeah. Right, because the or unions that you set. So on the left we'll have the union of the second thing A. And on the right we're going to have the union of epsilon, B, B, B, all of these. Yeah. So when you have an instance like this where the empty string is definitely part of this set, you actually include that epsilon symbol. Yes, you have to include it. But where when you have something like where it's concatenated with another letter, that's when you can exclude it because it's not really necessary. You have to exclude it because it's not correct. So empty strings will happen as we'll see. I mean like say in this, it is in this example. Say you concatenated A with the empty string. Right. You could just put A, but even though it's technically. Yes, yes, yes. So if it's concatenation. If you concatenate. That's right. Yes. So if you ever, yes, but if epsilon is by itself, you need to include it in the set. But if it's concatenated, right, we know by that identity property that anything concatenated with epsilon is itself. Cool. Okay. So what's the difference here between these two sets? So this is A or B star. What's this? What is the same? Same. Any number of A or Bs. Well this is a nightmare. We'll wait until we get to that. Is that wrong? Say again. Any number of A or Bs. Zero or more A or Bs. Right. So that's how to read the star. It is zero or more of whatever is in the star. And whatever is in the star is A or B. Right. So it's any number of A or Bs. What are some elements that are going to be in here? Infinite number of commas. Yeah. The MG string. Right. So we can also break it down with our definition here if we really want to. So what's A or B? Once. B. Yeah. The second containing A, B. Right. And A, B concatenated with A, B. A, A, B, A, B, A, B, B. Right. And what's this set concatenated with the second containing A, B? It's the other system. Yeah. It gets larger. Right. So A, A, B, B, A, B, A, B, A, B, A, B, A, B, A, B, B, B, B, B, B, B. And on and on forever. Right. So this is all strings that are contained of either A or Bs or R and B. So we'll stop here. It's like we didn't quite cover enough to get to the homework. I may get all signed in and give you more time or something. You just, like, close the homework anyway, anyway, and then just, like, take back. Amen. That's what I'll probably do. We'll see.