Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Discrete Mathematics Discrete Mathematics: is the part of mathematics devoted to the study of discrete objects. Discrete Mathematics is.

Similar presentations


Presentation on theme: "Introduction to Discrete Mathematics Discrete Mathematics: is the part of mathematics devoted to the study of discrete objects. Discrete Mathematics is."— Presentation transcript:

1 Introduction to Discrete Mathematics Discrete Mathematics: is the part of mathematics devoted to the study of discrete objects. Discrete Mathematics is used whenever objects are counted. We study Discrete Math to develop your Mathematical Maturity + is the gateway to more advanced courses in all parts of the Mathematical science. Discrete Math. Provides the mathematical foundation for many computer science courses

2 Chapter 1 Sec1.1 Propositional logic Proposition: is a declarative sentence that (that is a sentence that declares a fact) is either true or false but not both. Examples: 1. 1+1=2 is a declarative sentence which is true. So it is proposition (T) 2. 2+2=5 is a declarative sentence which is false. So it is proposition (F) 3. Kuwait city is the capital of Kuwait is a declarative sentence (which is true) (T) so proposition. 4. Hawally is the capital of Kuwait is a declarative sentence (which is false) so proposition (F).

3 Example: 1. What time is it? (Interrogative, not proposition) 2. Read this chapter imperative (command) not proposition 3. x + 4 = 6 not proposition because they are neither true nor false if we x + y = z assign values for the variables it will be proposition. Propositional variables: variables that represent propositions. Compound proposition: constructed by combining 2 or more propositions Negation of proposition: the negation of proposition p is p or = not p. It is the opposite of the truth value of p. Example: Find the negation of the proposition "Today is Monday" Answer: 1. "It is not the case that today is Monday" Or "Today is not Monday" "It is not Monday today" Ex: Find the negation of the proposition "At least 5 inches of rain fell today in Hawally" Answer: "It is not the case that at least 5 inches of rain fell today in Hawally" Or "less than 5 inches of rain fell today in Hawally"

4 The truth table for Negation of proposition -pP FT TF Connectives: logical operators are called connectives or, and, exclusive or Definition: let p and q be propositions the conjunctions 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 false other wise truth table of p ^ q p ^ qqp TTT FFT FTF FFF

5 EX: let p is "today is Monday" q is "It is raining today" Find the conjunction p and q Answer: p ^ q is the proposition "today is Monday and it is raining" Defintion3: Let p and q be propositions. The Disjunction of p and q denoted by p or q is the proposition "p or q". The disjunction p q is false when both of q them are false and true other wise. Truth table of p p qqp TTT TFT TTF FFF Example: let p: "today is Monday" Q: "It is raining today" Find the disjunction p q is

6 Answer: The proposition p q is: is Monday or it is raining today" "Today Definition 4: Let p and q be proposition. The exclusive or of p and q denoted by p is the proposition that is true when exactly one of p and q is true and falls other wise. Ex: "Student who have taken calculus or computer science but not both, can enroll in this class" q, Table4: The truth table of p q (exclusive or) p qqp TFT TTF FTT FFF To be true one of them should be true other wise false

7 Definition 5: conditional statement Let p and q be propositions. The conditional statement p q is the proposition " if p, then q". p is called hypothesis q is called conclusion Remark: The conditional statement is also called an implication. The conditional statement p q is false when p is true and q is false and true other wise: Table 5: The truth table for the conditional statement p q p qqp TTT FFT FTF TFF False if q is false only

8 The ways to express p 1." If p, then q" 2." If p, q" 3." p is sufficient for q" 4." q if p" 5."q when p" 6."Anecessary condition for p is q" 7."q unless * If 8."p implies q" 9."p only if q" 10. "a sufficient condition for p is q" 11."q when ever p" 12."q is necessary for p" 13."q follows from p" q " is false then q is true * When p is true and q is false true other wise

9 Example page7 Let p: "Amal learns discrete mathematics" "Amal will find a good job" Express the statement in English Answer: "If Amal learns discrete math then she will find a good job“ Or "Amal will find a good job when she learns discrete math“ Or "For Amal to get a good job, it is sufficient for her to learn discrete math“ Or "Amal will find a good job, unless she doesn’t learn discrete math" Page8 Converse, Contra positive and inverse p and q are propositions p q

10 1)converse of q 2) Contra positive of 3) Inverse of p Example 9: Consider the conditional statement "The home team wins when ever it is raining" Find the contra positive, the converse and the inverse Answer: "If it is raining, then the home team wins" 1. Contra positive: (Equivalent to the original) "If the home team doesn’t win, then it is not raining" 2. Converse: q p "If the home team wins, then it is raining" 3. Inverse: "If it is not raining, then the home team doesn’t win"

11 Definition6 (bi conditionals or bi-implications) let p and q be propositions the bi conditional statement p q is the proposition "p if and only if q". q is true when p and q have the same truth value and is false other wise The bi conditional statement p Remark: 1."p is necessary and sufficient for q" "If p and q, and conversely" "p iff q" Ex: (bi conditional) Let p: "You can take a flight" q: "You buy a ticket" Write p Answer: "You can take a flight if and only if you buy a ticket" q Truth table of p q p qqp TTT FFT FTF TFF True if both of them true or both of them false

12 Truth tables of compound propositions Ex11: construct the truth table of the compound proposition If Truth table qp TTFTT FTTFT FFFTF FTTFF pq true if both of them true or both of them false.

13 Translating English Sentences: Ex1: Translate the following English sentence into a logical expression. "You can access the internet from campus only if you are a computer science major or you are not a freshman" Answer: let a be the proposition: You can access the internet from campus. Let c be the proposition: You are a computer science major let f be the proposition: You are a freshman a Ex2: "You cannot ride the roller coaster if you are under 4 feet tall unless you are older than 16 years old" Answer: let q: You can ride the roller coaster Let r: You are under 4 feet tall Let s: You are older than 16 years old. Ex3: "The automated reply can't be sent when the file system is full using logical expression" Answer: p q q unless

14 Logic and Bit Operation: A bit is a symbol with 2 possible values, namely 0 and 1. (Bit comes from binary digit) *I represent true T and o represents F (false) A Boolean variable: a variable is called a Boolean variable if its value is either true or false. So a Boolean variable can be represented using a bit. Definition7: A bit string is a sequence of zero or more bits. The length of this string is the number of bits in the string. Ex: 10 10 10011 is a bit string of length nine Remark: We define the bitwise OR, bitwise AND, and bitwise XOR of 2 strings of the same length to be the strings that have as their bits OR AND XOR of the corresponding bits in the strings respectively.

15 Ex21: find the bitwise OR, bitwise AND and the bitwise XOR of the bit strings 10 10 11 011 0 and 1100011101 Answer: 10 1011 0 11 0 11 0001 1101 ____________ 1 1 1011 1111 bitwise OR 1 0 00010100 bitwise AND 0 1 1010 1011 bitwise XOR Table9: Table for the bit operation OR, AND, XOR yx 00000 10110 10101 01111

16 Section 1.2 Propositional Equivalences Definition: compound proposition that is always true is called tautology. A compound proposition that is always false is called contradiction. A compound proposition that is neither a tautology nor a contradiction is called a contingency Ex1: Table (1) examples of a tautology and a contradiction p FTFT FTTF because is always true is always false so it is at auto logy so it is a contradiction

17 Logical Equivalences: Definition 2: The compound propositions p and q are called logically equivalence if is a tautology. denotes that p and q are logically equivalent. (or we denoted The notation by ) De Morgan's Laws: 1.Show that. (Book page 22) 2.Show that qp FFFFTTT TTFTFFT TFTTFTF TTTTFFF

18 Example3 Show that are logically equivalent Answer: qp TFTTT FFFFT TTTTF TTTFF Table 4 page 23 Read table 6 Read table 7 Read table 8 Constructing New Logical Equivalence: Ex6: Show that are logically equivalence Do ex.7 and ex.8

19 Section1.3 Predictions and Quantifiers Predicates: propositions which contain variables. Remark: predicates are called propositional functions. Example1: consider the statement “x>3” (not proposition) Denote the statement “x>3” by p(x) where p denotes the predicate “is greater than 3” and x is the variable. The statement p(x) is said to be the value of the propositional function p at x. When we assign a value for x then p(x) is a proposition and has the truth value. Example1: page 31 Let p(x) denote the statement “x>3” what are the truth values of p(4) and p(2)? Answer: p(4) is the statement “4>3” which is true. p(2) is the statement “2>3” which is false.

20 Example2: page 31 Let A(x) denote the statement “computer x is under attack by an intruder”. Suppose that if the computers on campus, only CS2 and Math 1 are currently under attack by intruders what are the truth values of A(CS1), A (CS2) and A(Math1) Answer: let x= CS1 in the statement “computer x is under attack by an intruder” A(CS1) is the statement “computer CS1 is under attack by intruder” which is false A(CS2) is the statement “computer or CS2 is under intruder” which is true A(Math1) is the statement “computer Math1 is under intruder” which is true Ex3: page31 Let Q(x,y) denote the statement “x=y+3” what are the truth values of the propositions Q(1,2), Q(3,0)?

21 Answer: Q(1,2) is the statement “1=2+3” which is F. Q(3,0) is the statement “3=0+3” which is T. Remarks: Forming propositions 1- when the variables in a propositional function are assigned values, the resulting statement becomes a proposition with certain truth values. 2- Quantification: is a way to create a proposition from a proposition function using the words all, some, many, none and few. 3- We will focus on 2 types of quantifications which are: i.The universal quantification (using for all which tells the predict is true for every element under consideration. ii. existential quantification which tells us that there is one or more element under consideration for which the predict is true. iii. x = for all = for every = all of = for each = given any = for arbitrary = for each.

22 Do example 4 and 5. Definition1: The universal quantification of p(x) is the statement. “p(x) for all values of x in the domain”. The notation Vxp(x) denotes the universal quantification of p(x). Is called the universal quantifier. Remark: 1- An element for which p(x) is false is called Counter example of xp(x). 2- Particular domain is called the domain of discourse or the universal of discourse. 3- The universal quantifier is. 4- When x p(x) is used the Domain should be specified. Example8: let p(x) be the statement “x+1>x” what is the truth value of the quantification x p(x) where the domain is the set of all real numbers? Solution: Since p(x) is true for all real numbers x the quantification x p(x) is true. Table(1) quantifiers. When false?When true?Statement There is an x for which p(x) is false P(x) is true for every x P(x) is false for every x. There is an x for which p(x) is true

23 Example9: let Q(x) be the statement “x<2” what is the truth value of the quantification where the domain consists of all real numbers. Solution: take x=3 which is in the domain (R) “3<2” is a false statement so is false. Note that x=3 is a counter example for the statement Example10: suppose p(x) is “x²>0” show that the statement is false where the universe of discourse (domain) is set of integers. Solution: take x=0 so 0>0 is a false statement so is false. (note that we use a counter example which is x=0 to solve this question). Example11: what is the truth value of where p(x) is the statement “x²<10” and the domain consists of the positive integers not exceeding 4? Solution: domain is {1,2,3,4} take x=4 € domain Then p(4) is “4²<10” is false statement since “16<10” is a false statement so is false. not that the statement is the same as the conjunction p(1) ʌ p(2) ʌ p(3) ʌ p(4) and it is true if p(1), p(2), p(3), and p(4) are all true.

24 Read example 12 Example13: what is the truth of if the domain consists of all real numbers? What is the truth value if the domain consists of all integers. Solutions: 1- The domain consists of all real numbers take € domain. So is false if the domain is all real numbers 2- The domain consists of all integers if and only if So if the domain is the set of integers is true because there are no integers x with o<x<1

25 The existential quantifier: page36 The existential quantifier is the proposition “There exists an element x in the domain such that p(x)” Remark: 1- We use the notation xp(x) for the existential quantification of p(x). 2- is called the existential quantifier. 3- When xp(x) is used the domain should be specified. 4- “There exists= for some= for at least one= there is Example4: let p(x) be “x>3”. What is the truth value of the quantification xp(x) where the domain consists of all real number. Solution: domain is all real numbers take x=4, “4>3” is true proposition so xp(x) is true. Example5: let Q(x) be “x=x+1” what is the truth value of the quantification xQ(x), where the domain consists of all real numbers?

26 Solution: domain is all real numbers Q(x) is false for every real no. So xQ(x) is false. Example16: what is the truth value of xp(x) where p(x) is the statement “x²>10” and the universe of discourse consists of the positive integers not exceeding4? Solution: domain is {1,2,3,4} take x=4 so “16>10” is true proposition hence the proposition xp(x) is true Remark: The proposition xp(x) is true since xp(x) is the same as p(1)vp(2)vp(3)vp(4) So because p(4) is true so xp(x) is true. Other Quantifiers: The uniqueness quantifier denoted by ! or ! xp(x) states “there exists a unique x such that p(x) is true” ! = “there is exactly one” = “there is one and only one” Remark: 1- When a quantifier is used on the variable x, we say that this occurrence of the variable is bound. 2- An occurrence of a variable that is not bound by a quantifier or set to equal to a particular value is said to be free.

27 3- The part of a logical expression to which quantifiers is applied is called the scope of the quantifier. Example: 1- In the statement x(x+y=1), the variable x is bound by the existential quantification on x, but the variable y is free. 2- In the statement x(p(x) ʌ Q(x) V x R(x), all variables are bound. Logical Equivalences Involving Quantifiers: Definition3: Statement is involving predicates and quantifiers are logically equivalent if and only if they have the same truth value no matter which predicates are substituted into these statements and which domain is of discourse is used for the variables in these propositional functions. Remark: Use the notation to indicate that two statement S and T involving predicates and quantifiers are logically equivalent. Example: Show that Solution: first show that if is true then is true. Suppose is true.

28 Let a be in the domain → (p(a) and q(a)) is true. Since p(a) is true and Q(a) is true for every element in the domain, we get is true and is true this means that is true. Conversely: Suppose If a is in the domain then p(a) is true and Q(a) is true so p(a) ʌ Q(a) is true. So Negating Quantified Expression: “every student in your class has taken a course in calculus” The statement in logical expression is where x is the student and the domain is students in your class and p(x) is the statement “x has taken a course in calculus” Negation: is the statement “It is not the case that every student in your class has taken a course in calculus” Or “There is a student in your class who has not taken a course in calculus” in logical expression”. (there exists x which doesn’t satisfies p(x) or make p(x) not true) Or (not for all x p(x) is true) Remark: 1) the 2 logical expressions That is

29 The Negation of Quantified Expressions: The rules for negations for quantifiers are called De Morgan’s Laws for quantifiers. Example20, 21: What are the negations of the statements: 1- “There is an honest politician” 2- “All Americans eat cheese burgers” 3- 4- When is negation is false When is negation is true Equivalent statement Negation There is an x for which p(x) is true For every x, p(x) is false P(x) is true for every x. There is an x for which p(x) is false

30 Answer: 1- let x be politician. Domain is all politician let H(x) denote “x is honest”. Then the original statement will be represented by where the domain consists of all politicians. Negation of this statement is: There exists no there exists x which x which makes H(x) is not true x is true. 2- let G(x) denote “x easts cheese hamburgers” Domain: all Americans. The original statement can be represented logically by: Negation: “Some American doesn’t eat cheese hamburgers” 3-

31 4- Example2: Solution:

32 Translating from English into logical expression: Example: Express the statement “Every student in this class has studied calculus” using predicates and quantifiers. Answer: let the domain be the student in this class. Let c(x) be the statement “x has studied calculus” then the logical expression is Another solution: “For every person x, if person x is a student in this class then x has studied calculus” Let S(x) represents “person x in this class” Let C(x) represents “x has studied calculus” Domain: all people The logical expression is Example 26 page 44: Consider these statements. The first two are called premises and the third is called conclusion. The entire set is called an argument “All lions are fierce” “Some lions do not drink coffee” “Some fierce creatures do not drink coffee” Express the above statements in logical expressions.

33 Let p(x) be the statement “x is a lion” Let Q(x) be the statement “x is fierce” Let R(x) be the statement “x is drinks of coffee” Domain: All the creatures So the logical expressions for the 3 statements are: Example27: Consider the following statements” “All humming birds are richly colored” “Birds that do not live on honey are dull in color” “Humming birds are small” Let p(x) be the statement “x is a humming bird” Let Q(x) be the statement “x is large” Let R(x) be the statement “x lives on honey” Let S(x) be the statement “x is richly colored ” Express the statements in the argument using quantifiers p(x),Q(x),R(x) and S(x)

34 Answer:


Download ppt "Introduction to Discrete Mathematics Discrete Mathematics: is the part of mathematics devoted to the study of discrete objects. Discrete Mathematics is."

Similar presentations


Ads by Google