de book

64
Syllabus Section A: Set Theory and Propositional Calculus: • Introduction to set theory, Set operations, Algebra of sets, Duality, Finite and Infinite sets, Classes of sets, Power Sets, Multi sets, Cartesian Product, Representation of relations, Types of relation, Equivalence relations and partitions , Partial ordering relations and lattices Function and its types, Composition of function and relations, Cardinality and inverse Relations Introduction to propositional Calculus: Basic operations: AND(^), OR(v), NOT(~), Truth value of a compound statement, propositions, tautologies, contradictions. PDM CSE 1

Upload: mohit-arora

Post on 23-Jan-2016

224 views

Category:

Documents


0 download

DESCRIPTION

DE BOOK

TRANSCRIPT

Page 1: DE book

Syllabus

Section A: Set Theory and Propositional Calculus:

• Introduction to set theory, Set operations, Algebra of sets, Duality, Finite and Infinite sets, Classes of sets, Power Sets, Multi sets, Cartesian Product, Representation of relations, Types of relation, Equivalence relations and partitions , Partial ordering relations and lattices Function and its types, Composition of function and relations, Cardinality and inverse Relations Introduction to propositional Calculus: Basic operations: AND(^), OR(v), NOT(~), Truth value of a compound statement, propositions, tautologies, contradictions.

PDM CSE 1

Page 2: DE book

Contd..

Section B: Techniques of Counting and Recursion and recurrence Relation:

• Permutations with and without repetition, Combination.Polynomials and their evaluation, Sequences, Introduction to AP, GP and AG series, partial fractions, linear recurrence relation with constant coefficients, Homogeneous solution. Particular solutions, Total solution of a recurrence relation using generating functions.

PDM CSE 2

Page 3: DE book

Syllabus

Section C: Algebric Structures

• Definition and examples of a monoid, Semigroup, Groups and rings, Homomorphism, Isomorphism and Automorphism, Subgroups and Normal subgroups, Cyclic groups, Integral domain and fields, Cosets, Lagrange’s theorem

Section D: Section Graphs and Trees:

• Introduction to graphs, Directed and Undirected graphs, Homomorphic and Isomorphic graphs, Subgraphs, Cut points and Bridges, Multigraph and Weighted graph, Paths and circuits, Shortest path in weighted graphs, Eurelian path and circuits, Hamilton paths and circuits, Planar graphs, Euler’s formula, Trees, Spanning trees, Binary trees and its traversals

PDM CSE 3

Page 4: DE book

Reference Books

• Elements of Discrete Mathematics,C.L Liu, 1985, McGraw Hill

• Discrete Mathematics by Johnson Bough R., 5th Edition, PEA, 2001..

• Concrete Mathematics: A Foundation for Computer Science, Ronald Graham, Donald

• Knuth and Oren Patashik, 1989, Addison-Wesley.

• Mathematical Structures for Computer Science, Judith L. Gersting, 1993, Computer Science Press.

PDM CSE 4

Page 5: DE book

Reference Books

• Applied Discrete Structures for Computer Science, Doerr and Levasseur, (Chicago:1985,SRA)

• Discrete Mathematics by A. Chtewynd and P. Diggle (Modular Mathematics series),1995, Edward Arnold, London,

• Schaums Outline series: Theory and problems of Probability by S. Lipshutz, 1982,McGraw-Hill Singapore

• Discrete Mathematical Structures, B. Kolman and R.C. Busby, 1996, PHI

• Discrete Mathematical Structures with Applications to Computers by Tembley & Manohar, 1995, Mc Graw Hill.

PDM CSE 5

Page 6: DE book

Background

• Knowledge of Mathematics.

• Basic idea of digital gates.

PDM CSE 6

Page 7: DE book

SECTION-A

PDM CSE 7

Page 8: DE book

SETS

• Set Theory starts very simply :- it examines whether an object belongs, or does not belong, to a set of objects which has been described.

PDM CSE 8

Page 9: DE book

Defintion of Set

• A set can be defined as a collection of things that are brought together because they obey a certain rule.

• These 'things' may be anything you like: numbers, people, shapes, cities, bits of text ..., literally anything.

• The key fact about the 'rule' they all obey is that it must be well-defined.

 

PDM CSE 9

Page 10: DE book

Elements

Elements

• A 'thing' that belongs to a given set is called an element of that set. For example:

• A: {1,2,5,4} here 1 ,2 ,5,4 are elements of set. 

• Sets will usually be denoted using upper case letters: A , B, ...

• Elements will usually be denoted using lower case letters: x , y

PDM CSE 10

Page 11: DE book

Notation

• Curly brackets {}  are used to stand for the phrase 'the set of ...' . These braces can be used in various ways. For example:

• We may list the elements of a set:

• {-3,-2,-1,0,1,2,3}

• We may describe the elements of a set:

• {integers between -3 and 3 inclusive}

• We may use an identifier (the letter   for example) to represent a typical element, a   symbol to stand for the phrase 'such that', and then the rule or rules that the identifier must obey:

• {x| x is an integer and |x|=4}

PDM CSE 11

Page 12: DE book

Set Representation

• Tabular Form:

» {-1,-2,-3,0,1,2,3,4}

• Builder Form:

» {x|x is an integer and |x|=4}

PDM CSE 12

Page 13: DE book

Finite Set

• Є means 'is an element of ...'. For example:

• dog Є animal  

 Finite set-

• A set can be finite when it consists of specific no. of different elements.

• Q = {2,4,6,9}

• R = {months of year}• P = {x: x € N, 3<x<9 }.

PDM CSE 13

Page 14: DE book

Infinite Set

Infinite set-

• A set can be infinite when it consists of infinite number of different elements.

• A = { 2,4,6,8,…}

• This ellipse….. shows that there is infinite number of elements in the set.

• B ={set of all integers }

PDM CSE 14

Page 15: DE book

Universal Set

Universal Set

• It is denoted by U.

• All the sets under investigation are subsets of fixed set U, then set U is called universal set .The universal set may be {alphabetic characters} or {all living people}, etc.

PDM CSE 15

Page 16: DE book

Sets Of Numbers

The natural numbers

• The 'counting' numbers starting at 1, are called the natural numbers. This set is denoted by N. So N = {1, 2, 3, ...}

Integers

• All natural numbers, positive, negative and zero form the set of integers. It is denoted by Z. So Z = {..., -3, -2, -1, 0, 1, 2, 3, ...}

PDM CSE 16

Page 17: DE book

Contd..

Real numbers

• If we expand the set of integers to include all decimal numbers, we form the set of real numbers. The set of reals is denoted by R.

• A real number may have a finite number of digits after the decimal point (e.g. 3.625), or an infinite number of decimal digits. In the case of an infinite number of digits, these digits may:

• recur; e.g. 8.127127127...

• ... or they may not recur; e.g. 3.141592653...

PDM CSE 17

Page 18: DE book

Contd..

Rational numbers

• Those real numbers whose decimal digits are finite in number, or which recur, are called rational numbers. The set of rationals is denoted by the letter Q.

• A rational number can always be written as exact fraction p/q; where p and q are integers. If q equals 1, the fraction is just the integer p.

• Note that q may NOT equal zero as the value is then undefined.

• For example: 0.5, -17, 2/17, 82.01, 3.282828... are all rational numbers.

PDM CSE 18

Page 19: DE book

Contd..

Irrational numbers

• If a number can't be represented exactly by a fraction p/q, it is said to be irrational.

• Examples include: √2, √3, π.

PDM CSE 19

Page 20: DE book

Equality Of sets

• Two sets A and B are said to be equal if and only if they have exactly the same elements. In this case, we simply write:

• A = B

facts about equal sets:

• The order in which elements are listed does not matter.

• If an element is listed more than once, any repeat occurrences are ignored.So, for example, the following sets are all equal:

• {1, 2, 3} = {3, 2, 1} = {1, 1, 2, 3, 2, 2}

PDM CSE 20

Page 21: DE book

Subset

• If all the elements of a set A are also elements of a set B, then we say that A is a subset of B, and we write:

• A   B⊆• For example:

» If T = {2, 4, 6, 8, 10} and E = {even integers}, then T   E⊆

» If A = {alphanumeric characters} and P = {printable characters}, then A   P⊆

» If Q = {quadrilaterals} and F = {plane figures bounded by four straight lines}, then Q   F⊆

PDM CSE 21

Page 22: DE book

Proper Subset

• If B does contain at least one element that isn’t in A, then we say that A is a proper subset of B. In such a case we would write:

• A   B⊂• In the examples above:

» E contains 12, 14, ... , so T   E⊂» P contains $, ;, &, ..., so A   P⊂

PDM CSE 22

Page 23: DE book

Disjoint Sets

• Two sets are said to be disjoint if they have no elements in common. For example:

• If A = {even numbers} and B = {1, 3, 5, 11, 19}, then A and B are disjoint.

PDM CSE 23

Page 24: DE book

Venn Diagram

• A Venn diagram can be a useful way of illustrating relationships between sets.

In a Venn diagram:

• The universal set is represented by a rectangle.

• Other sets are represented by loops, usually oval or circular in shape, drawn inside the rectangle.

PDM CSE 24

Page 25: DE book

Operation On Sets

Intersection 

• In Venn diagrams where the two loops overlap is called the intersection of the sets A and B. It is denoted by A ∩ B. So we can define intersection as follows:

• The intersection of two sets A and B, written A ∩ B, is the set of elements that are in A and in B.

• For example,

• if A = {1, 2, 3, 4} and B = {2, 4, 6, 8}, then A ∩ B = {2, 4}.

PDM CSE 25

Page 26: DE book

Contd..

Union

• The union of two sets A and B, written A   B, is the set of ∪elements that are in A or in B (or both).

• So, for example,:

• {1, 2, 3, 4} {2, 4, 6, 8} = {1, 2, 3, 4, 6, 8}.∪

PDM CSE 26

Page 27: DE book

Difference

Difference

• The difference of two sets A and B (also known as the set-theoretic difference of A and B, or the relative complement of B in A) is the set of elements that are in A but not in B.

• This is written A - B, or sometimes A \ B.

• For example,

• if A = {1, 2, 3, 4} and B = {2, 4, 6, 8}, then A - B = {1, 3}.

PDM CSE 27

Page 28: DE book

Unary

• It is an unary operation - one that involves just one set.

• The set of elements that are not in a set A is called the complement of A. It is written A′ (or sometimes AC, or  ).

• For example,

• if U = N and A = {odd numbers}, then A′ = {even numbers}.

• The word complement: its literal meaning is 'a complementary item or items'; in other words, 'that which completes'. So if we already have the elements of A, the complement of A is the set that completes the universal set.

PDM CSE 28

Page 29: DE book

Symmetric Difference

• Symmetric Difference: things that are in A or in B but not both.

• A set containing all the elements that are in A or in B but not in both is called as symmetric difference of set A and set B. 

• It is denoted as A + B ⃝�

PDM CSE 29

Page 30: DE book

Cardinality

• The cardinality of a finite set A, written | A | (sometimes #(A) or n(A)), is the number of (distinct) elements in A. So, for example:

• If A = {lower case letters of the alphabet}, | A | = 26.

PDM CSE 30

Page 31: DE book

Power Set

• The power set of a set A is the set of all its subsets (including, of course, itself and the empty set). It is denoted by P(A).

• Using set comprehension notation, P(A) can be defined as

• P(A) = { Q | Q   A }⊆

PDM CSE 31

Page 32: DE book

Power Sets

Example

• Write down the power sets of A if:

• (a) A = {1, 2, 3}

• (b) A = {1, 2}

• (c) A = {1}

• (d) A = øSolution

• (a) P(A) = { {1, 2, 3}, {2, 3}, {1, 3}, {1, 2}, {1}, {2}, {3}, ø }

PDM CSE 32

Page 33: DE book

Contd..

• (b) P(A) = { {1, 2}, {1}, {2}, ø }

• (c) P(A) = { {1}, ø }

• (d) P(A) = { ø }

PDM CSE 33

Page 34: DE book

Foundational Rules Of Set theory

The Idempotent Laws

• A ∩ A = A 

• A   A = A∪De Morgan's Laws

• (A   B) ′ = A ′ ∩ B ′∪• (A ∩ B) ′ = A ′ B ′∪Commutative Laws 

• A ∩ B = B ∩ A

• A   B = B   A∪ ∪

PDM CSE 34

Page 35: DE book

Contd..

Associative Law

• (A ∩ B) ∩ C = A ∩ (B ∩ C)

• (A  B) C = A  (B  C)∪ ∪ ∪ ∪

Distributive Laws

• A ∩ (B  C) = (A ∩ B) (A ∩ C)∪ ∪• A  (B ∩ C) = (A  B) ∩ (A  C)∪ ∪ ∪

PDM CSE 35

Page 36: DE book

Contd..

Idempotent Laws 

• A ∩ A = A

• A   A = A∪Involution Law

• (A ′) ′ = A

Identity Laws

A   ø = A∪• A ∩ U = A

• A   ∪ U = U

PDM CSE 36

Page 37: DE book

Contd..

Complement Laws 

• A   A' = ∪ U

• A ∩ A' = ø

• U ′ = ø

• ø ′ = U

PDM CSE 37

Page 38: DE book

Duality & Boolean Algebra

• You may notice that the above Laws of Sets occur in pairs: if in any given law, you exchange for ∩ and vice versa (and, ∪if necessary, swap U and ø) you get another of the laws. The 'partner laws' in each pair are called duals, each law being the dual of the other.

• For example,

• each of De Morgan's Laws is the dual of the other.

PDM CSE 38

Page 39: DE book

Contd..

• The first complement law, A   A ′ = U, ∪ is the dual of the second: A ∩ A ′ = ø.

• ... and so on.

This is called the Principle of Duality. This set of laws constitutes the axioms of a Boolean Algebra.

PDM CSE 39

Page 40: DE book

Ordered Pairs

• If an event R can occur in r ways and a second event S can then occur in s ways, then the total number of ways that the two events, R followed by S, can occur is r × s. This is sometimes called the r-s Principle.

• As the name says, an ordered pair is simply a pair of 'things' arranged in a certain order.

• The two 'things' that make up an ordered pair are written in round brackets, and separated by a comma; like this:

• (Lasagne, Gateau)

PDM CSE 40

Page 41: DE book

Relations

• A relation is any association between elements of one set, called the domain or (less formally) the set of inputs, and another set, called the range or set of outputs.

• For example, if the domain is a set Fruits = {apples, oranges, bananas} and the  codomain is a set Flavors = {sweetness, tartness, bitterness}, the flavors of these fruits form a relation.

PDM CSE 41

Page 42: DE book

Definition

• A relation is a subset of ordered pairs drawn from the set of all possible ordered pairs (of elements of two other sets, which we normally refer to as the Cartesian product of those sets). Formally, R is a relation if

 

• R {(x, y) | x X, y Y}⊆ ∈ ∈• for the domain X and codomain Y.

PDM CSE 42

Page 43: DE book

Notations

• When we have the property that one value is related to another, we call this relation a binary relation and we write it as

• x R y

• where R is the relation.

PDM CSE 43

Page 44: DE book

Properties

Reflexive

• A relation is reflexive if, we observe that for all values a:

• a R a

Symmetric

• A relation is symmetric if, we observe that for all values a and b:

• a R b  implies  b R a

PDM CSE 44

Page 45: DE book

Contd..

Transitive

• A relation is transitive if for all values a, b, c:

• a R b  and  b R c  implies  a R c

• The relation greater-than ">" is transitive.

• If x > y, and y > z, then it is true that x > z. This becomes clearer when we write down what is happening into words. x is greater than y and y is greater than z. So x is greater than both y and z.

 

PDM CSE 45

Page 46: DE book

Contd..

Antisymmetric

• A relation is antisymmetric if we observe that for all values a and b:

• a R b  and  b R a  implies that  a=b

Trichotomy

• A relation satisfies trichotomy if we observe that for all values  a and  b it holds true that:

•  aRb  or  bRa

PDM CSE 46

Page 47: DE book

Equivalence Relations

• We have seen that certain common relations such as "=", and congruence obey some of these rules above.

Characteristics of equivalence relations

• For a relation R to be an equivalence relation, it must have the following properties, viz. R must be:

• symmetric

• transitive

PDM CSE 47

Page 48: DE book

Contd..

• reflexive

• (A helpful mnemonic, S-T-R)

• In the previous problem set you have shown equality, "=", to be reflexive, symmetric, and transitive. So "=" is an equivalence relation.

PDM CSE 48

Page 49: DE book

Partial Orders

• The partial order , as the name suggests, this relation gives some kind of ordering to numbers.

Characteristics of partial orders

• For a relation R to be a partial order, it must have the following three properties, viz R must be:

• reflexive

• antisymmetric

• transitive

• (A helpful mnemonic, R-A-T).We denote a partial order, in general, by x ≤ y.

PDM CSE 49

Page 50: DE book

Posets

• A partial order imparts some kind of "ordering" amongst elements of a set. For example, we only know that 2 ≥ 1 because of the partial ordering ≥.

• We call a set A, ordered under a general partial ordering ≤ , a partially ordered set, or simply just poset, and write it (A, ≤).

Terminology

• When we have a partial order ≤ , such that a  ≤  b, we write <  to say that a ≤ but a ≠ b. We say in this instance that a precedes b, or a is a predecessor of b. 

PDM CSE 50

Page 51: DE book

Posets

• If (A, ≤) is a poset, we say that a is an immediate predecessor of b (or a immediately precedes b) if there is no x in A such that a < x < b.

• If we have the same poset, and we also have a and b in A, then we say a and b are comparable if a ≤ b and b ≤ a. Otherwise they are incomparable.

PDM CSE 51

Page 52: DE book

Hasse Diagram

• Hasse diagrams are special diagrams that enable us to visualize the structure of a partial ordering.

• A Hasse diagram of the poset (A, ≤) is constructed by

• placing elements of A as points

• if a and b  A, and a is an immediate predecessor of b, we ∈draw a line from a to b

• if a < b, put the point for a lower than the point for b

• not drawing loops from a to a (this is assumed in a partial order because of reflexivity)

PDM CSE 52

Page 53: DE book

Operations on Relations

Inversion

• Let R be a relation, then its inversion, R-1 is defined by

• R-1 := {(a,b) | (b,a) in R}.

Concatenation

• Let R be a relation between the sets A and B, S be a relation between B and C. We can concatenate these relations by defining

• R • S := {(a,c) | (a,b) in R and (b,c) in S for some b out of B}

PDM CSE 53

Page 54: DE book

Operations contd..

Diagonal of a Set

• Let A be a set, then we define the diagonal (D) of A by

• D(A) := {(a,a) | a in A}

PDM CSE 54

Page 55: DE book

Functions

• A function is a relationship between two sets of numbers.

• This is as a mapping; a function maps a number in one set to a number in another set.

• Notice that a function maps values to one and only one value. Two values in one set could map to one value, but one value must never map to two values: that would be a relation, not a function.

 

PDM CSE 55

Page 56: DE book

Range –Image- Codomain

• If D is a set, we can say:

• which forms a new set, called the range of f.

• D is called the domain of f, and represents all values that f takes.

•  In general, the range of f is usually a subset of a larger set. This set is known as the co-domain of a function.

• For example, with the function f(x) = cos x,

• the range of f is [-1,1], but

•  the co-domain is the set of real numbers.

PDM CSE 56

Page 57: DE book

Compositions and Inverse Functions

• Given two functions f : A → B and g : B→ C

• we can define a new function g o f : A → C by (g o f)(x) = g(f(x)) for all x Є A.

• One useful function that can be defined for any set A is the identity function

• iA : A → A, defined by iA(x) = x for all x ЄA.

• We can use identity functions to define inverse functions. Specifically, if f : A → B is a bijection,

• then its inverse f-1: B → A is defined so that f−1 o f = iA and f o f−1 = iB.

PDM CSE 57

Page 58: DE book

Contd..

• Another result that is sometimes used is the following:

• If f : A → B and g : B→C are bijections

• then g o f : A→ C is a bijection,

• and (g o f)−1 = f−1 o g−1.

 

PDM CSE 58

Page 59: DE book

Mathematical Logic

• Perhaps the most distinguishing characteristic of mathematics is its reliance on logic.

• Familiarity with the concepts of logic is also a prerequisite to studying a number of central areas of computer science, including databases, compilers, a complexity theory.

 

PDM CSE 59

Page 60: DE book

Prepositions

• A proposition is a statement that is either true or false.

• For example, “It will rain tomorrow” and “It will not rain tomorrow” are propositions.

 

PDM CSE 60

Page 61: DE book

Compound Prepositions

• A complex preposition that can be split into number of simpler prepositions is called as compound prepositions.

• Example-”It was raining and I had to go to school,so I took my umbrella and went to school”

PDM CSE 61

Page 62: DE book

Tautology

• Whan all conclusions are true ,statement is called a tautology.

• Whatmayever be the premises but conclusion will always comes to be true.

• Tautology is calles as a truth statement.

PDM CSE 62

Page 63: DE book

Contradiction

• Exactly reverse of tautology is called contradiction.

• When all the conclusion comes out to be false ,the statement is called as a contradiction.

PDM CSE 63

Page 64: DE book

Contingency

• When the statement can be either true or false depending upon the situation and premises,it is called as a contingency.

PDM CSE 64