C959 Notes Day 1

1.1

  • Logic will be the base of Computer science
  • We’ll translate english into logic and deduce validity

1.2

  • Propositions and Truth Tables
    • Propositions, truth values, and truth tables
    • Logical operations
    • Compound statements and rules of order
    • Compound statements and truth tables

1.3

  • Propositions, truth values, and truth tables
    • Because true and false are so prevalent in decision-making and computer programming, it is essential to have a firm grasp of this concept.
    • After completing this lesson you should be able to find the truth values of a simple propositional statement using a truth table.
    • Logic is the study of formal reasoning
    • The most basic element in logic is a proposition. A proposition is a statement that is either true or false.
    • A proposition’s truth value is a value indicating whether the proposition is actually true or false. 
    • truth table shows the truth value of a proposition.

1.4 Propositions- Logical operators

  • The conjunction operation
    • compound proposition is created by connecting individual propositions with logical operations.
    • logical operation combines propositions using a particular composition rule
    • The proposition p ∧ q is read “p and q” and is called the conjunction of p and q. p ∧ q is true if both p is true and q is true. p ∧ q is false if p is false, q is false, or both are false.
    • truth table shows the truth value of a compound proposition for every possible combination of truth values for the variables contained in the compound proposition.
  • The disjunction operation
    • The proposition p ∨ q is read “p or q”, and is called the disjunction of p and q. p ∨ q is true if either one of p or q is true, or if both are true. The proposition p ∨ q is false if neither p nor q is true. 
  • The exclusive or
    • The exclusive or of p and q evaluates to true when p is true and q is false or when q is true and p is false.
    • The inclusive or operation is the same as the disjunction (∨) operation and evaluates to true when one or both of the propositions are true.

The negation operation

  • The negation operation acts on just one proposition and has the effect of reversing the truth value of the proposition. 
  • The negation operation is a unary operation, or an operation that acts on only one input. 

1.5 Compound statements- Operations and order

  • 1.5 Compound statements- Operations and order
    • A compound proposition can consist of propositions joined with more than one logical operator.
    • The order of operations applied in a compound proposition is as follows:
    • ¬(NOT)
    • ∧ (AND)
    • ∨ (OR)
    • Using the order of operations rule, place parentheses around proposition expressions to specify the order in which the operations are to be performed. We do not use parentheses for the negation operation.
    • Omit parentheses in compound propositions for multiple conjunctive ∧ (AND), or disjunctive ∨ (OR) operations.

1.6 Compound statements- Truth tables

  •  If there are n variables, there are 2n rows. In the truth table for the compound proposition (p ∨ r) ∧ ¬q, there are three variables and 2^3 = 8 rows.

Complete the truth table for the proposition (p∧q)∨¬r.

  • First, each logically possible combination of truth values for pq, and r are listed.
  • Next, the truth values of the intermediate states p∧q and ¬r are evaluated.
  • Finally, the truth values of (p∧q)∨¬r are evaluated based on the truth values of the intermediate states.

 Use the following steps to construct a truth table and complete the truth values.

  • Step 1: Construct a truth table. If there are n variables, there are 2n rows. The first columns represent the variables.
  • Step 2: Enter the T and F values for each variable to create all possible combinations.
  • Step 3: Add additional columns for each compound expression that occurs in the compound proposition. The final column will be for the truth value of each row. Complete the truth table for each intermediate column.
  • Step 4: Complete the final truth value for each row. In the final column, enter the truth value for each row by evaluating the truth value for each intermediate compound proposition.

1.7 Module 2 Propositional Statements

  • Conditional statements with logical operations
  • Conditional and biconditional operations
  • Logical equivalence
  • De Morgan’s law
  • Laws of propositional logic
  • The conditional operation
    • The conditional operation is denoted with the symbol →
    • A compound proposition that uses a conditional operation is called a conditional proposition.
    • A conditional proposition expressed in English is sometimes referred to as a conditional statement, as in “If there is a traffic jam today, then I will be late for work.”
    • In p → q, the proposition p is called the hypothesis, and the proposition q is called the conclusion. The truth table for p → q is given below
  • example:
    • If you mow Mr. Smith’s lawn, then he will pay you.
    • The only way for the contract between you and Mr. Smith to be broken, is for you to mow Mr. Smith’s lawn and for him not to pay you. If you do not mow his lawn, then he can either pay you or not, and the contract is not broken. In the words of logic, the only way for a conditional statement to be false is if the hypothesis is true and the conclusion is false. If the hypothesis is false, then the conditional statement is true regardless of the truth value of the conclusion.

The converse, contrapositive, and inverse

  • Three conditional statements related to proposition p → q are so common that they have special names. The converse of p → q is q → p. The contrapositive of p → q is ¬q → ¬p.The inverse of p → q is ¬p → ¬q.

Summary:

  • The conditional operation is denoted by → and means “if p, then q”
  • The following is a list of equivalent English expressions that mean “if p, then q“:
    • If pq
    • q, if p
    • p implies q
    • p only if q
    • p is sufficient for q
    • q is necessary for p
  • In a conditional proposition, p is the hypothesis and q is the conclusion
  • The proposition p → q is false if p is true and q is false. In ALL other cases, p → q is true.pqp → qTTTTFFFTTFFT
  • The converse is the opposite of the conditional statement. For example, the converse of p → q (if p then q) is q → p (if q then p). If p → q is true, it does NOT guarantee that q → p is true.
  • The inverse is the negation of the conditional statement. For example, the inverse of p → q (if p then q) is ¬p → ¬q (if not p then not q). If p → q is true, it does NOT guarantee that ¬p → ¬q is true.
  • The contrapositive is the opposite and negative of the conditional statement. For example, the contrapositive of p → q (if p then q) is ¬q → ¬p (if not q then not p). If p → q is true, it DOES guarantee that ¬q → ¬p is true.


Leave a Reply

Your email address will not be published. Required fields are marked *