Transcript Document

Discrete Mathematics
CS 2610
February 10, 2009
Agenda
Previously

Functions
And now


Finish functions
Start Boolean algebras (Sec. 11.1)
2
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.
3
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).
4
Combining Real Functions
Given f :RR and g :RR then

(f  g): RR, is defined as
(f  g)(x) = f(x)  g(x)

(f · g): RR is defined as
(f · g)(x) = f(x) · g(x)
Example:
Let f :RR be f(x) = 2x and and g :RR be g(x) = x3
(f+g)(x) = x3+2x
(f · g)(x) = 2x4
5
Monotonic Real Functions
Let f: AB such that A,B  R
f is strictly increasing iff
 for all x, y  A x > y  f(x) > f(y)
f is strictly decreasing iff
 for all x, y  A, x > y  f(x) < f(y)
Example:
f: R+  R+, f(x) = x2 is strictly increasing
6
Increasing Functions are Injective
Theorem: A strictly increasing function is always
injective
Proof:
7
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
8
Example Ceiling and Floor Functions
Example:
-2.8 = -3
2.8 = 2
2.8 = 3
-2.8 = -2
9
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
10
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!
11
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.
12
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





O corresponds to False
1 corresponds to True
 corresponds logical operator AND
+ corresponds logical operator OR
- corresponds logical operator NOT
13
Boolean Algebra Tables
x x
0 1
1 0
x y
x + y xy
0 0
0
0
0 1
1
0
1 0
1
0
1 1
1
1
x,y are Boolean variables – they assume values 0 or 1
14
Boolean n-Tuples
Let B = {0, 1}, the set of Boolean values.
Let Bn = { (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 nZ+, any function f:Bn→B is called a
Boolean function of degree n.
15
Example Boolean Function
F(x,y,z) =B3B
x
y
z
0
0
0
0
0
0
1
0
0
1
0
0
0
1
1
0
1
0
0
1
1
0
1
1
1
1
0
0
1
1
1
1
F(x,y,z)=x(y+z)
B3 has 8 triplets
16
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.
17