CSCI 115 Chapter 1 Fundamentals. CSCI 115 §1.1 Sets and Subsets.

Slides:



Advertisements
Similar presentations
CSNB143 – Discrete Structure
Advertisements

Chapter Matrices Matrix Arithmetic
Applied Informatics Štefan BEREŽNÝ
Cryptography and Network Security
Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Chapter Primes and Greatest Common Divisors ‒Primes ‒Greatest common divisors and least common multiples 1.
Basic properties of the integers
Prime An integer greater than one is called a prime number if its only positive divisors (factors) are one and itself. Examples: The first six primes are.
Mathematics. Matrices and Determinants-1 Session.
Denoting the beginning
Discrete Mathematics Lecture 4 Harper Langston New York University.
Chapter 4 Properties of the integers: mathematical induction Yen-Liang Chen Dept of IM NCU.
Chapter II. THE INTEGERS
Sets 1.
Lecture 3 Operations on Sets CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
MATRICES. Matrices A matrix is a rectangular array of objects (usually numbers) arranged in m horizontal rows and n vertical columns. A matrix with m.
Chapter 1: Matrices Definition 1: A matrix is a rectangular array of numbers arranged in horizontal rows and vertical columns. EXAMPLE:
Division in the Integers Theorem 1. If n and m are integers and n>0, then m=qn+r for unique integers q and r with 0
WHOLE NUMBERS; INTEGERS Whole numbers: Z 0,+ = the natural numbers  {0}. Integers:
Fall 2002CMSC Discrete Structures1 Let us get into… Number Theory.
CSCI 1900 Discrete Structures
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 3 (Part 2): The Fundamentals: Algorithms, the.
Chapter 2 The Fundamentals: Algorithms, the Integers, and Matrices
1 Properties of Integers Objectives At the end of this unit, students should be able to: State the division algorithm Apply the division algorithm Find.
CSE 504 Discrete Mathematics & Foundations of Computer Science
3.4/3.5 The Integers and Division/ Primes and Greatest Common Divisors Let each of a and b be integers. We say that a divides b, in symbols a | b, provided.
Systems of Linear Equation and Matrices
Numbers, Operations, and Quantitative Reasoning.
TMAT 103 Supplemental Chapter Cryptography. Sending messages that cannot be read if stolen –Been in use for centuries (wars) –Used to transmit data securely.
Chapter 4 – Matrix CSNB 143 Discrete Mathematical Structures.
Rational Numbers and Fields
CompSci 102 Discrete Math for Computer Science
Chapter 2 (Part 1): The Fundamentals: Algorithms, the Integers & Matrices The Integers and Division (Section 2.4)
Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN
Boolean Algebras Lecture 27 Section 5.3 Wed, Mar 7, 2007.
Foundations of Discrete Mathematics Chapter 4 By Dr. Dalia M. Gil, Ph.D.
CSCI 171 Presentation 9 Matrix Theory. Matrix – Rectangular array –i th row, j th column, i,j element –Square matrix, diagonal –Diagonal matrix –Equality.
Matrices Section 2.6. Section Summary Definition of a Matrix Matrix Arithmetic Transposes and Powers of Arithmetic Zero-One matrices.
Chapter 2 With Question/Answer Animations. Section 2.1.
Chapter 2 … part1 Matrices Linear Algebra S 1. Ch2_2 2.1 Addition, Scalar Multiplication, and Multiplication of Matrices Definition A matrix is a rectangular.
Module #9 – Number Theory 1/5/ Algorithms, The Integers and Matrices.
CompSci 102 Discrete Math for Computer Science February 7, 2012 Prof. Rodger Slides modified from Rosen.
Discrete Mathematics Set.
Greatest Common Divisors & Least Common Multiples  Definition 4 Let a and b be integers, not both zero. The largest integer d such that d|a and d|b is.
Linear Algebra Chapter 2 Matrices.
CSCI 115 Course Review.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 2 The Fundamentals: Algorithms,
Boolean Algebras Lecture 24 Section 5.3 Wed, Mar 22, 2006.
Section 2.4. Section Summary  Sequences. o Examples: Geometric Progression, Arithmetic Progression  Recurrence Relations o Example: Fibonacci Sequence.
Module #9 – Number Theory 6/11/20161 Chapter 3 Algorithms, Integers and Matrices.
Number Theory Lecture 1 Text book: Discrete Mathematics and its Applications, 7 th Edition.
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.
CS 285- Discrete Mathematics Lecture 11. Section 3.8 Matrices Introduction Matrix Arithmetic Transposes and Power of Matrices Zero – One Matrices Boolean.
A very brief introduction to Matrix (Section 2.7) Definitions Some properties Basic matrix operations Zero-One (Boolean) matrices.
MATRICES A rectangular arrangement of elements is called matrix. Types of matrices: Null matrix: A matrix whose all elements are zero is called a null.
Chapter 3 The Fundamentals: Algorithms, the integers, and matrices Section 3.4: The integers and division Number theory: the part of mathematics involving.
Number Theory. Introduction to Number Theory Number theory is about integers and their properties. We will start with the basic principles of divisibility,
Matrices Introduction.
Discrete Math II Howon Kim
Linear Algebra Lecture 2.
Unit-III Algebraic Structures
CMSC Discrete Structures
MATH301- DISCRETE MATHEMATICS Copyright © Nahid Sultana Dr. Nahid Sultana Chapter 4: Number Theory and Cryptography.
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
Foundations of Discrete Mathematics
Divisibility and Modular Arithmetic
Multiplication of Matrices
Number Theory.
Presentation transcript:

CSCI 115 Chapter 1 Fundamentals

CSCI 115 §1.1 Sets and Subsets

§1.1 – Sets and Subsets Definition Element Order does not matter Special Sets (Z, Z +, Z –, Q,, R, C, {}) Other Sets Equality Subsets Cardinality Power Set

CSCI 115 §1.2 Operations on Sets

§1.2 – Operations on Sets Union Intersection Special notation Disjoint Sets Complement (B with respect to A) Symmetric Difference

§1.2 – Operations on Sets Theorem –Algebraic Properties handout Theorem –Addition Principle for 2 sets: |A  B| = |A| + |B| - |A  B| Theorem –Addition Principle for 3 sets: |A  B  C| = |A| + |B| + |C| - |A  B| - |B  C| - |A  C| + |A  B  C|

CSCI 115 §1.3 Sequences

§1.3 – Sequences List of objects in a definite order –Finite –Infinite –Recursively defined –Explicitly defined –Arrays

§1.3 – Sequences Characteristic Function –For a set A, f A (x) = 1x  A 0x  A Theorem –Characteristic functions satisfy the following i) f A  B = f A f B ii) f A  B = f A + f B –f A f B iii) f A ⊕ B = f A + f B – 2f A f B {

§1.3 – Sequences Computer representations of sets –Utilizes the characteristic function –Universal set must be clearly defined –Stored in Arrays U = {1, 2, 3, 4, 5, 6} A = {1, 3, 6} –Computer representation of A f A = {1, 0, 1, 0, 0, 1}

§1.3 – Sequences Cardinality –Finite –Infinitely countable –Infinitely uncountable

§1.3 – Sequences Strings and Regular Expressions Given a set A, A* is the set of all finite sequences of elements in A (   A*) –A – alphabet –A* – set of words Concatenation

§1.3 – Sequences Regular Expressions – a regular expression over A is a string constructed from the elements of A, (, ), v, *, and  according to: –RE1:  is a regular expression –RE2: If x  A, x is a regular expression –RE3: If a and b are regular expressions, then ab is a regular expression –RE4: If a and b are regular expressions, then a v b is a regular expression –RE5: If a is a regular expression, then a* is a regular expression We will not be covering regular subsets

CSCI 115 §1.4 Properties of Integers

§1.4 – Properties of Integers Theorem –If n and m are integers and n > 0, we can write m = qn + r for integers q and r with 0  r < n. Moreover, there is just one way to do this. If the r in theorem is 0, we say n divides m, and write n|m. Then m = qn with n  m.

§1.4 – Properties of Integers Theorem –Let a, b, and c be integers 1.If a|b and a|c, then a|(b + c) 2.If a|b and a|c, where b > c, then a|(b – c) 3.If a|b or a|c, then a |bc 4.If a|b and b|c, then a|c

§1.4 – Properties of Integers A integer p is prime if p > 1 and the only positive integers that divide p are p and 1 Theorem –Every positive integer n > 1 can be written uniquely as, where p 1 <p 2 <…<p s are distinct primes that divide n and the k’s are positive integers giving the number of times each prime occurs as a factor of n

§1.4 – Properties of Integers Greatest Common Divisor –If a, b, and k are in Z +, and k|a and k|b, we say that k is a common divisor of a and b. If d is the largest such k, d is called the greatest common divisor, or GCD, of a and b, and we write d = GCD(a, b).

§1.4 – Properties of Integers Theorem –If d is GCD(a, b), then 1.d = sa + tb for some integers s and t. (s and t may not be positive) 2.If c is any other common divisor of a and b, then c|d Theorem –If a and b are in Z +, then: GCD(a, b) = GCD(b, b  a)

§1.4 – Properties of Integers Algorithm 1 to find GCD(a, b) (assume a > b) Euclidean Algorithm 1.Find q and r such that a = qb + r (as in Thm 1.4.1) 2.Replace a with b, b with r 3.Continue process from step 1 until r = 0 4.The GCD is the last of the non-zero divisors Ex: Find GCD (5797, 68355) using Algorithm 1

§1.4 – Properties of Integers Algorithm 2 to find GCD(a, b) 1.Find the prime factorizations of a and b 2.Find the product of only those prime numbers represented in both factorizations, to the lowest power represented Ex: Find GCD (5797, 68355) using Algorithm 2

§1.4 – Properties of Integers Least Common Multiple –If a, b, and k are in Z +, and a|k and b|k, we say k is a common multiple of a and b. The smallest such k, called c, is called the least common multiple, or LCM, of a and b, and we write c = LCM(a, b).

§1.4 – Properties of Integers Theorem –If a and b are two positive integers, then GCD(a, b) · LCM(a, b) = ab

§1.4 – Properties of Integers Algorithm to find LCM(a, b) 1.Find the prime factorizations of a and b 2.Find the product each of the prime numbers represented in either factorization, to the greatest power represented Ex: Find LCM (5797, 68355)

§1.4 – Properties of Integers Theorem –If b > 1 is an integer, then every positive integer n can be uniquely expressed in the form: where This is called the base b expansion of n. –Example: Find the base 7 representation of 381.

§1.4 – Properties of Integers Cryptology – Sir Francis Bacon’s code DISCRETE OREGO NISAS TATEI NTHEU NITED STATE SOFAM ERICA Message sent: OREGON IS A STATE IN THE UNITED STATES OF AMERICA

§1.4 – Properties of Integers Example – decode the following WILLIAM IS A FAMOUS AUTHOR FROM THE SIXTEENTH CENTURY Key: Underlined and bold text stands for 0 Steganography

CSCI 115 §1.5 Matrices

§1.5 – Matrices Matrix – Rectangular array –i th row, j th column, i,j element –Square matrix, diagonal –Diagonal matrix –Equality –Zero Matrix (additive identity) –Identity Matrix (multiplicative identity)

Addition Theorem –i) A + B = B + A –ii) (A + B) + C = A + (B + C) –iii) A + 0 = 0 + A = A §1.5 – Matrices

Multiplication Theorem –i) A(BC) = (AB)C –ii) A(B + C) = AB + AC –iii) (A + B)C = AC + BC §1.5 – Matrices

Commutativity of Multiplication? Let A be size m x p, B be size p x n BA: –May not be defined –May be defined, but a different size than AB –May be defined, same size as AB, but AB  BA –May be equal to AB §1.5 – Matrices

Other properties / definitions: –If A is m x n, then I m A = AI n = A –If A is square (n x n): A p = AAA … A (p factors) A 0 = I n A p A q = A (p+q) (A p ) q = A pq –(AB) p = A p B p if and only if AB = BA §1.5 – Matrices

Transposition Theorem –i) (A T ) T = A –ii) (A + B) T = A T + B T –iii) (AB) T = B T A T Symmetry (A T = A) –A is symmetric if and only if a i,j = a j,i for all i and j §1.5 – Matrices

Boolean Matrices (all elements are 0 or 1) Operations on Boolean Matrices: –Let A and B be boolean Matrices –The join of A and B (C = A  B): C i,j = 1 if A i,j = 1 or B i,j = 1 C i,j = 0 if A i,j = 0 and B i,j = 0 –The meet of A and B (C = A  B): C i,j = 1 if A i,j = 1 and B i,j = 1 C i,j = 0 if A i,j = 0 or B i,j = 0 §1.5 – Matrices

Boolean Matrices (all elements are 0 or 1) Operations on Boolean Matrices: –Let A and B be boolean Matrices –The boolean product of A (m x p) and B (p x n ) is (C = A  B): C i,j = 1 if A i,j =1 and B k,j = 1 for some k, 1  k  p C i,j = 0 otherwise §1.5 – Matrices

Theorem (Inverses – not discussed) Theorem If A, B, and C are boolean matrices of appropriate sizes, then: i) A  B = B  A A  B = B  A ii) (A  B)  C = A  (B  C) (A  B)  C = A  (B  C) iii) A  (B  C) = (A  B)  (A  C) A  (B  C) = (A  B)  (A  C) iv) (A ⊙ B) ⊙ C = A ⊙ (B ⊙ C) §1.5 – Matrices

CSCI 115 §1.6 Mathematical Structures

§1.6 – Mathematical Structures Mathematical structure (system) –A collection of objects with an operation or operations defined on those objects

§1.6 – Mathematical Structures Types of operations –Unary – operates on a single object –Binary – operates on two objects Properties of operations –Closure –Commutativity –Associativity –Distribution of one over another –De Morgan’s laws for a unary operation * and binary operations  and  (x  y)* = x*  y* and (x  y)* = x *  y*

Identities –A structure with binary operation  may contain a distinguished object e, with the property x  e = e  x = x for all x in the collection. We call e an identity for . Theorem –If e is an identity for a binary operation , then e is unique. §1.6 – Mathematical Structures

Inverses –If a binary operation  has an identity e, we say y is a  -inverse of x if x  y = y  x = e. Theorem –If  is an associative operation and x has a  -inverse y, then y is unique. §1.6 – Mathematical Structures