# Discrete Mathematics – Applications of Propositional Logic

A ** proposition **is an assertion, statement, or declarative sentence that can either be true or false but not both. For example, the sentence “Ram went to school.” can either be true or false, but the case of both happening is not possible. So we can say, the sentence “Ram went to school.” is a proposition. But, the sentence “N is greater than 100” is not a proposition as we cannot state that whether it is true or false unless the value of N is given. A few more examples of propositions are “12 – 10 = 3”, “The library is open.”, etc.Â

The area of mathematical logic that deals with propositions are called * Propositional Logic* or

*. It is also known as*

*Propositional Calculus**or*

*sentential logic**. It studies the logical values of propositions when taken as a whole and logical relationships when connected using logical connectives(such as logical AND, logical OR, etc.).Â*

*sentential calculus*### Importance of Propositional Logic

Propositional Logic plays an important role in computer science as well as in a person’s daily life. The main benefits of studying and using propositional logic are that it prevents us from making inconsistent inferences and incautious decisions. It incorporates reasoning and thinking abilities in one’s daily life.Â

### Applications of Propositional Logic

In the computer science field, propositional logic has a wide variety of applications and hence is very important. It is used in system specifications, circuit designing, logical puzzles, etc. Apart from this, it can also be used in translating English sentences to mathematical statements and vice-versa. Let us look at this vast variety of applications in detail.

#### 1) Translating English Sentences into logical statements

Like any other human language, English sentences can be ambiguous. This ambiguity might lead to uninformed decision-making and other fatal errors. To remove this ambiguity, we can translate these English sentences into logical expressions with the help of Propositional Logic. Note that sometimes this may include making a few assumptions based on the sentence’s intended meaning.Â

** Example: **Given a sentence “

*” Now, this is a bit complex to be understood at once. So we translate this into a logical expression that will make it simple to understand. Let*

*You can purchase this book if you have $20 or $10 and a discount coupon.**,*

*a**,*

*b**and*

*c,**represent*

*d**the sentences “*

*“, “*

*You can purchase this book.**“, “*

*You have $20.**“, and “*

*You have $10.**” respectively. Then the given sentence can be translated to Â*

*You have a discount coupon.**, which simply means that “if you either have $20 or $10, along with a discount coupon, then you can purchase the book.”*

*(b âˆ¨ (c âˆ§ d) -> a*#### 2) System Specifications

When developing/manufacturing a system(Software or Hardware), the developers/manufacturers have to meet certain needs and specifications, which are usually stated in English. But as English sentences can be ambiguous, developers/engineers translate these system specifications into logical expressions to state specifications rigorously and unambiguously.

** Example: **Let

*and*

*a, b, c,**represent the sentences “*

*d**“, “*

*The computer is within the local network.**“, “*

*The computer has a valid login id.**“, and “*

*The computer is under the use of administrator.**So the complex sentence, “*

*Internet is accessible to the computer.”**” can be expressed as (*

*If the computer is within the local network or it is not within the local network but has a valid login id or it is under the use of administrator, then the Internet is accessible to the computer.*

*a âˆ¨ (Â¬a âˆ§ b) âˆ¨ c) -> d.*#### 3) Logical Puzzles

Puzzles that are solved using reasoning and logic are called logical puzzles. They can be used for brain exercises, recreational purposes, and for testing a person’s reasoning capabilities. Solving such puzzles is generally tricky, but it can be done easily using propositional logic. Some of the famous logic puzzles are *the** muddy children puzzle*,

*etc.Â*

*Smullyan’s puzzles about knights and knaves,***Example:*** Problem Statement: *There is an island that has two kinds of inhabitants, knights, who always tell the truth, and their opposites, knaves, who always lie. You encounter two people A and B. Determine what are A and B if A says “B is a knave” and B says “Both of us are of same types”?

* Solution*: Let

*and*

*p**be the statements that*

*q**is a knight and*

*A**is a knight, respectively, so*

*B**and*

*Â¬p**are the statements that*

*Â¬q**is a knave and*

*A**is a knave, respectively. Let’s assume*

*B**is a knight, i.e.,*

*A**is true. So*

*p**is telling the truth, which means*

*A**is true. Now as*

*Â¬q**is a knave whatever it is saying is a lie, i.e.,*

*B**is false, which simply means if either of them is a knave then the other one is a knight or vice-versa. Now, as per the assumption, this statement is true. So we can conclude that*

*(p âˆ§ q) âˆ¨ (Â¬p âˆ§ Â¬q)**is a knight and*

*A**is a knave.*

*B*#### 4) Boolean Searches

Another important application of propositional logic is Boolean searches. These searches use techniques from propositional logic. Logical connectives are used extensively in searches of large collections of information, such as indexes of Web Pages. In Boolean searches, the connective AND is used to find records that contain both of the two terms, the connective OR is used to find records that have either one or both of the terms, and the connective NOT, also written as AND NOT, is used when we need to exclude a particular search term.Â

** Example: **Some web search engines support web page searching that uses Boolean techniques. For instance, if we want to look for web pages about hiking in West Alps, then we can look for pages matching WEST

*ALPS*

*AND**HIKING. And if we want web pages about hiking in the Alps, but not in West Alps, then we can search for pages matching the record HIKING*

*AND**ALPS*

*AND**(WEST*

*AND NOT**ALPS).*

*AND*#### 5) Logic/Computer Circuits

Logic gates or circuits are electronic devices that implement Boolean functions, i.e. it does a logic operation on one or more bits of input and gives a bit as an output. They are the basic building blocks of any digital system. The relationship between the input and output is based on a certain propositional logic.Â

** Example:** Logic gates are named as AND gate, OR gate, NOT gate, etc. based on the names of logical connectives AND, OR, NOT, etc. The output truth values for the given input bits for these gates are the same as that those returned by the logical connectives.

#### 6) Inference and Decision Making

Propositional Logic is widely used in the making rules of inference and decision making. These rules of inferences can then be used to build arguments. When several premises are given, it is hard to tell if a given argument is valid. Thus, we use these rules of inference to validate an argument and make a decision.

** Example: **We can prove that the following premises build up a valid argument using the rule of inference.

“* If today is Tuesday, I have a test in English or Science. If my English Professor is absent, then I will not have a test in English. Today is Tuesday and my English Professor is absent. Therefore I have a test in Science.*“

T: Today is Tuesday

E: I have a test in English

S: I have a test in Science

A: My English Professor is absent

Hence, the argument stated is valid.

#### 7) Artificial Intelligence – Fuzzy Logic

AI algorithms make use of fuzzy logic. In fuzzy logic, Â there is no logic for the absolute truth and absolute false value. But in fuzzy logic, there is an intermediate value too present which is partially true and partially false.

** For Example: **The truth value 0.6 can be assigned to the statement “Fred is happy”, because Fred is happy slightly more than most of the time, and the truth value 0.5 can be assigned to the statement “Percy is happy” because Percy is happy half of the time.