1 Fundamentals Of Logic And Propositions

Discrete Structure Ā· Unit 1

Fundamentals of Logic and Propositions

Exam-focused notes for Fundamentals of Logic and Propositions (Discrete Structure, BIT152): what the TU syllabus asks and how it has actually been tested, with 6 solved past questions from this unit.

Fundamentals of Logic and Propositions in short

Logic is the study of correct reasoning. It gives us exact rules to decide whether a statement is true, and it is the base of proofs, programming conditions and digital circuits.

Fundamentals of Logic and Propositions: notes

Propositions and non-propositions

A proposition is a declarative sentence that is either true or false, but not both. The truth value of a proposition is T (true) or F (false).

Examples of propositions:

  • Kathmandu is the capital of Nepal. (true)
  • $2 + 3 = 6$. (false)
  • Every prime number is odd. (false, because 2 is prime)

Examples of non-propositions:

  • What time is it? (a question)
  • Close the door. (a command)
  • $x + 1 = 5$. (true or false depends on $x$, so it has no fixed truth value)
  • This sentence is false. (it cannot be given a consistent truth value)

We name propositions with letters such as $p, q, r$. A statement built from smaller ones using connectives is called a compound proposition.

Logical connectives and truth tables

A connective joins propositions to make a new one. A truth table lists the truth value of the compound proposition for every possible choice of truth values of its parts. With $n$ variables the table has $2^n$ rows.

NameSymbolRead asTrue when
Negation$\neg p$not $p$$p$ is false
Conjunction$p \land q$$p$ and $q$both are true
Disjunction$p \lor q$$p$ or $q$at least one is true
Exclusive or$p \oplus q$$p$ xor $q$exactly one is true
Implication$p \to q$if $p$ then $q$not ($p$ true and $q$ false)
Biconditional$p \leftrightarrow q$$p$ if and only if $q$both have the same value

Truth table for the main connectives:

$p$$q$$p \land q$$p \lor q$$p \oplus q$$p \to q$$p \leftrightarrow q$
TTTTFTT
TFFTTFF
FTFTTTF
FFFFFTT

In $p \to q$, $p$ is the hypothesis and $q$ is the conclusion. An implication is false only when the hypothesis is true and the conclusion is false. If $p$ is false, the implication is true (it is true "by default").

Example. Build the truth table of $(p \lor q) \land \neg r$.

$p$$q$$r$$p \lor q$$\neg r$$(p \lor q) \land \neg r$
TTTTFF
TTFTTT
TFTTFF
TFFTTT
FTTTFF
FTFTTT
FFTFFF
FFFFTF

Precedence order: $\neg$ first, then $\land$, then $\lor$, then $\to$, then $\leftrightarrow$.

What this unit covers

  • Propositions and non-propositions
  • Logical connectives and truth tables
  • Tautology and contradiction
  • Converse, inverse, and contrapositive
  • Logical equivalence
  • Quantifiers and predicate logic
  • Negation of statements

Quantifiers and predicate logic

2082 Ā· 10 marks

Why do we need quantifiers? List any three rules of inferences. Prove that $2\sqrt{2}$ is irrational using proof by contradiction. [2+3+5]

Show solved answer

Answer

1. Why Do We Need Quantifiers? [2 marks]

In propositional logic, we can only deal with specific propositions (true or false statements). However, many mathematical and logical statements involve variables and express properties over a range of objects. Quantifiers allow us to express such statements precisely.

Reasons we need quantifiers:

  • To express statements like "For all integers n, n² ≄ 0" or "There exists a number x such that x + 2 = 5". These cannot be captured by propositional logic alone.
  • To generalize propositions over a domain (universe of discourse) rather than stating each case individually.
  • To formally reason about predicates (properties/relations) involving variables.

Two main quantifiers:

  • Universal Quantifier (āˆ€): "For all" - asserts a property holds for every element.
  • Existential Quantifier (∃): "There exists" - asserts a property holds for at least one element.

2. Three Rules of Inference [3 marks]

RuleFormName
1p, p → q ∓ qModus Ponens
2¬q, p → q ∓ ¬pModus Tollens
3p → q, q → r ∓ p → rHypothetical Syllogism

Explained:

  1. Modus Ponens: If p is true and p implies q, then q is true.
  2. Modus Tollens: If q is false and p implies q, then p must be false.
  3. Hypothetical Syllogism: If p implies q and q implies r, then p implies r (chain rule).

3. Prove that √2 is Irrational (Proof by Contradiction) [5 marks]

Setup

Claim: √2 is irrational.

Method: Proof by contradiction. We assume the negation of what we want to prove and derive a contradiction.


Proof

Step 1: Assume the opposite (negation).

Assume, for the sake of contradiction, that √2 is rational.

Step 2: Use the definition of rational numbers.

If √2 is rational, then it can be expressed as:

$$\sqrt{2} = \frac{p}{q}$$

where p, q are integers, q ≠ 0, and the fraction p/q is in lowest terms (i.e., gcd(p, q) = 1, so p and q share no common factors).

Step 3: Square both sides.

$$2 = \frac{p^2}{q^2}$$

$$p^2 = 2q^2 \quad \cdots (1)$$

Step 4: Conclude p is even.

From equation (1), p² is divisible by 2.

Since 2 is prime, if 2 | p², then 2 | p.

So we can write: p = 2k for some integer k.

Step 5: Substitute back.

Substituting p = 2k into equation (1):

$$(2k)^2 = 2q^2$$

$$4k^2 = 2q^2$$

$$q^2 = 2k^2 \quad \cdots (2)$$

Step 6: Conclude q is even.

From equation (2), q² is divisible by 2.

Since 2 is prime, if 2 | q², then 2 | q.

Step 7: Derive the contradiction.

We have shown that both p is even and q is even, meaning:

$$\gcd(p, q) \geq 2$$

But this contradicts our assumption that gcd(p, q) = 1 (the fraction was in lowest terms).

Step 8: Conclusion.

Our assumption that √2 is rational leads to a contradiction. Therefore, by proof by contradiction:

$$\boxed{\sqrt{2} \text{ is irrational.} \quad \blacksquare}$$

Open this answer on its own page →

2081 Ā· 5 marks

Define proposition. Convert the following sentences to predicate: (a) Some kind hearted peoples do still exist. (b) Student who study hard and do the homework get good marks in exam. [5]

Show solved answer

Proposition and Predicate Logic

Definition of Proposition

A proposition is a declarative statement that is either true or false, but not both simultaneously. It has a definite truth value (T or F).

Examples:

  • "2 + 2 = 4" (True proposition)
  • "The sky is green" (False proposition)
  • "Close the door!" (NOT a proposition - it is a command)

Converting Sentences to Predicate Logic

(a) Some kind hearted people do still exist.

Identify the components:

  • Let K(x) = "x is kind hearted"
  • Let E(x) = "x still exists" (or "x is a person who still exists")
  • The quantifier "Some" maps to the Existential Quantifier (∃)

Predicate Form:

$$\exists x ; [K(x) \land E(x)]$$

Reading: "There exists some x such that x is kind hearted and x still exists."


(b) Students who study hard and do the homework get good marks in exam.

Identify the components:

  • Let S(x) = "x is a student"
  • Let H(x) = "x studies hard"
  • Let D(x) = "x does the homework"
  • Let G(x) = "x gets good marks in exam"
  • The quantifier "All/Every" (implied) maps to the Universal Quantifier (āˆ€)

Predicate Form:

$$\forall x ; [S(x) \land H(x) \land D(x) \Rightarrow G(x)]$$

Reading: "For all x, if x is a student and x studies hard and x does the homework, then x gets good marks in the exam."


Note: The existential quantifier (∃) uses conjunction (∧) with its conditions, while the universal quantifier (āˆ€) typically uses implication (⇒) to express conditional relationships.

Open this answer on its own page →

Propositions and non-propositions

2079 Ā· 10 marks

Give any four examples that are not propositions. Assume the premises, all over smart persons are stupid, children of stupid persons are naughty, John is over smart, Sam is children of John. Using rules of inferences, show that Sam is naughty.[10]

A proposition is a declarative statement that is either true or false, but not both. The following are not propositions because they are questions, commands, exclamations, or paradoxes with no definite truth value: Example Reason -------------------- 1 "What time is it?" Interrogative sentence (a...

Open this answer on its own page →

Tautology and contradiction

2078 Ā· 5 marks

What is tautology? Show $(p \land q) \rightarrow (p \lor q)$ is a tautology. [5]

A tautology is a propositional formula (compound statement) that is always true regardless of the truth values assigned to its component variables. In other words, every row of its truth table yields True (T). --- We need to evaluate (p ∧ q) → (p ∨ q) for all possible combinations of truth values...

Open this answer on its own page →

Negation of statements

2080.1 Ā· 5 marks

List the negations of following statements: (a) He has passed the exam. (b) All dogs are loyal. (c) Some medicine has side effect. (d) If you study then you will pass the exam. (e) Open the door. [5]

Negation: He has not passed the exam. --- Negation: Some dogs are not loyal. Note: The negation of a universal statement ("All A are B") is an existential statement ("Some A are not B").) --- Negation: No medicine has side effect. (i.e., All medicines have no side effect.) Note: The negation of a...

Open this answer on its own page →

Converse, inverse, and contrapositive

0 Ā· 5 marks

What do you mean by converse, inverse, and contrapositive? Show that the sentences "if it is hot today then today is Sunday" and "if it is not Sunday then today is not hot" are logically equivalent. [5]

Let the original conditional statement be: P → Q (If P, then Q) Name Form Description ------------------------- Converse Q → P Swap the hypothesis and conclusion Inverse ¬P → ¬Q Negate both hypothesis and conclusion Contrapositive ¬Q → ¬P Swap AND negate both hypothesis and conclusion Key fact: A...

Open this answer on its own page →