inequalities - tamu computer science people pages · 2020. 8. 10. · using inequalities as an...

11
A < B Andreas Klappenecker

Upload: others

Post on 17-Sep-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: inequalities - TAMU Computer Science People Pages · 2020. 8. 10. · using inequalities as an example. We start from first principles and define when a number a is greater than a

A < BAndreas Klappenecker

Page 2: inequalities - TAMU Computer Science People Pages · 2020. 8. 10. · using inequalities as an example. We start from first principles and define when a number a is greater than a

Motivation

We want to highlight some basic proof techniques using inequalities as an example.

We start from first principles and define when a number a is greater than a number b.

Then we derive some simple facts, exercising the direct proof technique.

Building on this foundation, we prove for some simple function f(n) that f(n) = O(g(n)). We also show how to disprove such a claim.

Page 3: inequalities - TAMU Computer Science People Pages · 2020. 8. 10. · using inequalities as an example. We start from first principles and define when a number a is greater than a

A<B

Let a and b be real numbers.

We say that a is greater than b, written a > b, if and only if a-b is a positive number.

Page 4: inequalities - TAMU Computer Science People Pages · 2020. 8. 10. · using inequalities as an example. We start from first principles and define when a number a is greater than a

Transitivity

Let a, b, and c be real numbers.

Theorem: If a>b and b>c then a>c.

Proof: Since a>b and b>c, it follows that a-b and b-c are positive real numbers (by definition of >).

The sum of positive real numbers is positive,

hence a-b + b-c = a-c is a positive real number.

Therefore, we can conclude that a>c. We only used the definition!

Page 5: inequalities - TAMU Computer Science People Pages · 2020. 8. 10. · using inequalities as an example. We start from first principles and define when a number a is greater than a

Adding a Number

Theorem: Let a, b, and c be real numbers.

If a>b, then a+c > b+c

Proof: Try to prove it yourself!

Page 6: inequalities - TAMU Computer Science People Pages · 2020. 8. 10. · using inequalities as an example. We start from first principles and define when a number a is greater than a

Adding Inequalities

Theorem: If a>b and c>d, then a+c > b+d.

Proof: If a>b, then a+c > b+c by the previous theorem.

Similarly, it follows from c>d that b+c > b+d.

By transitivity, we get a+c > b+d. Now we used previously

established facts

Page 7: inequalities - TAMU Computer Science People Pages · 2020. 8. 10. · using inequalities as an example. We start from first principles and define when a number a is greater than a

Multiplication and Inequalities

Theorem: Suppose that a>b. For any c>0, we have ac>bc. For any c<0, we have ac<bc.

Theorem: Suppose that a>b and c>d. Then ac>bd.

Again: Try to prove these yourself!

Page 8: inequalities - TAMU Computer Science People Pages · 2020. 8. 10. · using inequalities as an example. We start from first principles and define when a number a is greater than a

Big Oh

Page 9: inequalities - TAMU Computer Science People Pages · 2020. 8. 10. · using inequalities as an example. We start from first principles and define when a number a is greater than a

Example

Theorem: n = O(n2)

Proof: For all natural numbers n, we have n>=1.

It follows that n2>=n holds for all n >= 1.

Thus, by definition, n = O(n2).

We used that inequalities can be multiplied by a positive constant.

Page 10: inequalities - TAMU Computer Science People Pages · 2020. 8. 10. · using inequalities as an example. We start from first principles and define when a number a is greater than a

Proof by Contradiction

We want to prove that a certain statement S is true.

We begin by assuming that the statement S is false. We then deduce from the fact that S is false by logical reasoning some fact that is not true, an absurdity. Therefore, the statement

“S is false”

must be wrong, hence S must be true.

Page 11: inequalities - TAMU Computer Science People Pages · 2020. 8. 10. · using inequalities as an example. We start from first principles and define when a number a is greater than a

Example

Theorem: n2∉O(n).

Proof: Seeking a contradiction, we assume that n2 ∈O(n). Then there would have to exist a constant U and a natural number n0 such that

n2<= Un holds for all n>= n0.

This would imply that n <= U holds for all

n > max(n0 ,U), which is absurd. Therefore, we can conclude that n2 is not contained in O(n).