Boolean Algebra

ShareThis is an introduction to Propositional Logic tutorial.

A Proposition is an atomic sentence that can either be TRUE or FALSE and nothing else.

Following sentences are example of proposition.

Proposition: India is a country

Result: TRUE

Proposition: 100 is greater than 200

Result: FALSE

Whereas the sentence **How are you?** is not a proposition as the answer can’t be TRUE or FALSE.

A simple proposition is one that does not contain any other propositions as its part.

A compound proposition is one that is made up of two or more simple propositions.

We use lower case letters a,b,c… to represent proposition.

**It is raining.**

This statement can either be TRUE or FALSE.

**Today is Sunday and Sunday is a holiday.**

This statement contain two simple propositions "Today is Sunday" and "Sunday is a holiday" both the statement can be either TRUE or FALSE.

Operator or logical connective are the things that joins simple propositions into compound propositions and joins compound propositions into larger compound propositions.

Propositional Logic is a way to represent logic through propositions and logical connectives.

Following are the types of logical connectives (operators) used in propositional logic.

- Disjunctive (also called OR)
- Conjunctive (also called AND)
- Conditional (also called Implication)
- Bi-conditional (also called Equivalence)
- Negation (also called NOT)

Disjunctive (also called OR) means one of the two arguments is true or both of them are true.

We use the word OR and + and ∨ symbols to represent disjunctive.

Example

p + q

p ∨ q

p OR q

They all mean

either p is true, or q is true, or both are true.

Consider two arguments (proposition)

p = Oct 21, 2012 was Sunday

q = Sunday is a holiday

then,

p + q

p ∨ q

p OR q

They all means either p is true, or q is true, or both are true.

i.e., either **Oct 21, 2012 was Sunday** is true or **Sunday is a holiday** is true or both are true.

Conjunctive (also called AND) means both the arguments are true. We use the word AND and . & and ∧ symbols to represent conjunctive.

Example

p . q

p & q

p ∧ q

p AND q

They all means both p and q are true.

Consider two arguments (proposition)

p = Oct 21, 2012 was Sunday

q = Sunday is a holiday

then,

p . q

p & q

p ∧ q

p AND q

They all means both p and q are true.

i.e., both **Oct 21, 2012 was Sunday** and **Sunday is a holiday** are true.

Conditional also called Implication (If...Then).

Implication means if one argument is true then the other argument is true.

We use the ⇒ symbol to represent conditional operator.

Example

p ⇒ q

this means if p is true, then q is true.

Consider two arguments (proposition)

p = 10 is greater than 0

q = 10 is positive

then,

p ⇒ q

this means if p is true, then q is true.

i.e., if 10 is greater than 0 then 10 is positive.

Bi-conditional also called Equivalence (If and only If).

Equivalence means either both arguments are true or both are false.

We use the ⇔ symbol to represent bi-conditional.

Example

p ⇔ q

this means

p and q either both are true or both are false.

Consider two arguments (proposition)

p = 10 is greater than 0

q = 10 is positive

then,

p ⇔ q

this means

p and q either both are true or both are false.

i.e., 10 is greater than 0 and 10 is positive

either both are true or both are false.

Negation is an operator that affects only one statement and does not join two statements.

We use the ~ and ' symbol to represent negation

~p

p'

this means

if p is true then,

~p is false.

Example

Consider the argument (proposition)

p = It is raining

if p is true i.e., it is raining

then,

~p is false i.e., it is not raining.

- Maximum subarray problem - Kadane's Algorithm Programming
- Maximum subarray problem Programming
- Find median of an array Programming
- Find the minimum and maximum number in an array using Tournament Method Programming
- Find the minimum and maximum number in an array Programming
- Reverse a string Programming
- Design Patterns - Strategy Pattern Design Patterns
- PostgreSQL - SELECT FROM Table PostgreSQL
- PostgreSQL - INSERT INTO Table PostgreSQL
- PostgreSQL - CREATE Table PostgreSQL