CISC 1400 Discrete Structures

Similar documents
MATH Dr. Halimah Alshehri Dr. Halimah Alshehri

Conversions between Decimal and Binary

ENGIN 112 Intro to Electrical and Computer Engineering

Number Theory: Representations of Integers

Four Important Number Systems

Counting in Different Number Systems

EE260: Digital Design, Spring n Digital Computers. n Number Systems. n Representations. n Conversions. n Arithmetic Operations.

Menu. Review of Number Systems EEL3701 EEL3701. Math. Review of number systems >Binary math >Signed number systems

CISC 1100: Structures of Computer Science

4. Number Theory (Part 2)

Binary addition example worked out

Numbering Systems. Contents: Binary & Decimal. Converting From: B D, D B. Arithmetic operation on Binary.

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 2 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

12/31/2010. Digital Operations and Computations Course Notes. 01-Number Systems Text: Unit 1. Overview. What is a Digital System?

CSE 241 Digital Systems Spring 2013

We say that the base of the decimal number system is ten, represented by the symbol

Mat Week 8. Week 8. gcd() Mat Bases. Integers & Computers. Linear Combos. Week 8. Induction Proofs. Fall 2013

Student Responsibilities Week 8. Mat Section 3.6 Integers and Algorithms. Algorithm to Find gcd()

Introduction Integers. Discrete Mathematics Andrei Bulatov

ECE380 Digital Logic. Positional representation

Hakim Weatherspoon CS 3410 Computer Science Cornell University

CHAPTER 2 NUMBER SYSTEMS

ENGIN 112 Intro to Electrical and Computer Engineering

Expressions, Equations and Inequalities Guided Notes

Chapter 2 (Part 3): The Fundamentals: Algorithms, the Integers & Matrices. Integers & Algorithms (2.5)

CSEN102 Introduction to Computer Science

Number System conversions

Number System. Decimal to binary Binary to Decimal Binary to octal Binary to hexadecimal Hexadecimal to binary Octal to binary

CS1800 Discrete Structures Fall 2017 October, CS1800 Discrete Structures Midterm Version A

Week No. 06: Numbering Systems

EECS 1028 M: Discrete Mathematics for Engineers

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

Number Bases. Ioan Despi. University of New England. August 4, 2013

Lecture 2. The Euclidean Algorithm and Numbers in Other Bases

10/14/2009. Reading: Hambley Chapters

Numbers. Dr Hammadi Nait-Charif. Senior Lecturer Bournemouth University United Kingdom

Advanced Counting Techniques. Chapter 8

Chapter 9 - Number Systems

2.5 정수와알고리즘 (Integers and Algorithms)

of Digital Electronics

THE TEACHER UNDERSTANDS THE REAL NUMBER SYSTEM AND ITS STRUCTURE, OPERATIONS, ALGORITHMS, AND REPRESENTATIONS

Base-b representations of integers. (b 진법표현 ) Algorithms for computer arithmetic: Euclidean algorithm for finding GCD s.

INFINITE SEQUENCES AND SERIES

ALGEBRA+NUMBER THEORY +COMBINATORICS

9.1 SEQUENCES AND SERIES

0,..., r 1 = digits in radix r number system, that is 0 d i r 1 where m i n 1

ENG2410 Digital Design Introduction to Digital Systems. Fall 2017 S. Areibi School of Engineering University of Guelph

CSE 20 DISCRETE MATH. Fall

With Question/Answer Animations. Chapter 4

Advanced Counting Techniques

NUMBERS AND CODES CHAPTER Numbers

What is Binary? Digital Systems and Information Representation. An Example. Physical Representation. Boolean Algebra

Standard forms for writing numbers

Sequences. 1. Number sequences. 2. Arithmetic sequences. Consider the illustrated pattern of circles:

1 Computing System 2. 2 Data Representation Number Systems 22

Numbers and Arithmetic

14:332:231 DIGITAL LOGIC DESIGN. Why Binary Number System?

THE TEACHER UNDERSTANDS THE REAL NUMBER SYSTEM AND ITS STRUCTURE, OPERATIONS, ALGORITHMS, AND REPRESENTATIONS

Fundamentals of Digital Design

Math /Foundations of Algebra/Fall 2017 Foundations of the Foundations: Proofs

Solutions to Assignment 1

SERIES

Why digital? Overview. Number Systems. Binary to Decimal conversion

Sequences and Series. Copyright Cengage Learning. All rights reserved.

Digital Systems Overview. Unit 1 Numbering Systems. Why Digital Systems? Levels of Design Abstraction. Dissecting Decimal Numbers

CSCI 220: Computer Architecture-I Instructor: Pranava K. Jha. BCD Codes

MAT 243 Test 2 SOLUTIONS, FORM A

COT 3100 Applications of Discrete Structures Dr. Michael P. Frank

Contents. Chapter 2 Digital Circuits Page 1 of 30

THE TEACHER UNDERSTANDS THE REAL NUMBER SYSTEM AND ITS STRUCTURE, OPERATIONS, ALGORITHMS, AND REPRESENTATIONS

Computer Number Systems

Senior Math Circles Cryptography and Number Theory Week 2

hexadecimal-to-decimal conversion

Digital Electronics Part 1: Binary Logic

Midterm Examination # 1 Wednesday, February 25, Duration of examination: 75 minutes

SAMPLE ANSWERS MARKER COPY

UNDERSTANDING ENGINEERING MATHEMATICS

1 What is numerical analysis and scientific computing?

Finding Prime Factors

CS/COE0447: Computer Organization and Assembly Language

Sequences and Series. College Algebra

Discrete Mathematics GCD, LCM, RSA Algorithm

Unit 1. Math 116. Number Systems

CS1800 Discrete Structures Final Version A

Floating Point Number Systems. Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le

Mathematical Induction

3 The fundamentals: Algorithms, the integers, and matrices

TI-36X Solar, English

Chapter 1 Indices & Standard Form

Representation of Functions as Power Series.

Exam 1. Problem 1: True or false

Prerequisites. Introduction CHAPTER OUTLINE

Base Number Systems. Honors Precalculus Mr. Velazquez

In this lecture, we will consider how to analyse an electrical circuit by applying KVL and KCL. As a result, we can predict the voltages and currents

Chapter 4: Radicals and Complex Numbers

Introduction to digital systems. Juan P Bello

Mathematical Induction

MATH3283W LECTURE NOTES: WEEK 6 = 5 13, = 2 5, 1 13

1 Question related to polynomials

School of Computer Science and Electrical Engineering 28/05/01. Digital Circuits. Lecture 14. ENG1030 Electrical Physics and Electronics

Transcription:

CISC 1400 Discrete Structures Chapter 2 Sequences What is Sequence? A sequence is an ordered list of objects or elements. For example, 1, 2, 3, 4, 5, 6, 7, 8 Each object/element is called a term. 1 st term in a sequence : a 1 k th term in a sequence : a k A sequence can be infinite or finite A length is associated with a finite sequence. in the sequence indicates that the sequence continues. a 1, a 2,, a k,.

Describing Patterns in Sequences What number comes next? 1, 2, 3, 4, 5, 2, 6, 10, 14, 18, 1, 2, 4, 8, 16, 2, 4, 6, 8, 10 What is a 1? What is a 3? What is a 5? What is a k if k = 4? What is a k-1 if k = 4?

2, 4, 6, 8, 10 Can we relate a term to previous terms? The first term a 1 is 2. Second term a 2 is 2 more than the first term a 1. Third term a 3 is 2 more than the second term a 2.. In fact, each subsequent term a k is just two more than the previous one a k-1. a 1 = 2 a k = a k-1 +2 2, 4, 6, 8, 10 Can we describe each item in relation to its position in the sequence? The term at position 1 is 2 The term at position 2 is 4 The term at position 3 is 6 The term at position k is 2 * k a k = 2*k

2, 4, 6, 8, 10 We have found two ways to describe the sequence Recursive method: each subsequent term a k is two more than the previous one a k-1 Closed method: the term at position k is 2 * k It s also the sequence of all even numbers Describing Patterns in Sequences Recursive Method The pattern could be that each term is somehow related to previous terms Closed Method The pattern could be described by its relationship to its position in the sequence (1 st, 2 nd, 3 rd etc )

1, 2, 3, 4, 5, Recursive method: a 1 = 1 a 2 = 2 = 1 + a 1 a 3 = 3 = 1 + a 2 a 4 = 4 = 1 + a 3 a k = 1+ a k-1 Closed method: a 1 = 1 a 2 = 2 = 1*2 a 3 = 3 = 1*3 a 4 = 4 = 1*4 a k = 1*k = k 1, 3, 5, 7, 9, Recursive method: a 1 = 1 a 2 = 3 = 2 + a 1 a 3 = 5 = 2 + a 2 a 4 = 7 = 2 + a 3 a k = 2+a k-1 Closed method: a 1 = 1 = 1+2*0 a 2 = 3 = 1+2*1 a 3 = 5 = 1+2*2 a 4 = 7 = 1+2*3 a k = 1+2*(k-1)

1, 2, 6, 24, 120, Recursive method: a 1 = 1 a 2 = 2 = 2 * a 1 a 3 = 6 = 3 * a 2 a 4 = 24 = 4 * a 3 a k = k*a k-1 Closed method: a 1 = 1 a 2 = 2 = 1*2 a 3 = 6 = 1*2*3 a 4 = 24 = 1*2*3*4 a k = 1*2*3* *k Recursive Method vs. Closed Method Recursive Method Given the sequence, easier to find recursive formula Harder for evaluating a given term Closed Method Given the sequence, harder to find closed formula Easier for evaluating a given term

Exercises: find out recursive formula 1, 4, 7,10,13, a 1 =1, a k = a k-1 +3 1, 2, 4, 8, 16, 32, a 1 =1, a k = a k-1 *2 1, 1, 2, 3, 5, 8, 13, a 1 =1, a 2 =1, a k = a k-1 +a k-2 Exercises: find out closed formula 3, 5, 7, 9, a k = 1+k*2 3, 6, 9, 12, a k = k*3 1, 4, 7, 10, 13, a k = (k-1)*3+1

What comes next? 2, 5, 10, 17, 26, 37, a 1 =2, a k =a k-1 +2k-1 2, 3, 5, 8, 12, 17, a 1 =2, a k = a k-1 +k-1 Closed Formula => Recursive Formula By observations: write out a number of initial terms, and then determine how each value relates to previous term(s) a k 7k 6 k 1 2 3 4 5 a k 1 8 15 22 29 a 1 1 a k a k 1 7

Closed formula => Recursive formula: algebraic manipulation a k 7k 6 Try to describe a k in terms of a k-1 a k 7k 6 a k 1 7( k 1) 6 7k 13 We see that a k 13 7k a 13 k 1 7 k 1 7 k 1 k 1 ak k 6 a 13 6 a So the recursive formula is a 7*1 6 a 7 k a k 1 1 1 7 Exercise Given the closed formula, find the recursive formula: a k =3k+5

Summation A summation is just the sum of some terms in a sequence. For example 1+2+3+4+5+6 is the summation of first 6 terms of sequence: 1, 2, 3, 4, 5, 6, 7,. 1+4+9+16+25 is the summation of the first 5 terms of sequence 1, 4, 9, 16, 25, 49, Summation is a very common Idea Because it is so common, mathematicians have developed a shorthand to represent summations (some people call this sigma notation) n i1 a i This is what the shorthand looks like, on the next few slides we will dissect it a bit.

Sigma Notation n i1 a i The giant Sigma just means that this represents a summation Sigma Notation n i1 a i The i=1 at the bottom just states where is the sequence we want to start. If the value was 5 then we would start the sequence at the 5 th position

Sigma Notation n i1 a i The n at the top just says to what element in the sequence we want to get to. In this case we want to go up through the nth item. Sigma Notation n i1 a i The portion to the right of the sigma is the closed formula for the sequence you want to sum over.

Sigma Notation n i1 a i So this states that we want to compute the closed formula for each element from 1 to n. Sigma Notation n i1 i Thus our summation is 1 + 2 + 3 + + n If I told you that n had the value of 5, then the summation would be 1 + 2 + 3 + 4 + 5 = 15

Examples 5 1 2) ( i i 7 1 2 1) ( i i 25 7 6 5 4 3 147 50 37 26 17 10 5 2 Sums using sigma notation 5+10+15+20+25+30+35+40 1+8+27+64+125+216 8 1 ) (5 i i 6 1 3 ) ( i i

Decimal Numeral System Base-10 Decimal numbers uses digits from 0..9. These are the regular numbers that we use. It is based on the decimal sequence 10, 100, 1000, Example: 2538 10 = 2 1000 + 5 100 + 3 10+8 1 = 2 10 3 +5 10 2 +3 10 1 +8 10 0 Numeral System b - numeral system base d n - the n-th digit n - can start from negative number if the number has a fraction part. N+1 - the number of digits

Binary Numeral System - Base-2 It is easier that computer hardware represents only the binary digits - 0/1. It is based on the binary sequence 2, 4, 8, 16, 32,. Since the closed form of binary sequence is a k = 2 k, the binary sequence is written as 2 1, 2 2,2 3, 2 4, Binary Numeral System - Base-2 Binary number 10101 2 1 0 1 0 1 4 3 2 1 0 n: position of digits 1 2 4 +0 2 3 +1 2 2 +0 2 1 +1 2 0 = 16+4+1= 21

Binary Numeral System - Base-2 1 0 1 1 1 4 3 2 1 0 10111 2 = 1 2 4 +0 2 3 +1 2 2 +1 2 1 +1 2 0 = 16+4+2+1= 23 1 0 0 0 1 1 5 4 3 2 1 0 100011 2 = 1 2 5 +0 2 4 +0 2 3 +0 2 2 +1 2 1 +1 2 0 =32+2+1= 35 From Decimal to Binary Short Division by Two with Remainder

Octal Numeral System - Base-8 Octal numbers uses digits from 0..7. 27 8 = 2 8 1 +7 8 0 = 16+7 = 23 30 8 = 3 8 1 +0 8 0 = 24 4307 8 = 4 8 3 +3 8 2 +0 8 1 +7 8 0 = 2247 Hexadecimal Numeral System - Base-16 Hex numbers uses digits from 0..9 and A..F 28 16 = 2 16 1 +8 16 0 = 40 2F 16 = 2 16 1 +15 16 0 = 47 BC12 16 = 11 16 3 +12 16 2 +1 16 1 +2 16 0 = 48146

2016/9/8