Prepositional Logic

Importance of Mathematical Logic
The rules of logic give precise meaning to mathematical statements. These rules are used to distinguish between valid and invalid mathematical arguments.
Apart from its importance in understanding mathematical reasoning, logic has numerous applications in Computer Science, varying from design of digital circuits, to the construction of computer programs and verification of correctness of programs.
 

Prepositional Logic

A proposition is the basic building block of logic. It is defined as a declarative sentence that is either True or False, but not both.
The Truth Value of a proposition is True(denoted as T) if it is a true statement, and False(denoted as F) if it is a false statement.


1. The sun rises in the East and sets in the West.
2. 1 + 1 = 2
3. 'b' is a vowel.
All of the above sentences are propositions, where the first two are Valid(True) and the third one is Invalid(False).
Some sentences that do not have a truth value or may have more than one truth value are not propositions.
For Example,
1. What time is it?
2. Go out and play.
3. x + 1 = 2.
The above sentences are not propositions as the first two do not have a truth value, and the third one may be true or false.
To represent propositions, propositional variables are used. By Convention, these variables are represented by small alphabets such as p,q,r,s .
The area of logic which deals with propositions is called propositional calculus or propositional logic.
It also includes producing new propositions using existing ones. Propositions constructed using one or more propositions are called compound propositions. The propositions are combined together using Logical Connectives or Logical Operators.

Truth Table
Since we need to know the truth value of a proposition in all possible scenarios, we consider all the possible combinations of the propositions which are joined together by Logical Connectives to form the given compound proposition. This compilation of all possible scenarios in a tabular format is called a truth table.

 OR () − The OR operation of two propositions A and B (A ∨ B) is true if at least any of the propositional variable A or B is true.
The truth table is as follows −
A B A ∨ B
True True True
True False True
False True True
False False False

AND () − The AND operation of two propositions A and B (A ∧ B
) is true if both the propositional variable A and B is true.
The truth table is as follows −
A B A ∧ B
True True True
True False False
False True False
False False False
 Negation (~) − The negation of a proposition A (¬ A is false when A is true and is true when A is false.
The truth table is as follows −
A ¬ A
True False
False True

 Implication / if-then ( → )  − An implication(A → B)
is the proposition “if A, then B”. It is false if A is true and B is false. The rest cases are true.
The truth table is as follows −
A B A → B
True True True
True False False
False True True
False False True


 If and only if(⇔) (A ⇔ B)
is bi-conditional logical connective which is true when p and q are same, i.e. both are false or both are true.
The truth table is as follows −
A B A ⇔ B
True True True
True False False
False True False
False False True

Tautology
A Tautology is a formula which is always true for every value of its propositional variables.
Example

The truth table is as follows −
A     B         A → B           (A → B) ∧ A         A ⇔ B
True     True  True True True
True       False  False False True
False     True  True False True
False      False True False True



is "True", it is a tautology.

Contradiction
A Contradiction is a formula which is always false for every value of its propositional variables.
Example

The truth table is as follows −
A B A ∨ B ¬ A ¬ B (¬ A) ∧ ( ¬ B) (A ∨ B) ∧ [( ¬ A) ∧ (¬ B)]
True True True False False False False
True False True False True False False
False True True True False False False
False False False True True True False


is “False”, it is a contradiction.


Contingency

A Contingency is a formula which has both some true and some false values for every value of its propositional variables.  
Example

The truth table is as follows −
A       B        A ∨ B          ¬ A          (A ∨ B) ∧ (¬ A)
True          True     True       False False
True          False     True      False False
False         True     True     True True
False          False      False     True False


has both “True” and “False”, it is a contingency.






Sunday 17 February 2019

Prepositional Logic

Importance of Mathematical Logic
The rules of logic give precise meaning to mathematical statements. These rules are used to distinguish between valid and invalid mathematical arguments.
Apart from its importance in understanding mathematical reasoning, logic has numerous applications in Computer Science, varying from design of digital circuits, to the construction of computer programs and verification of correctness of programs.
 

Prepositional Logic

A proposition is the basic building block of logic. It is defined as a declarative sentence that is either True or False, but not both.
The Truth Value of a proposition is True(denoted as T) if it is a true statement, and False(denoted as F) if it is a false statement.


1. The sun rises in the East and sets in the West.
2. 1 + 1 = 2
3. 'b' is a vowel.
All of the above sentences are propositions, where the first two are Valid(True) and the third one is Invalid(False).
Some sentences that do not have a truth value or may have more than one truth value are not propositions.
For Example,
1. What time is it?
2. Go out and play.
3. x + 1 = 2.
The above sentences are not propositions as the first two do not have a truth value, and the third one may be true or false.
To represent propositions, propositional variables are used. By Convention, these variables are represented by small alphabets such as p,q,r,s .
The area of logic which deals with propositions is called propositional calculus or propositional logic.
It also includes producing new propositions using existing ones. Propositions constructed using one or more propositions are called compound propositions. The propositions are combined together using Logical Connectives or Logical Operators.

Truth Table
Since we need to know the truth value of a proposition in all possible scenarios, we consider all the possible combinations of the propositions which are joined together by Logical Connectives to form the given compound proposition. This compilation of all possible scenarios in a tabular format is called a truth table.

 OR () − The OR operation of two propositions A and B (A ∨ B) is true if at least any of the propositional variable A or B is true.
The truth table is as follows −
A B A ∨ B
True True True
True False True
False True True
False False False

AND () − The AND operation of two propositions A and B (A ∧ B
) is true if both the propositional variable A and B is true.
The truth table is as follows −
A B A ∧ B
True True True
True False False
False True False
False False False
 Negation (~) − The negation of a proposition A (¬ A is false when A is true and is true when A is false.
The truth table is as follows −
A ¬ A
True False
False True

 Implication / if-then ( → )  − An implication(A → B)
is the proposition “if A, then B”. It is false if A is true and B is false. The rest cases are true.
The truth table is as follows −
A B A → B
True True True
True False False
False True True
False False True


 If and only if(⇔) (A ⇔ B)
is bi-conditional logical connective which is true when p and q are same, i.e. both are false or both are true.
The truth table is as follows −
A B A ⇔ B
True True True
True False False
False True False
False False True

Tautology
A Tautology is a formula which is always true for every value of its propositional variables.
Example

The truth table is as follows −
A     B         A → B           (A → B) ∧ A         A ⇔ B
True     True  True True True
True       False  False False True
False     True  True False True
False      False True False True



is "True", it is a tautology.

Contradiction
A Contradiction is a formula which is always false for every value of its propositional variables.
Example

The truth table is as follows −
A B A ∨ B ¬ A ¬ B (¬ A) ∧ ( ¬ B) (A ∨ B) ∧ [( ¬ A) ∧ (¬ B)]
True True True False False False False
True False True False True False False
False True True True False False False
False False False True True True False


is “False”, it is a contradiction.


Contingency

A Contingency is a formula which has both some true and some false values for every value of its propositional variables.  
Example

The truth table is as follows −
A       B        A ∨ B          ¬ A          (A ∨ B) ∧ (¬ A)
True          True     True       False False
True          False     True      False False
False         True     True     True True
False          False      False     True False


has both “True” and “False”, it is a contingency.