Discrete Structures and Propositional Logic Note

Overview and Learning Outcomes

  • Academic Institution: Superior University RAK Campus
  • Subject: Discrete Structures
  • Core Learning Outcomes:
    • Explain the importance and foundational applications of Discrete Structures in digital systems and computer science.
    • Identify, formalize, and construct logical statements and mathematical propositions.

Introduction to Discrete Structures

  • Definition of Discrete Structures:
    • Discrete structures are mathematical objects characterized by distinct, separate values.
    • They provide the theoretical and mathematical foundation underlying computer science, digital logic, and computational systems.

Introduction to Discrete Structures

  • Primary Types of Discrete Structures:

    • Sets: Collections of distinct objects.
    • Functions: Mappings assigning elements from a domain to a codomain.
    • Sequences: Ordered lists of elements.
    • Relations: Structures defining associations between elements of sets.
    • Graphs: Networks comprising nodes (vertices) connected by edges.
  • Discrete vs. Continuous Values:

    • Discrete Values:
    • Composed of integer values or isolated objects.
    • Countable in nature.
    • Either finite or countably infinite.
    • Continuous Values:
    • Composed of real numbers.
    • Uncountable in nature.
    • Infinite number of values exist between any two given distinct values.
  • Why Study Discrete Structures?:

    • Foundation of Computer Science: Digital hardware and hardware logic operate fundamentally on discrete binary values (00\text{s} and 11\text{s}).
    • Algorithm Design: Facilitates precise, rigorous reasoning regarding computational processes and efficiency.
    • Data Structures: Enables the systematic organization, storage, and manipulation of discrete data.
    • Cryptography: Underpins methods for securing information through discrete algebraic principles.
    • Database Theory: Governs the structuring and querying of discrete data relationships.
    • Artificial Intelligence: Provides the formal logic required to represent knowledge and construct automated reasoning engines.
    • Network Protocols: Assists in modeling, designing, and analyzing digital communication architectures.

Mathematical Propositions and Sentence Types

  • Definition of a Proposition:

    • A proposition is a declarative statement that is strictly evaluated as either True or False, but never both simultaneously.
  • Classification of English Sentence Types:

    • Declarative Sentences: Statements that state facts or opinions. Only declarative sentences can be propositions because they express factual claims capable of being assigned a truth value.
    • Interrogative Sentences: Sentences asking questions (e.g., "What time is it?"). These are non-propositions.
    • Imperative Sentences: Sentences giving commands or instructions (e.g., "Go out and play."). These are non-propositions.
    • Exclamatory Sentences: Sentences expressing strong emotion or feelings (e.g., "Have a nice day!"). These are non-propositions.
  • Examples of Valid Propositions and Their Truth Values:

    • "The sun rises in the East and sets in the West" →True\rightarrow\text{True}
    • "1+1=21 + 1 = 2" →True\rightarrow\text{True}
    • "'b' is a vowel" →False\rightarrow\text{False}
    • "The Earth orbits around the Sun" →True\rightarrow\text{True}
    • "Water boils at 100 ∘C100\,^\circ\text{C} at sea level" →True\rightarrow\text{True}
    • "Humans need oxygen to survive" →True\rightarrow\text{True}
  • Non-Examples of Propositions:

    • "What time is it?" →Question (Interrogative)\rightarrow\text{Question (Interrogative)}
    • "Go out and play." →Command (Imperative)\rightarrow\text{Command (Imperative)}
    • "x+1=2x + 1 = 2" →Open Sentence (Truth depends on the value of variable x)\rightarrow\text{Open Sentence (Truth depends on the value of variable } x \text{)}
    • "Have a nice day!" →Expression / Exclamation\rightarrow\text{Expression / Exclamation}
    • "Please close the door" →Command (Imperative)\rightarrow\text{Command (Imperative)}
    • "How old are you?" →Question (Interrogative)\rightarrow\text{Question (Interrogative)}
    • "What a beautiful day!" →Exclamation\rightarrow\text{Exclamation}
  • Key Takeaway:

    • Only declarative sentences qualify as propositions because they make explicit factual assertions that evaluate to either True or False.

Practice Problems: Expressing Statements in Symbolic Form

  • Formalizing Statements into Propositional Logic (P∧QP \land Q, P∨QP \lor Q, or ∼P\sim P):
    1. Statement: "The number 8 is both even and a power of 2."
    • Variables: Let PP: "8 is even", Let QQ: "8 is a power of 2".
    • Required Form: P∧QP \land Q
    1. Statement: "The matrix A is not invertible."
    • Variables: Let PP: "Matrix A is invertible".
    • Required Form: ∼P\sim P
    1. Statement: "x<yx < y"
    • Variables: Let PP: "x<yx < y".
    • Required Form: PP
    1. Statement: "y≥xy \ge x"
    • Variables: Let PP: "y≥xy \ge x".
    • Required Form: P∨QP \lor Q (representing y>x∨y=xy > x \lor y = x).
    1. Statement: "There is a quiz scheduled for Wednesday or Friday."
    • Variables: Let PP: "There is a quiz on Wednesday", Let QQ: "There is a quiz on Friday".
    • Required Form: P∨QP \lor Q
    1. Statement: "The number x equals zero, but the number y does not."
    • Variables: Let PP: "x=0x = 0", Let QQ: "y≠0y \neq 0".
    • Required Form: P∧QP \land Q
    1. Statement: "At least one of the numbers x and y equals 0."
    • Variables: Let PP: "x=0x = 0", Let QQ: "y=0y = 0".
    • Required Form: P∨QP \lor Q

Notation and Foundations of Propositional Logic

  • Propositional Notation:

    • In propositional logic, lowercase letters represent atomic propositions, analogous to algebraic variables.
    • Common symbolic designations:
    • pp: First proposition
    • qq: Second proposition
    • rr: Third proposition
  • Definition of Propositional Logic:

    • A branch of mathematics analyzing the logical connections between propositions treated as whole units.
  • Core Focus Areas:

    • Relationships between propositions established via logical connectives.
    • Evaluation of truth values and construction of truth tables.
    • Analysis and derivation of logical equivalences.
    • Development of foundational structures for logical reasoning.
  • Fields of Application:

    • Mathematics
    • Digital Circuits
    • Computer Science
    • Artificial Intelligence
    • Decision Making
    • Linguistics

Negation of Propositions

  • Definition:

    • The negation of a proposition pp is denoted by ¬p\neg p (or ∼p\sim p), which reads "not pp".
    • The truth value of ¬p\neg p is always the exact opposite of the truth value of pp.
  • Truth Table for Negation:

pp¬p\neg p
TrueFalse
FalseTrue
  • Weather Example:

    • Let pp = "It is raining today"
    • Negation ¬p\neg p = "It is not raining today"
    • Truth Value Analysis:
    • If it is raining (p=Truep = \text{True}), then "It is not raining today" is False (¬p=False\neg p = \text{False}).
    • If it is not raining (p=Falsep = \text{False}), then "It is not raining today" is True (¬p=True\neg p = \text{True}).
  • Real-Life Examples:

    • "The sky is blue" →\rightarrow "The sky is not blue"
    • "I am hungry" →\rightarrow "I am not hungry"
    • "The store is open" →\rightarrow "The store is not open"

Compound Propositions and Logical Connectives

  • Definition:

    • A compound proposition is formed by joining two or more atomic propositions using logical connectives.
  • Standard Logical Connectives:

    • Conjunction (AND): Denoted by ∧\land
    • Disjunction (OR): Denoted by ∨\lor
    • Exclusive OR (XOR): Denoted by ⊕\oplus
    • Implication (Conditional): Denoted by →\rightarrow
    • Biconditional: Denoted by ↔\leftrightarrow
  • Examples of Compound Statements:

    • Conjunction: "I will go to the park and I will bring my dog"
    • Disjunction: "It is sunny or it is cloudy"
    • Implication: "If it rains, then I will take an umbrella"
  • Structural Example Analysis:

    • Let pp = "Today is Friday"
    • Let qq = "It is raining today"
    • p∧qp \land q = "Today is Friday and it is raining today"
    • Evaluates to True strictly when both pp and qq are True.
    • Evaluates to False if either "Today is Friday" is False or "It is raining today" is False.
    • p∨qp \lor q = "Today is Friday or it is raining today"
    • p→qp \rightarrow q = "If today is Friday, then it is raining today"

Conjunction

  • Definition:

    • The conjunction of propositions pp and qq is denoted by p∧qp \land q, meaning "pp and qq".
    • A conjunction is True only when both pp and qq are True.
  • Truth Table for Conjunction:

ppqqp∧qp \land q
TrueTrueTrue
TrueFalseFalse
FalseTrueFalse
FalseFalseFalse
  • Real-Life Examples:

    • "I will study and I will pass the exam"
    • "The sky is blue and the grass is green"
    • "She is tall and she is smart"
  • Algebraic Properties of Conjunction:

    • Commutative Property: p∧q≡q∧pp \land q \equiv q \land p
    • Associative Property: (p∧q)∧r≡p∧(q∧r)(p \land q) \land r \equiv p \land (q \land r)

Disjunction

  • Definition:

    • The disjunction of propositions pp and qq is denoted by p∨qp \lor q, meaning "pp or qq".
    • A disjunction is True when at least one proposition (pp, qq, or both) is True. It is False only when both propositions are False.
  • Truth Table for Disjunction:

ppqqp∨qp \lor q
TrueTrueTrue
TrueFalseTrue
FalseTrueTrue
FalseFalseFalse
  • Real-Life Examples:

    • "I will study or I will watch TV"
    • "It is sunny or it is cloudy"
    • "You can pay with cash or with a credit card"
  • Algebraic Properties of Disjunction:

    • Commutative Property: p∨q≡q∨pp \lor q \equiv q \lor p
    • Associative Property: (p∨q)∨r≡p∨(q∨r)(p \lor q) \lor r \equiv p \lor (q \lor r)

Exclusive OR (XOR)

  • Definition:

    • The exclusive OR of propositions pp and qq is denoted by p⊕qp \oplus q, meaning "either pp or qq, but not both".
    • An exclusive OR evaluates to True strictly when exactly one of pp or qq is True.
  • Truth Table for Exclusive OR:

ppqqp⊕qp \oplus q
TrueTrueFalse
TrueFalseTrue
FalseTrueTrue
FalseFalseFalse
  • Real-Life Examples:

    • "You can have either tea or coffee, but not both"
    • "The light is either on or off"
    • "You can choose either the red shirt or the blue shirt"
  • Algebraic Properties and Equivalences:

    • Commutative Property: p⊕q≡q⊕pp \oplus q \equiv q \oplus p
    • Alternative Boolean Expression: p⊕q≡(p∨q)∧¬(p∧q)p \oplus q \equiv (p \lor q) \land \neg(p \land q)

Implication (Conditional Statements)

  • Definition:

    • The implication of propositions pp and qq is denoted by p→qp \rightarrow q, meaning "if pp then qq".
    • In p→qp \rightarrow q, pp represents the premise (hypothesis) and qq represents the conclusion.
    • An implication is False only when the premise pp is True and the conclusion qq is False.
  • Truth Table for Implication:

ppqqp→qp \rightarrow q
TrueTrueTrue
TrueFalseFalse
FalseTrueTrue
FalseFalseTrue
  • Real-Life Examples:

    • "If it rains, then the ground will be wet"
    • "If you study, then you will pass the exam"
    • "If the traffic light is red, then you must stop"
  • Key Logical Equivalences for Implication:

    • Alternative Expression: p→q≡¬p∨qp \rightarrow q \equiv \neg p \lor q
    • Contrapositive Expression: p→q≡¬q→¬pp \rightarrow q \equiv \neg q \rightarrow \neg p

Types of Implication and Logical Equivalences

  • The Four Related Conditional Statements:
    • Conditional Statement: p→qp \rightarrow q
    • Converse Statement: q→pq \rightarrow p
    • Inverse Statement: ¬p→¬q\neg p \rightarrow \neg q
    • Contrapositive Statement: ¬q→¬p\neg q \rightarrow \neg p

Logical Connectives: Types of Implication

  • Master Truth Table Comparison:
ppqqConditional (p→qp \rightarrow q)Converse (q→pq \rightarrow p)Inverse (¬p→¬q\neg p \rightarrow \neg q)Contrapositive (¬q→¬p\neg q \rightarrow \neg p)
TrueTrueTrueTrueTrueTrue
TrueFalseFalseTrueTrueFalse
FalseTrueTrueFalseFalseTrue
FalseFalseTrueTrueTrueTrue
  • Fundamental Equivalences:

    • A Conditional statement is logically equivalent to its Contrapositive:     p→q≡¬q→¬pp \rightarrow q \equiv \neg q \rightarrow \neg p
    • The Converse statement is logically equivalent to the Inverse statement:     q→p≡¬p→¬qq \rightarrow p \equiv \neg p \rightarrow \neg q
  • Real-Life Illustrative Examples:

    • Conditional: "If it is raining, then I will take an umbrella"
    • Converse: "If I take an umbrella, then it is raining"
    • Inverse: "If it is not raining, then I will not take an umbrella"
    • Contrapositive: "If I do not take an umbrella, then it is not raining"
  • Practical Proof Implications:

    • Proving a statement is logically identical to proving its contrapositive.
    • Disproving a statement is logically identical to disproving its contrapositive.

Biconditional Statements

  • Definition:

    • The biconditional of propositions pp and qq is denoted by p↔qp \leftrightarrow q, meaning "pp if and only if qq" (abbreviated as "pp iff qq").
    • A biconditional evaluates to True when pp and qq possess the identical truth value (both True or both False).
  • Truth Table for Biconditional:

ppqqp↔qp \leftrightarrow q
TrueTrueTrue
TrueFalseFalse
FalseTrueFalse
FalseFalseTrue
  • Real-Life Examples:

    • "You can vote if and only if you are 18 years or older"
    • "The light is on if and only if the switch is up"
    • "I will go to the party if and only if you go with me"
  • Properties & Relationship to Implication:

    • Relationship to Implication: p↔q≡(p→q)∧(q→p)p \leftrightarrow q \equiv (p \rightarrow q) \land (q \rightarrow p)
    • Commutative Property: p↔q≡q↔pp \leftrightarrow q \equiv q \leftrightarrow p

Comprehensive Practice Problems and Solutions

  • Truth Table Verification Problems (Problems 1–9):

    1. Truth Table for P∨(Q⇒R)P \lor (Q \Rightarrow R)
PPQQRRQ⇒RQ \Rightarrow RP∨(Q⇒R)P \lor (Q \Rightarrow R)
TrueTrueTrueTrueTrue
TrueTrueFalseFalseTrue
TrueFalseTrueTrueTrue
TrueFalseFalseTrueTrue
FalseTrueTrueTrueTrue
FalseTrueFalseFalseFalse
FalseFalseTrueTrueTrue
FalseFalseFalseTrueTrue
  1. Truth Table for (Q∨R)⇔(R∧Q)(Q \lor R) \Leftrightarrow (R \land Q)
PPQQRRQ∨RQ \lor RR∧QR \land Q(Q∨R)⇔(R∧Q)(Q \lor R) \Leftrightarrow (R \land Q)
TrueTrueTrueTrueTrueTrue
TrueTrueFalseTrueFalseFalse
TrueFalseTrueTrueFalseFalse
TrueFalseFalseFalseFalseTrue
FalseTrueTrueTrueTrueTrue
FalseTrueFalseTrueFalseFalse
FalseFalseTrueTrueFalseFalse
FalseFalseFalseFalseFalseTrue
  1. Truth Table for ∼(P⇒Q)\sim(P \Rightarrow Q)
PPQQP⇒QP \Rightarrow Q∼(P⇒Q)\sim(P \Rightarrow Q)
TrueTrueTrueFalse
TrueFalseFalseTrue
FalseTrueTrueFalse
FalseFalseTrueFalse
  1. Truth Table for ∼(P∨Q)∨(∼P)\sim(P \lor Q) \lor (\sim P)
PPQQP∨QP \lor Q∼(P∨Q)\sim(P \lor Q)∼P\sim P∼(P∨Q)∨(∼P)\sim(P \lor Q) \lor (\sim P)
TrueTrueTrueFalseFalseFalse
TrueFalseTrueFalseFalseFalse
FalseTrueTrueFalseTrueTrue
FalseFalseFalseTrueTrueTrue
  1. Truth Table for (P∧∼P)∨Q(P \land \sim P) \lor Q
PPQQ∼P\sim PP∧∼PP \land \sim P(P∧∼P)∨Q(P \land \sim P) \lor Q
TrueTrueFalseFalseTrue
TrueFalseFalseFalseFalse
FalseTrueTrueFalseTrue
FalseFalseTrueFalseFalse
  1. Truth Table for (P∧∼P)∧Q(P \land \sim P) \land Q
PPQQ∼P\sim PP∧∼PP \land \sim P(P∧∼P)∧Q(P \land \sim P) \land Q
TrueTrueFalseFalseFalse
TrueFalseFalseFalseFalse
FalseTrueTrueFalseFalse
FalseFalseTrueFalseFalse
  1. Truth Table for (P∧∼P)⇒Q(P \land \sim P) \Rightarrow Q
PPQQ∼P\sim PP∧∼PP \land \sim P(P∧∼P)⇒Q(P \land \sim P) \Rightarrow Q
TrueTrueFalseFalseTrue
TrueFalseFalseFalseTrue
FalseTrueTrueFalseTrue
FalseFalseTrueFalseTrue
  1. Truth Table for P∨(Q∧∼R)P \lor (Q \land \sim R)
PPQQRR∼R\sim RQ∧∼RQ \land \sim RP∨(Q∧∼R)P \lor (Q \land \sim R)
TrueTrueTrueFalseFalseTrue
TrueTrueFalseTrueTrueTrue
TrueFalseTrueFalseFalseTrue
TrueFalseFalseTrueFalseTrue
FalseTrueTrueFalseFalseFalse
FalseTrueFalseTrueTrueTrue
FalseFalseTrueFalseFalseFalse
FalseFalseFalseTrueFalseFalse
  1. Truth Table for ∼(∼P∨∼Q)\sim(\sim P \lor \sim Q)
PPQQ∼P\sim P∼Q\sim Q∼P∨∼Q\sim P \lor \sim Q∼(∼P∨∼Q)\sim(\sim P \lor \sim Q)
TrueTrueFalseFalseFalseTrue
TrueFalseFalseTrueTrueFalse
FalseTrueTrueFalseTrueFalse
FalseFalseTrueTrueTrueFalse
  • Analytical Deductive Problems Without Truth Tables:

    • Problem 10: Suppose the statement ((P∧Q)∨R)⇒(R∨S)((P \land Q) \lor R) \Rightarrow (R \lor S) is False. Find the truth values of P,Q,R,P, Q, R, and SS

    • Step 1: An implication X⇒YX \Rightarrow Y is False if and only if premise XX is True and conclusion YY is False. Here, X=((P∧Q)∨R)X = ((P \land Q) \lor R) and Y=(R∨S)Y = (R \lor S).

    • Step 2: Evaluate conclusion (R∨S)=False(R \lor S) = \text{False}. A disjunction is False if and only if both components are False. Therefore, R=FalseR = \text{False} and S=FalseS = \text{False}.

    • Step 3: Substitute R=FalseR = \text{False} into the premise: ((P∧Q)∨False)=(P∧Q)((P \land Q) \lor \text{False}) = (P \land Q). For the premise to be True, (P∧Q)(P \land Q) must be True.

    • Step 4: A conjunction (P∧Q)(P \land Q) is True if and only if both components are True. Therefore, P=TrueP = \text{True} and Q=TrueQ = \text{True}.

    • Final Results: P=TrueP = \text{True}, Q=TrueQ = \text{True}, R=FalseR = \text{False}, S=FalseS = \text{False}.

    • Problem 11: Suppose PP is False and the statement (R⇒S)⇔(P∧Q)(R \Rightarrow S) \Leftrightarrow (P \land Q) is True. Find the truth values of RR and SS

    • Step 1: Given P=FalseP = \text{False}, the conjunction (P∧Q)(P \land Q) evaluates to False regardless of the value of QQ.

    • Step 2: The biconditional (R⇒S)⇔(P∧Q)(R \Rightarrow S) \Leftrightarrow (P \land Q) is given as True. A biconditional is True when both sides share the same truth value.

    • Step 3: Since the right side (P∧Q)(P \land Q) is False, the left side (R⇒S)(R \Rightarrow S) must also be False.

    • Step 4: An implication (R⇒S)(R \Rightarrow S) is False if and only if the premise RR is True and the conclusion SS is False.

    • Final Results: R=TrueR = \text{True}, S=FalseS = \text{False}.

Applications of Discrete Structures in Computer Science

  • Algorithm Design: Enables formal, precise mathematical reasoning and proof of correctness regarding computational steps and software processes.
  • Cryptography: Provides foundational logical, modular, and algebraic principles required to build encryption algorithms and secure communications.
  • Database Systems: Forms the mathematical model for relational databases (relational algebra), facilitating accurate query processing and data relationship management.
  • Artificial Intelligence: Supplies propositional and predicate logic for knowledge representation, automated theorem proving, and cognitive reasoning frameworks.
  • Programming: Underpins conditional execution logic (if-else\text{if-else} statements), boolean expression evaluation, and computer arithmetic operations.