Transforming logical expressions, associative and distributive laws. Logical expressions often consist of many joined subject expressions. For instance, there is a lady In the left room or there is a lady or a tiger in the right room. The logical structure of the statement we can analyze by introducing some form of letters. The statement P. There is a lady in the left room The statement Q, there is a lady in the right room. And the statement R, there is a tiger in the right room. And if we now look to our statement it says well we can have P or we can have Q or R. And this is the logical structure of the big expression here above. Now the question is how important are these brackets. And can we for instance, I don't know. But can we say that this is the same thing as saying P or Q or R. Which the letter sentence would be something like there's a lady in either the left or in the right room or there's a tiger in the right room. Now the laws we are now discussing, are the laws which handle these records, and are the laws which allow us to transform logical expressions. So let's do some bracket gymnastics. First, the situation we have (P or Q) or R is the same thing as P or (Q or R) which is usually expressed by leaving out brackets if there's only a sequence of all sentences P or Q, or R. And the same things holds for and (P and Q) and R is the same thing as P and (Q and R). And we express it by leaving out the brackets, P and Q and R. The first statement P or Q or R is true, if either P is true or Q is true or R is true. And the second one is true, if P is true and Q is true and R is true and it's easy to check the truth tables for the other expressions here. These have a fancy name, these bracket gymnastics, and they're called the associative law. And the only thing you really have to remember about them is that if you've got a sequence of or statements, you can leave out the brackets. And if you've got a sequence of and statements you could also leave out brackets. The situation is different if you join and and or, for instance in the sentence P and Q or R. For instance, example, there is a lady in the left room and there is either a lady or a tiger in the right room. This would be a sentence which has the structure P and Q or R and the law is that you can transform it in such a way that you say well its either P and Q is the case or P and R is the case. In our example, you would say, there's a lady in the left room and a lady in the right room, P and Q. Or there is a lady in the left room and a tiger in the right room. These two would be equivalent and it's easy to check this rule using a truth table. There's of course a similar rule for P or Q and R, which is P or Q and P or R. You see that in this case, it is imperative to have the brackets because they tell you in which order you have to take the ands and the ors. These two relations have also fancy name their quote the distributive laws and they're called in such ways because they tell you how to distribute P and over this expression Q or R. Now I have got a question for you. Evaluate not P and P or Q. Well using only our laws this is the same thing as saying not P and P or not P and Q. But not P and P can never be true, because either P is true and then not P is false or P is false and not P is true, so this is false or not P and Q and a statement. False or some statement is always equal to the statement so this would equal to the same thing as saying not P and Q.