ICS141: Discrete Mathematics for Computer Science I

Similar documents
2.1 Sets. Definition 1 A set is an unordered collection of objects. Important sets: N, Z, Z +, Q, R.

Functions. Given a function f: A B:

Introduction to Decision Sciences Lecture 6

ICS141: Discrete Mathematics for Computer Science I

ICS141: Discrete Mathematics for Computer Science I

9/21/2018. Properties of Functions. Properties of Functions. Properties of Functions. Properties of Functions. Properties of Functions

ICS141: Discrete Mathematics for Computer Science I

Introduction to Series and Sequences Math 121 Calculus II Spring 2015

Discrete Structures for Computer Science

Chapter 2 - Basics Structures MATH 213. Chapter 2: Basic Structures. Dr. Eric Bancroft. Fall Dr. Eric Bancroft MATH 213 Fall / 60

Chapter Summary. Sets The Language of Sets Set Operations Set Identities Functions Types of Functions Operations on Functions Computability

Section Summary. Definition of a Function.

Section 4.4 Functions. CS 130 Discrete Structures

ICS141: Discrete Mathematics for Computer Science I

CSCE 222 Discrete Structures for Computing. Dr. Hyunyoung Lee

Ch 9/10/11/12 Exam Review

EECS 1028 M: Discrete Mathematics for Engineers

Sequences are ordered lists of elements

Functions. Definition 1 Let A and B be sets. A relation between A and B is any subset of A B.

Func%ons. function f to the element a of A. Functions are sometimes called mappings or transformations.

ICS141: Discrete Mathematics for Computer Science I

CS100: DISCRETE STRUCTURES

Examples of Finite Sequences (finite terms) Examples of Infinite Sequences (infinite terms)

MAT115A-21 COMPLETE LECTURE NOTES

Section Summary. Definition of a Function.

Countable and uncountable sets. Matrices.

Countable and uncountable sets. Matrices.

Propositional Logic, Predicates, and Equivalence

Chapter 2 - Basics Structures

When combining power functions into a single polynomial function, there are a few new features we like to look for, such as

1 + lim. n n+1. f(x) = x + 1, x 1. and we check that f is increasing, instead. Using the quotient rule, we easily find that. 1 (x + 1) 1 x (x + 1) 2 =

Chapter Summary. Sets (2.1) Set Operations (2.2) Functions (2.3) Sequences and Summations (2.4) Cardinality of Sets (2.5) Matrices (2.

Functions and Their Graphs

Sec$on Summary. Definition of a Function.

Notes. Functions. Introduction. Notes. Notes. Definition Function. Definition. Slides by Christopher M. Bourke Instructor: Berthe Y.

ALGEBRA I CCR MATH STANDARDS

Sequences and Summations. CS/APMA 202 Rosen section 3.2 Aaron Bloomfield

Fall 2014 CMSC250/250H Midterm II

Math 163: Lecture notes

Sequence. A list of numbers written in a definite order.

Infinite Series Summary

Catholic Central High School

A video College Algebra course & 6 Enrichment videos

Mathematics High School Functions

Replacing the a in the definition of the derivative of the function f at a with a variable x, gives the derivative function f (x).

Intermediate Math Circles March 11, 2009 Sequences and Series

Sequences and Series. College Algebra

1 The distributive law

Algebra 2 Standards. Essential Standards:

8.1 Sequences. Example: A sequence is a function f(n) whose domain is a subset of the integers. Notation: *Note: n = 0 vs. n = 1.

Quantum Mechanics for Scientists and Engineers. David Miller

Algebra 1 Standards Curriculum Map Bourbon County Schools. Days Unit/Topic Standards Activities Learning Targets ( I Can Statements) 1-19 Unit 1

, 500, 250, 125, , 2, 4, 7, 11, 16, , 3, 9, 27, , 3, 2, 7, , 2 2, 4, 4 2, 8

ICS141: Discrete Mathematics for Computer Science I

Name: Date: Practice Midterm Exam Sections 1.2, 1.3, , ,

Section 11.1 Sequences

Finite and infinite sets, and cardinality

Today s Topics. Methods of proof Relationships to logical equivalences. Important definitions Relationships to sets, relations Special functions

CHAPTER 8: EXPLORING R

College Algebra with Corequisite Support: Targeted Review

Comparison of Virginia s College and Career Ready Mathematics Performance Expectations with the Common Core State Standards for Mathematics

Infinite Series. MATH 211, Calculus II. J. Robert Buchanan. Spring Department of Mathematics

Math Fall 2014 Final Exam Solutions

One-to-one functions and onto functions

Math 0230 Calculus 2 Lectures

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

MATH 3300 Test 1. Name: Student Id:

Mathematics Review for Business PhD Students

ECARES Université Libre de Bruxelles MATH CAMP Basic Topology

Algebra I Number and Quantity The Real Number System (N-RN)

LESSON RELATIONS & FUNCTION THEORY

Alpha Sequences & Series MAΘ National Convention 2018

Final Exam Study Guide Mathematical Thinking, Fall 2003

Math 106: Review for Final Exam, Part II - SOLUTIONS. (x x 0 ) 2 = !

Week Some Warm-up Questions

Section Summary. Sequences. Recurrence Relations. Summations. Examples: Geometric Progression, Arithmetic Progression. Example: Fibonacci Sequence

Name: Date: Practice Midterm Exam Sections 1.2, 1.3, , ,

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

Section 4.1: Sequences and Series

Chapter Generating Functions

Algebra 2 Curriculum Guide Lunenburg County Public Schools June 2014

ICS141: Discrete Mathematics for Computer Science I

Keystone Exams: Algebra

ICS141: Discrete Mathematics for Computer Science I

Math Circle: Recursion and Induction

Mathematics. Number and Quantity The Real Number System

AQR Unit 4: Using Recursion in Models and Decision Making Sequence Notes. Name: Date: Sequences

Semester Review Packet

10.1 Sequences. Example: A sequence is a function f(n) whose domain is a subset of the integers. Notation: *Note: n = 0 vs. n = 1.

Algebra I, Common Core Correlation Document

Model Traditional Pathway: Model Algebra I Content Standards [AI]

ACCRS/QUALITY CORE CORRELATION DOCUMENT: ALGEBRA II

Midterm Exam. There are 6 problems. Your 5 best answers count. Please pay attention to the presentation of your work! Best 5

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 27

It is in Secondary Mathematics III Critical Area 1 Critical Area 2: Critical Area 3: Critical Area 4:

p-adic Continued Fractions

Mathathon Round 1 (2 points each)

CSE 20 DISCRETE MATH WINTER

1. Decide for each of the following expressions: Is it a function? If so, f is a function. (i) Domain: R. Codomain: R. Range: R. (iii) Yes surjective.

Algebra II Standards of Learning Curriculum Guide

Transcription:

ICS141: Discrete Mathematics for Computer Science I Dept. Information & Computer Sci., Jan Stelovsky based on slides by Dr. Baek and Dr. Still Originals by Dr. M. P. Frank and Dr. J.L. Gross Provided by McGraw-Hill ICS 141: Discrete Mathematics I Fall 2011 11-1

Lecture 11 Chapter 2. Basic Structures 2.3 Functions 2.4 Sequences and Summations ICS 141: Discrete Mathematics I Fall 2011 11-2

The Identity Function n For any domain A, the identity function I: A A (also written as I A, 1, 1 A ) is the unique function such that a A: I(a) = a. n Note that the identity function is always both one-to-one and onto (i.e., bijective). n For a bijection f : A B and its inverse function f -1 : B A, f 1 f = n Some identity functions you ve seen: n + 0, 1, T, F,, U. I A 11-3

Identity Function Illustrations n The identity function: y y = I(x) = x Domain and range x 11-4

Graphs of Functions n We can represent a function f : A B as a set of ordered pairs {(a, f(a)) a A}. The function s graph. n Note that a A, there is only 1 pair (a, b). n Later (ch.8): relations loosen this restriction. n For functions over numbers, we can represent an ordered pair (x, y) as a point on a plane. n A function is then drawn as a curve (set of points), with only one y for each x. 11-5

Graphs of Functions: Examples The graph of f(n) = 2n + 1 from Z to Z The graph of f(x) = x 2 from Z to Z 11-6

Floor & Ceiling Functions n In discrete math, we frequently use the following two functions over real numbers: n The floor function : R Z, where x ( floor of x ) means the largest integer x, i.e., x = max( {i Z i x} ). n E.g. 2.3 = 2, 5 = 5, 1.2 = 2 n The ceiling function : R Z, where x ( ceiling of x ) means the smallest integer x, i.e., x = min( {i Z i x} ) n E.g. 2.3 = 3, 5 = 5, 1.2 = 1 11-7

Visualizing Floor & Ceiling n Real numbers fall to their floor or rise to their ceiling. n Note that if x Z, -x - x & -x - x n Note that if x Z, x = x = x. 3 2 1 0-1 -2-3 1.6-1.6-3........ 1.6 = 2 1.6 = 1-1.6 = -1. -1.6 = -2-3 = -3 = -3 11-8

Plots with Floor/Ceiling: Example y = x y = x 11-9

Plots with Floor/Ceiling n Note that for f(x) = x, the graph of f includes the point (a, 0) for all values of a such that 0 a < 1, but not for the value a = 1. n We say that the set of points (a, 0) that is in f does not include its limit or boundary point (a,1). n Sets that do not include all of their limit points are called open sets. n In a plot, we draw a limit point of a curve using an open dot (circle) if the limit point is not on the curve, and with a closed (solid) dot if it is on the curve. 11-10

Plots with Floor/Ceiling: Another Example n Plot of graph of function f(x) = x/3 : f(x) Set of points (x, f(x)) 2-6 -3 3 6 x -2 11-11

2.4 Sequences and Summations n A sequence or series is just like an ordered n-tuple, except: n Each element in the sequence has an associated index number. n A sequence or series may be infinite. n A summation is a compact notation for the sum of the terms in a (possibly infinite) sequence. 11-12

Sequences n A sequence or series {a n } is identified with a generating function f : I S for some subset I N and for some set S. n Often we have I = N or I = Z + = N - {0}. n If f is a generating function for a sequence {a n }, then for n I, the symbol a n denotes f(n), also called term n of the sequence. n n The index of a n is n. (Or, often i is used.) A sequence is sometimes denoted by listing its first and/or last few elements, and using ellipsis ( ) notation. n E.g., {a n } = 0, 1, 4, 9, 16, 25, is taken to mean n N, a n = n 2. 11-13

Sequence Examples n Some authors write the sequence a 1, a 2, instead of {a n }, to ensure that the set of indices is clear. n Be careful: Our book often leaves the indices ambiguous. n An example of an infinite sequence: n Consider the sequence {a n } = a 1, a 2,, where ( n 1) a n = f(n) = 1/n. n Then, we have {a n } = 1, 1/2, 1/3, n Called harmonic series 11-14

Example with Repetitions n Like tuples, but unlike sets, a sequence may contain repeated instances of an element. n Consider the sequence {b n } = b 0, b 1, (note that 0 is an index) where b n = (-1) n. n Thus, {b n } = 1, -1, 1, -1, n Note repetitions! n This {b n } denotes an infinite sequence of 1 s and -1 s, not the 2-element set {1, -1}. 11-15

Geometric Progression n A geometric progression is a sequence of the form a, ar, ar 2,, ar n, where the initial term a and the common ratio r are real numbers. n A geometric progression is a discrete analogue of the exponential function f(x) = ar x n Examples n {b n } with b n = ( 1) n Assuming n = 0, 1, 2, initial term 1, common ratio 1 n {c n } with c n = 2 5 n n {d n } with d n = 6 (1/3) n initial term 2, common ratio 5 initial term 6, common ratio 1/3 11-16

Arithmetic Progression n An arithmetic progression is 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. n An arithmetic progression is a discrete analogue of the linear function f(x) = a + dx n Examples n {s n } with s n = 1 +4n Assuming n = 0, 1, 2, initial term 1, common diff. 4 n {t n } with t n = 7 3n initial term 7, common diff. 3 11-17

Recognizing Sequences (I) n Sometimes, you re given the first few terms of a sequence, n and you are asked to find the sequence s generating function, n or a procedure to enumerate the sequence. n Examples: What s the next number? n 1, 2, 3, 4, n 1, 3, 5, 7, 9, n 2, 3, 5, 7, 11,... 5 (the 5th smallest number > 0) 11 (the 6th smallest odd number > 0) 13 (the 6th smallest prime number) 11-18

Recognizing Sequences (II) n General problems n Given a sequence, find a formula or a general rule that produced it n Examples: How can we produce the terms of a sequence if the first 10 terms are n 1, 2, 2, 3, 3, 3, 4, 4, 4, 4? Possible match: next five terms would all be 5, the following six terms would all be 6, and so on. n 5, 11, 17, 23, 29, 35, 41, 47, 53, 59? Possible match: nth term is 5 + 6(n 1) = 6n 1 (assuming n = 1, 2, 3, ) 11-19

Special Integer Sequences n A useful technique for finding a rule for generating the terms of a sequence is to compare the terms of a sequence of interest with the terms of a well-known integer sequences (e.g. arithmetic/geometric progressions, perfect squares, perfect cubes, etc.) 11-20

Coding: Fibbonaci Series n Series {a n } = {1, 1, 2, 3, 5, 8, 13, 21, } n Generating function (recursive definition!): n a 0 = a 1 = 1 and n a n = a n-1 + a n-2 for all n > 1 n Now let's find the entire series {a n }: n int [] a = new int [n]; a[0] = 1; a[1] = 1; for (int i = 2; i < n; i++) { a[i] = a[i-1] + a[i-2]; } return a;" 11-21

Coding: Factorial Series n Factorial series {a n } = {1, 2, 6, 24, 120, } n Generating function: n a n = n! = 1 x 2 x 3 x x n n This time, let's just find the term a n : n int an = 1; for (int i = 1; i <= n; i++) { an = an * i; } return an;" 11-22