Lecture 1 - Propositional Logic

nptelhrd
4 Dec 200756:47

Summary

TLDRThe video script introduces Discrete Mathematics, a foundational course for computer science students, focusing on abstract mathematical structures like sets, graphs, and automata. It emphasizes the importance of mathematical thinking in computer science and outlines topics including logic, combinatorics, and algebra. The course aims to develop students' mathematical reasoning skills, essential for understanding and proving program correctness, logic programming, and network analysis. Reference books and the significance of propositional logic, including truth tables and logical identities, are also discussed.

Takeaways

  • πŸ“š The course is an introduction to Discrete Mathematics, aimed at B.Tech or B.E. students in computer science, focusing on abstract mathematical models for discrete objects and their relationships.
  • 🧠 The purpose of studying Discrete Mathematics is to understand basic mathematical concepts used in computer science fields, enabling students to comprehend other subjects more effectively.
  • πŸ€” The course encourages students to develop mathematical thinking, which is essential for grasping complex computer science topics.
  • πŸ” Discrete Mathematics concepts are applied across various computer science domains, including programming, artificial intelligence, computer networks, and compilers.
  • πŸ“ˆ The curriculum covers topics such as Logic, sets, relations, functions, graphs, combinatorics, recurrence relations, algebras, and finite state automata (FSA).
  • πŸ“˜ Reference books like 'Elements of Discrete Mathematics' by C.L. Liu and 'Discrete Mathematical Structures with Applications to Computer Science' by Tremblay and Manohar are recommended for further study.
  • πŸ“ Propositional Logic is a fundamental part of the course, teaching students about assertions, propositional variables, and logical connectives.
  • πŸ”‘ Logical connectives such as 'and', 'or', 'not', 'if and only if', and 'implies' are essential for constructing well-formed formulas in Propositional Logic.
  • πŸ“Š Truth tables are used to evaluate the truth values of logical expressions, determining when an expression is a tautology, a contradiction, or a contingency.
  • βš™οΈ Logical identities and laws, including idempotence, commutativity, associativity, and DeMorgan's laws, are crucial for simplifying logical expressions.
  • πŸ”„ The course progressively builds from basic concepts like Propositional Logic to more complex topics like proofs and automata, ensuring a comprehensive understanding of discrete mathematical structures.

Q & A

  • What is the primary focus of the course on Discrete Mathematical Structures?

    -The course focuses on the study of discrete structures which are abstract mathematical models dealing with discrete objects like sets, permutations, graphs, and their relationships.

  • Why is Discrete Mathematics important for computer science students?

    -Discrete Mathematics is important because it provides the basic mathematical concepts used in various fields of Computer Science, enabling students to understand these subjects more thoroughly and develop mathematical thinking.

  • What are some of the applications of Discrete Mathematics in Computer Science?

    -Applications include proving programs correct, using logic in artificial intelligence, applying graph theory in computer networks, and utilizing automata concepts in compilers.

  • How does the course aim to develop students' thinking?

    -The course aims to develop students' mathematical thinking by teaching them to understand and apply discrete mathematical concepts to various computer science subjects.

  • What topics are covered in the Discrete Mathematics course?

    -The topics covered include Logic, sets, relations, functions, graphs, combinatorics, recurrence relations, algebras, and finite state automata (FSA).

  • Can you provide an example of a paradox mentioned in the script?

    -The example of a paradox given is the statement 'This statement is false.' It is a paradox because it cannot have a consistent truth value.

  • What is a propositional variable and how is it used?

    -A propositional variable denotes an arbitrary proposition with an unspecified truth value, like P, Q, and R. It can be assigned a truth value or a proposition as its value.

  • What are the logical connectives mentioned in the script?

    -The logical connectives mentioned are AND, OR, NOT, Exclusive OR, Implication, and Equivalence.

  • What is a well-formed formula (wff) in Propositional Logic?

    -A well-formed formula (wff) is a propositional form that connects variables using logical connectives, representing a valid expression in Propositional Logic.

  • What is the difference between a tautology, a contradiction, and a contingency?

    -A tautology is a propositional form that is always true, a contradiction is always false, and a contingency is a propositional form that is sometimes true and sometimes false depending on the truth values of its variables.

  • Can you explain the concept of truth tables as discussed in the script?

    -Truth tables are used to determine the truth value of logical expressions by systematically listing all possible combinations of truth values for the variables involved and evaluating the expression for each combination.

  • What are some logical identities mentioned in the script that can be used to simplify logical expressions?

    -Some logical identities include idempotence of AND and OR, commutative laws, associative laws, DeMorgan's laws, and the rules of implication and equivalence.

Outlines

00:00

πŸ“š Introduction to Discrete Mathematics for Computer Science

This paragraph introduces the course on discrete mathematical structures, tailored for computer science students in their second semester. It emphasizes the importance of discrete mathematics in understanding basic mathematical concepts used across various computer science fields. The course aims to develop students' mathematical thinking and covers topics like sets, permutations, graphs, and finite state automata (FSA). The necessity to study discrete mathematics for comprehending advanced computer science subjects is highlighted, along with its applications in programming, artificial intelligence, computer networks, and compilers.

05:08

πŸ“˜ Course Layout and Reference Materials

The second paragraph outlines the structure of the discrete mathematics course, which includes initial lectures on logic and its applications, followed by topics on sets, relations, functions, graphs, combinatorics, and finite state automata (FSA). It mentions the lack of prerequisite knowledge, except for a basic mathematical maturity. The paragraph also provides a list of reference books, including both classic and modern texts, covering a range of discrete mathematics topics and their applications to computer science.

10:11

πŸ” Delving into Propositional Logic

This paragraph focuses on the fundamentals of Propositional Logic, which is the initial topic in the course, with nine dedicated lectures. It defines a proposition as an assertion with a binary truth value and distinguishes propositions from questions and orders. The paragraph also introduces the concept of propositional variables and logical connectives such as 'and', 'or', and 'not', which are used to form compound statements. The importance of understanding Propositional Logic for computer science students is reiterated.

15:14

πŸ“Œ Propositions and Logical Connectives

The fourth paragraph delves deeper into the nature of propositions and logical connectives. It explains the conditions under which compound statements formed using 'and', 'or', and 'not' are considered true or false, using truth tables to illustrate. The concept of paradoxes, such as the liar paradox, is introduced, and the distinction between propositional variables and individual variables is clarified. The paragraph establishes the foundation for understanding complex logical expressions in computer science.

20:20

βš™οΈ Truth Tables and Logical Operators

This paragraph discusses the construction and interpretation of truth tables for logical operators, including 'and', 'or', 'not', and 'exclusive or'. It explains how these operators are used to create well-formed formulas of Propositional Logic (wff) and the importance of distinguishing between inclusive and exclusive 'or' in logical expressions. The paragraph also highlights the need for careful translation between English sentences and logical notation.

25:20

πŸ”„ Implication, Equivalence, and Logical Identities

The sixth paragraph explores the concepts of implication and equivalence in logical expressions, explaining the truth tables for 'implies' and 'equivalence'. It discusses the different ways to interpret implications and the historical context of Greek and Indian logic. The paragraph also introduces the idea of logical identities and the similarities between Propositional Logic and Boolean algebra.

30:20

πŸ“š Theorems, Consequences, and Contrapositives

This paragraph examines the relationship between theorems and their consequences, introducing the terms 'converse' and 'contrapositive'. It explains how to construct truth tables for implications and their contrapositives, emphasizing the logical equivalence between a statement and its contrapositive. The paragraph also discusses the application of these concepts in understanding the validity of theorems and their converse or contrapositive statements.

35:25

🧩 Constructing and Analyzing Truth Tables

The eighth paragraph provides a detailed guide on constructing truth tables for complex logical expressions involving multiple variables. It explains the process of assigning truth values to variables and how to determine the truth value of compound statements. The paragraph also discusses the concept of tautologies, contradictions, and contingencies in the context of truth tables.

40:52

🎲 Tautologies, Contradictions, and Logical Identities

This paragraph introduces the concepts of tautologies, contradictions, and various logical identities. It explains how to identify these forms by analyzing truth tables and provides examples of each. The paragraph also discusses the use of logical identities in simplifying logical expressions and the importance of understanding these concepts for working with Propositional Logic.

46:00

πŸ“ Recap and Preview of Upcoming Concepts

The final paragraph serves as a brief recap of the logical connectives and concepts covered in the script so far and previews the topics to be discussed in the next lecture. It emphasizes the importance of understanding truth tables and logical identities for further study in discrete mathematics and their applications in computer science.

Mindmap

Keywords

πŸ’‘Discrete Mathematics

Discrete Mathematics is the study of mathematical structures that are fundamentally discrete rather than continuous. In the context of the video, it is an essential subject for computer science students as it deals with abstract mathematical models and discrete objects such as sets, permutations, and graphs. The script emphasizes its importance in developing a mathematical mindset and its applications in various computer science fields.

πŸ’‘Propositional Logic

Propositional Logic, also known as propositional calculus, is a branch of logic that deals with propositions which are either true or false. The script introduces it as one of the first topics in discrete mathematics, explaining that it involves the study of compound statements made from simpler propositions using logical connectives like 'and', 'or', and 'not'.

πŸ’‘Truth Table

A truth table is a mathematical table used in logic to determine the truth value of a logical expression. The video script describes how to construct truth tables for various logical operations, illustrating how they help in understanding the conditions under which a proposition is true or false.

πŸ’‘Logical Connectives

Logical Connectives, also known as logical operators, are symbols or words used to connect propositions. The script discusses several connectives such as 'and', 'or', 'not', 'if-then', and 'if and only if', showing how they are used to form compound statements in propositional logic.

πŸ’‘Tautology

A tautology is a propositional form that is true under all possible assignments of truth values to its variables. The script provides the example 'P or not P', which is always true regardless of the truth value of P, to illustrate the concept of a tautology.

πŸ’‘Contradiction

A contradiction is a propositional form that is false under all possible assignments of truth values to its variables. The script uses 'P and NOT P' as an example, which is always false because a proposition and its negation cannot both be true at the same time.

πŸ’‘Contingency

A contingency is a propositional form that is neither a tautology nor a contradiction, meaning its truth value can vary depending on the truth values of its variables. The script explains that contingencies like 'Q and NOT P implies P' and 'P and Q or NOT R is equivalent to P' can be true in some cases and false in others.

πŸ’‘Implication

Implication is a logical connective that is used to represent the relationship between two propositions, where the truth of one proposition (P) implies the truth of another (Q). The script describes the truth table for implication and discusses its various interpretations, such as 'if P then Q'.

πŸ’‘Equivalence

Equivalence in logic is a relationship between two propositions that are both true or both false under the same conditions. The script explains that an equivalence is represented by a double-headed arrow and provides the truth table for this logical connective.

πŸ’‘DeMorgan's Laws

DeMorgan's Laws are a set of rules in logic that allow for the transformation of logical expressions by moving negations from one side of a logical operation to the other. The script mentions these laws as a way to simplify logical expressions, showing that NOT (P AND Q) is equivalent to NOT P OR NOT Q.

πŸ’‘Associative Law

The Associative Law states that the way in which elements are grouped in a mathematical operation does not change the result. In the script, this law is mentioned in the context of logical operations, where (P OR Q) OR R is equivalent to P OR (Q OR R), and similarly for the AND operation.

πŸ’‘Distributive Law

The Distributive Law is a fundamental principle in mathematics that allows for the rearrangement of terms in an expression. The script explains that this law allows for the distribution of AND over OR (P AND (Q OR R) is equivalent to (P AND Q) OR (P AND R)) and vice versa, which can be useful in simplifying complex logical expressions.

Highlights

Discrete Mathematics is an essential course for computer science students, focusing on abstract mathematical models and discrete objects such as sets, permutations, graphs, and FSA.

The course aims to develop students' mathematical thinking and understanding of basic mathematical concepts used in computer science.

Discrete Mathematics has applications in various fields of computer science, including programming, artificial intelligence, computer networks, and compilers.

The course covers topics such as Logic, sets, relations, functions, graphs, combinatorics, recurrence relations, algebras, and finite state automata (FSA).

The first nine lectures are dedicated to Logic and its applications, including Propositional Logic, Predicate Logic, and Logical Inference.

Sets are fundamental in Discrete Mathematics, with three lectures allocated to explore their properties and applications.

Graph theory is extensively covered in the course, with four lectures dedicated to basic concepts and properties of graphs.

Relations are revisited with six lectures discussing their properties and their importance in computer science.

The course includes a lecture on lattices, which are about partially ordered sets, to understand complex structures in mathematics.

Combinatorics is introduced with lectures on the pigeonhole principle, permutations, combinations, and generating functions.

Recurrence relations are crucial for algorithmic analysis and are covered in three lectures to understand their significance.

Algebraic structures such as groups, semi-groups, and rings are studied to understand their role in Discrete Mathematics.

Finite state automata are introduced with two lectures focusing on their basic principles and applications in computer science.

Reference books for the course include 'Elements of Discrete Mathematics' by C.L.Liu and 'Discrete Mathematical Structures with Applications to Computer Science' by Tremblay and Manohar.

The course does not require prior knowledge beyond a reasonable mathematical maturity expected of a high school student.

Propositional Logic is the foundation of Logic, starting with the concept of a proposition and moving to logical connectives such as AND, OR, and NOT.

The truth table is a fundamental tool in Logic for determining the truth values of compound statements under various conditions.

Logical identities and laws, such as idempotence, commutativity, associativity, and DeMorgan's laws, are essential for simplifying and understanding logical expressions.

Transcripts

play00:09

This

play01:01

course is about discrete mathematical structures. It is a theoretical course intended for B.

play01:08

Tech or B.E. students in computer science in the second semester and what are the things

play01:16

we are going to study in this subject, so first of all what is discrete mathematics.

play01:23

And what are the topics to be covered here? Discrete Mathematics is a study of discrete

play01:32

structures which are abstract mathematical models dealing with discrete objects and their

play01:39

relationship between them. The discrete objects could be like: sets, permutations, graphs,

play01:49

FSA, etc. We will see in a minute, what are the topics to be covered here? And why do

play01:59

we want to study Discrete Mathematics? And why should one study this subject?

play02:06

The reason is, in many fields of Computer Science basic mathematical concepts will be

play02:14

used and in any books on them when such a concept is introduced they will not explain

play02:23

it in detail but briefly mention a few lines about it. But for a student to understand

play02:31

the subject completely, that may not be enough.

play02:34

At the same time, one need not go in-depth in this subject also. One need not learn this

play02:43

subject as a mathematical student could learn Algebra or analysis. You want to know something

play02:49

about each topic to a decent depth and that will help to understand the other subjects

play02:58

in computer science in a better way. The aim of this course is not only make people learn

play03:10

about these topics, but also help them to develop the habit of thinking mathematically.

play03:16

The student should develop to think in a mathematical manner. That is the aim of this course.

play03:26

What are the applications or what are the fields in which this these concepts will be

play03:33

used? They are plenty, in fact in each and every subject in Computer Science some where

play03:39

or the other these concepts will be used. For example, when you want to study programming,

play03:48

after writing a program you would like to check that if it is correct and you want to

play03:54

prove it, so proving programs correct is a topic which will be studied in this course

play04:02

which will help you to write correct programs. And in artificial intelligence lot of ideas

play04:09

about Logic will be used. Prolog is a Logic programming language where the resolution

play04:15

principle is used and we will learn about these in this subject.

play04:23

And in computer networks lot of concepts about graph theory and final state automata are

play04:31

used, so that will be very useful there. In fact you can find that in any field you will

play04:39

have a few concepts from discrete mathematics which will help you to understand the subject

play04:45

in a better manner. In compilers you learnt final state automata concepts will be used,

play04:53

cramer concepts will be used, hash functions should be used and these are studied in this

play04:59

subject. And now what are the topics which will be covered in this subject? We will be

play05:08

studying about Logic, sets, relations, functions, graphs, combinatorics, recurrence relations,

play05:16

algebras and FSA. The layout of the subject will be like this.

play05:29

First 9 lectures will be devoted to Logic and its applications. Then three lectures

play05:41

will be on sets. Actually this subject does not pre-suppose any prior knowledge from the

play05:48

student except a reasonable mathematical maturity expected of a high school student. That is

play05:55

the only thing we assume and proceed with this subject, In fact after learning this

play06:02

subject the student should be able to think more mathematically and also should have acquired

play06:08

a basic knowledge about these topics. Then we go on to relations. In relations, first

play06:15

we have lecture 13, then afterwards we shift to graphs from lecture 14-17, then again come

play06:23

back to more properties of relations from 18-23.

play06:31

Then the last lecture will be about lattices which are also about partially ordered sets.We

play06:38

will learn certain basic facts about graphs in lecture 14-17, then we will learn about

play06:47

functions in lecture 24-26, then a few lectures on combinatorics where we will be studying

play06:56

about pigeon hole principle, permutation and combination, and generating functions. Recurrence

play07:07

relation is another topic which is of importance especially in algorithmic analysis.

play07:15

We spend three lectures on them, and then we will study a little bit about algebras

play07:20

where we study about groups, semi groups, rings, etc and about finite state automata.

play07:27

We have two lectures where we study only the basic principles of final state automata.

play07:32

We shall give some reference books for the subject. Some of them are new and some of

play07:40

them are old. But, there have been recent editions of them, Elements of Discrete Mathematics

play07:48

by C.L.Liu and the second one is Discrete Mathematical Structures with Applications

play07:56

to Computer Science by Tremblay and Manohar. These are standard books. Discrete Mathematics

play08:05

in Computer Science by Stanat and McAllister is another book. Discrete Mathematics and

play08:13

its Application by Rosen,

play08:19

Logic and Discrete Mathematics by Grassman and Tremblay has some concepts about prolog

play08:25

and application of Logic to that. Introductory Combinatorics by Brualdi is a book that can

play08:34

be used to study some topics of Combinatory. Modern Applied Algebra by Birkhoff and Bartee

play08:39

is an old book but it has got some good concepts about Lattices and Final State Automata, Mathematical

play08:45

Theory of Computation by Manna is another book which will be useful for proving programs

play08:51

correct.

play08:54

Introduction to Combinatorial Mathematics by Liu is an old book but still it has got

play08:59

some very good topics: permutation and combination, generating functions, recurrence relation

play09:07

etc. Then for Automata Theory this book can be used Introduction to Automata Theory, Languages

play09:15

and Computation by Hofcroft Motwani and Ullman are some of them among the few books. There

play09:26

are so many other books also.

play09:31

Any student studying this subject can use the prescribed book by the respective University

play09:40

or College. Now we shall go on to the first topic Logic. Logic is a very useful topic.

play09:52

Every student in Computer Science should learn this topic because it is applied in proving

play10:02

programs correct in data bases where you study about relational algebra and relational calculus

play10:10

and also in artificial intelligence about reasoning and things like that. So, first,

play10:19

coming to Logic, there will be 9 lectures on Logic. They are divided like this:

play10:25

The first 2 lectures will be devoted to Propositional Logic, then we go on to Predicate Logic, then

play10:34

Logical Inference, then Resolution Principle, then Methods of Proofs, Normal Forms and 1

play10:43

lecture on Proving Programs Correct. So let us start first with Logic and Propositional

play10:55

Logic.

play10:59

What is Propositional Logic? So for that first we have to start with what is a proposition.

play11:09

In English language we talk about sentences, we talk about assertions, we talk about orders,

play11:15

questions and so on. What is a proposition? First of all it should be an assertion. An

play11:24

assertion is a statement. It is different from asking a question or giving an order,

play11:30

the proposition is an assertion which is either true or false but not both. So you must be

play11:40

able to associate a truth value with an assertion.

play11:51

The truth value will be false or true. Usually you denote false by 0 and true by 1. So to

play12:06

any sentence or to any assertion to which you can associate a truth value is called

play12:12

a proposition. Consider the following examples: the following are propositions, 4 is a prime

play12:22

number, it is an assertion but it is a false statement. So the truth value associated with

play12:29

4 is a prime number is false. Then take the next sentence, 3 plus 3 is equal to 6. Again,

play12:39

it is an assertion and it is a correct statement. So the truth value associated with that is

play12:45

true. The moon is made of green cheese or the moon is made of cheese. This is again

play12:54

an assertion and a wrong statement. So the truth value associated with that is false.

play13:00

Let us see what are not propositions.

play13:07

Consider the statement X plus Y greater than 4, is it true or false? It depends on what

play13:19

value you are going to give for X and Y. If you give X the value 2, Y the value 2, then

play13:27

2 plus 2 is greater that 4, is not correct. Or, if I give the value X is equal to 3, Y

play13:35

is equal to 4, then it takes the value 3 plus 4 is greater than 4, that is 7 is greater

play13:46

than 4 which is correct.

play13:48

So depending on the value you give for X and Y the statement takes a true or a false value.

play13:54

It does not have a unique value, it depends on the value you are going to give for the

play14:00

variables X and Y. X and Y are called individual variables. So you cannot associate a unique

play14:07

truth value to this. Next, take the sentence X is equal to 3. Here you find that you cannot

play14:21

associate a truth value to this. If you give the value 3 to X it will be true, if you give

play14:27

some other value to X, it will not be true. So again this is not a proposition.

play14:35

Take the next one, are you leaving? This is not an assertion. A proposition should be

play14:40

an assertion. Are you leaving is a question and it is not an assertion. So it is not a

play14:46

proposition. Take the next one, buy 4 books, this again is not an assertion, it is an order,

play14:55

go and buy 3 books, this is an order and not an assertion so it cannot be a proposition.

play15:01

So whenever something is not an assertion, it is a question or an order it cannot be

play15:05

a proposition. But in special cases there can be assertions which are not propositions.

play15:14

For example, consider this sentence. This statement is false. This is an assertion,

play15:34

is it a proposition? It is not a proposition because you cannot associate a truth value

play15:40

to this. If it is true, it is false. If it is false, it is true. So you cannot associate

play15:48

a true or a false value with this statement. This is called a paradox. This is actually

play15:56

called a liar paradox. And such a statement even though it is an assertion,

play16:06

it is not a proposition because you are not able to associate a truth value to that.

play16:16

This has, you have individual variables X and Y to which we associate numbers. You can

play16:22

talk about proposition variables. A propositional variable denotes an arbitrary proposition

play16:29

with unspecified truth value like P, Q and R.

play16:33

They are all propositional variables and you can assign a proposition to them. P is just

play16:41

a propositional variable, just as we assigned the value 4 to X, you can assign the value

play16:46

of a proposition to the variable P. Similarly, you can denote these as propositional variables

play16:57

and you can assign propositions as values to them. Then when you have propositional

play17:04

variables or actually propositions also, you can connect them with logical Connectives.

play17:11

There are several Connectives. First, we shall study three of them: and, or, and not.

play17:20

Consider the proposition, John is 6 feet tall, and the proposition Q, there are 4 cows in

play17:35

the barn. Then the compound statement P and Q is John is 6 feet tall and there are 4 cows

play17:44

in the barn. When is this true? P and Q will be true when both P is true and Q is true.

play17:56

So we have a truth table for them. So and is denoted by this symbol and the truth table

play18:09

for that will be P Q or P and Q.

play18:18

The possibilities are, both can be false or P can be false and Q can be true. This can

play18:26

be true and this can be false and both can be true, these are the possibilities. And

play18:33

when both are false the compound statement will be false and when one is false also the

play18:40

compound statement will be false but when both are true the compound statement will

play18:45

be true. Usually we denote false by 0 and true by 1. So the truth table will be like

play18:54

this, P Q, P and Q 0 0, 0 1, 1 0, 1 1. And in these three cases it is 0 and 1 in this

play19:17

case. So the compound statement P and Q will be true only when both P is true and Q is

play19:27

true. In all the other cases it will be false. What about the Connectives or P or Q? If P

play19:37

denotes this sentence and Q denotes this sentence P or Q will denote the sentence John is 6

play19:44

feet tall or there are 4 cows in the barn.

play19:49

When can you say that this is true? When one of them is true the compound statement will

play19:57

be true or when both of them are true also the compound statement will be true. This

play20:05

is called inclusive OR and the truth table for that will be like this.

play20:19

P Q, P or Q, 0 0, 0 1, 1 0, 1 1, 0 denotes false and 1 denotes true and when both of

play20:33

them are false, this is false. When one of them or both of them are true, this will be

play20:38

true. This is the truth table. This is called a truth table for OR. And for the unary operator

play20:57

NOT P and NOT P, when P is false NOT P will be true and when P is true NOT P will be false.

play21:11

So, what is the statement NOT P? John is not 6 feet tall. That will be the statement for

play21:20

NOT P. So, we are studying the operators And, OR, and NOT. There is one more operator called

play21:33

the Exclusive or. An assertion which contains at least one propositional variable is called

play21:40

a propositional form. So when you connect two propositional variables by And or OR it

play21:45

is a propositional form.

play21:46

You can also use the Exclusive or operator. Exclusive or means the truth table for that

play22:00

will be like this -> 0 1, 1 0, 1 1. In the Exclusive or case it is true only when one

play22:20

of them is true and the other is false. If both of them are true or both of them are

play22:26

false, it is false. So when you say something like that, John is 6 feet tall, there are

play22:36

4 curves in the bond. Both statements can be true and the compound statement can be

play22:41

true. But in some cases like say Sudha is wearing a saree and Sudha is wearing a blue

play22:51

chudidhar, and if I say Sudha is wearing a saree or Sudha is wearing a blue chudidhar

play22:56

both of them cannot be true at the same time. Only one can be true, the other will be false.

play23:04

So in such cases you use Exclusive or.

play23:08

Usually when you say either this or that it means Exclusive or. When you just say or it

play23:15

means inclusive or. But you have to be very careful because sometimes they are used in

play23:20

a slightly ambiguous way. So when you want to transform an English sentence into logical

play23:26

notation or transform some logical formula into English sentence you have to be very

play23:32

careful whether you are using inclusive or, Exclusive or. Usually Exclusive or means you

play23:39

must say either or and for inclusive or you just say or without that either. And any propositional

play23:52

form which is connecting variables, it is called a well formed formula of Propositional

play24:12

Logic. Well formed formula is denoted by wff usually called as wff. So P and Q is a well

play24:30

formed formula. P or Q is a well formed formula, P Exclusive or Q is a well formed formula.

play24:37

So P Exclusive or will be denoted like P Exclusive or.

play24:45

Apart from these operators, there are two more operators which are used in Logic. One

play25:00

is called the implication and another is called equivalence. What is implication? Let us look

play25:07

at this. P implies Q, it is denoted like P implies Q. In some books, it may be written

play25:19

like this and in some books they rarely use this sort of an arrow for P implies Q. So

play25:29

when you take a book you must be clear to find what sort of a notation they are using.

play25:35

Similarly, NOT P is usually denoted like this. Sometimes it is also denoted like this. So

play25:41

when you see a book you must be careful to find what notation they are using. So in this

play25:51

case, P is called the premise, hypothesis or antecedent and Q is called the conclusion

play26:01

or consequence. And what is the truth table for P implies Q? For P implies Q you have:

play26:10

0 0, 0 1, 1 0, 1 1, then when both are false, it is true. When P is false and Q is true,

play26:18

it is true. When P is true and Q is false, it is false. When both of them are true, it

play26:25

is true. There is a slight problem here, it is not a problem but you must feel convinced

play26:34

about this truth table. Usually when we say Logic or what we study is Greek Logic which

play26:45

was formulated by Aristotle Socrates and Greek philosophers, in such Logic this is the truth

play27:00

table for implication.

play27:01

The antecedent and the consequent need not be related at all, they may be quiet unrelated

play27:08

statements like the moon is made of cheese, then the earth is not round, it could be something

play27:34

like that. There is no relation between the antecedent and the consequence. But the compound

play27:42

statement is true because this is of the form false implies false. And for that in the first

play27:54

line of the truth table tells you if P is 0 and Q is 0, P implies Q will be true. Greek

play28:03

Logic allows that. Usually in Indian Logic you look at Aryabhatta or Bascrads explanation

play28:13

on Aryabhatta’s work, such things are not allowed.

play28:17

Usually antecedent and the consequence will be related. For example, something like this,

play28:23

you can very easily see, if I fall into the lake I will get wet. Obviously the premise

play28:30

and the conclusion or the consequence is related and you can see the correspondence between

play28:36

them. But generally in the truth table you must also give a value at the compound statement

play28:43

even though the premise and antecedent are not related. This, you must remember very

play28:52

well. So the implication is true when the premise or the antecedent is false or the

play29:02

consequence is true. It is false only in the case when premise is true and the conclusion

play29:09

is false or the antecedent is true and the consequence is false. Only in that case it

play29:14

will be false. In the other three cases it is taken to be true. This can be read in several

play29:22

ways.

play29:23

You can read it as; if P then Q, P only if Q, P is a sufficient condition for Q, Q is

play29:35

a necessary condition for P, Q if P, Q follows from P, Q provided P, Q is a logical consequence

play29:46

of P, Q whenever P. These are the different ways of saying this. You would have studied

play30:01

about sufficient conditions and necessary conditions in High school level and in many

play30:09

theorems where the statement will be in the form if then.

play30:13

For example, you would have studied the Pythagoras theorem. If a, b, c is a triangle right angled

play30:20

at b, then ac square is equal to ab square plus bc square So the statement of the theorem

play30:27

is of the form if something, then something. And sometimes you talk about the converse

play30:37

of a theorem. Sometimes the theorem will be proved in a slightly different manner. When

play30:44

we study methods of proof we will get into that in detail. But generally, the converse

play30:53

of a theorem is denoted as Q implies P. P implies Q is a statement and the converse

play31:03

is Q implies P and NOT Q implies NOT P is called the contra positive. So you have this

play31:20

P implies Q, Q implies P is the converse, NOT Q implies NOT P is the contra positive.

play31:46

So suppose Pythagoras theorem is, if a, b, c is a triangle right angled at b then ac

play31:56

square is ab square plus bc square.

play32:00

What will be the converse of that theorem? Converse also you would have studied in school.

play32:04

If in a triangle ac square is ab square plus bc square, then the triangle is right angled

play32:12

at b. So that is a converse. In this case it so happens that both the theorem and converse

play32:20

are true. But several situations may arise where the theorem may be true but the converse

play32:26

need not be true, because P implies Q it does not mean Q implies P is true. Whereas the

play32:33

contra positive NOT Q implies NOt P will be true whenever P implies Q is true. Let us

play32:41

draw the truth table and see this. So you have P, you have P Q, P implies Q NOT P NOT

play33:00

Q, NOT Q implies NOT P. So consider this table. You have the possibilities 0 0,,

play33:21

0 1, 1 0 and 1 1.

play33:31

Another thing you must note before going into that is, let us see if there are variables

play33:38

say P, Q, R, S like that, in the truth table there will be one column for each one of the

play33:47

variables and there will be one row for each assignment of the variables. Each variable

play33:55

can be assigned the value true or false that is, 0 or 1. So if there are 4 variables there

play34:01

will be 2 into 2 into 2 into 2, where we get 16 possibilities. So there will be 16 rows

play34:07

in the truth table.

play34:11

In general when you deal with N propositional variables and you want to study the truth

play34:21

table involving them for an expression involving them, there will be N columns, first N columns

play34:29

will be for variables and later on there will be more columns. Here there are two variables,

play34:44

two columns are for the variables. And here you consider every possible assignment for

play34:50

the variables. So there will be 2 power n possible assignments of truth values for the

play35:07

variables and so there will be 2 power n rows and if you look at them carefully they are

play35:15

representing binary numbers 0 1 2 3. So, they will represent binary numbers from 0 to 2

play35:25

power n minus 1.

play35:37

Now coming to this, this is NOT Q implies NOT P is the contra positive. P implies Q

play35:48

is true here, it is false here, what about NOT P? NOT P will be true if P is false, it

play35:59

will be false when P is true, what about NOT Q? If Q is false, this will be true, if Q

play36:08

is true, this will be false and when is the implication false? When the premise is true

play36:20

and the conclusion is false. So, in this case it will be false 1 and 0. If the premise is

play36:27

false the conclusion will be true. I mean the result, the implication will be true.

play36:34

If the consequence is true then also it is true. Here both are 1, so it will be true

play36:43

as 1 represents true. So you see that these two columns are identical. So P implies Q

play36:58

is the same as saying NOT Q implies NOT P. Many times you will make use of such statements.

play37:09

For example, if a prime number is not a perfect number, so you may say it as if X is a prime

play37:21

it is not a perfect number, or you may also say a perfect number is not a prime, it is

play37:26

saying the other way round in the contra positive manner.

play37:36

So the next thing is equivalence. You also have a logical connective equivalence which

play37:44

is denoted by a double arrow with arrow like this which is called equivalence. This is

play37:52

read as P is equivalent to Q or P if and only if Q or P is a necessary and sufficient condition

play38:00

for Q. Generally you read it as P is equivalent to Q or P, if and only if Q. This is also

play38:07

correct. Now, P is a necessary and sufficient condition for Q. When is this compound statement

play38:12

true? This compound statement is true when both P and Q have the same values. When both

play38:21

of them are false or when both of them are true, the compound statement takes the value.

play38:28

If one of them is false and the other is true, then it takes the value false. So this is

play38:36

the truth table for equivalence.

play38:41

Those who have learnt a little bit about Boolean algebra will know the similarity between propositional

play38:46

logic and Boolean algebra. In Boolean algebra you also study about two operators and NOT,

play38:52

which we will not study in Logic and instead in Logic we study about equivalence and implication.

play39:03

Now let us take some examples: Let us construct truth tables for Q and NOT P implies P and

play39:13

P and Q or NOT R is equivalent to P. So as I mentioned to you earlier, when you have

play39:21

k variables there will be k columns for each of the variables.

play39:25

Then some more columns, but there will be 2 power k rows representing the assignments

play39:32

and they will be representing binary numbers from 0 to 2 power k minus1. Now let us draw

play39:43

the truth tables for these expressions.

play39:46

Q and NOT P implies P. There are two variables P and Q. So there will be two columns for

play39:58

them and you will give the values 0 0, 0 1, 1 0, 1 1 for them. Then NOT P, Q and NOT P

play40:24

in the whole expression Q and not P implies. Now, when is not P true? When P is false NOT

play40:52

P is true and when P is true NOT P will be false and the adding of that when both of

play41:02

them are true this is true. In other cases it will be false. Now this is the premise

play41:11

and this is the consequence. When is the implication true?

play41:18

When the premise is false the implication will be true. And in this case the premise

play41:24

is true and the conclusions are there, consequence is false. So in that case you know that it

play41:29

is false. So this is the truth table for Q and NOT P implies P. Now let us take the other

play41:40

one P and Q or NOT R is equivalent to P. There are three variables P, Q and R. So, there

play41:49

will be three columns for them and there will be all possible assignments for them. That

play42:00

will be: 0, 0 and 0. Usually, you write them in this order so that they are representing

play42:06

number 0, 1, 2 and 3 etc, 1 0 1, 1 1 0, 1 1 1. Now, what is the statement? The statement

play42:31

is this, I will write here, P and Q or NOT R is equivalent to P. So next you must have

play42:47

a column for P and Q, you must have a column for NOT R, So when is P and Q true? When both

play43:00

of them are true, when one of them is false, it will be false. So you get this for P and

play43:09

Q. When is not of r true? When r is false and it is false when r is true. So you will

play43:18

get 1 0 1 0 1 0 and 1 0. Now you have the expression for P and Q or NOT of R. you are

play43:38

orring this and this. When you Orr, when one of them is true the result is true. So when

play43:51

one of them is true, it is true. When both of them are false, it is false. In this case

play43:57

it will be true, in this case it will be false, true and true.

play44:05

Then the last column is like this: P and Q or NOT R, this is equivalent to P. When are

play44:18

two expressions equivalent? When they take the same value 0 0 or 1. So you have to compare

play44:27

this and this, when they are the same, it is true here, 0 0, it is true but here it

play44:33

is 0 and 1, so it is false, 0 and 0 it is true, 1 and 1 it is true, 0 and 1 it is false,

play44:47

1 and 1, 1 and 1 is true. So this is the truth table for P and Q or NOT R is equivalent to

play45:01

P. So for any given expression, you can draw the truth table and find out when the whole

play45:12

expression will be true and when the whole expression will be false and so on.

play45:17

Now a tautology is a propositional form whose truth value is true for all possible values

play45:28

of its propositional variables. Sometimes an expression may be such that, always it

play45:35

takes the truth value true. For example, P or not P, consider this expression P or not

play45:43

P. There are two possibilities, P can be true or P can be false. When P is true, this compound

play45:51

expression is true because one of the component is true. When P is false NOT P will be true.

play45:59

So this compound expression will be true because one of the components is true. So whether

play46:05

you give the value 0 or 1 or false or true to P, this compound expression is always true.

play46:13

Such an expression is called a tautology.

play46:15

A tautology is a propositional form whose truth value is true for all possible values

play46:22

of its propositional variables. The other way round, a contradiction or an absurdity

play46:30

is a propositional form which is always false, take this expression P and NOT P. There are

play46:38

two possibilities, P is true or P is false. If P is true NOT P is false, so this expression

play46:49

will be false because and will be true only when both of them are true. It is not possible

play46:55

for both P and NOT P to be true either one of them will be true. In any case, one of

play47:02

them will be true, the other will be false. The possibility is, this is true, this is

play47:06

false or this is false, this is true. In any case this compound expression P and NOT P

play47:12

will always be false. Such an expression is called a contradiction.

play47:16

A propositional form which is neither a tautology nor a contradiction is called a contingency.

play47:25

These are the examples which we consider: Q and NOT P implies P and Q and P or NOT R

play47:35

is equivalent to P. These two are the examples of contingency. In some cases they are true

play47:41

but in some cases they are false. So they are examples of contingency. Given a propositional

play47:48

form, it is always possible to find out whether it is a tautology or not because you can always

play47:57

draw the truth table and if the last column is always 1 1 and 1 then it is a tautology.

play48:03

If the last column is always 0 0 and 0 then it is a contradiction and sometimes when it

play48:08

is 0 and sometimes it is 1, then it is called a contingency.

play48:14

Then, we have a lot of logical identities. These logical identities can be used in simplifying

play48:29

logical expressions. Let us see one by one. P is equivalent to saying P or P. When you

play48:41

say P or P, it is not necessary to say twice, it is enough to say once. This is called idempotence

play48:48

of R. Then, if you have P and P, it is not necessary to write like this. It is enough

play48:54

to say like this: So P is equivalent to P and P. This is called idempotence of and.

play49:00

So, whenever in an expression you get something like P and P, you can replace it by P. Then

play49:08

you have the commutative laws. It is equivalent to saying Q or P is equivalent to saying P

play49:15

or Q. You can interchange the variables, it does not affect the meaning, either this or

play49:23

that. A or B is B or A, so P or Q is same as Q or P. So, this is called commutativity

play49:31

law.

play49:32

Similarly, you have commutativity for an, P and Q is equivalent to saying Q and P and

play49:41

you have associative laws P or Q, then or R. That is first or P or Q. Then you take

play49:54

R and combine, that is equivalent to having P or Q or R and P and Q and R is equivalent

play50:06

to saying P and Q and R. This is called associative law. And in general whenever you write an

play50:16

expression you try to use parenthesis. There is no priority but generally NOT has higher

play50:23

priority than and or if you use only these three it is because you can write NOT P and

play50:36

Q. This is NOT P and Q that is it is equivalent to saying NOT P and Q. You can write without

play50:45

the parenthesis, it is not NOT P and Q, this is different. If you want to write like this,

play50:50

you must put the parenthesis in a proper way.

play50:57

So, we see that, but P and Q and R, you can write without parenthesis because of associativity.

play51:03

Whether we group this first, or this first is immaterial. When both the operators are

play51:09

without any problem, you can write like this. That is what is meant by associativity of

play51:14

law and similarly for OR.

play51:16

Whereas, you can realize that P implies Q implies, if you want to write like that, P

play51:24

implies Q implies R, this is different from saying P implies Q implies R. You cannot say

play51:34

something like this; P implies Q implies R because you do not know whether you mean this

play51:40

or that. You can draw the truth table and verify that this has got a different value,

play51:47

they are not the same, so you cannot write something like this. You have to put parenthesis

play51:53

wherever is either you mean this or you mean that. So, implication is not associative.

play52:04

And there are Demorgans laws which are very common and very useful also. NOT of P or Q,

play52:13

you can bring the NOT inside which will mean NOT P and NOT Q. You can again draw the truth

play52:19

table for this and see that they will be identical, the columns representing them will be identical.

play52:25

So, when you bring the NOT inside, R becomes similarly NOT of P and Q will be NOT of P

play52:35

or NOT of Q, So, when you bring the NOT inside, it becomes R and R becomes And. These are

play52:41

called Demorgans laws.

play52:45

Then you have distributive laws and distributes over R. That is P and Q or R is equivalent

play52:54

to saying P and Q or P or R. So you can distribute and over R and write like this. Sometimes

play53:04

you can use the distributive laws in the reverse direction also. Another thing is, R distributes

play53:12

over and, P or Q and R is the same as saying P or Q and P or R. Again, here also in the

play53:26

distributive law sometimes you can apply in the reverse. Then you have these rules implying

play53:32

when one of the operands is true or false, P or 1 is always 1. So this is a compound

play53:40

statement. But when one of the operands is true, the compound statement is always true,

play53:47

this we know. So even when one of them is true, this is true and now we are taking one

play53:53

operand as true only so this is 1, P and 1 if P is true this will be true, if P is false

play54:01

this will be false. So P and 1 has the same value as P. Similarly for R, P R 0, if P is

play54:11

true, this will be true if P is false, this will be false. So P or 0 takes the same value

play54:17

as P and the and with 0, P and 0 because one of the operands is false, the compound statement

play54:27

will be false, so you will have P and 0 which is the same as 0 or false.

play54:33

P or NOT P is always 1, which is always true. This is called a tautology. This is what we

play54:40

have seen earlier. P and NOT P is called a contradiction or absurdity if it always takes

play54:46

the value 0. And you have double negation saying P is equivalent to NOT of P. So if

play55:00

you use negative negation operation twice, it is equal to the original statement.

play55:08

There are some more statements like this. We shall briefly look into them. We shall

play55:14

look into them in more detail in the next lecture, but just we have a brief look at

play55:21

them. P implies Q, you can write it as NOT P or Q. This is equivalent to saying P implies

play55:31

Q. And similarly P is equivalent to Q, you can equivalently say it as P implies Q and

play55:39

Q implies P. This rule is also true P and Q implies R, is equivalent to saying P implies

play55:48

Q implies R and P implies Q and P implies NOT Q is equivalent to saying NOT P. It is

play55:56

called absurdity. This is used in proves by contradiction. This is the most commonly used.

play56:03

This we have seen earlier P implies Q is equivalent to saying NOT Q implies NOT P which is the

play56:09

contra positive and so on. So in this class we have learnt about a few logical connectives

play56:18

and on how to write the truth table and so on. We shall continue with these concepts

play56:25

in the next lecture.

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
Discrete MathComputer ScienceLogic PrinciplesTheoretical CourseMathematical StructuresProgramming LogicAI ReasoningGraph TheoryAutomata ConceptsCombinatorics