Download presentation
Presentation is loading. Please wait.
Published byPearl Baldwin Modified over 9 years ago
1
Conditional Statements CS 2312, Discrete Structures II Poorvi L. Vora, GW
2
Conditional Statement A implies B A => B If A then B A is the hypothesis; B the conclusion Example: If x is a prime larger than 2 then x is odd A: “x is a prime number larger than 2” B: “x is odd” Generally, the truth of the conditional statement is a function of one or more variables; in this case, x. This example statement is true for all values of x.
3
Truth value a function of variables Generally speaking, the truth value of a statement depends on variables. For example, consider the inequality: 0 ≤ n 3 ≤ Bn 2 – Whether it is true or not depends on the values of the variables: n and B – There are quite likely value of n and B for which it is true, as well as values for which it is false
4
: for every Consider a modification of the previous example: 0 ≤ n 3 ≤ Bn 2 n ≥ b The truth value of this inequality is now a function of B and b On fixing b and B, If it is untrue for a single value of n ≥ b then the statement is false If it is true n ≥ b then it is true Thus the truth is not dependent on n
5
Counterexample Sometimes you may have statement that is false: x is divisible by 4 even integers x The way to show it is false is to show that the statement is not true “ even integers x” one even integer for which it is false is enough. However, this does not mean that x is not divisible by 4 even integers x
6
Counterexample, contd The statement “x is divisible by 4” is sometimes true and sometimes false Thus neither of the statements below is true, because there are counterexamples for both: x is divisible by 4 even integers x x is not divisible by 4 even integers x
7
: There exists Sometimes you may be asked to show that there exist values of variables such that a statement is true. Continuing the previous example: B, b > 0 such that 0 ≤ n 3 ≤ Bn 2 n ≥ b One way of proving above is to find one value of b, B and show that the inequality is true for these values.
8
How and and change a statement Consider the statement: “x is divisible by 6” Its truth depends on the value of x Adding or can eliminate the dependence on x to allow you to say definitively whether the statement is true or false: x such that x divisible by 6: True odd x such that x is divisible by 6: False x is divisible by 6 integers x that are multiples of 12: True x is divisible by 6 integers x: False
9
The truth table of A=>B We want to know the truth value of A => B Note: statement makes no claims when A is false. – when A is false, the statement is true independent of the value of B
10
Negation or Counterexample Examining the statement A(x) => B(x) x (where both A and B are functions of x) – If you think it is true, you need to provide a proof. Begin with the assumption A(x) is true and show B(x) is true. – If you think it is false, you could provide a counterexample. Exactly one example of the variable which makes A true but B false. Notice that providing an example where B is true but A false gives you nothing at all – because the statement is making no claims when A is false. don’t care
11
A Counterexample Suppose you are presented with the conditional statement: integers x, if 2 divides x then 4 divides x What is a valid counterexample? Are there values of x for which the statement is true?
12
Converse Given: A => B The converse is B => A Does it follow? Example: If x is a prime larger than 2 then x is odd What is the converse? Does it follow?
13
Proving the converse does not prove the main statement Suppose you have to show A => B And you begin with B to show A You have not shown A => B You have shown B => A
14
Examples of incorrect proofs To show that If 2 divides x, then 4 divides x (this is not true, but examples of incorrect proofs will conclude it is) Example 1: Suppose 4 divides x. Then x = 4q (for q the quotient when 4 divides x). Hence x is even and 2 divides x. Incorrect! Why?
15
Examples of incorrect proofs, contd. To show that If 2 divides x, then 4 divides x (this is not true, but examples of incorrect proofs will conclude it is) Example 2: Suppose 2 divides x. Then x = 2q 1 Suppose 4 divides x. Then x = 4q 2 x = x => 2q 1 = 4q 2 => q 1 = 2q 2 LHS = RHS Incorrect! Why?
16
Contrapositive One can show A=> B by assuming A is true and showing that then B is true OR by assuming that B is not true and showing that then A is not true. That is, by showing: not B => not A Which is the contrapositive Which is logically equivalent to A => B
17
Why is the contrapositive equivalent to the original statement? ABA => Bnot B => not A TTTT TFFF FTTT FFTT Consider the truth table
18
Inverse not A => not B Is this related to the original statement? The converse? The contrapositive? It is the contrapositive of the converse
19
Summary Conditional Statement: A => B – Converse: B => A – Contrapositive: not B => not A – Inverse: not A => not B – Counterexample: an example of A and not B
20
Necessary and Sufficient A => B A sufficient for B B => A A necessary for B A B A is necessary and sufficient for B B is necessary and sufficient for A
21
Bidirectional If and only if (iff) If A then B AND If B then A A B A iff B A and B are equivalent statements
22
False Premise, Valid Argument, False Conclusion Claim: If 0 + 1 = 0 then 2=0 Proof: Begin with correct statement: 2 = 0 + 1 + 1 => 2 = (0+1)+1 = 0+1=0
23
Valid Premise, Invalid Argument, Valid Conclusion gives zero credit Assume: If 4 divides x then 2 divides x Show that 4 divides 16 Invalid proof: 2 divides 16. Hence, applying assumption, 4 divides 16.
24
Proof by Contradiction To show A=> B Recall, if A is not true, you cannot determine anything. Assume A is true. Suppose B is not. Then show there is a contradiction. That is, B has to be true.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.