170 likes | 314 Views
Discrete Mathematics CS 2610. February 10, 2009. Agenda. Previously Functions And now Finish functions Start Boolean algebras (Sec. 11.1). But First. p q r, is NOT true when only one of p, q, or r is true. Why not? It is true for (p Λ ¬q Λ ¬r)
E N D
Discrete Mathematics CS 2610 February 10, 2009
Agenda • Previously • Functions • And now • Finish functions • Start Boolean algebras (Sec. 11.1)
But First • p q r, is NOT true when only one of p, q, or r is true. Why not? • It is true for (p Λ ¬q Λ ¬r) • It is true for (¬p Λ q Λ ¬r) • It is true for (¬p Λ ¬q Λ r) • So what’s wrong? Raise your hand when you know.
Injective Functions (one-to-one) • If function f : A B is 1-to-1 then every b B has 0 or 1 pre-image. • Proof (bwoc): Say f is 1-to-1 and b B has 2 or more pre-images. • Then a1, a2 st a1 A and a2 A, and a1 ≠ a2. • So f(a1) = b and f(a2) = b, meaning f(a1) = f(a2). • This contradicts the definition of an injection since when a1 ≠ a2 we know f(a1) ≠ f(a2).
Combining Real Functions • Given f :RR and g :RR then • (f g): RR, is defined as (f g)(x) = f(x) g(x) • (f · g): RR is defined as (f · g)(x) = f(x)· g(x) Example: Let f :RR bef(x) = 2x and and g :RR be g(x) = x3 (f+g)(x) = x3+2x (f · g)(x) = 2x4
Monotonic Real Functions • Let f: ABsuch thatA,B R f is strictlyincreasing iff • for all x, y A x > y f(x) > f(y) fis strictlydecreasingiff • for all x, y A, x > y f(x) < f(y) Example: f: R+ R+, f(x) = x2 is strictly increasing
Increasing Functions are Injective Theorem: A strictly increasing function is always injective Proof:
Floor and Ceiling Function Definition: The floor function .:R→Z, x is the largest integer which is less than or equal to x. • x reads the floor of x Definition: The ceiling function . :R→Z, x is the smallest integer which is greater than or equal to x. • x reads the ceiling of x
Example Ceiling and Floor Functions Example: -2.8 = 2.8 = 2.8 = -2.8 = -3 2 3 -2
Ceiling and Floor Properties Let n be an integer (1a) x = n if and only if n ≤ x < n+1 (1b) x = n if and only if n-1 < x ≤ n (1c) x = n if and only if x-1 < n ≤ x (1d) x = n if and only if x ≤ n < x+1 (2) x-1 < x ≤ x ≤ x < x+1 (3a) -x = - x (3b) -x = - x (4a) x+n = x+n (4b) x+n = x+n
Ceiling and Floor Functions Let n be an integer, prove x+n = x+n • Proof • Let k = x • Then k ≤ x < k+1 • So k+n ≤ x+n < k+1+n • I.e., k+n ≤ x+n < (k+n)+1 • Since both k and n are integers, k+n is an integer • Thus, x+n = k+n = x+n (by our choice of k) • This concludes the proof • This also concludes Chapter 2!
Boolean Algebras (Chapter 11) • Boolean algebra provides the operations and the rules for working with the set {0, 1}. • These are the rules that underlie electronic and optical circuits, and the methods we will discuss are fundamental to VLSI design.
Boolean Algebra • The minimal Boolean algebra is the algebra formed over the set of truth values {0, 1} by using the operations functions +, ·, - (sum, product, and complement). • The minimal Boolean algebra is equivalent to propositional logic where • Ocorresponds to False • 1 corresponds to True • corresponds logical operator AND • + corresponds logical operator OR • - corresponds logical operator NOT
x 0 0 1 1 y 0 1 0 1 x + y 0 1 1 1 x 0 1 x 1 0 xy 0 0 0 1 Boolean Algebra Tables x,y are Boolean variables – they assume values 0 or 1
Boolean n-Tuples • Let B = {0, 1}, the set of Boolean values. • LetBn = { (x1,x2,…xn) | xi B, i=1,..,n} . B1= { (x1) | x1 B,} B2= { (x1, x2), | xi B, i=1,2} Bn= { ((x1,x2,…xn) | xi B, i=1,..,n,} • For all nZ+, any function f:Bn→B is called a Boolean function of degree n.
Example Boolean Function F(x,y,z) =B3B z 0 1 0 1 0 1 0 1 x 0 0 0 0 1 1 1 1 y 0 0 1 1 0 0 1 1 F(x,y,z)=x(y+z) 0 0 0 0 1 B3 has 8 triplets 1 0 1
Number of Boolean Functions • How many different Boolean functions of degree 1 are there? • How many different Boolean functions of degree 2 are there? • How many different functions of degree n are there ? • There are 22ⁿ distinct Boolean functions of degree n.