february 26, 2015applied discrete mathematics week 5: mathematical reasoning 1 addition of integers...

25
February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning 1 Addition of Integers Example: Add a = (1110) 2 and b = (1011) 2 . a 0 + b 0 = 0 + 1 = 02 + 1, so that c 0 = 0 and s 0 = 1. a 1 + b 1 + c 0 = 1 + 1 + 0 = 12 + 0, so c 1 = 1 and s 1 = 0. a 2 + b 2 + c 1 = 1 + 0 + 1 = 12 + 0, so c 2 = 1 and s 2 = 0. a 3 + b 3 + c 2 = 1 + 1 + 1 = 12 + 1, so c 3 = 1 and s 3 = 1. s = c = 1.

Upload: kristen-keane

Post on 14-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

1

Addition of Integers

Example:Add a = (1110)2 and b = (1011)2.

a0 + b0 = 0 + 1 = 02 + 1, so that c0 = 0 and s0 = 1.

a1 + b1 + c0 = 1 + 1 + 0 = 12 + 0, so c1 = 1 and s1 = 0.

a2 + b2 + c1 = 1 + 0 + 1 = 12 + 0, so c2 = 1 and s2 = 0.

a3 + b3 + c2 = 1 + 1 + 1 = 12 + 1, so c3 = 1 and s3 = 1.

s4 = c3 = 1.

Therefore, s = a + b = (11001)2.

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

2

Addition of Integers

procedure add(a, b: positive integers)c := 0for j := 0 to n-1 {larger integer (a or b) has n digits}begin

d := (aj + bj + c)/2sj := aj + bj + c – 2dc := d

endsn := c{the binary expansion of the sum is (snsn-1…s1s0)2}

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

3

MatricesA matrix is a rectangular array of numbers.A matrix with m rows and n columns is called anmn matrix.

Example:

083.05.2

11A is a 32 matrix.

A matrix with the same number of rows and columns is called square.

Two matrices are equal if they have the same number of rows and columns and the corresponding entries in every position are equal.

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

4

Matrices

A general description of an mn matrix A = [aij]:

mnmm

n

n

aaa

aaaaaa

A

............

...

...

21

22221

11211

inii aaa ...,,, 21

mj

j

j

a

aa

.

.

.2

1

i-th row of A

j-th column of A

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

5

Matrix Addition

Let A = [aij] and B = [bij] be mn matrices.The sum of A and B, denoted by A+B, is the mnmatrix that has aij + bij as its (i, j)th element.In other words, A+B = [aij + bij].

Example:

17141103

146395

038412

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

6

Matrix Multiplication

Let A be an mk matrix and B be a kn matrix.The product of A and B, denoted by AB, is the mnmatrix with (i, j)th entry equal to the sum of the products of the corresponding elements from the i-th row of A and the j-th column of B.

In other words, if AB = [cij], then

tj

k

titkjikjijiij babababac

1

2211 ...

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

7

Matrix Multiplication

A more intuitive description of calculating C = AB:

011500412103

A

4310

12B

- Take the first column of B - Turn it counterclockwise by 90 and superimpose

it on the first row of A - Multiply corresponding entries in A and B and

add the products: 32 + 00 + 13 = 9 - Enter the result in the upper-left corner of C

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

8

Matrix Multiplication

- Now superimpose the first column of B on the second, third, …, m-th row of A to obtain the entries in the first column of C (same order).

- Then repeat this procedure with the second, third, …, n-th column of B, to obtain to obtain the remaining columns in C (same order).

- After completing this algorithm, the new matrix C contains the product AB.

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

9

Matrix Multiplication

Let us calculate the complete matrix C:

011500412103

A

4310

12B

C98

15-2

71520-2

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

10

Identity Matrices

The identity matrix of order n is the nn matrix In = [ij], where ij = 1 if i = j and ij = 0 if i j:

1...00.........0...100...01

A

Multiplying an mn matrix A by an identity matrix of appropriate size does not change this matrix:

AIn = ImA = A

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

11

Powers and Transposes of Matrices

The power function can be defined for square matrices. If A is an nn matrix, we have:

A0 = In,Ar = AAA…A (r times the letter A)

The transpose of an mn matrix A = [aij], denoted by At, is the nm matrix obtained by interchanging the rows and columns of A.

In other words, if At = [bij], then bij = aji for i = 1, 2, …, n and j = 1, 2, …, m.

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

12

Powers and Transposes of Matrices

Example:

411302tA

4310

12A

A square matrix A is called symmetric if A = At.Thus A = [aij] is symmetric if aij = aji for alli = 1, 2, …, n and j = 1, 2, …, n.

493921

315A

131131131

B

A is symmetric, B is not.

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

13

Zero-One Matrices

A matrix with entries that are either 0 or 1 is called a zero-one matrix. Zero-one matrices are often used like a “table” to represent discrete structures.

We can define Boolean operations on the entries in zero-one matrices:

a b ab

0 0 0

0 1 0

1 0 0

1 1 1

a b ab

0 0 0

0 1 1

1 0 1

1 1 1

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

14

Zero-One Matrices

Let A = [aij] and B = [bij] be mn zero-one matrices.

Then the join of A and B is the zero-one matrix with (i, j)th entry aij bij. The join of A and B is denoted by A B.

The meet of A and B is the zero-one matrix with (i, j)th entry aij bij. The meet of A and B is denoted by A B.

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

15

Zero-One Matrices

Example:

011011

A

001110

B

Join:

011111

000111101101

BA

Meet:

001010

000111101101

BA

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

16

Zero-One MatricesLet A = [aij] be an mk zero-one matrix and B = [bij] be a kn zero-one matrix.

Then the Boolean product of A and B, denoted by AB, is the mn matrix with (i, j)th entry [cij], where

cij = (ai1 b1j) (ai2 b2i) … (aik bkj).

Note that the actual Boolean product symbol has a dot in its center.

Basically, Boolean multiplication works like the multiplication of matrices, but with computing instead of the product and instead of the sum.

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

17

Zero-One Matrices

Example:

11

01A

10

10B

10

10)11()11()01()01()10()11()00()01(

BA

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

18

Zero-One Matrices

Let A be a square zero-one matrix and r be a positive integer.

The r-th Boolean power of A is the Boolean product of r factors of A. The r-th Boolean power of A is denoted by A[r].

A[0] = In,A[r] = AA…A (r times the letter A)

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

19

Let’s proceed to…

Mathematical Reasoning

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

20

Mathematical Reasoning

We need mathematical reasoning to• determine whether a mathematical argument is correct or incorrect and• construct mathematical arguments.

Mathematical reasoning is not only important for conducting proofs and program verification, but also for artificial intelligence systems (drawing inferences).

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

21

Terminology

An axiom is a basic assumption about mathematical structures that needs no proof.

We can use a proof to demonstrate that a particular statement is true. A proof consists of a sequence of statements that form an argument.

The steps that connect the statements in such a sequence are the rules of inference.

Cases of incorrect reasoning are called fallacies.

A theorem is a statement that can be shown to be true.

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

22

Terminology

A lemma is a simple theorem used as an intermediate result in the proof of another theorem.

A corollary is a proposition that follows directly from a theorem that has been proved.

A conjecture is a statement whose truth value is unknown. Once it is proven, it becomes a theorem.

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

23

Rules of Inference

Rules of inference provide the justification of the steps used in a proof.

One important rule is called modus ponens or the law of detachment. It is based on the tautology (p(pq)) q. We write it in the following way:

pp q____ q

The two hypotheses p and p q are written in a column, and the conclusionbelow a bar, where means “therefore”.

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

24

Rules of Inference

The general form of a rule of inference is:

p1

p2 . . . pn____ q

The rule states that if p1 and p2 and … and pn are all true, then q is true as well.

These rules of inference can be used in any mathematical argument and do not require any proof.

February 26, 2015 Applied Discrete Mathematics Week 5: Mathematical Reasoning

25

Rules of Inference

p_____ pq Addition

pq_____ p Simplification

p q_____ pq

Conjunction

q pq _____ p

Modus tollens

pq qr _____ pr

Hypothetical syllogism

pq p_____ q

Disjunctive syllogism