Matrices Proof Strategy Sequences and Summations - PowerPoint PPT Presentation

1 / 36
About This Presentation
Title:

Matrices Proof Strategy Sequences and Summations

Description:

A matrix with m rows and n columns is called an m x n matrix. Square matrix: has the same number of rows and columns. ... Matrix Arithmetic ... – PowerPoint PPT presentation

Number of Views:137
Avg rating:3.0/5.0
Slides: 37
Provided by: isabellebi
Category:

less

Transcript and Presenter's Notes

Title: Matrices Proof Strategy Sequences and Summations


1
MatricesProof StrategySequences and Summations
2
Learning Objectives
  • Matrix definitionMatrix arithmeticMatrix
    properties.
  • Proof strategy.
  • Sequences and summations.

3
Matrix Definition
  • A matrix is a rectangular array of numbers.
  • A matrix with m rows and n columns is called an m
    x n matrix.
  • Square matrix has the same number of rows and
    columns.
  • Two matrices are equal if they have the same
    number of rows, the same number of columns, and
    the same elements.

4
Matrix Definition
  • A matrix is also an application from N x N to a
    set E, generally R.
  • (i,j) ? aij
  • ith row is (ai1, ai2 , , ain )
  • jth column is (a1j, a2j , , anj )

5
Matrix Definition
  • procedure matrixEquality(A, B matrices)
    equal true for i1 to m for
    j1 to n if not aij bij
    then equal false
    equal is true if A and B are equal, false
    otherwise

6
Matrix Arithmetic
  • Addition let Aaij and B bij two matrices m
    x n, then the matrix AB aij bij and is also
    m x n.

7
Matrix Arithmetic
  • Matrix addition algorithmprocedure
    matrixAddition(A, B matrices) for i1 to m
    for j1 to n cij
    aij bij Ccij is the sum of A and B

8
Matrix Arithmetic
  • Multiplication let Aaij an m x k matrix, and
    B bij a k x n matrix. Then the matrix AB
    cij , product of A by B, is m x n, and is
    defined as

9
Matrix Arithmetic
  • Matrix product algorithmprocedure
    matrixProduct(A, B matrices) for i1 to m
    for j1 to n begin
    cij 0 for
    q 1 to k cij cij
    aiqbqj end Ccij is
    the sum of A and B

10
Matrix Properties
  • The product of two matrices is not commutative.
  • First of all, the two matrices need to be square.
  • Even in this case, in general AB ? BA.
  • The product of matrices is associative(AB)C
    A(BC)
  • The product of matrices is like composition of
    functions. It represents the composition of
    functions between vector spaces.

11
Matrix Properties
  • The identity matrix is defined as a square matrix
    with all zeros, except on the diagonal, which
    contains only 1.
  • In ?ij were ?ij 1 if i j,
    and 0 otherwise.

12
Matrix Properties
  • In is the neutral element (zero) of matrix
    multiplication for square matrices of order n.
  • InAAIn A
  • Power AAA An _________
    n times

13
Matrix Properties
  • The transpose of a matrix is obtained by
    exchanging the lines and columns.

14
Matrix Properties
  • A symmetric matrix is a matrix that is equal to
    its transpose. It is a square matrix.

15
Matrix Properties
  • Matrices are used in computer science to
    represent documents (information retrieval).
  • A collection of n texts and m different words can
    be represented by an m x n matrix, where each
    document is a line and each word is a column. If
    a document contains a word, then the
    corresponding matrix element is set to 1,
    otherwise it is set to 0.
  • The result is a zero-one matrix that is sparse
    mostly containing zeros. Specific methods in data
    structures are used to represent sparse matrices.

16
Proof Strategy
  • There are many proof strategies
  • Forward chaining (from hypotheses to conclusion)
  • Backward chaining (from conclusion to hypotheses)
  • Proof by cases (odd numbers, even numbers)
  • Adapting existing proofs
  • Conjecture and proof
  • Counterexamples
  • The halting problem

17
The proof, using proof by cases...
  • Given ngt0, prove there is a prime pgtn.
  • Consider x n!1. Since xgt1, we know (x is
    prime)?(x is composite).
  • Case 1 x is prime. Obviously xgtn, so let px
    and were done.
  • Case 2 x has a prime factor p. But if p?n, then
    p mod x 1. So pgtn, and were done.

18
The Halting Problem (Turing36)
  • The halting problem was the first mathematical
    function proven to have no algorithm that
    computes it!
  • We say, it is uncomputable.
  • The desired function is Halts(P,I) the truth
    value of this statement
  • Program P, given input I, eventually
    terminates.
  • Theorem Halts is uncomputable!
  • I.e., There does not exist any algorithm A that
    computes Halts correctly for all possible
    inputs.
  • Its proof is thus a non-existence proof.
  • Corollary General impossibility of predictive
    analysis of arbitrary computer programs.

Alan Turing1912-1954
19
The Proof
  • Given any arbitrary program H(P,I),
  • Consider algorithm Breaker, defined asprocedure
    Breaker(P a program) halts H(P,P) if halts
    then while T begin end
  • Note that Breaker(Breaker) halts iff
    H(Breaker,Breaker) F.
  • So H does not compute the function Halts!

Breaker makes a liar out of H, by doing the
opposite of whatever H predicts.
20
Goldbachs Conjecture
  • Some very simple statements of number theory
    havent been proved or disproved!
  • E.g. Goldbachs conjecture Every integer n2 is
    exactly the average of some two primes.
  • ?n2 ? primes p,q n(pq)/2.
  • There are true statements of number theory (or
    any sufficiently powerful system) that can never
    be proved (or disproved) (Gödel).

21
Sequences and Summations
  • Definition Two sets A and B have the same
    cardinality if there is a bijection f A? B.
  • The cardinality of A will be denoted by A .
  • Two finite sets have the same cardinality if they
    have the same number of elements.
  • N and N x N have the same cardinality. N and N x
    N x N also have the same cardinality.
  • Definition An infinite set A is countable if A
    N

22
Sequences and Summations
  • Definition A sequence is a function from a
    subset of the natural numbers (usually of the
    form 0, 1, 2, . . . to a set S.
  • Note the sets 0, 1, 2, 3, . . . , k and 1, 2,
    3, 4, . . . , k are called initial segments of
    N.
  • Notation if f is a function from 0, 1, 2, . .
    . to S we usually denote f(i) by ai and we write
  • where k is the upper limit (usually ?).

23
Sequences and Summations
  • Examples Using zero-origin indexing, if f(i)
    1/(i 1). then the sequence f 1, 1/2,1/3,1/4,
    . . . a0, a1, a2, a3, Using one-origin
    indexing the sequence f becomes 1/2, 1/3, . . .
    a1, a2, a3, . . .

24
Sequences and Summations
25
Sequences and Summations
  • Product notation
  • Definition A geometric progression is a sequence
    of the form a, ar, ar 2 , ar 3 , ar 4 , . . .
  • Your book has a proof that

26
Sequences and Summations
  • Proof by induction reasoning
  • property is true for n0
  • Hypothesis true for all k lt n
  • Let us take n1.
  • You should also be able to determine the sum
  • if the index starts at k vs. 0
  • if the index ends at something other than n
    (e.g., n-1, n1, etc.).

27
Sequences and Summations
  • CardinalityDefinition The cardinality of a set
    A is equal to the cardinality of a set B, denoted
    A B , if there exists a bijection from A
    to B.
  • Definition If a set has the same cardinality as
    a subset of the natural numbers N, then the set
    is called countable.If A N, the set A is
    countably infinite.
  • The (transfinite) cardinal number of the set N is
    aleph null.
  • If a set is not countable we say it is
    uncountable.

28
Sequences and Summations
  • ExamplesThe following sets are uncountable (we
    show later)
  • The real numbers in 0, 1
  • P(N), the power set of N
  • Note With infinite sets proper subsets can have
    the same cardinality. This cannot happen with
    finite sets.
  • Countability carries with it the implication that
    there is a listing of the elements of the set.

29
Sequences and Summations
  • Definition A ? B if there is an
    injection from A to B.
  • ExampleTheorem If A is a subset of B then A
    ? B .Proof the function f(x) x is an
    injection from A to B.

30
Sequences and Summations
31
Sequences and Summations
  • Theorem For any set A, A and P(A) have distinct
    cardinalities.
  • Proof Assume that f A ? P(A). We shall show
    that f cannot be ONTO, that is there is a subset
    B ? A (an element of P(A)) such that ?b ? A, B ?
    f(b) (B does not have a preimage).
  • For every a ? A, the subset f(a) either contains
    a or does not.
  • Let B a ? A a ? f(a). B may be empty or
    not.
  • If B f(b), for some b ? A, then
  • if b ? B by the definition of B, b ? f(b) and if
    b ? f(b), b ? B. Since it is not possible for
    an element to belong and not belong to a set, we
    have a contradiction. So, b ? B.

32
Sequences and Summations
  • if b ? B by the definition of B, b ? f(b), which
    is also B. So b ? B. Since it is not possible
    for an element to belong and not belong to a set,
    we have here also a contradiction.
  • The contradiction is a result of our assumption
    that B f(b). Hence B is not accounted for.
    QED
  • Conclusion there are non-countable sets, for
    instance P(N).

33
Sequences and Summations
  • Examples
  • (i) B Binary strings is not countable.
  • (ii) F f f N ? 0,1 is not countable.
  • (iii) 0,1 x x ? R ? 0 ? x ? 1 is not
    countable.

34
Sequences and Summations
  • The set of (finite length) strings S over a
    finite alphabet A is countably infinite.To show
    this we assume that
  • A is nonvoid
  • There is an alphabetical ordering of the
    symbols in A
  • Proof List the strings in lexicographic order
  • all the strings of zero length,
  • then all the strings of length 1 in alphabetical
    order,
  • then all the strings of length 2 in alphabetical
    order, etc.
  • This implies a bijection from N to the list of
    strings and hence it is a countably infinite set.

35
Sequences and Summations
  • For example Let A a, b, c.
  • Then the lexicographic ordering of A is l , a, b,
    c, aa, ab, ac, ba, bb, bc, ca, cb, cc, aaa, aab,
    aac, aba, .... f(0), f(1), f(2), f(3), f(4),
    . . . .

36
Sequences and Summations
  • The set of all C programs is countable .
  • Proof Let S be the set of legitimate characters
    which can appear in a C program.- A C compiler
    will determine if an input program is a
    syntactically correct C program (the program
    doesn't have to do anything useful).- Use the
    lexicographic ordering of S and feed the strings
    into the compiler.
  • If the compiler says YES, this is a
    syntactically correct C program, we add the
    program to the list.Else we move on to the next
    string.
  • In this way we construct a list or an implied
    bijection from N to the set of C programs.
  • Hence, the set of C programs is countable.
    Q. E. D.
Write a Comment
User Comments (0)
About PowerShow.com