html5-img
1 / 19

Lecture 1

Lecture 1 . The Foundations: Logic and Proofs. Disrete mathematics and its application by rosen 7 th edition. 1.1 Propositional Logic. Propositions. A proposition is a declarative sentence (that is, a sentence that declares a fact) that is either true or false, but not both

chiara
Télécharger la présentation

Lecture 1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 1

  2. The Foundations:Logic and Proofs Disrete mathematics and its application by rosen 7th edition 1.1 Propositional Logic

  3. Propositions • A proposition is a declarative sentence (that is, a sentence that declares a fact) that is either true or false, but not both • 1 + 1 = 2 (true) • 4 + 9 = 13 (true) • Islamabad is capital of Pakistan (true) • Karachi is the largest city of Pakistan (true) • 100+9 = 111 (false) • Some sentences are not prepositions • Where is my class? (undeceleratedsentence) • What is the time by your watch? (undeceleratedsentence) • x + y = ? ( willbeprepositionswhenvalueisassigned) • Z +w * r = p

  4. Propositions • We use letters to denote propositional variables (or statement variables). • The truth value of a proposition is true, denoted by T, if it is a true proposition. • The truth value of a proposition is false, denoted by F, if it is a false proposition. • Many mathematical statements are constructed by combining one or more propositions. They are called compound propositions, are formed from existing propositions using logical operators.

  5. negation • Definition: Let p be a proposition. The negation of p, denoted by¬p(also denoted by p), is the statement “It is not the case that p.” • The proposition ¬p is read “not p.” The truth value of the negation of p, ¬p, is the opposite of the truth value of p. • Also denoted as “ ′ ” • Examples: • p := Sir PC is running Windows OS • ¬p := sir PC is not running Windows OS • p := a + b = c • p := a + b ≠ c

  6. conjunction • Definition: Let p and q be propositions. The conjunction of p and q, denoted by p ∧ q, is the proposition “p and q.” The conjunction p ∧ q is true when both p and q are true and is false otherwise. • Also known as UNION, AND, BIT WISE AND, AGREGATION • Denoted as ^ , &, AND

  7. disjunction • Definition:Let p and q be propositions. The disjunction of p and q, denoted by p ∨ q, is the proposition “p or q.” The disjunction p ∨ q is false when both p and q are false and is true otherwise. • Also known as OR, BIT WISE OR, SEGREGATION • Denoted as v, || , OR

  8. exclusive or • Definition: Let p and q be propositions. The exclusive or of p and q, denoted by p ⊕ q, is the proposition that is true when exactly one of p and q is true and is false otherwise. • Also known asZORING • Denoted as XOR , Ex OR, ⊕

  9. conditional statement • Let p and q be propositions. The conditional statement p → q is the proposition “if p, then q.” The conditional statement p → q is false when p is true and q is false, and true otherwise. • In the conditional statement p → q, p is called the hypothesis (or antecedent or premise) and q is called the conclusion (or consequence). • Denoted by 

  10. CONVERSE • The proposition q → p is called the converse of p → q. • The converse, q → p, has no same truth value as p → q for all cases. • Formed from conditional statement.

  11. CONTRAPOSITIVE • The contrapositive of p → q is the proposition ¬q →¬p. • only the contrapositive always has the same truth value as p → q. • The contrapositive is false only when ¬p is false and ¬q is true. • Formed from conditional statement.

  12. INVERSE • Formed from conditional statement. • The proposition ¬p →¬q is called the inverse of p → q. • The converse, q → p, has no same truth value as p → q for all cases.

  13. biconditional • Let p and q be propositions. The biconditional statement p ↔ q is the proposition “p if and only if q.” The biconditional statement p ↔ q is true when p and q have the same truth values, and is false otherwise. • Biconditional statements are also called bi-implications.

  14. Compound Propositions • Definition: When more that one above defined preposition logic combines it is called as compound preposition. • Example: • (p^q)v(p’) • (p ⊕ q) ^ (r v s)

  15. Compound Propositions (truth Table) • (p ∨¬q) → (p ∧ q)

  16. Precedence of Logical Operators

  17. Logic and Bit Operations • Computers represent information using bits • A bit is a symbol with two possible values, namely, 0 (zero) and 1 (one). • A bit can be used to represent a truth value, because there are two truth values, namely, true and false. • 1 bit to represent true and a 0 bit to represent false. That is, 1 represents T (true), 0 represents F (false). • A variable is called a Boolean variable if its value is either true or false. Consequently, a Boolean variable can be represented using a bit.

  18. Logic and Bit Operations • Computer bit operations correspond to the logical connectives. • By replacing true by a one and false by a zero in the truth tables for the operators ∧ (AND) , ∨ (OR) , and ⊕ (XOR) , the tables shown for the corresponding bit operations are obtained.

  19. bitwise OR, bitwise AND, and bitwise XOR • 01 1011 0110 11 0001 1101 11 1011 1111 bitwise OR 01 0001 0100 bitwise AND 10 1010 1011 bitwise XOR • 11 1010 1110 11 0001 1101 11 1011 1111 bitwise OR 11 0000 1100 bitwise AND 00 1010 0011 bitwise XOR

More Related