Ever wondered how computers can understand and process human language? A fundamental concept that underpins this ability is propositional logic. It's the language of logic, a system for representing and manipulating statements.
Think of it as the grammar of reasoning. Propositional logic provides the rules and structures for combining simple statements (called propositions) into more complex ones. These rules help us to determine the truth or falsity of these statements based on the truth values of their components.
Propositions
Our discussion begins with an introduction to the basic building blocks of logic—propositions. A proposition is a declarative sentence (that is, a sentence that declares a fact) that is either true or false, but not both.
For example, let us take a couple of declarative sentences.
1. Washington, D.C., is the capital of the United States of America.
2. Toronto is the capital of Canada.
3. 1 + 1 = 2
4. 2 + 2 = 3
So here, Propositions 1 and 3 are true whereas 2 and 4 are false.
Now, let us take sentences which aren't propositions;
1. Read this carefully.
2. x + 1 = 2
3. x + y = z
Here, 1 isn't a proposition since the sentence is not declarative, whereas 3 and 4 aren't propositions because they are neither true nor false, but can be converted to propositions once values are assigned to the variables.
We use letters to denote propositional variables (or statement variables), that is, variables that represent propositions, just as letters are used to denote numerical variables. The truth value of a proposition is true, denoted by T, if it is a true proposition, and the truth value of a proposition is false, denoted by F, if it is a false proposition. The area of logic that deals with propositions is called the propositional calculus or propositional logic. It was first developed systematically by the Greek philosopher Aristotle more than 2300 years ago.
Negation of p (¬p or p'): The proposition ¬p is read “not p.” The truth value of the negation of p, ¬p, is the opposite of the truth value of p.
For example: We take a proposition "It is raining." So the negation of this proposition is "It is not the case that it is raining."
This negation can be simply expressed as "It is not raining."
In propositional logic, we need to know the truth values of propositions in all possible scenarios. We can combine all the possible combination with logical connectives, and the representation of these combinations in a tabular format is called Truth table. The truth table for negation is expressed as follow:
Conjunction (p ∧ q): Let p and q be propositions. The conjunction of p and q, denoted by p ∧ q, is the proposition “p and q.” The conjunction p ∧ q is true when both p and q are true and is false otherwise.
Example: Rohan is intelligent and hardworking.
It can
be written as,
P= Rohan is intelligent,
Q= Rohan is hardworking.
→ P∧ Q'
The truth table for Conjunction is as follow:
Example: "Ritika is a doctor or Engineer",
Here P= Ritika is Doctor.
Q= Ritika is Engineer,
so we can write it as P ∨ Q.
The truth table for Disjunction is as follow:
Exclusive OR (XOR) is like telling the waiter, "I want either a steak or a fish, but not both." It's a choice where only one option can be true at a time.
Here's a breakdown:
- If you choose a fish: That's true.
- But if you choose both steak and fish: That's false because you can only have one.
In simpler terms: XOR means "one or the other, but not both."
CONDITIONAL STATEMENTS
Let P= It is raining,
Because conditional statements play such an essential role in mathematical reasoning, a variety of terminology is used to express p → q. You will encounter most if not all of the following ways to express this conditional statement:
1. Converse (The proposition q → p is called the converse of p → q)
- Definition: A proposition formed by switching the hypothesis and conclusion of the original proposition.
- Example:
- Original: If it rains, the ground gets wet.
- Converse: If the ground gets wet, it rains.
2. Contrapositive (Contrapositive of p → q is the proposition ¬q → ¬p.)
- Definition: A proposition formed by negating both the hypothesis and conclusion of the original proposition and then switching them.
- Example:
- Original: If it rains, the ground gets wet.
- Contrapositive: If the ground does not get wet, it did not rain.
3. Inverse (¬p → ¬q is called the inverse of p → q.)
- Definition: A proposition formed by negating both the hypothesis and conclusion of the original proposition, but without switching them.
- Example:
- Original: If it rains, the ground gets wet.
- Inverse: If it does not rain, the ground does not get wet.
Important Note: In logic, the original proposition and its contrapositive are always equivalent. This means that if one is true, the other must be true, and if one is false, the other must be false. The converse and inverse, however, are not necessarily equivalent to the original proposition.
When two compound propositions always have the same truth value we call them equivalent, so that a conditional statement and its contrapositive are equivalent. The converse and the inverse of a conditional statement are also equivalent, as the reader can verify, but neither is equivalent to the original conditional statement.
For example, we have a statement “The home team wins whenever it is raining?”
Now to find the converse, contrapositive and inverse of the above statement,
Because “q whenever p” is one of the ways to express the conditional statement
p → q,
the original statement can be rewritten as
“If it is raining, then the home team wins.”
Consequently, the contrapositive of this conditional statement is “If the home team does not win, then it is not raining.”
The converse is
“If the home team wins, then it is raining.”
The inverse is
“If it is not raining, then the home team does not win.”
Only the contrapositive is equivalent to the original statement.
BICONDITIONALS
Compound Propositions
APPLICATIONS OF PROPOSITIONAL LOGIC
While it may seem abstract, propositional logic has a wide range of practical applications across various fields. By breaking down complex reasoning into simple propositions and logical connectives, it provides a systematic way to analyze and solve problems.
For example, logic is used in the specification of software and hardware, because these
specifications need to be precise before development begins. Furthermore, propositional logic
and its rules can be used to design computer circuits, to construct computer programs, to verify
the correctness of programs, and to build expert systems. Logic can be used to analyze and
solve many familiar puzzles. Software systems based on the rules of logic have been developed
for constructing some, but not all, types of proofs automatically.
We will be discussing one of many applications, and that is, Translating English sentences.
There are many reasons to translate English sentences into expressions involving propositional variables and logical connectives. In particular, English (and every other human language) is often ambiguous. Translating sentences into compound statements (and other types of logical expressions, which we will introduce later in this chapter) removes the ambiguity. Note that this may involve making a set of reasonable assumptions based on the intended meaning of the sentence. Moreover, once we have translated sentences from English into logical expressions we can analyze these logical expressions to determine their truth values, we can manipulate them, and we can use rules of inference to reason about them.
Let us look at few examples...
(I) How can this English sentence be translated into a logical expression?
“You can access the Internet from campus only if you are a computer science major or you are not a freshman.”
Solution: The given sentence can be translated into a logical expression as follows:
Let P represent "you are a computer science major".
Let Q represent "you are a freshman".
Let R represent "you can access the Internet from campus".
Then, the sentence can be expressed as:
R → (P ∨ ¬Q)
This expression means that if you can access the Internet from campus (R), then it must be the case that you are either a computer science major (P) or you are not a freshman (¬Q).
(II) How can this English sentence be translated into a logical expression?
“You cannot ride the roller coaster if you are under 4 feet tall unless you are older than 16 years old.”
Solution: Let:
- P represent "you are under 4 feet tall."
- Q represent "you are older than 16 years old."
- R represent "you can ride the roller coaster."
Then, the given sentence can be translated into a logical expression as:
¬R → (¬P ∨ Q)
This expression means that if you cannot ride the roller coaster (¬R), then it must be the case that either you are not under 4 feet tall (¬P) or you are older than 16 years old (Q).
<endnote>
And that is all for this blogpost (which by the looks of the length, has turned into a research paper at this point...) on the topic of "Propositional Logic" for my CIA assignment submission, assigned by my Mathematics teacher, Dr. Ansa Mathew. Until next time folks, when I arrive with another anecdote of my adventures in Christ University!
- Divyabhanu Rana
Good job 👍
ReplyDeleteGreat work!
ReplyDeletevery informative
ReplyDelete