Docsity

Discrete Structure Computer Science Applied I | CECS 228, Study notes of Discrete Structures and Graph Theory

Toggle sidebar
bg1
DISCRETE MATHEMATICS AND ITS APPLICATIONS
by Kenneth H. Rosen
Chapter 1 -- The Foundations: Logic and Proof, Sets, and Functions
Teaching Goals:
This course is designed to enable you to:
− understand problems and problem specification in computer science field
− to design solutions using the knowledge of this course.
Learning Objectives – Chapter 1:
Upon successful completion of this chapter, you will be able to
− Model statements and systems using propositional and predicate logic
− Translate between English sentences and propositional/predicate logic
− Determine the consistency of a set of logical statements
− Solve puzzles from a set of given statements
− Define a set and perform set operations.
− Find the Cartesian product of sets, and the power set of a given set.
− Represent a set in computer programs, and the corresponding operations.
− Recognize well-known set identities, and determine the relationship between two sets (equal,
subset, etc.)
− Identify when a relationship between two sets represents a function
− Find the domain and range of a function, and determine whether or not it is 1-1, onto, or both.
− Find composite and inverse functions.
− Use special functions including the floor and ceiling functions.
pf3
pf4
pf5

Partial preview of the text

Download Discrete Structure Computer Science Applied I | CECS 228 and more Study notes Discrete Structures and Graph Theory in PDF only on Docsity!

DISCRETE MATHEMATICS AND ITS APPLICATIONS

by Kenneth H. Rosen

Chapter 1 -- The Foundations: Logic and Proof, Sets, and Functions Teaching Goals: This course is designed to enable you to: − understand problems and problem specification in computer science field − to design solutions using the knowledge of this course. Learning Objectives – Chapter 1: Upon successful completion of this chapter, you will be able to − Model statements and systems using propositional and predicate logic − Translate between English sentences and propositional/predicate logic − Determine the consistency of a set of logical statements − Solve puzzles from a set of given statements − Define a set and perform set operations. − Find the Cartesian product of sets, and the power set of a given set. − Represent a set in computer programs, and the corresponding operations. − Recognize well-known set identities, and determine the relationship between two sets (equal, subset, etc.) − Identify when a relationship between two sets represents a function − Find the domain and range of a function, and determine whether or not it is 1-1, onto, or both. − Find composite and inverse functions. − Use special functions including the floor and ceiling functions.

1.1 Logic A proposition is a statement that is either true or false, but not both. ( p, q, r, s, … ) We confine our attention to declarative sentences to which it is meaningful to assign one and only one of the truth values “true” or “false.” Assumptions about propositions are

  • Assumption 1. The Law of Excluded Middle. For every proposition p, either p is true or p is false.
  • Assumption 2. The Law of Contradiction. For every proposition p, it is not the case that p is both true and false. Propositional logic is the area of logic that deals with propositions. A truth table displays the relationships between the truth values of propositions. Logical operators: Negation of p ( ¬ p, not p ) Conjunction of p and q ( , ) Disjunction of p and q ( , ) Exclusive or of p and q ( , ) Implication ( , ) Biconditional ( , ) Propositions that are related to an implication p → q Converse of an implication p → q ( ) Contrapositive of an implication p → q ( ) Inverse of an implication p → q ( ) Compound propositions may be formed using various logical operators. Generally accepted precedence of the logical operators (from highest to lowest): ____________________ System specifications are a series of statements that spell out the requirements of the system in question. The specifications are said to be consistent if there is an assignment of truth values to the variables in the expressions that makes all the expressions true.

1.2 Propositional Equivalences A compound proposition that is always true is a tautology. A compound proposition that is always false is a contradiction. A compound proposition that is neither a tautology nor a contradiction is a contingency. Compound propositions that always have the same truth value are called logically equivalent (denoted by ≡). [Example] Some well known logical equivalences (See Table 5 on p. 24 of the textbook) Equivalences Name p ∧ T ≡ p p ∨ F ≡ p Identity laws p ∨ T ≡ T p ∧ F ≡ F Domination laws p ∨ p ≡ p p ∧ p ≡ p Idempotent laws ¬ ( ¬ p) ≡ p Double negation law p ∨ q ≡ q ∨ p p ∧ q ≡ q ∧ p Commutative laws (p ∨ q) ∨ r ≡ p ∨ (q ∨ r) (p ∧ q) ∧ r ≡ p ∧ (q ∧ r) Associative laws p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r) p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r) Distributive laws ¬ (p ∧ q) ≡ ¬ p ∨ ¬ q ¬ (p ∨ q) ≡ ¬ p ∧ ¬ q De Morgan's laws

Logical equivalences involving implications (See Table 6 on p. 24 of the textbook) Logical Equivalences Involving Implications p → q ≡ ¬p ∨ q p → q ≡ ¬q → ¬p p ∨ q ≡ ¬p → q p ∧ q ≡ ¬(p → ¬q) ¬(p → q) ≡ p ∧ ¬q (p → q) ∧ (p → r) ≡ p → (q ∧ r) (p → r) ∧ (q → r) ≡ (p ∨ q) → r (p → q) ∨ (p → r) ≡ p → (q ∨ r) (p → r) ∨ (q → r) ≡ (p ∧ q) → r Logical equivalences involving implications (See Table 7 on p. 24 of the textbook) Logical Equivalences Involving Biconditionals p ↔ q ≡ (p → q) ∧ (q → p) p ↔ q ≡ ¬p ↔ ¬q p ↔ q ≡ (p ∧ q) ∨ (¬p ∧ ¬q) ¬(p ↔ q) ≡ p ↔ ¬q Exercises in 1. 7, 9, 11, 15-20, 23, 25, 34-37, 41, 43, 49