CS285 · Annotated SlidesChapter 2 — Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Chapter 2 · Annotated slides

Basic Structures: Sets, Functions, Sequences, Sums, and Matrices

Sets (roster and set-builder notation, subsets, cardinality, power sets, Cartesian products), set operations and identities, functions (one-to-one, onto, bijections, inverses, composition, floor and ceiling), sequences and summations, recurrence relations, and matrices including zero-one matrices and Boolean products.

Slide text Study notes Highlight: key words Tips, tricks & traps Seen again elsewhere How it can come up
Slide 1: Basic Structures: Sets, Functions,
Exam weight Low

    Chapter Summary

    • Sets
      • The Language of Sets
      • Set Operations
      • Set Identities
    • Set Cardinality
      • Countable Sets
    • Functions
      • Types of Functions
      • Operations on Functions
      • Computability
    • Sequences and Summations
      • Types of Sequences
      • Summation Formulae
    • Matrices
      • Matrix Arithmetic
    2
    Exam weight Low

      Sets S E C T I O N 2. 1

      3
      Exam weight Low

        Section Summary

        • Definition of sets
        • Describing Sets
          • Roster Method
          • Set-Builder Notation
        • Some Important Sets in Mathematics
        • Empty Set and Universal Set
        • Subsets and Set Equality
        • Cardinality of Sets
        • Tuples
        • Cartesian Product
        4
        Exam weight Low

          Introduction

          • Sets are one of the basic building blocks for the types of objects considered in discrete mathematics.
            • Important for counting.
            • Programming languages have set operations.
          • Set theory is an important branch of mathematics.
            • Many different systems of axioms have been used to develop set theory.
            • Here we are not concerned with a formal set of axioms for set theory. Instead, we will use what is called naïve set theory.
          5
          Exam weight Low
            Slide 6: Sets
            Exam weight Low
            1. A set is an unordered collection of distinct elements; a ∈ A means a is an element of A.

            Describing Sets

            • Roster Method
            • Set-Builder Notation
            • Interval Notation
            7
            Exam weight Low

              Describing a Set: Roster Method

              • List all the members of a set.
              • S a,b,c,d = { }
              • Order not important S a,b,c,d b,c,a,d = { } = { }
              • Each distinct object is either a member or not; listing more than once does not change the set. S a,b,c,d a,b,c,b,c,d = { } = { }
              • Elipses () may be used to describe a set without listing all of the members when the pattern is clear. ... S a,b,c,d = { } , ......,z
              8
              Exam weight Medium
              1. Roster method lists the elements: {a, e, i, o, u}. Order and repetition don’t matter: {1, 2, 2} = {2, 1}.
              🎯 How this can come up · 1 question
              True / False

              {1, 3, 3, 5} and {5, 3, 1} are equal sets.

              Roster Method

              • Set of all vowels in the English alphabet: V = {a,e,i,o,u}
              • Set of all odd positive integers less than: 10 O = {1,3,5,7,9}
              • Set of all positive integers less than: 100 S
              • Set of all integers less than 0: = {1,2,3,........,99} S -3,-2,-1} = {....,
              9
              Exam weight Low

                Set-Builder Notation

                • Specify the property or properties that all members must satisfy: S x | x is a positive integer less than 100} = { O | = { x x is an odd positive integer less than 10} O = { x | is odd and < 10} x x
                • A predicate may be used: ∈ Z+ S = | P( { x x )}
                • Example: S = x | Prime(x )} {
                • Positive rational numbers: Q = { + x R x = p q | / , for some positive integers p } , q ∈
                10
                Exam weight Low
                1. Set-builder: {x | P(x)}, e.g. {x ∈ ℤ⁺ | x is odd and x < 10}.

                Interval Notation

                [ a ] = { x a x b

                , b

                |

                }

                [ a) = { x a x b

                , b

                |

                < }

                ≤ ≤

                (a ] = { x a x b

                , b

                | <

                }

                ≤

                (a) = { x a x b

                , b

                | < < }

                ≤

                closed interval [ a,b ] open interval (a,b)

                11
                Exam weight Low
                  Slide 12: Some Important Sets
                  Exam weight Low
                  1. ℕ natural numbers, ℤ integers, ℤ⁺ positive integers, ℚ rationals, ℝ reals.
                  Slide 13: Universal Set and Empty Set
                  Exam weight High
                  1. Universal set U holds everything under discussion; ∅ = {} has no elements, and {∅} is NOT empty (it has one element).
                  Exam trap∅ ≠ {∅}: |∅| = 0 but |{∅}| = 1.
                  🎯 How this can come up · 1 question
                  MCQ

                  |{∅, {∅}}| equals:

                  Slide 14: John Venn (1834-1923) Cambridge, UK
                  Exam weight Low

                    Some things to remember

                    • Sets can be elements of sets.

                    { {1,2,3} , a b,c

                    , { } }

                    {N,Z,Q,R}

                    • The empty set is different from a set containing the empty set. = {} ∅ ≠ { ∅ } ∅
                    15
                    Exam weight Low

                      Set Equality

                      Definition: Two sets are equal if and only if they have the same

                      elements.

                      • Therefore if A and B are sets, then A and B are equal if and only if
                      • We write A = B if A and B are equal sets. {1,3,5} = {3, 5, 1}

                      {1,5,5,5,3,3,1} = {1,3,5}

                      Set Equality
                      16
                      Exam weight Low
                        Slide 17: Subsets
                        Exam weight High
                        1. A ⊆ B when every element of A is in B. ∅ ⊆ every set, and every set ⊆ itself.
                        🎯 How this can come up · 1 question
                        True / False

                        ∅ ⊆ A for every set A.

                        Slide 18: Showing a Set is or is not a Subset of Another Set
                        Exam weight Low
                          Slide 19: Another look at Equality of Sets
                          Exam weight Low
                            Slide 20: Proper Subsets
                            Exam weight Low
                            1. Proper subset A ⊂ B: A ⊆ B and A ≠ B.
                            Slide 21: Slide 21
                            Exam weight Low

                              22
                              Exam weight Low
                                Slide 23: Set Cardinality
                                Exam weight Low
                                1. |A| = number of distinct elements (cardinality).
                                Slide 24: Set Cardinality
                                Exam weight Low

                                  Power Sets

                                  Definition: The set of all subsets of a set A, denoted P (A) , is called the

                                  power set of A.

                                  Example: If A = {a,b} then

                                  P

                                  (A) = {ø, {a},{b},{a,b}}

                                  • If a set has n elements, then the cardinality of the power set is. (In 2 n Chapters 5 and 6, we will discuss different ways to show this.)
                                  25
                                  Exam weight High
                                  1. Power set P(A) = the set of all subsets of A. If |A| = n then |P(A)| = 2ⁿ.
                                  🎯 How this can come up · 2 questions
                                  MCQ

                                  If A = {a, b, c}, |P(A)| is:

                                  MCQ

                                  P(∅) equals:

                                  Slide 26: Power Sets
                                  Exam weight Low
                                    Slide 27: Tuples
                                    Exam weight Low
                                    1. Ordered n-tuples: order matters, (1, 2) ≠ (2, 1).
                                    Slide 28: Ren é Descartes (1596-1650)
                                    Exam weight Low
                                      Slide 29: Cartesian Product
                                      Exam weight High
                                      1. A × B = {(a, b) | a ∈ A, b ∈ B}; |A × B| = |A|·|B|; A × B ≠ B × A in general.
                                      🎯 How this can come up · 1 question
                                      MCQ

                                      If |A| = 3 and |B| = 4, |A × B| is:

                                      30
                                      Exam weight Low
                                        Slide 31: Slide 31
                                        Exam weight Low
                                          Slide 32: Slide 32
                                          Exam weight Low

                                            Truth Sets of Quantifiers

                                            • Given a predicate P and a domain D, we define the truth set of P to be the set of elements in D for which P (x) is true. The truth set of P (x) is denoted by
                                            • Example: The truth set of P (x) where the domain is the integers and P (x) is “| x | = 1 ” is the set {-1,1}
                                            Truth Sets of Quantifiers
                                            33
                                            Exam weight Low

                                              Set Operations S E C T I O N 2. 2

                                              34
                                              Exam weight Low

                                                Section Summary

                                                • Set Operations
                                                  • Union
                                                  • Intersection
                                                  • Complementation
                                                  • Difference
                                                • More on Set Cardinality
                                                • Set Identities
                                                • Proving Identities
                                                • Membership Tables
                                                35
                                                Exam weight Low
                                                  Slide 36: Boolean Algebra
                                                  Exam weight Low
                                                    Slide 37: Union
                                                    Exam weight Low
                                                    1. A ∪ B: in A or B (or both).
                                                    Slide 38: Intersection
                                                    Exam weight Low
                                                    1. A ∩ B: in both. Disjoint sets: A ∩ B = ∅.
                                                    Slide 39: Complement
                                                    Exam weight Low
                                                    1. Complement Ā = U − A.
                                                    Slide 40: Difference
                                                    Exam weight Low
                                                    1. A − B: in A but not in B (= A ∩ B̄).
                                                    Slide 41: The Cardinality of the Union of Two Sets
                                                    Exam weight High
                                                    1. |A ∪ B| = |A| + |B| − |A ∩ B| (inclusion–exclusion).
                                                    🎯 How this can come up · 1 question
                                                    MCQ

                                                    |A| = 10, |B| = 7, |A ∩ B| = 3. |A ∪ B| =

                                                    Review Questions

                                                    Example: U = { 0,1,2,3,4,5 6,7,8,9,10

                                                    ,

                                                    } A = { 1,2,3,4,5

                                                    }, B ={ 4,5,6,7,8

                                                    }

                                                    1. A B Solution: { 1,2,3,4,5 6,7,8 , } ∪
                                                    2. A B Solution: { } 4,5 ∩

                                                    3.

                                                    Solution: { 0,6,7,8,9,10

                                                    }

                                                    4.

                                                    Solution: { 0,1,2,3,9,10 }

                                                    1. A B Solution: { }
                                                      • 1,2,3
                                                    2. B A Solution: { 6,7,8 }
                                                    42
                                                    Exam weight Low
                                                      Slide 43: Symmetric Difference ( optional )
                                                      Exam weight Low
                                                      1. Symmetric difference A ⊕ B: in A or B but not both = (A − B) ∪ (B − A).

                                                      Set Identities

                                                      • Identity laws
                                                      • Domination laws
                                                      • Idempotent laws
                                                      • Complementation law Continued on next slide 
                                                      Set Identities
                                                      44
                                                      Exam weight Medium
                                                      1. Set identities mirror the logical equivalences (∪ ↔ ∨, ∩ ↔ ∧, complement ↔ ¬).
                                                      Slide 45: Set Identities
                                                      Exam weight Low

                                                        Set Identities

                                                        • De Morgan’s laws
                                                        • Absorption laws
                                                        • Complement laws
                                                        Set Identities
                                                        46
                                                        Exam weight Low

                                                          Proving Set Identities

                                                          • Different ways to prove set identities:
                                                          1. Prove that each set (side of the identity) is a subset of the other.
                                                          2. Use set-builder notation and propositional logic.
                                                          3. Membership Tables: Verify that elements in the same combination of sets always either belong or do not belong to the same side of the identity. Use to indicate it is in the set and a to indicate that it is 1 0 not.
                                                          47
                                                          Exam weight Low
                                                          1. Prove set identities by: mutual subsets, set-builder notation with logical equivalences, or a membership table.

                                                          Proof of Second De Morgan Law

                                                          Example: Prove that Solution: We prove this identity by showing that:

                                                          and

                                                          2)

                                                          Continued on next slide 

                                                          Proof of Second De Morgan Law
                                                          48
                                                          Exam weight High
                                                          1. De Morgan for sets: (A ∩ B)‾ = Ā ∪ B̄ and (A ∪ B)‾ = Ā ∩ B̄.
                                                          Slide 49: Proof of Second De Morgan Law
                                                          Exam weight Low
                                                            Slide 50: Proof of Second De Morgan Law
                                                            Exam weight Low
                                                              Slide 51: Set-Builder Notation: Second De Morgan Law
                                                              Exam weight Low
                                                                Slide 52: Membership Table
                                                                Exam weight Low
                                                                1. Membership table: 1/0 for "in"/"not in"; the identity holds if both columns match.
                                                                Slide 53: Generalized Unions and Intersections
                                                                Exam weight Low

                                                                  Functions S E C T I O N 2. 3

                                                                  54
                                                                  Exam weight Low

                                                                    Section Summary

                                                                    • Definition of a Function.
                                                                      • Domain, Cdomain
                                                                      • Image, Preimage
                                                                    • Injection, Surjection, Bijection
                                                                    • Inverse Function
                                                                    • Function Composition
                                                                    • Graphing Functions
                                                                    • Floor, Ceiling, Factorial
                                                                    • Partial Functions (optional)
                                                                    55
                                                                    Exam weight Low
                                                                      Slide 56: Functions
                                                                      Exam weight High
                                                                      1. A function f: A → B assigns EXACTLY ONE element of B to each element of A. A is the domain, B the codomain, f(A) the range.
                                                                      Exam trapRange ⊆ codomain; they are not always equal.
                                                                      🎯 How this can come up · 1 question
                                                                      MCQ

                                                                      For f: A → B, the set of values actually taken by f is the:

                                                                      Functions

                                                                      • A function A B can also be defined as a subset of A B (a relation). f: × This subset is restricted to be a relation where no two elements of the relation have the same first element. →
                                                                      • Specifically, a function f from A to B contains one, and only one ordered pair (a, b) for every element a A. and
                                                                      Functions
                                                                      57
                                                                      Exam weight Low

                                                                        Functions

                                                                        Given a function f: A B:

                                                                        • We say f maps A to B or →

                                                                        f is a mapping from A to B .

                                                                        • A is called the domain of f.
                                                                        • B is called the codomain of f.
                                                                        • If f (a) = b,
                                                                          • then b is called the image of a under f.
                                                                          • a is called the preimage of b.
                                                                        • The range of is the set of all images of points in A under f. We denote it by f f (A ).
                                                                        • Two functions are equal when they have the same domain, the same codomain and map each element of the domain to the same element of the codomain.
                                                                        Functions
                                                                        58
                                                                        Exam weight Low

                                                                          Representing Functions

                                                                          • Functions may be specified in different ways:
                                                                            • An explicit statement of the assignment. Assignment of Grades in a Discrete Mathematics Class example.
                                                                            • A formula. f (x) = + 1 x
                                                                            • A computer program.
                                                                              • A Java program that when given an integer n, produces the n th Fibonacci Number (covered in the next section and also in Chapter ). 5
                                                                          59
                                                                          Exam weight Low
                                                                            Slide 60: Questions
                                                                            Exam weight Low
                                                                              Slide 61: Question on Functions and Sets
                                                                              Exam weight Low
                                                                                Slide 62: Injections
                                                                                Exam weight Low
                                                                                1. One-to-one (injective): f(a) = f(b) ⇒ a = b, no two inputs share an output.
                                                                                Slide 63: Surjections
                                                                                Exam weight Low
                                                                                1. Onto (surjective): every b in the codomain is hit by some a.
                                                                                Slide 64: Bijections
                                                                                Exam weight High
                                                                                1. Bijection: one-to-one AND onto; only bijections have inverses.
                                                                                🎯 How this can come up · 3 questions
                                                                                MCQ

                                                                                f: ℤ → ℤ, f(x) = x + 1 is:

                                                                                MCQ

                                                                                f: ℤ → ℤ, f(x) = 2x is:

                                                                                MCQ

                                                                                f: ℝ → ℝ, f(x) = x² is:

                                                                                65
                                                                                Exam weight Low
                                                                                  Slide 66: Showing that f is one-to-one or onto
                                                                                  Exam weight Low
                                                                                    Slide 67: Showing that f is one-to-one or onto
                                                                                    Exam weight Low
                                                                                    1. To show one-to-one: assume f(x) = f(y) and derive x = y. To show onto: take any y and solve for an x with f(x) = y.

                                                                                    Injections, Surjections and Bijections

                                                                                    Let A = B = R, the reals. Determine which are injections, surjections, bijections:

                                                                                    • f(x) = x,

                                                                                    2,

                                                                                    • f(x) = x

                                                                                    3,

                                                                                    • f(x) = x

                                                                                    • f(x) = x + sin(x),

                                                                                    • f(x) = | x |

                                                                                    68
                                                                                    Exam weight Low

                                                                                      Injections, Surjections and Bijections

                                                                                      Let A = B = R, the reals. Determine which are injections, surjections, bijections:

                                                                                      injective, surjective, bijective

                                                                                      • f(x) = x,

                                                                                      2, none

                                                                                      • f(x) = x

                                                                                      3, injective, surjective, bijective

                                                                                      • f(x) = x

                                                                                      • f(x) = x + sin(x), injective, surjective, bijective |, none

                                                                                      • f(x) = | x

                                                                                      69
                                                                                      Exam weight Low
                                                                                        Slide 70: Showing that f is one-to-one or onto
                                                                                        Exam weight Low
                                                                                          Slide 71: Recall
                                                                                          Exam weight Low
                                                                                            Slide 72: Function types
                                                                                            Exam weight Low
                                                                                              Slide 73: Inverse Functions
                                                                                              Exam weight High
                                                                                              1. Inverse f⁻¹(b) = a when f(a) = b; exists only for bijections.
                                                                                              🎯 How this can come up · 1 question
                                                                                              Written

                                                                                              Find the inverse of f: ℝ → ℝ, f(x) = 3x − 2.

                                                                                              Slide 74: Inverse Functions
                                                                                              Exam weight Low

                                                                                                Questions

                                                                                                Example: Let f be the function from { a,b,c } to {1,2,3} such that

                                                                                                f (a) = 2, f (b) = 3, and f (c) = 1.

                                                                                                Is f invertible and if so what is its inverse?

                                                                                                Solution

                                                                                                :

                                                                                                The function f is invertible because it is a one-to-one correspondence. The inverse function reverses the correspondence given by f, so f

                                                                                                -1 (1) = c, f (2) = a, and f (3) = b.

                                                                                                -1

                                                                                                -1

                                                                                                75
                                                                                                Exam weight Low

                                                                                                  Questions

                                                                                                  Example Let f: Z Z be such that f(x) = x + . Is f invertible, and if so,

                                                                                                  2:

                                                                                                  what is its inverse?

                                                                                                  Solution: The function f is invertible because it is a one-to-one correspondence. The inverse function f -1 reverses the correspondence so f - 1 (y) = y – 1.

                                                                                                  76
                                                                                                  Exam weight Low

                                                                                                    Questions

                                                                                                    Example Let f: R R be such that

                                                                                                    3:

                                                                                                    . Is f invertible,

                                                                                                    and if so, what is its inverse?

                                                                                                    →

                                                                                                    Solution:

                                                                                                    The function f is not invertible because it is not one-to-one.

                                                                                                    77
                                                                                                    Exam weight Low

                                                                                                      Composition

                                                                                                      78
                                                                                                      Exam weight Low
                                                                                                        Slide 79: Composition
                                                                                                        Exam weight High
                                                                                                        1. (f ∘ g)(x) = f(g(x)): apply g FIRST.
                                                                                                        Exam trapf ∘ g ≠ g ∘ f in general.
                                                                                                        🎯 How this can come up · 1 question
                                                                                                        MCQ

                                                                                                        f(x) = 2x + 3, g(x) = 3x + 2. (f ∘ g)(x) =

                                                                                                        Slide 80: Composition
                                                                                                        Exam weight Low

                                                                                                          Composition

                                                                                                          Example 1 and

                                                                                                          Composition
                                                                                                          81
                                                                                                          Exam weight Low
                                                                                                            Slide 82: Composition Questions
                                                                                                            Exam weight Low
                                                                                                              Slide 83: Composition Questions
                                                                                                              Exam weight Low
                                                                                                                Slide 84: Slide 84
                                                                                                                Exam weight Low
                                                                                                                  Slide 85: Graphs of Functions
                                                                                                                  Exam weight Low

                                                                                                                    Floor and Ceiling Functions

                                                                                                                    86
                                                                                                                    Exam weight Low

                                                                                                                      Some Important Functions

                                                                                                                      • The floor function, denoted is the largest integer less than or equal to x.
                                                                                                                      • The ceiling function, denoted is the smallest integer greater than or equal to x
                                                                                                                      Some Important Functions
                                                                                                                      87
                                                                                                                      Exam weight Low

                                                                                                                        Some Important Functions

                                                                                                                        Example:

                                                                                                                        Some Important Functions
                                                                                                                        88
                                                                                                                        Exam weight Low
                                                                                                                          Slide 89: Floor and Ceiling Functions
                                                                                                                          Exam weight High
                                                                                                                          1. ⌊x⌋ largest integer ≤ x; ⌈x⌉ smallest integer ≥ x. ⌊−1.5⌋ = −2, ⌈−1.5⌉ = −1.
                                                                                                                          🎯 How this can come up · 1 question
                                                                                                                          MCQ

                                                                                                                          ⌊−2.3⌋ + ⌈2.3⌉ equals:

                                                                                                                          Factorial Function

                                                                                                                          Definition: f: N Z

                                                                                                                          + , denoted by f (n) = n ! is the product of the first n

                                                                                                                          positive integers when n is a nonnegative integer.

                                                                                                                          →

                                                                                                                          f (n) = 1

                                                                                                                          n

                                                                                                                          n, f (0) = 0! = 1

                                                                                                                          Examples: – 1) ∙

                                                                                                                          ∙ 2 ∙∙∙ (

                                                                                                                          Stirling’s

                                                                                                                          Formula:

                                                                                                                          f (1) = 1! = 1 f (2) = 2! = 1

                                                                                                                          f (6) = 6! = 1

                                                                                                                          ∙ 2 = 2

                                                                                                                          f (20) = 2,432,902,008,176,640,000.

                                                                                                                          ∙ 2 ∙ 3∙ 4∙ 5 ∙ 6 = 720

                                                                                                                          Factorial Function
                                                                                                                          90
                                                                                                                          Exam weight Low
                                                                                                                          1. n! = 1·2·…·n, 0! = 1.

                                                                                                                          Sequences and Summations S E C T I O N 2. 4

                                                                                                                          91
                                                                                                                          Exam weight Low

                                                                                                                            Section Summary

                                                                                                                            • Sequences.
                                                                                                                              • Examples: Geometric Progression, Arithmetic Progression
                                                                                                                            • Recurrence Relations
                                                                                                                              • Example: Fibonacci Sequence
                                                                                                                            • Summations
                                                                                                                            • Special Integer Sequences (optional)
                                                                                                                            92
                                                                                                                            Exam weight Low

                                                                                                                              Introduction

                                                                                                                              • Sequences are ordered lists of elements.
                                                                                                                                • 1, 2, 3, 5, 8
                                                                                                                                • 1, 3, 9, 27, 81, .......
                                                                                                                              • Sequences arise throughout mathematics, computer science, and in many other disciplines, ranging from botany to music.
                                                                                                                              • We will introduce the terminology to represent sequences and sums of the terms in the sequences.
                                                                                                                              93
                                                                                                                              Exam weight Low
                                                                                                                                Slide 94: Sequences
                                                                                                                                Exam weight Low

                                                                                                                                  Sequences

                                                                                                                                  Example: Consider the sequence where

                                                                                                                                  Sequences
                                                                                                                                  95
                                                                                                                                  Exam weight Low
                                                                                                                                    Slide 96: Geometric Progression
                                                                                                                                    Exam weight Low
                                                                                                                                    1. Geometric progression: a, ar, ar², … ; arithmetic: a, a + d, a + 2d, …

                                                                                                                                    Arithmetic Progression

                                                                                                                                    Definition: A arithmetic progression is a sequence of the form:

                                                                                                                                    where the initial term a and the common difference d are real

                                                                                                                                    numbers.

                                                                                                                                    Examples:

                                                                                                                                    1. Let a = and d = : 1 4
                                                                                                                                    2. Let a = and d = : 7 3
                                                                                                                                    3. Let a = 1 and d = 2:
                                                                                                                                    Arithmetic Progression
                                                                                                                                    97
                                                                                                                                    Exam weight Low

                                                                                                                                      Special Integer Sequences ( opt )

                                                                                                                                      • Given a few terms of a sequence, try to identify the sequence. Conjecture a formula, recurrence relation, or some other rule.
                                                                                                                                      • Some questions to ask?
                                                                                                                                        • Are there repeated terms of the same value?
                                                                                                                                        • Can you obtain a term from the previous term by adding an amount or multiplying by an amount?
                                                                                                                                        • Can you obtain a term by combining the previous terms in some way?
                                                                                                                                        • Are they cycles among the terms?
                                                                                                                                        • Do the terms match those of a well known sequence?
                                                                                                                                      98
                                                                                                                                      Exam weight Low
                                                                                                                                        Slide 99: Questions on Special Integer Sequences ( opt )
                                                                                                                                        Exam weight Low
                                                                                                                                          Slide 100: Useful Sequences
                                                                                                                                          Exam weight Low
                                                                                                                                            Slide 101: Guessing Sequences ( optional )
                                                                                                                                            Exam weight Low
                                                                                                                                              Slide 102: Integer Sequences ( optional )
                                                                                                                                              Exam weight Low

                                                                                                                                                Integer Sequences ( optional )

                                                                                                                                                • Here are three interesting sequences to try from the OESIS site. To solve each puzzle, find a rule that determines the terms of the sequence.
                                                                                                                                                • Guess the rules for forming for the following sequences:
                                                                                                                                                  • 2, 3, 3, 5, 10, 13, 39, 43, 172, 177, ...
                                                                                                                                                    • Hint: Think of adding and multiplying by numbers to generate this sequence.
                                                                                                                                                  • 0, 0, 0, 0, 4, 9, 5, 1, 1, 0, 55, ...
                                                                                                                                                    • Hint: Think of the English names for the numbers representing the position in the sequence and the Roman Numerals for the same number.
                                                                                                                                                  • 2, 4, 6, 30, 32, 34, 36, 40, 42, 44, 46, ...
                                                                                                                                                    • Hint: Think of the English names for numbers, and whether or not they have the letter ‘e.’
                                                                                                                                                • The answers and many more can be found at http://oeis.org/Spuzzle.html
                                                                                                                                                103
                                                                                                                                                Exam weight Low

                                                                                                                                                  Summations

                                                                                                                                                  104
                                                                                                                                                  Exam weight Low

                                                                                                                                                    Summations

                                                                                                                                                    • Sum of the terms from the sequence
                                                                                                                                                    • The notation: represents
                                                                                                                                                    • The variable j is called the index of summation. It runs through all the integers starting with its lower limit m and ending with its upper limit n.
                                                                                                                                                    Summations
                                                                                                                                                    105
                                                                                                                                                    Exam weight Low
                                                                                                                                                      Slide 106: Example
                                                                                                                                                      Exam weight Low
                                                                                                                                                        Slide 107: Example
                                                                                                                                                        Exam weight Low
                                                                                                                                                          Slide 108: Summations
                                                                                                                                                          Exam weight Low

                                                                                                                                                            Product Notation ( optional )

                                                                                                                                                            • Product of the terms from the sequence
                                                                                                                                                            • The notation: represents
                                                                                                                                                            Product Notation ( optional )
                                                                                                                                                            109
                                                                                                                                                            Exam weight Low
                                                                                                                                                              Slide 110: Some Useful Summation Formulae
                                                                                                                                                              Exam weight High
                                                                                                                                                              1. Key sums: Σk = n(n+1)/2, Σk² = n(n+1)(2n+1)/6, Σarᵏ (k = 0…n) = (arⁿ⁺¹ − a)/(r − 1) for r ≠ 1.
                                                                                                                                                              🎯 How this can come up · 1 question
                                                                                                                                                              MCQ

                                                                                                                                                              Σ_{k=1}^{100} k =

                                                                                                                                                              111
                                                                                                                                                              Exam weight Low
                                                                                                                                                                Slide 112: Slide 112
                                                                                                                                                                Exam weight Low
                                                                                                                                                                  Slide 113: Example
                                                                                                                                                                  Exam weight Low

                                                                                                                                                                    from Table 2, slide 113

                                                                                                                                                                    114
                                                                                                                                                                    Exam weight Low

                                                                                                                                                                      115
                                                                                                                                                                      Exam weight Low
                                                                                                                                                                        Slide 116: Example
                                                                                                                                                                        Exam weight Low
                                                                                                                                                                          Slide 117: Example
                                                                                                                                                                          Exam weight Low

                                                                                                                                                                            Recurrence Relations

                                                                                                                                                                            118
                                                                                                                                                                            Exam weight Low

                                                                                                                                                                              Recurrence Relations

                                                                                                                                                                              Definition: A recurrence relation for the sequence { a } is an equation

                                                                                                                                                                              n

                                                                                                                                                                              that expresses a in terms of one or more of the previous terms of the

                                                                                                                                                                              n

                                                                                                                                                                              sequence, namely, a, a, ..., a

                                                                                                                                                                              , for all integers n with n ≥ n

                                                                                                                                                                              , where n

                                                                                                                                                                              0 1

                                                                                                                                                                              n-1

                                                                                                                                                                              is a nonnegative integer.

                                                                                                                                                                              • A sequence is called a solution of a recurrence relation if its terms satisfy the recurrence relation.
                                                                                                                                                                              • The initial conditions for a sequence specify the terms that precede the first term where the recurrence relation takes effect.
                                                                                                                                                                              119
                                                                                                                                                                              Exam weight High
                                                                                                                                                                              1. A recurrence defines aₙ from earlier terms plus initial conditions.
                                                                                                                                                                              🎯 How this can come up · 1 question
                                                                                                                                                                              MCQ

                                                                                                                                                                              aₙ = aₙ₋₁ + 3, a₀ = 2. a₃ =

                                                                                                                                                                              Questions about Recurrence Relations

                                                                                                                                                                              Example: Let { a } be a sequence that satisfies the recurrence relation

                                                                                                                                                                              n

                                                                                                                                                                              a = a + 3 for n = 1,2,3,4, .... and suppose that

                                                                                                                                                                              a = 2. What are a, a

                                                                                                                                                                              n n-1

                                                                                                                                                                              1 2

                                                                                                                                                                              and a ?

                                                                                                                                                                              [Here a = is the initial condition. ]

                                                                                                                                                                              Solution: We see from the recurrence relation that

                                                                                                                                                                              a a + 3 = 2 + 3 = 5

                                                                                                                                                                              =

                                                                                                                                                                              a = 5 + 3 = 8

                                                                                                                                                                              a = 8 + 3 = 11

                                                                                                                                                                              120
                                                                                                                                                                              Exam weight Low
                                                                                                                                                                                Slide 121: Questions about Recurrence Relations
                                                                                                                                                                                Exam weight Low
                                                                                                                                                                                  Slide 122: Fibonacci Sequence
                                                                                                                                                                                  Exam weight Low
                                                                                                                                                                                  1. Fibonacci: f₀ = 0, f₁ = 1, fₙ = fₙ₋₁ + fₙ₋₂.

                                                                                                                                                                                  Solving Recurrence Relations

                                                                                                                                                                                  • Finding a formula for the n th term of the sequence generated by a recurrence relation is called solving the recurrence relation.
                                                                                                                                                                                  • Such a formula is called a closed formula.
                                                                                                                                                                                  • Various methods for solving recurrence relations will be covered in Chapter 8 where recurrence relations will be studied in greater depth.
                                                                                                                                                                                  • Here we illustrate by example the method of iteration in which we need to guess the formula. The guess can be proved correct by the method of induction (Chapter 5).
                                                                                                                                                                                  123
                                                                                                                                                                                  Exam weight Low
                                                                                                                                                                                    Slide 124: Iterative Solution Example
                                                                                                                                                                                    Exam weight Low
                                                                                                                                                                                    1. Iteration (forward/backward substitution): expand until a pattern appears, then close the formula.
                                                                                                                                                                                    Slide 125: Iterative Solution Example
                                                                                                                                                                                    Exam weight Low
                                                                                                                                                                                      Slide 126: Financial Application
                                                                                                                                                                                      Exam weight Low
                                                                                                                                                                                      1. Compound interest: Pₙ = 1.11·Pₙ₋₁ → Pₙ = (1.11)ⁿ·P₀.
                                                                                                                                                                                      Slide 127: Financial Application
                                                                                                                                                                                      Exam weight Low

                                                                                                                                                                                        2.6. Matrices

                                                                                                                                                                                        128
                                                                                                                                                                                        Exam weight Low
                                                                                                                                                                                          Slide 129: 2.6. Matrices
                                                                                                                                                                                          Exam weight Low
                                                                                                                                                                                            Slide 130: Matrix Equality
                                                                                                                                                                                            Exam weight Low
                                                                                                                                                                                              Slide 131: Row and Column Order
                                                                                                                                                                                              Exam weight Low
                                                                                                                                                                                                Slide 132: Matrix Sums
                                                                                                                                                                                                Exam weight Low
                                                                                                                                                                                                  Slide 133: Matrix Products
                                                                                                                                                                                                  Exam weight High
                                                                                                                                                                                                  1. A (m×k) times B (k×n) gives an m×n matrix; cᵢⱼ = row i of A · column j of B. Inner sizes must match.
                                                                                                                                                                                                  Exam trapAB ≠ BA in general, and BA may not even be defined.
                                                                                                                                                                                                  🎯 How this can come up · 1 question
                                                                                                                                                                                                  MCQ

                                                                                                                                                                                                  A is 2×3 and B is 3×4. AB is:

                                                                                                                                                                                                  Slide 134: Matrix Product Example
                                                                                                                                                                                                  Exam weight Low
                                                                                                                                                                                                    Slide 135: Matrix Product Example
                                                                                                                                                                                                    Exam weight Low
                                                                                                                                                                                                      Slide 136: Matrix Product Example
                                                                                                                                                                                                      Exam weight Low
                                                                                                                                                                                                        Slide 137: Identity Matrices
                                                                                                                                                                                                        Exam weight Low
                                                                                                                                                                                                          Slide 138: Powers of Matrices
                                                                                                                                                                                                          Exam weight Low
                                                                                                                                                                                                            Slide 139: Matrix Transposition
                                                                                                                                                                                                            Exam weight Low
                                                                                                                                                                                                            1. Transpose Aᵗ swaps rows and columns; symmetric when A = Aᵗ.
                                                                                                                                                                                                            Slide 140: Symmetric Matrices
                                                                                                                                                                                                            Exam weight Low
                                                                                                                                                                                                              Slide 141: Zero-One Matrices
                                                                                                                                                                                                              Exam weight Low
                                                                                                                                                                                                              1. Zero-one matrices: join A ∨ B (entrywise OR), meet A ∧ B (entrywise AND).
                                                                                                                                                                                                              Slide 142: Example
                                                                                                                                                                                                              Exam weight Low
                                                                                                                                                                                                                Slide 143: Boolean Products
                                                                                                                                                                                                                Exam weight High
                                                                                                                                                                                                                1. Boolean product A ⊙ B: like a matrix product with ∧ for × and ∨ for +.
                                                                                                                                                                                                                Slide 144: Boolean Powers
                                                                                                                                                                                                                Exam weight Low
                                                                                                                                                                                                                  Slide 145: Example
                                                                                                                                                                                                                  Exam weight Low