 from computer science and engineering department, Walsh and Institute of Technology, Sholapur. Today, we will go for infix notation from the subject-descript mathematical structures. We will also see how to convert infix notation into completely parenthesized form and prefix notation. The learning outcome of today's session student will be able to express precedence of operator, then he will be able to convert the infix notation into fully parenthesized infix notation. The content of today's videos are first of all we will see what is the priority of or the precedence of operator, then how infix notations or expressions are evaluated, then how to convert the given infix expression into fully parenthesized form, then we will also see what are the different rules for evaluating prefix expression or notation. Following is the precedence of operator. Now we have different operators like AND or conditional, BIConditional, NAND, NOR and so on. So, this is the precedence of operator. Now if you look at this operator, first of all negation, then conjunction, distinction, conditional, biconditional, conditional and or negation and or conditional, biconditional. The priority is that first of all the negation will be evaluated first then conditional, biconditional, then AND or conditional and biconditional, this is the precedence. Negation has got the highest precedence followed by AND or conditional and biconditional. If statement formula has parenthesis, then the innermost parenthesis will be evaluated first followed by the outer and the outermost parenthesis. Inside parenthesis statement formula will have the same precedence as I told earlier that is negation AND or conditional and biconditional. Now let us consider one example. This is example P or Q and R or S and T. Here we see that there are two operators they are used that is one is OR, second one is AND, OR and AND means two operators OR and AND are used. How the evaluation will take place? What is the precedence of operator? Now negation is not there so after that condition AND will be evaluated. So first of all Q and R will be evaluated then S and T will be evaluated that is step number two after that this OR will be evaluated P or this expression result of Q and R will be evaluated. Finally the result of P or Q and R and the result of S and T they are in a distinction that will be evaluated at the step number four. In the above expression has highest precedence and one has the highest precedence and four has the least precedence. The expression will be evaluated according to the precedence of operator. Now let us see the conversion of infix foundation into fully parenthesis form. Now P or Q and R or S and T. Let us know if I write in this way and if I put the brackets. So that will be if I put the brackets what will happen? I will come to know that the innermost bracket will be evaluated first then the outer and the outer most bracket will be evaluated. So for a human being it will be easier to understand which operator will be evaluated first. So let us see just how to convert infix to fully parenthesis form. Now in this expression as this AND that is Q and R will be evaluated first then S and T will be evaluated second then P or this result of Q and R. So the highest precedence Q and R so let us write the bracket like Q and R then say in second step S and T will be evaluated so put a bracket for S and T then finally in the third step P or the result of Q or R will be placed one more bracket over there that is innermost bracket P or into bracket Q and R and in the finally S and T will be descended with this result of the third step that is so finally the formula will look like a innermost bracket P or Q and R bracket close or S and T. So is the final parenthesis expression after fourth precedence. Now consider this example or expression and convert it into fully precedence expression according to operator precedence fully parenthesis form rather P conditional Q or R or S take a pause for a minute and try to write down the answer. The solution the parenthesis according to the precedence is first of all Q or R one bracket then Q or R with oring with S one more bracket and finally one more bracket including P with a conditional operator. So this is the solution this is called as a fully parenthesis form for the expression which has no brackets that is infix expression. Now the rules for evaluating prefix expression the first tool says that now if I give the expression if I give the expression consider this expression P conditional Q or R or S this is infix expression. Now prefix expression will be or AB or A or B is an infix expression and prefix will be as we know that in prefix will be first of all operator followed by the two operands. So first of all operators will be scanned followed by the operands prefix. So the rules for evaluating prefix expression find the right most operator in the expression then they select the two operands immediately to the right of the operator form perform the indicated operation and replace the operator and operands with the result. If I write an expression over here let us consider this expression A or B or C this is expression let us convert this into prefix expression. So first of all the priority for A or B or C or A or B will be evaluated first. In the second step the result of A or B will be connected with C. So first of all convert A or B into prefix. So A or B will be converted into A or B is equal to first of all operator followed by the two operands since it is a binary operator we write two operands. So let us some give some name say as a result T1. So this is step number two now substitute this T1 in the equation number given one. So this equation number one will become now T1 or C. So let us convert this T1 or C into prefix so that will be or T1 C. So this is step number three. Now substitute T1 in the expression in the equation number three the T1 is nothing but or A, B. So this or then or A, B, C so this is a final prefix expression. So this is a final prefix expression. So if you look at if you look at so this is a conversion of infix to prefix. Now the reference is a discrete mathematical structure book is used. I hope you understood how to convert infix to completely parenthesized form and infix to prefix form. Thank you.