CMPD133 – DISCRETE STRUCTURE Chapter 1 - Topic 2 – Sequence & Strings.

Slides:



Advertisements
Similar presentations
CSNB143 – Discrete Structure
Advertisements

Copyright © Cengage Learning. All rights reserved. CHAPTER 1 SPEAKING MATHEMATICALLY SPEAKING MATHEMATICALLY.
Warm-up Finding Terms of a Sequence
9-4 Sequences & Series. Basic Sequences  Observe patterns!  3, 6, 9, 12, 15  2, 4, 8, 16, 32, …, 2 k, …  {1/k: k = 1, 2, 3, …}  (a 1, a 2, a 3, …,
Discrete Structures Chapter 2 Part A Sequences Nurul Amelina Nasharuddin Multimedia Department.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
Sequence A list of objects arranged in a particular order.
Copyright © Cengage Learning. All rights reserved.
13.1 Sequences.
Cardinality of Sets Section 2.5.
Set theory Sets: Powerful tool in computer science to solve real world problems. A set is a collection of distinct objects called elements. Traditionally,
Applied Discrete Mathematics Week 9: Relations
Advanced Counting Techniques
Sequences and Summations
9.1 Sequences. A sequence is a list of numbers written in an explicit order. n th term Any real-valued function with domain a subset of the positive integers.
Chapter 8. Section 8. 1 Section Summary Introduction Modeling with Recurrence Relations Fibonacci Numbers The Tower of Hanoi Counting Problems Algorithms.
CSC312 Automata Theory Lecture # 2 Languages.
CSC312 Automata Theory Lecture # 2 Languages.
Lecture 4 Sequences CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Languages, Grammars, and Regular Expressions Chuck Cusack Based partly on Chapter 11 of “Discrete Mathematics and its Applications,” 5 th edition, by Kenneth.
Sequences – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Sequences Reading: Kolman, Section 1.3.
Chapter 4 – Matrix CSNB 143 Discrete Mathematical Structures.
CSNB143 – Discrete Structure Topic 11 – Language.
Module 2 How to design Computer Language Huma Ayub Software Construction Lecture 8.
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
Fall 2002CMSC Discrete Structures1 … and now for… Sequences.
Chapter 5: Sequences, Mathematical Induction, and Recursion 5.9 General Recursive Definitions and Structural Induction 1 Erickson.
Lecture 5 Regular Expressions CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Discrete Mathematics R. Johnsonbaugh
Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN
UNIT VOCABULARY Functions. Closed Form of a Sequence (This is also known as the explicit form of a sequence.) For an arithmetic sequence, use a n = a.
CSNB143 – Discrete Structure Topic 1 - Set. Topic 1 - Sets Learning Outcomes – Student should be able to identify sets and its important components. –
Section 9-4 Sequences and Series.
Discrete Mathematics Lecture # 10. Set Theory  A well defined collection of {distinct} objects is called a set.  The objects are called the elements.
Introduction A sequence is an ordered list of numbers. The numbers, or terms, in the ordered list are determined by a formula that is a function of the.
CompSci 102 Discrete Math for Computer Science February 7, 2012 Prof. Rodger Slides modified from Rosen.
CSNB 143 Discrete Mathematical Structures
 A sequence is a list of objects arranged in a specific order.  A sequence in computer science is known as an array. An array hold objects of the same.
Module #10: Proof Strategies Rosen 5 th ed., §3.1 (already covered)
ARITHMETIC SEQUENCES. SEQUENCE  What is a sequence?  “A list of things (usually numbers) that are in order.”  We are free to define what order that.
Arithmetic Sequences Sequence is a list of numbers typically with a pattern. 2, 4, 6, 8, … The first term in a sequence is denoted as a 1, the second term.
Chapter 3 – Sequence and String CSNB 143 Discrete Mathematical Structures.
Chapter 7 – Counting Techniques CSNB 143 Discrete Mathematical Structures.
Discrete Mathematics Lecture # 22 Recursion.  First of all instead of giving the definition of Recursion we give you an example, you already know the.
Theory of computation Introduction theory of computation: It comprises the fundamental mathematical properties of computer hardware, software,
Mathematical Foundations of Computer Science Chapter 3: Regular Languages and Regular Grammars.
Notions & Notations (2) - 1ICOM 4075 (Spring 2010) UPRM Department of Electrical and Computer Engineering University of Puerto Rico at Mayagüez Spring.
3/16/20161 … and now for… Sequences. 3/16/20162 Sequences Sequences represent ordered lists of elements. A sequence is defined as a function from a subset.
Lecture 03: Theory of Automata:2014 Asif Nawaz Theory of Automata.
Recursively Defined Sequences Lecture 40 Section 8.1 Wed, Apr 11, 2007.
Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 1/18 Module.
Lecture #2 Advanced Theory of Computation. Languages & Grammar Before discussing languages & grammar let us deal with some related issues. Alphabet: is.
11.1 Sequences. A sequence is a list of numbers written in an explicit order. n th term Any real-valued function with domain a subset of the positive.
8.1 Sequences.
CSNB 143 Discrete Mathematical Structures
Theory of Computation Lecture #
CSNB 143 Discrete Mathematical Structures
Copyright © Cengage Learning. All rights reserved.
VCU, Department of Computer Science CMSC 302 Sequences and Summations Vojislav Kecman 9/19/2018.
Rosen 5th ed., §3.2 ~9 slides, ~½ lecture
WELCOME.
Copyright © Cengage Learning. All rights reserved.
CMSC Discrete Structures
The aim of education is to teach students how to think rather than what to think. Sets The set is the fundamental discrete structure on which all other.
Copyright © Cengage Learning. All rights reserved.
Rosen 5th ed., §3.2 ~9 slides, ~½ lecture
Discrete Mathematics and its Applications
Copyright © Cengage Learning. All rights reserved.
Write the recursive and explicit formula for the following sequence
CSNB 143 Discrete Mathematical Structures
Presentation transcript:

CMPD133 – DISCRETE STRUCTURE Chapter 1 - Topic 2 – Sequence & Strings

Topic 2 – Sequence & Strings OBJECTIVES  Students should be able to differentiate few characteristics of sequence.  Students should be able to use sequence and strings.  Students should be able to concatenate string and know how to use them.

Sequence  A list of objects in its order. That is, taking order as an important thing.  A list in which the first one should be in front, followed by the second element, third element and so on.  List might be ended after n, n  N and it is named as Finite Sequence. We called n as an index for that sequence.  List might have no ending value, and this is called as Infinite Sequence.  Elements might be redundancy.

Ex 1:  S = 2, 4, 6, …, 2n  S = S 1, S 2, S 3, … S n whereS 1 =2, S 2 = 4, S 3 =6, … S n = 2n Ex 2:  T = a, a, b, a, b whereT 1 =a, T 2 =a, T 3 =b, T 4 =a, T 5 =b Sequence

 If the sequence is depending on the previous value, it is called Recursive Sequence.  If the sequence is not depending on the previous value, in which the value can be directly retrieved, it is called Explicit Sequence. Sequence

Ex 3: A n = A n-1 + 5; A 1 = 1, 2  n < , this is a recursive sequence where: A 2 = A A 3 = A Ex 4: A n = n 2 + 1; 1  n < , this is an explicit sequence where:A 1 = = 2 A 2 = = 5 A 3 = = 10 That is, we can get the value directly, without any dependency to previous value. Sequence

Both recursive and explicit formula can have both finite and infinite sequence. Ex 5:Consider all the sequences below, and identify which sequence is recursive/explicit and finite/infinite. a) C 1 = 5, C n = 2C n-1,2  n  6 b) D 1 = 3, D n = D n c) S n = (-4) n, 1  n   d) T n = 92 – 5n, 1  n  5 Sequence

 Both sequences also can have an Increasing or Decreasing sequence.  A sequence is said to be increased if for each S n, the value is less than S n + 1 for all n, S n  S n + 1 ; all n  A sequence is said to be decreased if for each S n the value is bigger than S n + 1 for all n, S n  S n + 1 ; all n Sequence

Ex 6:Determine either this sequence in increasing or decreasing.  S n = 2(n + 1), n  1  X n = (½) n, n  1  S = 3, 5, 5, 7, 8, 8, 13 Sequence

String  Sequences or letters or other symbols that is written without commas are also referred as strings.  An infinite string such as abababa… may be regarded as infinite sequence of a,b,a,b,a,b,a…  The set corresponding to sequence is simply the set of all distinct elements in the sequence.  E.g 1: 1,4,8,9,2… is {1,4,8,9,2…}  E.g 2 : a,b,a,b,a,b,a… is simply {a, b}

 A string over A set is a finite sequence of elements from A.  Let A = {a, b, c}. If we let A 1 = b, A 2 = a, A 3 = a, A 4 = c Then we obtain a string over A. The string is written baac.  Since a string is a sequence, order is taken into account. For example the string baac is different from acab.  Repetition in a string can be specified by superscript. For example the string bbaaac may be written b 2 a 3 c. String

 The string with no element is call the null string and is denoted as . We let set A* denote the set of all strings over A, including the null string. Ex 10:  Let say A = {a, b, c, …, z}  Then A* = {aaaa, computer, denda, pqr, sysrq,… }  Or let X = {a, b }. Some elements of X * are:  a, b, baba, , b 2 a 29 ba String

 That is, all finite sequence that can be build from A, contains all words either it has any meaning or not, regardless its length.  The number of elements in any string A is called Elements’ Length, denoted as |A|. Ex 11:  If A = abcde…z, then |A| = 26. String

Concatenation  If W 1 and W 2 are two strings, the string consisting of W 1 followed by W 2 written W 1. W 2 is called concatenation of W 1 and W 2 : W 1.W 2 =A 1 A 2 A 3 …A n B 1 B 2 B 3 …B m where W 1.W 2 And it is known that W 1.  = W 1 and .W 1 = W 1

Ex 12:Let say R = aabc, S = dacb  So,R.S = aabcdacbS.R = dacbaabc  R.  = aabc .R = aabc Concatenation

Subsequence It is quite different from what we have learn in subset A new sequence can be build from original sequence, but the order of elements must remains. Ex 13: T = a, a, b, c, q where T 1 =a, T 2 =a, T 3 =b, T 4 =c, T 5 =q S = b, c is a subsequence of T but R = c, b is not a subsequence of T *Take note that the order in which b and c appears must be the same with the original sequence.

Exercise 1. List all string on X = {0, 1}, with length With your own words, explain the meaning of sequence. What is the basic difference between sequence and set?