Unit – 1 : FOUNDATIONS Syllabus: Sets – relations – equivalence relations partial orders – functions – recursive functions sequences – induction principle.

Slides:



Advertisements
Similar presentations
COUNTING AND PROBABILITY
Advertisements

Counting Chapter 6 With Question/Answer Animations.
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
April 9, 2015Applied Discrete Mathematics Week 9: Relations 1 Solving Recurrence Relations Another Example: Give an explicit formula for the Fibonacci.
The Engineering Design of Systems: Models and Methods
Relations.
Recursion. n! (n factorial)  The number of ways n objects can be permuted (arranged).  For example, consider 3 things, A, B, and C.  3! = 6 1.ABC 2.ACB.
Math 3121 Abstract Algebra I
CSE115/ENGR160 Discrete Mathematics 04/17/12
Recursive Definitions Rosen, 3.4 Recursive (or inductive) Definitions Sometimes easier to define an object in terms of itself. This process is called.
Induction and recursion
Relations Chapter 9.
Section 1.8: Functions A function is a mapping from one set to another that satisfies certain properties. We will first introduce the notion of a mapping.
Applied Discrete Mathematics Week 9: Relations
Advanced Counting Techniques
Discrete Mathematics CS 2610 March 26, 2009 Skip: structural induction generalized induction Skip section 4.5.
FINITE FIELDS 7/30 陳柏誠.
Induction and recursion
CS 490 Mathematical Logic, Combinatorics, Counting Arguments, Graph Theory, Number Theory, Discrete Probability, Recurrence Relation. Thao Tran.
2.3 Functions A function is an assignment of each element of one set to a specific element of some other set. Synonymous terms: function, assignment, map.
Chapter 8. Section 8. 1 Section Summary Introduction Modeling with Recurrence Relations Fibonacci Numbers The Tower of Hanoi Counting Problems Algorithms.
Advanced Counting Techniques CSC-2259 Discrete Structures Konstantin Busch - LSU1.
CS Discrete Mathematical Structures Mehdi Ghayoumi MSB rm 132 Ofc hr: Thur, 9:30-11:30a Fall 2002KSU - Discrete Structures1.
Discrete Mathematical Structures (Counting Principles)
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
Chapter 6 With Question/Answer Animations 1. Chapter Summary The Basics of Counting The Pigeonhole Principle Permutations and Combinations Binomial Coefficients.
Foundations of Discrete Mathematics Chapters 5 By Dr. Dalia M. Gil, Ph.D.
The Integers. The Division Algorithms A high-school question: Compute 58/17. We can write 58 as 58 = 3 (17) + 7 This forms illustrates the answer: “3.
Chapter 2 Mathematical preliminaries 2.1 Set, Relation and Functions 2.2 Proof Methods 2.3 Logarithms 2.4 Floor and Ceiling Functions 2.5 Factorial and.
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFunctions.
Chapter 7 Advance Counting Techniques. Content Recurrence relations Generating function The principle of inclusion-exclusion.
Chapter 8 With Question/Answer Animations. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.
Chapter 5 – Relations and Functions. 5.1Cartesian Products and Relations Definition 5.1: For sets A, B  U, the Cartesian product, or cross product, of.
Mathematical Induction
Reading and Writing Mathematical Proofs Spring 2015 Lecture 4: Beyond Basic Induction.
Induction Proof. Well-ordering A set S is well ordered if every subset has a least element. [0, 1] is not well ordered since (0,1] has no least element.
Functions Section 2.3. Section Summary Definition of a Function. – Domain, Cdomain – Image, Preimage Injection, Surjection, Bijection Inverse Function.
Advanced Counting Techniques CSC-2259 Discrete Structures Konstantin Busch - LSU1.
CS201: Data Structures and Discrete Mathematics I
Copyright © Cengage Learning. All rights reserved.
ICS 253: Discrete Structures I Induction and Recursion King Fahd University of Petroleum & Minerals Information & Computer Science Department.
The Pigeonhole Principle. The pigeonhole principle Suppose a flock of pigeons fly into a set of pigeonholes to roost If there are more pigeons than pigeonholes,
Mathematical Preliminaries
Counting Discrete Mathematics. Basic Counting Principles Counting problems are of the following kind: “How many different 8-letter passwords are there?”
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
Foundations of Discrete Mathematics Chapters 5 By Dr. Dalia M. Gil, Ph.D.
Unit II Discrete Structures Relations and Functions SE (Comp.Engg.)
Mathematical Induction Section 5.1. Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If.
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 7 Functions Instructor: Hayk Melikyan Today we will review sections 7.3, 7.4 and 7.5.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
FUNCTIONS COSC-1321 Discrete Structures 1. Function. Definition Let X and Y be sets. A function f from X to Y is a relation from X to Y with the property.
5 Lecture in math Predicates Induction Combinatorics.
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
Chapter 2 1. Chapter Summary Sets The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions and sequences.
FUNCTIONS.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
Section Recursion 2  Recursion – defining an object (or function, algorithm, etc.) in terms of itself.  Recursion can be used to define sequences.
Section Recursion  Recursion – defining an object (or function, algorithm, etc.) in terms of itself.  Recursion can be used to define sequences.
SEQUENCES A function whose domain is the set of all integers greater than or equal to some integer n 0 is called a sequence. Usually the initial number.
Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar Dr Nazir A. Zafar Advanced Algorithms Analysis and Design.
Review: Discrete Mathematics and Its Applications
Relations, Functions, and Matrices
Modeling with Recurrence Relations
Applied Discrete Mathematics Week 10: Relations
Applied Discrete Mathematics Week 9: Equivalence Relations
CS201: Data Structures and Discrete Mathematics I
Lecture 7 Functions.
Applied Discrete Mathematics Week 5: Boolean Algebra
Review: Discrete Mathematics and Its Applications
MA/CSSE 474 More Math Review Theory of Computation
Presentation transcript:

Unit – 1 : FOUNDATIONS Syllabus: Sets – relations – equivalence relations partial orders – functions – recursive functions sequences – induction principle – structural induction recursive algorithms – counting –pigeonhole principle permutations and combinations – recurrence relations 1

Sets Definition: Set is a well defined collection of objects 2

Sets 3

4

5

6

7

8

This n means the number of elements in the set 9

Relations Definition: Let A and B be sets. A binary relation from A to B is a subset of A  B. In other words, for a binary relation R we have R  A  B. We use the notation aRb to denote that (a, b)  R and aRb to denote that (a, b)  R. Example: Let P be a set of people, C be a set of cars, and D be the relation describing which person drives which car(s). P = {Carl, Suzanne, Peter, Carla}, C = {Mercedes, BMW, tricycle} D = {(Carl, Mercedes), (Suzanne, Mercedes), (Suzanne, BMW), (Peter, tricycle)} This means that Carl drives a Mercedes, Suzanne drives a Mercedes and a BMW, Peter drives a tricycle, and Carla does not drive any of these vehicles. 10

Relations 11

Relations 12

Equivalence Relations Equivalence relations are used to relate objects that are similar in some way. Definition: A relation on a set A is called an equivalence relation if it is reflexive, symmetric, and transitive. Two elements that are related by an equivalence relation R are called equivalent. 13

Partial Orders A partial order is a binary relation "≤" over a set P which is reflexive, antisymmetric, and transitive, i.e., which satisfies for all a, b, and c in P: a ≤ a (reflexivity); if a ≤ b and b ≤ a then a = b (antisymmetry); if a ≤ b and b ≤ c then a ≤ c (transitivity). In other words, a partial order is an antisymmetric preorder. 14

Functions 15

Identity function A function f from a set A to the same set A stating that f(x) = x for all elements of x in the set A. Identity function is one one and onto also. It is a bijective mapping from a set into it self. 16

One one function A function f from a set A to set B such that for any element of set B there exists only one preimage in set A. If f(a) = f(b) then a = b for all elements of a,b in set A. It is also called as injective or some times

Onto function A function from a set A to set B such that for all elements of set B there exists at least one element in set B such that f(a) = b. It is also called as surjective mapping. Here f(A) = B. All images are have preimages. 18

One to one function A function from a set A to set B with the two properties one one and onto. It is also called as 1to1 or some times bijective mapping n(A) = n(B) i. e. both the sets have same number of elements. one element to one image and one image is for one element. 19

Step function A function f from real numbers set to integers set stating that f(x) = y where y-1<x<=y for all real numbers x. where y is an integer. Examples are floor function or ceiling function. 20

Absolute function A function from real numbers set to real numbers set stating that x if x is > 0 f(x) = -x if x is < 0 0 if x is = 0 21

Recursive Functions A recursive function is an equation that recursively defines a sequence, once one or more initial terms are given: each further term of the sequence is defined as a function of the preceding terms. The term difference equation sometimes (and for the purposes of this article) refers to a specific type of recurrence relation. However, "difference equation" is frequently used to refer to any recurrence relation. Example: We obtain the sequence of Fibonacci numbers which begins: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89,... It can be solved by methods described below yielding the closed-form expression which involve powers of the two roots of the characteristic polynomial t2 = t + 1; the generating function of the sequence is the rational function 22

Sequences A sequence is an ordered list. Like a set, it contains members (also called elements, or terms). The number of ordered elements (possibly infinite) is called the length of the sequence. Unlike a set, order matters, and exactly the same elements can appear multiple times at different positions in the sequence. Most precisely, a sequence can be defined as a function whose domain is a countable totally ordered set, such as the natural numbers. For example, (M, A, R, Y) is a sequence of letters with the letter 'M' first and 'Y' last. This sequence differs from (A, R, M, Y). Also, the sequence (1, 1, 2, 3, 5, 8), which contains the number 1 at two different positions, is a valid sequence. 23

Induction Principle Mathematical induction is a method of mathematical proof typically used to establish a given statement for all natural numbers. It is done in two steps. The first step, known as the base case, is to prove the given statement for the first natural number. The second step, known as the inductive step, is to prove that the given statement for any one natural number implies the given statement for the next natural number. From these two steps, mathematical induction is the rule from which we infer that the given statement is established for all natural numbers. 24

Structural Induction Structural induction is a proof method that is used in mathematical logic (e.g., in the proof of Łoś' theorem), computer science, graph theory, and some other mathematical fields. It is a generalization of mathematical induction over natural numbers, and can be further generalized to arbitrary Noetherian induction. Structural recursion is a recursion method bearing the same relationship to structural induction as ordinary recursion bears to ordinary mathematical induction. Structural induction is used to prove that some proposition P(x) holds for all x of some sort of recursively defined structure such as lists or trees. A well-founded partial order is defined on the structures ("sublist" for lists and "subtree" for trees). The structural induction proof is a proof that the proposition holds for all the minimal structures, and that if it holds for the immediate substructures of a certain structure S, then it must hold for S also. (Formally speaking, this then satisfies the premises of an axiom of well-founded induction, which asserts that these two conditions are sufficient for the proposition to hold for all x.) 25

Recursive Algorithms The Nature of Recursion Algorithms Problems that lend themselves to a recursive solution have the following characteristics: One or more simple cases of the problem (called stopping cases) have a simple, non-recursive solution. For the other cases, there is a process (using recursion) for substituting one or more reduced cases of the problem that are closer to a stopping case. Eventually the problem can be reduced to stopping cases only, all of which are relatively easy to solve. if (the stopping case is reached) { Solve it } else { Reduce the problem using recursion } 26

Recursive Algorithms 1. To find N!: If N = 1 then N! = 1; Otherwise N! = N x (N - 1)! 2. The Fibonacci sequence is defined below. Fib1 is 1. Fib2 is 1. Fibn is Fibn-2 + Fibn-1, for n > GCD(M, N) is N if N <= M and N divides M. GCD(M, N) is GCD(N, M) if M < N. GCD(M, N) is GCD(N, remainder of M divided by N) otherwise. 27

Counting Combinatorics is a branch of mathematics concerning the study of finite or countable discrete structures. Aspects of combinatorics include counting the structures of a given kind and size (enumerative combinatorics), deciding when certain criteria can be met, and constructing and analyzing objects meeting the criteria (as in combinatorial designs and matroid theory), finding "largest", "smallest", or "optimal" objects (extremal combinatorics and combinatorial optimization), and studying combinatorial structures arising in an algebraic context, or applying algebraic techniques to combinatorial problems (algebraic combinatorics). Counting is the action of finding the number of elements of a finite set of objects. The traditional way of counting consists of continually increasing a (mental or spoken) counter by a unit for every element of the set, in some order, while marking (or displacing) those elements to avoid visiting the same element more than once, until no unmarked elements are left; if the counter was set to one after the first object, the value after visiting the final object gives the desired number of elements. The related term enumeration refers to uniquely identifying the elements of a finite (combinatorial) set or infinite set by assigning a number to each element. 28

Pigeonhole Principle Pigeonhole principle : If n items are put into m pigeonholes with n > m, then at least one pigeonhole must contain more than one item. This theorem is exemplified in real-life by truisms like "there must be at least two left gloves or two right gloves in a group of three gloves". It is an example of a counting argument, and despite seeming intuitive it can be used to demonstrate possibly unexpected results; for example, that two people in London have the same number of hairs on their heads 29

Permutations and Combinations Permutation means to the act of permuting (rearranging) objects or values. Informally, a permutation of a set of objects is an arrangement of those objects into a particular order. example, there are six permutations of the set {1,2,3}, namely (1,2,3), (1,3,2), (2,1,3), (2,3,1), (3,1,2), and (3,2,1). The number of permutations of n distinct objects is "n factorial" usually written as "n!", which means the product of all positive integers less than or equal to n. 30

Permutations and Combinations A permutation of a set S of objects is an ordered arrangement of these objects. The number of r-permutations of a set with n elements is denoted by P n r Example: How many permutations of the letter JKLMNOPQ contain the string JKL? Since the letter JKL must occur in a block, we must consider six objects namely JKL as one block and M,N,O,P,Q. the six objects can occur in any order and there are 6! = 720 permutations of the letters JKLMNOPQ in which JKL occurs as a block 31

Permutations and Combinations Combinations Def:An r-combination of elements of a set S is simply a subset T of S with r members. Combinations with repetitions: There are C(n+r-1, r) r-combinations from a set with n elements when repetition of elements is allowed. 32

Permutations and Combinations Combination is a way of selecting several things out of a larger group, where (unlike permutations) order does not matter. In smaller cases it is possible to count the number of combinations. For example given three fruits, say an apple, an orange and a pear, there are three combinations of two that can be drawn from this set: an apple and a pear; an apple and an orange; or a pear and an orange. More formally a k-combination of a set S is a subset of k distinct elements of S. If the set has n elements the number of k-combinations is equal to the binomial coefficient 33

Recurrence Relations Recurrence relation is an equation that recursively defines a sequence, once one or more initial terms are given: each further term of the sequence is defined as a function of the preceding terms. The Fibonacci numbers are the archetype of a linear, homogeneous recurrence relation with constant coefficients (see below). They are defined using the linear recurrence relation 34

Recurrence Relations Recurrence relations are having fundamental importance in Analysis of Algorithms. If an algorithm is designed so that it will break a problem into smaller sub problems, its running time is described by a recurrence relation. A simple example is the time an algorithm takes to search an element in an ordered vector with n elements, in the worst case. A naive algorithm will search from left to right, one element at a time. The worst possible scenario is when the required element is the last, so the number of comparisons is n. 35

Recurrence Relations A better algorithm is called binary search. It will first check if the element is at the middle of the vector. If not, then it will check if the middle element is greater or lesser than the seeked element. At this point, half of the vector can be discarded, and the algorithm can be run again on the other half. The number of comparisons will be given by which will be close to 36