Sequences. What is sequence? A sequence is an ordered collection of objects. We use sequences to model collections in which order or multiplicity is important.

Slides:



Advertisements
Similar presentations
18 April 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Formal.
Advertisements

18 April 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Formal.
Equivalence Relations
The Logic of Quantified Statements
If R = {(x,y)| y = 3x + 2}, then R -1 = (1) x = 3y + 2 (2) y = (x – 2)/3 (3) {(x,y)| y = 3x + 2} (4) {(x,y)| y = (x – 2)/3} (5) {(x,y)| y – 2 = 3x} (6)
Z -Toolkit Z specification language is based on formal system: –Propositional and predicate calculus –Set theory –Relations and –Functions Thus Z offers.
Lecture 7 Surreal Numbers. Lecture 7 Surreal Numbers.
Section 1.6: Sets Sets are the most basic of discrete structures and also the most general. Several of the discrete structures we will study are built.
Discussion #25 1/13 Discussion #25 Set Topics & Applications.
CS5371 Theory of Computation Lecture 1: Mathematics Review I (Basic Terminology)
CSE115/ENGR160 Discrete Mathematics 02/10/11 Ming-Hsuan Yang UC Merced 1.
Courtesy Costas Busch - RPI1 Mathematical Preliminaries.
Sets. Copyright © Peter Cappello Definition Visualize a dictionary as a directed graph. Nodes represent words If word w is defined in terms of word.
1 Section 3.4 Recursive Definitions. 2 Recursion Recursion is the process of defining an object in terms of itself Technique can be used to define sequences,
1.3 Arithmetic Sequences Objectives:
The Z Notation: relations and functions Compiled By Tariq R. Soomro, Ph.D. Reference: Text Book Week-7.
1 © 2010 Pearson Education, Inc. All rights reserved 10.1 DEFINITION OF A SEQUENCE An infinite sequence is a function whose domain is the set of positive.
Section 5.3. Section Summary Recursively Defined Functions Recursively Defined Sets and Structures Structural Induction.
Nested Quantifiers. 2 Nested Iteration Let the domain be {1, 2, …, 10}. Let P(x, y) denote x > y.  x,  y, P(x, y) means  x, (  y, P(x, y) ) Is the.
Introduction to sequences and series
Mathematical Preliminaries (Hein 1.1 and 1.2) Sets are collections in which order of elements and duplication of elements do not matter. – {1,a,1,1} =
Concept: Introduction to Functions EQ: How do we interpret and represent functions using function notation? (F.IF.2) Vocabulary: Function notation, f(x),
9.1 Sequences and Series. A sequence is a collection of numbers that are ordered. Ex. 1, 3, 5, 7, …. Finding the terms of a sequence. Find the first 4.
Sequence – a function whose domain is positive integers. Section 9.1 – Sequences.
Chapter 2: Basic Structures: Sets, Functions, Sequences, and Sums (1)
ELEMENTARY SET THEORY.
Sets Goal: Introduce the basic terminology of set theory.
9.1 Sets, Intersections, and Unions  Standard 1.0  8 Key Terms.
THEORY OF COMPUTATION Komate AMPHAWAN 1. 2.
Chapter 8 Equivalence Relations Let A and B be two sets. A relation R from A to B is a subset of AXB. That is, R is a set of ordered pairs, where the first.
Table of Contents Rational Functions and Domains where P(x) and Q(x) are polynomials, Q(x) ≠ 0. A rational expression is given by.
Rational Functions and Domains where P(x) and Q(x) are polynomials, Q(x) ≠ 0. A rational expression is given by.
Slide 7- 1 Copyright © 2012 Pearson Education, Inc.
SECTION 9 Orbits, Cycles, and the Alternating Groups Given a set A, a relation in A is defined by : For a, b  A, let a  b if and only if b =  n (a)
Module #10: Proof Strategies Rosen 5 th ed., §3.1 (already covered)
9.1 Sequences and Series. Definition of Sequence  An ordered list of numbers  An infinite sequence is a function whose domain is the set of positive.
Strings and Languages Denning, Section 2.7. Alphabet An alphabet V is a finite nonempty set of symbols. Each symbol is a non- divisible or atomic object.
Theory of computation Introduction theory of computation: It comprises the fundamental mathematical properties of computer hardware, software,
Sets and Basic Operations on Sets Notation A set will usually be denoted by a capital letter, such as, A,B,X, Y,..., whereas lower-case letters, a, b,
1 Modelling using Sequences Sequences The finite sequence constructor Value definitions: enumeration, subsequence Operators on Sequences Case Study: the.
13.1 Sequences. Definition of a Sequence 2, 5, 8, 11, 14, …, 3n-1, … A sequence is a list. A sequence is a function whose domain is the set of natural.
Table of Contents Matrices - Definition and Notation A matrix is a rectangular array of numbers. Consider the following matrix: Matrix B has 3 rows and.
CS 173, Lecture B August 27, 2015 Tandy Warnow. Proofs You want to prove that some statement A is true. You can try to prove it directly, or you can prove.
Chapter 5 With Question/Answer Animations 1. Chapter Summary Mathematical Induction - Sec 5.1 Strong Induction and Well-Ordering - Sec 5.2 Lecture 18.
Lecture #4 Thinking of designing an abstract machine acts as finite automata. Advanced Computation Theory.
Sets.
Tuples and Lists.
Cartesian product Given two sets A, B we define their Cartesian product is the set of all the pairs whose first element is in A and second in B. Note that.
Discrete Mathematics Lecture#14.
Intro to Set Theory The Math of Santa’s Bag.
Rosen 5th ed., §3.2 ~9 slides, ~½ lecture
Set-Builder Notation.
Section 11.1 Sequences.
CHAPTER 1 - Sets and Intervals
Copyright © Cengage Learning. All rights reserved.
CHAPTER 1 - Sets and Intervals
Advanced Algorithms Analysis and Design
Solving Equations and Inequalities with Absolute Value
Solving Equations and Inequalities with Absolute Value
Rosen 5th ed., §3.2 ~9 slides, ~½ lecture
Visit for More Learning Resources
Aim: What is the function notation?
Discrete Mathematics and its Applications
Terms Set S Set membership x  S Cardinality | S |
Copyright © Cengage Learning. All rights reserved.
Lecture Sets 2.2 Set Operations.
Functions.
Totalization To define refinement for partial relations, we consider their totalised forms: where X = X ⋃ {⊥} Y = Y ⋃ {⊥}
Math 0332 Subsets Name ________________________
Terminology and Symbols
Presentation transcript:

Sequences

What is sequence? A sequence is an ordered collection of objects. We use sequences to model collections in which order or multiplicity is important. If we do not wish to impose an order, then we may choose to use bags instead. A sequence of values of type X is a partial function from natural numbers N to X whose domain is just 1..n, where n is the length of the sequence. Formally we can define the set of all sequences of values of type X as follows: seq X == { f : N ↛ X | (  n : N dom f = 1..n)}

Since seq X is a set of functions, the type of seq X must be ℙ (ℙ(ℤ  X)) The type of any sequence of values of type X is ℙ(ℤ  X) The following notation denote a sequence: {1 ↦ u, 2 ↦ s, 3 ↦ i, 4 ↦ n, 5 ↦ g, 6 ↦ z} ‹u,s,i,n,g,z› ‹› empty sequence

If we let s denotes the above sequence, then the following statements are well-formed and true: dom s = 1..6 ran s = {u,s,i,n,g,z} #s = 4 s 4 = n

Sequence notation

last s = s #s front s = {#s} s

Filter If s is a sequence, then s ↾ A is the largest subsequence of s containing only those objects that are elements of A. ↾ {a, b} =

Question

Sequences as function

Concatenation

Bag A bag is an unordered collection of objects in which multiplicities are important: [[ ]] [[a, b, c, a, b, c]]