Next question, I wish we didn't have to know about strings in particular. But if we examine this as a way to understand how do we compare objects, I'm okay with it. So what's the answer here? Well, let's look at the code briefly. All right, string one, string two, they each create a new string object which holds the terms C-O-M-P-U-T-E-R S-C-I-E-N-C-E. Should have been saying capitals and all that stuff. And then the last instruction, string str3 does not create a new string. In fact, it just gives str3 the same reference to whatever was created in string one. So string three and string one are aliases to each other. So, another great one to have here again, this is not an exam question. This is a discussion. Could be the more than one answer evaluates to false. And also students really have to pay attention here, I said earlier to false, they always tend to think true. The key here is that students really, really need to learn to draw on paper, the memory when you're allocating, creating objects and trying to compare them. You just, you'll get lost in your head if you don't. In going back to CSSM 3.7 has this image that kind of goes along with what we are doing here. Let me draw it for us here, and this is what you should do with, should ask students like did you draw this on paper? If not, let's draw it together on the board. First instruction, str1 equal new string computer science. So this says create a new object out there in memory. Put the computer science out there and put a reference or give me the address where that place is in memory, and store that address or reference in str1. Second instruction looks very similar except, again, it's not pointing to the same, quote computer science, as str1, str2 makes a whole new object with its own place in memory. And a different address that points to a different copy of C-O-M-P-U-T-E-R S-C-I-E-N-C-E. All right, trick. Third one, str3, does not say new, so we don't make a new quote someplace out in memory. Instead, we just say, whatever the address is, whatever the reference is in str1, wherever it points, str3 is going to point. Another thing I tend to do is I tend to actually make up addresses in memory, like 3,000, 4,000, 4,400. Then you kind of have to explain to students, why are you using those numbers? And that definitely gets beyond, but it turns out all of memory is given a numerical address. But it really just any sort of largish number works for that sort of thing. So now we can see why C is, man, did I get that too? It's not str1 == str3 is equal, that evaluates to true. I've failed at my own game. And let's see if I got the last one right. I think I did. So it's supposed to be A and B by the way. Str1 equals, str3 equals str1. Not, okay actually that one's right. Str1 and str3, we're using the dot equals method, are the things inside them equal? They are, not that, that's false. Str1 == str2, that's false. So it's B is also false. And D is false. Str1 equals str2, A, that's true. So, B and D, not C and D. See, I'm going to see if you're actually listening rather than just looking at my pictures. All right, this one surprisingly throws students off. You gotta remember, it may not seem difficult to you because you've been teaching math or you've dealt with, you've had more years of dealing with abstraction and whatnot than your students. But we're having them learn all these new vocabulary about programming, etc. And here, we have a program that you would never write in real life. because it uses only literals, false and true, rather than Boolean variables or expressions. However, these kind of things get given as exams. And in a way, it's good to reinforce the fact that, do we really understand that just applying the operations and the order of operations. So, correct answer here is D, FirstSecond. And again, they're one on the same line, because there's no print line. The key things that students need to remember here is that "AND" has a higher precedence than "OR". So remember, "AND" is harder to satisfy. So it has a higher precedence. It's king over the or, because harder to satisfy means both this and that have to be true. It's just my mnemonic that I use. And then also getting students just accustomed to reading codes that have literals, which might happen on the exam, even though we wouldn't ever write this way. That said, there's another take home, sort of a teacher tip here. And I don't know if this is something you feel is useful to teach all your students or not. But the great thing about or, so even though the ands all got done first, anything or true is true. So if you've got whatever the heck or true, then it's always going to be true. So, I can just look at the first one and then it's like, that's true. And then the second, I don't even you know have to look false and false, yeah, okay, that's false. But true or false? True or anything is true. So, absolutely I'm going to print out first and then I look at the next if statement, that's always a true or. It's going to be true, so that doesn't mean that of course that I print out everything, that just means I'm going to print out the true portions of every if statement. All right, this looks diabolical. Yep, and one of the important things is to teach your students not to just turn their brains off when they see this. To be like, it's okay. It looks big and complicated. Let me break it down. This question can be misleading to students, because they're like, which is the inverse of the Boolean expression given there? They're like, De Morgan's law, I apply it, I apply it. Well this is an expression with a not at the beginning of it, and we said, which of the following is equivalent to this particular expression. Let me give you the answers and then we'll break down what's interesting there. It's actually again two different ones. Especially around like a third of the way into the course, I really start liking to make sure that these discussion questions have maybe more than one answer or in some way are sneaky to really make students be engaging to create more vigorous discussion. I like this question because I want students to feel confident and comfortable in saying I see a big scary expression and I can parse it. That means I can read it and break it up into bits. The other thing, and this is the difference between part C and part D, is that you can recognize that there's not just maybe one level that you can apply De Morgan's at. That when we want to talk about simplifying an expression, which is I haven't gone all the way here, but that you can apply it more than one time. So let me point out on the c, that's the basic first level application of De Morgan's. We took the not from the outside and we put it on this first expression, which is a, and b or c, we changed the, and in the middle to an or, and then we, I left out my not. No, the nots canceled out. I was like, I know I checked this one. The nots cancelled out, so the last expression, b or not a and c, that had a not in front of it. We threw that other not over there, they cancelled each other out. And then we've got b or not a and c. However, to get to option d, I basically took and applied De Morgan's Law again in carrying out the not A and C. So it distributed the not into the A and the C and changed the and to an or. So this is the second step of De Morgan's. Now, let me just tell you, as a teacher, these things are crazy to create. Even so, I picked the A and B which maybe kind of messed up this idea of, they thought De Morgan's meant you change all of this, the ands and ors to different ones. What does it, what is really a student misconception? I don't know. And did I get this right? You need a tool. I'm just telling you, you need a tool. Let me recommend this one. Okay, I googled Boolean expression equivalent elevator or calculator or something like that. This is a screenshot from the webpage. It's not immediately clear this is exactly what you want, but I promise you, this will give it to you. You just copy paste in the original Boolean expression you've got on the right hand side, and then there's a submit button. And on the left hand side of the page over here under results, it's going to show your original one and then it gives you the most simplified version. Well that's not in any of my answers, but what I did is I took both of my correct answers that I thought I had gotten right and correct and I made sure they actually simplified to the exact same thing. And then I took my other two answer options, A and B, and I made sure they simplified to something else. So great tip for a teacher.