Countable Sets

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 28

Discrete Structures

Feedback of Students

Application Speed (fast) Examples (should be added)

Applications

Artificial Intelligence

Predicate Logic Fuzzy Logic Genetic Algorithms Neural Network

Fuzzy Logic

How to handle linguistic variables?

Sally is tall It is very hot today

It use sets to keep the elements of the system Sets and Propositions Experts systems

Pascal Triangle

C(n,0) = C(n,n) = 1 C(n,k) = C(n-1,k-1) + C(n-1,k) 4 = 3 + 3 2 1 2

Pascal Triangle
0 0 1 0 2 0 3 0 4 0 5 0 5 1 4 1 5 2 3 1 4 2 5 3 2 1 3 2 4 3 5 4 1 1 2 2 3 3 4 4 5 5 1 1 5 1 4 10 3 6 10 3 4 5 1 1 1 1 2 1 1 1 1

Pascal Triangle

C(n,k)

K-element subset A of an n-set say n+


nA

Two cases of C(n,k)

A = B {n}, Where B is a (k-1)-subset of (n-1)+

n A

A is a k-subset of (n-1)+

Recurrence Equation

S(n,k) = S(n-1,k-1) + k . S(n-1,k) S(n,1) = S(n,n) = 1 S(5,4) = S(4,3) + 4* S(4,4)


S(5,4) = { S(3,2) + 3*S(2,2)} + 4*1 S(5,4) = {{S(2,1)+2*S(2,2)} + 3*1} + 4 S(5,4) = (1 + 2*1 + 3) + 4 S(5,4) = 6 + 4 S(5,4) = 10

Recurrence Equation
k n 1 2 3 4 5 1 1 15 1 7 25 1 3 6 10 1 1 1 1 1 1 2 3 4 5

Recurrence Relation

The Stirling numbers can be characterized in terms of the following recurrence relation: subject to the following initial conditions: there is only one way to partition n objects into 1 group (everything is in that group), and only one way to partition n objects into n groups (every object is a group all by itself).

Recurrence Relation

Proceeding recursively, a division of n objects a1, a2, ,an-1, an into k groups can be achieved by only one of two basic maneuvers:

We could partition the first n-1 objects into k groups, and then add object an into one of those groups. There are k * S(n-1,k). We could partition the first (n-1) objects into (k-1) groups and then add object an as a new, 1 element group. This gives an additional S(n-1,k-1) ways to create the desired partition

Countable Sets

A set is countable if there is a bijection from that set to N. An alternate way to define countable is: If there is a way to enumerate the elements of a set, then the set has the same cardinality as N and is called countable A set that is infinite and not countable is called uncountable.

Countable Sets

Example

C=Z
1 2 3 4 5 6 0 1 -1 2 -2 3 1 2 3 4 5 6

C = B*
0 0 1 00 01 10

Countable Sets

1st Principle of Countability

A subset of countable set is countable

2nd Principle of Countability

A set product of two countable sets is countable

3rd Principle Of Countability

The countable union of countable sets is countable

Algebra And Algorithms

An Algorithm is a specification of a mechanical or systematic procedure for carrying out a computation. An Algorithm is a finite set of precise instructions for performing a computation or for solving a problem

Algebra And Algorithms

Integers and Induction Recursion Algebras and proposition Algebraic Expressions Algebraic Structures Algebraic Flowchart Language Syntax and Semantics

Principle of Mathematical Induction


1.

2.

P(k) = is true For all n k; P(n) => P(n+1) Then the principle asserts that
P(n) is true for all n k.

1.

2.

The proposition is true for the smallest integer under consideration (in this case k) The assumption (inductive hypothesis) that the proposition is true for some integer n k implies that it is true for the next largest integer n + 1

Induction

Induction is like heridity: If Adam had big feet, and big feet are heriditary then every person (except possibly Eve) has/had big feet

Example

The sum of first n odd positive integers is n2 P(1) = 12 = 1 P(k) = 1 + 3 + 5 + + (2k-1) = k2 P(k+1) = 1 + 3 + 5 + + (2k-1) + (2k+1) = {1+3+5++(2k-1)} + (2k+1) = k2 + 2k + 1 = (k+1)2

Example

Now apply the principle to verify that

P(1) = 1(2) /2 = 2/2 = 1 P(n+1) = (n+1)((n+1)+1) /2 = (n+1)(n+2) / 2 = (n+1) + = (n+1) + n(n+1) /2 = (2n + 2 + n2 + n) / 2 = (n2 + 3n + 2) / 2 = (n+1)(n+2) / 2

Example

For all n 1 = n(n+1)(2n+1) / 6

P(k) = k(k+1)(2k+1)/6 P(n+1)= (n+1)(n+2)(2n+3)/6

Example
=(n+1)2 + = (n+1)2 + n(n+1)(2n+1)/6

= (n2+2n+1) + (n2+n)(2n+1)/6 = [6n2+12n+6) + (2n3+n2+2n2+n)]/6 = (2n3 + 9n2 +13n + 6)/6 = (n+1)((n+1)+1)(2(n+1)+1)/6

Division Algorithm

n divides m (n|m) if there exists an integer q such that m = q.n that is, if m is an integer multiple of n We can define the integer quotient m / n = tr (m.n) E.g. m = 22 and n = 5

m/n = tr(22/5) = tr(4.4) = 4 22 = q.5 => q = 5

Division Algorithm

Similarly, remainder can be defined as r = a b.q Division Algorithm

For any integers a, b Z+, there exist unique integers q and r such that a = b.q + r and 0 r < b

Division Algorithm

Example

Let a = 22, b = 5 q = a / b = tr(22/5) = tr(4.4) = 4 r = a b.q = 22 20 = 20 Then


a = b.q + r 22 = 5.4 + 2

and 0 2 < 5

Application of Division Algorithm

Greatest common divisor (gcd)


d = gcd(a,b)
1. 2.

d|a , d|b c|a, c|b => c|d a = b.q1 + r1 b = r 1 . q 2 + r2 r1 = r 2 . q 3 + r3 rk-2 = rk-1. qk + rk rk-1 = rk. qk+1 0 r1 <b 0 < r2 < r 1 0 < r3 < r 2 0 < rk < rk-1 0 = rk+1

Given a, b whose gcd is sought, we write

Division Algorithm

Every common divisor of a, b also divides remainder ri.

gcd(a,b) = gcd(b,r1) = gcd(r1,r2)==gcd(rk-1,rk) = rk

Division Algorithm

Example

Let a = 252 ; b = 180 q = a/b = tr(a/b) and 252 = 180*1 +72 180 = 72*2 + 36 72 = 36*2 + 0 So

r = a b.q (a = b.q1 + r1) (b = r1. q2 + r2) (r1 = r2. q3 ; r3 =0)

gcd(252,180) = gcd(180,72) = gcd(72,36) = 36

You might also like