Sequence A list of objects arranged in a

Sequence • A list of objects arranged in a particular order. • Order is very important in a sequence. (Unlike Sets). • Finite sequence=> No. of elements is finite. Example: 1, 4, 7, 10, 13. Mathematically, a n = a n-1 + 3, where a 1 = 1 and 1≤n<6 • Infinite=> No. of elements is not finite. Example: 1, 4, 7, 10, 13, … Three dots means “and so on”. Mathematically, a n = a n-1 + 3, where a 1 = 1 and 1≤n<∞

Sequence • Recursive: If we need previous element to get the next element in a sequence, then the formula is called recursive. • Example: 1, 4, 7, 10, 13, … Three dots means “and so on”. Mathematically, a n = a n-1 + 3, where a 1 = 1 and 1≤n<∞ • Explicit: Without using the previous element we will be able to get the exact value of each element in a sequence. This type of formula is called explicit. Example: 1, 4, 9, 16, 25, … Three dots means “and so on”. Mathematically, b n = n 2, where 1≤n<∞

Sequence • What is the explicit formula for the following sequence? -2, 4, -8, 16, -32, … ü Explicit formula: b n = (-2) n, where 1≤n<∞ • What is the recursive formula for the following sequence? 1, 4, 7, 10, 13, … ü Recursive formula: b n = b n-1 + 3, where b 1 = 1 and 1≤n<∞

Set and Sequence • The set corresponding to a sequence is simply the set of all distinct elements in the sequence. ü Example 1: Sequence: -2, 4, -8, 16, -32, … The set corresponding to the above sequence: {-2, 4, -8, 16, -32, …} ü Example 2: Sequence: 1, 0, 0, 1, 1, 0, 0, 1 The set corresponding to the above sequence: {0, 1}

Characteristic Functions • If A is a subset of a universal set U, the characteristic function f A of A is defined for each x Є U as follows: f A (x) = 1 if x Є A = 0 if x A • Use: ü Help us prove theorems about properties of subsets ü To represent sets in a computer.

Properties of Characteristic Functions • f A∩B = f A f B => f A∩B (x) = f A(x) f B(x) for all x • f AUB = f A + f B - f A f B => f AUB(x) = f A(x) + f B(x) - f A(x) f B(x) for all • f A B = f A + f B - 2 f A f B => f A B(x) = f A(x) + f B(x) - 2 f A(x) f B(x) for all x

Proof of the properties of characteristic functions f A∩B = f A f B => f A∩B (x) = f A(x) f B(x) for all x RHS= f A(x) f B(x) = 1 if and only if f A(x) = 1 and f B(x) =1 = 1 if and only if x Є A and x Є B = 1 if and only if x Є A∩B = f A∩B (x) (since f A f B is 1 on A∩B and 0 otherwise) = LHS

Computer representation of sets and subsets • If a universal set U is finite and A is a subset of U, then the characteristic function assigns 1 to an element that belongs to A and 0 to an element that does not belong to A. • Thus f. A can be represented by a sequence of 0’s and 1’s of length n. • Example: U = {1, 2, 3, 4, 5, 6} A = {1, 2}, B = {2, 4, 6}, and C = {4, 5, 6} ü f. A corresponds to the sequence 1, 1, 0, 0. ü f. B corresponds to the sequence 0, 1, 0, 1. ü f. C corresponds to the sequence 0, 0, 0, 1, 1, 1.

Computer representation of sets and subsets • Example: U = {a, b, c, d, e, f, g, h} A = {a, b, c, d} f. A(x) = 1 if x = a, b, c, d = 0 if x = e, f, g, h 1 1 1 1 U 1 1 0 0 A

Countable and uncountable sets • Countable set => A set is called countable if it corresponds to some sequence. Members of such a set can be arranged in a list. Members can be counted. ü Example: All finite sets are countable. • Uncountable set => A set that is not countable is called uncountable. ü Example: Set of all real numbers that can be represented by an infinite decimal of the form 0. a 1 a 2 a 3…where ai is an integer and 0≤ai ≤ 9

1. 3 Exercises • Give three different sequences that have {1, 2, 3, …} as a corresponding set. • Possible answers: ü 1, 2, 3, 4, … ü 1, 1, 2, 2, 3, 3, 4, 4, … ü 1, 2, 2, 2, 3, 2, 4, 2, 5, 2

1. 3 Exercises Write the formula for the nth term. • 0, 3, 8, 15, 24, 35 ü b n = n 2 - 1, where 1≤n ≤ 6 => Explicit • 0, 2, … ü b n = 0, if n is odd = 2, if n is even => Explicit • 2, 5, 7, 12, 19, 31, … ü b n = b n-1 + b n-2 , b 1 = 2, b 2 = 5 => Recursive
- Slides: 12