Sets, Sequences, and Summations

Slides:



Advertisements
Similar presentations
Copyright © Cengage Learning. All rights reserved.
Advertisements

Sets Lecture 11: Oct 24 AB C. This Lecture We will first introduce some basic set theory before we do counting. Basic Definitions Operations on Sets Set.
Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Instructor: Hayk Melikya
(CSC 102) Discrete Structures Lecture 14.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Mathematics Lecture 4 Harper Langston New York University.
CSE115/ENGR160 Discrete Mathematics 02/22/11 Ming-Hsuan Yang UC Merced 1.
CSE115/ENGR160 Discrete Mathematics 02/21/12
Discrete Mathematics Lecture 5
Sets 1.
Sets 1.
1 Section 3.2 Sequences and Summations. 2 Sequence Function from a subset of Z (usually the set beginning with 1 or 0) to a set S a n denotes the image.
1 Set Theory. Notation S={a, b, c} refers to the set whose elements are a, b and c. a  S means “a is an element of set S”. d  S means “d is not an element.
Lecture , 3.1 Methods of Proof. Last time in 1.5 To prove theorems we use rules of inference such as: p, p  q, therefore, q NOT q, p  q, therefore.
SETS A set B is a collection of objects such that for every object X in the universe the statement: “X is a member of B” Is a proposition.
Set Theory A B C.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
CS355 - Theory of Computation Lecture 2: Mathematical Preliminaries.
Sequences & Summations CS 1050 Rosen 3.2. Sequence A sequence is a discrete structure used to represent an ordered list. A sequence is a function from.
Induction and recursion
Sequences and Summations
2.4 Sequences and Summations
Section 2.4. Section Summary Sequences. Examples: Geometric Progression, Arithmetic Progression Recurrence Relations Example: Fibonacci Sequence Summations.
ICS 253: Discrete Structures I
Set, Combinatorics, Probability & Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Set,
Sequences and Summations
Section 2.4. Section Summary Sequences. Examples: Geometric Progression, Arithmetic Progression Recurrence Relations Example: Fibonacci Sequence Summations.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
1 ENM 503 Block 1 Algebraic Systems Lesson 2 – The Algebra of Sets The Essence of Sets What are they?
Sequences and Summations Section 2.4. Section Summary Sequences. – Examples: Geometric Progression, Arithmetic Progression Recurrence Relations – Example:
Functions Section 2.3. Section Summary Definition of a Function. – Domain, Cdomain – Image, Preimage Injection, Surjection, Bijection Inverse Function.
CS201: Data Structures and Discrete Mathematics I
CompSci 102 Discrete Math for Computer Science
Week 6 - Friday.  What did we talk about last time?  Solving recurrence relations.
Sets 2/10/121. What is a Set? Informally, a collection of objects, determined by its members, treated as a single mathematical object Not a real definition:
Chapter 2 With Question/Answer Animations. Section 2.1.
Rosen 1.6, 1.7. Basic Definitions Set - Collection of objects, usually denoted by capital letter Member, element - Object in a set, usually denoted by.
Basic Structures: Sets, Functions, Sequences, and Sums.
(CSC 102) Lecture 13 Discrete Structures. Previous Lectures Summary  Direct Proof  Indirect Proof  Proof by Contradiction  Proof by Contra positive.
Chapter 2 With Question/Answer Animations. Section 2.1.
Set Operations Section 2.2.
1 Set Theory Second Part. 2 Disjoint Set let A and B be a set. the two sets are called disjoint if their intersection is an empty set. Intersection of.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 11 Basic Structure : Sets, Functions, Sequences, and Sums Sequences and Summations.
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
Chapter 2 1. Chapter Summary Sets The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions and sequences.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
Sequences Lecture 11. L62 Sequences Sequences are a way of ordering lists of objects. Java arrays are a type of sequence of finite size. Usually, mathematical.
Fifteen Puzzle Move: can move a square adjacent to the empty square to the empty square.
Russell’s Paradox Is W in W? In words, W is the set that contains all the sets that don’t contain themselves. If W is in W, then W contains itself. But.
Set. Outline Universal Set Venn Diagram Operations on Sets.
ICS 253: Discrete Structures I
CSE15 Discrete Mathematics 03/01/17
Discrete Mathematics Lecture 3 (and 4)
Set Operations CS 202, Spring 2008 Epp, chapter 5.
Set Theory.
Set, Combinatorics, Probability & Number Theory
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
Mathematical Induction Recursion
Discrete Math (2) Haiming Chen Associate Professor, PhD
VCU, Department of Computer Science CMSC 302 Sequences and Summations Vojislav Kecman 9/19/2018.
Exercises Show that (P  Q)  (P)  (Q)
CS100: Discrete structures
Lecture 7 Functions.
Set Theory A B C.
CSE15 Discrete Mathematics 02/27/17
CS100: Discrete structures
ICS 253: Discrete Structures I
Math/CSE 1019N: Discrete Mathematics for Computer Science Winter 2007
Presentation transcript:

Sets, Sequences, and Summations Rosen 2.1, 2.2, 2.4 A B C Lecture 6: Oct 10

Sets real numbers, ℝ complex numbers, ℂ integers, ℤ natural numbers ℕ A set is a collection of mathematical objects, with the collection treated as a single mathematical object. Examples: real numbers, ℝ complex numbers, ℂ integers, ℤ natural numbers ℕ rational numbers ℚ empty set, 

Defining Sets Sets can be defined directly: e.g. {1,2,4,8,16,32,…}, {CSC1209,MTH3105,…} Order, number of occurence are not important. e.g. {A,B,C} = {C,B,A} = {A,A,B,C,B} A set can be an element of another set. {1, {2}, {3,{4}} }

Defining Sets by Predicates The set of elements, x, in A such that P(x) is true. The set of prime numbers:

Membership {7, “Albert”, /2, T} x is an element of A x is in A Examples: /2 ∈ {7, “Albert”,/2, T} /3 ∉ {7, “Albert”,/2, T} 14/2  {7, “Albert”,/2, T} 7  2/3  

Containment A is a subset of B A is contained in B Every element of A is also an element of B. A B A is a proper subset of B

Examples R, {3} {5,7,3}   every set, A  A prime odd {3} {5,7,3}   every set, A  A prime odd {a, {b}, c} {a, b, c} {{b}} ≠ {b}

Basic Operations on Sets union: intersection: difference: complement:

Examples A = {1, 3, 6, 8, 10} B = {2, 4, 6, 7, 10} A B = {6, 10}, A B = {1, 2, 3, 4, 6, 7, 8, 10} A-B = {1, 3, 8} A ⊕ B = ??? prime even = {2}, even odd = Ø A = { x | x = 2k for some integer k}, B = { x | x = 3k for some integer k} A B = { x | x = 6k for some integer k} A B = { x | x is either a multiple of 2 or a multiple of 3 (or both) } A – B = { x | x is even but not a multiple of 3 } Let D be the set of integers, then A = odd

Partitions of Sets Two sets are disjoint if their intersection is empty. A collection of nonempty sets {A1, A2, …, An} is a partition of a set A if and only if A1, A2, …, An are mutually disjoint. Example. Let A be the set of integers. A1 be the set of integers  1 (mod 3) A2 be the set of integers  2 (mod 3) A3 be the set of integers  0 (mod 3) {A1, A2, A3} is a partition of A

Power Sets power set: pow({a,b}) = {Ø, {a}, {b}, {a,b}} pow({a,b,c}) = {Ø, {a}, {b}, {c}, {a,b}, {a,c}, {b,c}, {a,b,c}} pow({a,b,c,d}) = {Ø, {a}, {b}, {c}, {d}, {a,b}, {a,c}, {b,c}, {a,d}, {b,d}, {c,d}, {a,b,c}, {a,b,d}, {a,c,d}, {b,c,d}, {a,b,c,d}} If A has n elements, then the pow(A) has 2n elements.

Set Identities (1) Distributive Law: (2) A B A B C C (1) (2)

Set Identities A B C Distributive Law: If you insist on proving this law more formally… S2 S1 S3 A B S4 S5 S6 S7 C There are even more formal proofs in the textbook…

Set Identities De Morgan’s Law:

Set Identities De Morgan’s Law:

Exercises

Sequences - 2.4 Ordered list of elements e.g., 1, 2, 3, 5, 8 is a sequence with 5 elements 1, 3, 9, 27, 81, …, 30, …, is an infinite sequence Sequence {an}: a function from a subset of the set of integers (usually either the set of {0, 1, 2, …} or the set {1, 2, 3, …}) to a set S Use an to denote the image of the integer n Call an a term of the sequence

Sequences Example: {an} where an=1/n a1, a2, a3, a4, … 1, ½, 1/3, ¼,… When the elements of an infinite set can be listed, the set is called countable We showed that the set of positive rational numbers is countable, but the set of real numbers is not

Geometric progression Geometric progression: a sequence of the form a, ar, ar2, ar3,…, arn where the initial term a and common ratio r are real numbers Can be written as f(x)=a ∙ rx The sequences {bn} with bn=(-1)n, {cn} with cn=2∙5n, {dn} with dn=6 ∙(1/3)n are geometric progression bn : 1, -1, 1, -1, 1, … cn: 2, 10, 50, 250, 1250, … dn: 6, 2, 2/3, 2/9, 2/27, …

Arithmetic progression Arithmetic progression: a sequence of the form a, a+d, a+2d, …, a+nd where the initial term a and the common difference d are real numbers Can be written as f(x)=a+dx {sn} with sn=-1+4n, {tn} with tn=7-3n {sn}: -1, 3, 7, 11, … {tn}: 7, 4, 1, -2, …

Recurrence relations Express an in terms of one or more of the previous terms of the sequence Example: an=an-1+3 for n=1,2,3,… and a1=2 a2=a1+3=2+3=5, a3=a2+3=(2+3)+3=2+3x2=8, a4=a3+3=(2+3+3)+3=2+3+3+3=2+3x3=11 an=2+3(n-1) an=an-1+3=(an-2+3)+3=an-2+3x2 =(an-3+3)+3x2=an-3+3x3 =a2+3(n-2)=(a1+3)+3(n-2)=2+3(n-1)

Fibonacci sequence f0=0, f1=1, fn=fn-1+fn-2, for n=2, 3, 4 f2=f1+f0=1+0=1 f3=f2+f1=1+1=2 f4=f3+f2=2+1=3 f5=f4+f3=3+2=5 f6=f5+f4=5+3=8 …

Special integer sequences Finding some patterns among the terms Are terms obtained from previous terms by adding the same amount or an amount depends on the position in the sequence? by multiplying a particular amount? By combining previous terms in a certain way? In some cycle? Examples Find formulate for the sequences with the following 5 terms 1, ½, ¼, 1/8, 1/16 1, 3, 5, 7, 9 1, -1, 1, -1, 1 The first 10 terms: 1, 2, 2, 3, 3, 3, 4, 4, 4, 4 The first 10 terms: 5, 11, 17, 23, 29, 35, 41, 47, 53, 59

More Examples Conjecture a simple formula for {an} where the first 10 terms are: 1, 7, 25, 79, 241, 727, 2185, 6559, 19681, 59047 © Rosen 2.4 Table 1

Summations The sum of terms: am, am+1, …, an from {an} that represents Here j is the index of summation (can be replaced arbitrarily by i or k) The index runs from the lower limit m to upper limit n The usual laws for arithmetic applies

Examples Express the sum of the first 100 terms of the sequence {an} where an=1/n, n=1, 2, 3, … What is the value of Shift index:

Geometric series Geometric series: sums of geometric progressions

Double summations Often used in programs Can also write summation to add values of a function of a set

© Rosen 2.4 Table 2

Examples Find Let x be a real number with |x|<1, Find Differentiating both sides of

Russell’s Paradox so Is W in W? Let us call a set "abnormal" if it is a member of itself, and "normal" otherwise For example, take the set of all squares. That set is not itself a square, and therefore is not a member of the set of all squares. So it is "normal" On the other hand, if we take the complementary set that contains all non-squares, that set is itself not a square and so should be one of its own members. It is "abnormal"

Halting Problem Now we study one of the most famous problems in computer science. The halting problem: Can we write a program which detects infinite loop? We want a program H that given any program P and input I: H(P,I) returns “halt” if P will terminate given input I; H(P,I) returns “loop forever” if P will not terminate given input I. The halting problem: Does such a program H exist? Note that the program H can not just simulate the program P on input I; if P halts on I, then H can return halt successfully; but if P loops forever on I, then H will also loop forever.

Halting Problem We want a program H that given any program P and input I: H(P,I) returns “halt” if P will terminate given input I; H(P,I) returns “loop forever” if P will not terminate given input I. The halting problem: Does such a program H exist? Prove by contradiction: Suppose, by way of contradiction, that H exists. Both P and I are binary strings. H should be able to determine if P will terminate given itself as the input. That is, H(P,P) will either returns “halt” or “loop forever”.

Barber’s Paradox There is a male barber who shaves all those men, and only those men, who do not shave themselves. Does the barber shave himself? If the barber does not shave himself, he must abide by the rule and shave himself If he does shave himself, according to the rule he will not shave himself