9 Nov 25 A permutation matrix is an n by n matrix with a single in each row and column, elsewhere. If P is a permutation (bijection) on {,2,..,n} let A P be the permutation matrix with A ip(i) =, A ij = for j P(i) 9 Nov 25 CS 32 Let E uv be the n by n matrix with in the (u,v) position and elsewhere. * Note that E uv E rs = E us if v = r, and is the n by n zero matrix otherwise. Then A P = Σ i= n E ip(i) If Q = P - then you can check that A Q = (A P ) T, the transpose of A P. 9 Nov 25 CS 32 2 Note also that A P T A P = Σ i=n E P(i)i Σ t=n E tp(t) = Σ i=n Σ t=n E P(i)i E tp(t) = Σ t=n E P(t)P(t) = I n, the n by n identity matrix, by * Also, E ik A P = E ik Σ t=n E tp(t) = E ip(k). Right multiplying an m by n matrix B by A P permutes the columns of B, moving the k th column to the P(k) th column 9 Nov 25 CS 32 3 Likewise A PT E ik =Σ t=n E P(t)t E ik = E P(i)k so left multiplying an n by m matrix B by A PT will permute the rows, moving the i th row to the P(i) th place. If B is n by n then A PT B A P will be B with both rows and columns permuted by P: row i row P(i), column j column P(j) 9 Nov 25 CS 32 4 Isomorphisms of Graphs Suppose G and H are graphs, each with n vertices. If G has vertices g, g n and H has vertices h,,h n then a permutation P taking g i to h P(i) will give an isomorphism of graphs if A PT M G A P = M H, where M S is the adjacency matrix of graph S. 9 Nov 25 CS 32 5 Example The graphs G and H are clearly isomorphic, but can we tell that from their matrices? G 4 Map vertices of G to those of H by P() = 4, P(2) =, P(3) = 3, P(4) = 2. 2 3 9 Nov 25 CS 32 6 H 4 2 3
9 Nov 25 M G = M H = M G A P = = A P = A PT M G A P = = = M H 9 Nov 25 CS 32 7 9 Nov 25 CS 32 8 Isomorphisms of Graphs Note that if F is an isomorphism from a graph G of n vertices v v n to a graph H of n vertices w w n then F defines a permutation of {,,n} and the adjacency matrices of G and H will be related by a permutation matrix. Isomorphisms of Graphs But not every permutation of the vertices will produce a graph isomorphism. The permutations producing a graph isomorphism F have to map the edges appropriately because (v,u) is an edge iff (F(v), F(u)) is an edge. 9 Nov 25 CS 32 9 9 Nov 25 CS 32 Our Next Topic: Boolean Algebra Chapter 2 Boolean Algebra Boolean algebra provides the operations and the rules for working with the set {, }. These are the rules that underlie electronic circuits, and the methods we will discuss are fundamental to VLSI design. We are going to focus on three operations: Boolean complementation, Boolean sum, and Boolean product 9 Nov 25 CS 32 9 Nov 25 CS 32 2 2
9 Nov 25 Boolean Operations The complement is denoted by a bar (on the slides, we will use a minus sign). It is defined by - = and - =. The Boolean sum, denoted by + or by OR, has the following values: + =, + =, + =, + = The Boolean product, denoted by or by AND, has the following values: =, =, =, = Definition: Let B = {, }. The variable x is called a Boolean variable if it assumes values only from B. A function from B n, the set {(x, x 2,, x n ) x i B, i n}, to B is called a Boolean function of degree n. Boolean functions can be represented using expressions made up from the variables and Boolean operations. 9 Nov 25 CS 32 3 9 Nov 25 CS 32 4 The Boolean expressions in the variables x, x 2,, x n are defined recursively as follows:,, x, x 2,, x n are Boolean expressions. If E and E 2 are Boolean expressions, then (-E ), (E E 2 ), and (E + E 2 ) are Boolean expressions. Each Boolean expression represents a Boolean function. The values of this function are obtained by substituting and for the variables in the expression. For example, we can create Boolean expression in the variables x, y, and z using the building blocks,, x, y, and z, and the construction rules: Since x and y are Boolean expressions, so is xy. Since z is a Boolean expression, so is (-z). Since xy and (-z) are expressions, so is xy + (-z). and so on 9 Nov 25 CS 32 5 9 Nov 25 CS 32 6 Example: Give a Boolean expression for the Boolean function F(x, y) as defined by the following table: x y F(x, y) Possible solution: F(x, y) = (-x) y 9 Nov 25 CS 32 7 Another Example: Possible solution I: x y z F(x, y, z) F(x, y, z) = -(xz + y) Possible solution II: F(x, y, z) = (-(xz))(-y) 9 Nov 25 CS 32 8 3
9 Nov 25 There is a simple method for deriving a Boolean expression for a function that is defined by a table. This method is based on minterms. Definition: A literal is a Boolean variable or its complement. A minterm of the Boolean variables x, x 2,, x n is a Boolean product y y 2 y n, where y i = x i or y i = -x i. Hence, a minterm is a product of n literals, with one literal for each variable. 9 Nov 25 CS 32 9 Consider F(x,y,z) again: x y z F(x, y, z) F(x, y, z) = if and only if: x = y = z = or x = y =, z = or x =, y = z = Therefore, F(x, y, z) = (-x)(-y)(-z) + (-x)(-y)z + x(-y)(-z) 9 Nov 25 CS 32 2 Definition: The Boolean functions F and G of n variables are equal if and only if F(b, b 2,, b n ) = G(b, b 2,, b n ) whenever b, b 2,, b n belong to B. Two different Boolean expressions that represent the same function are called equivalent. For example, the Boolean expressions xy, xy +, and xy are equivalent. The complement of the Boolean function F is the function F, where F(b, b 2,, b n ) = -(F(b, b 2,, b n )). Let F and G be Boolean functions of degree n. The Boolean sum F+G and Boolean product FG are then defined by (F + G)(b, b 2,, b n ) = F(b, b 2,, b n ) + G(b, b 2,, b n ) (FG)(b, b 2,, b n ) = F(b, b 2,, b n ) G(b, b 2,, b n ) 9 Nov 25 CS 32 2 9 Nov 25 CS 32 22 Question: How many different Boolean functions of degree are there? Solution: There are four of them, F, F 2, F 3, and F 4 : Question: How many different Boolean functions of degree 2 are there? Solution: There are 6 of them, F, F 2,, F 6 : x F F 2 F 3 F 4 x y F F 2 F 3 F 4 F 5 F 6 F 7 F 8 F 9 F F F 2 F 3 F 4 F 5 F 6 9 Nov 25 CS 32 23 9 Nov 25 CS 32 24 4
9 Nov 25 Question: How many different Boolean functions of degree n are there? Solution: There are 2 n different n-tuples of s and s. A Boolean function is an assignment of or to each of these 2 n different n-tuples. Therefore, there are 2 2n different Boolean functions. Boolean Identities There are useful identities of Boolean expressions that can help us to transform an expression A into an equivalent expression B (see Table 5 on page 85 [6 th edition: page 753] in the textbook). 9 Nov 25 CS 32 25 9 Nov 25 CS 32 26 --x = x, law of double complement x+x = x,idempotent laws x x = x x+ = x, identity laws x = x x+ =, domination laws x = x+y = y+x, commutative laws x y = y x 9 Nov 25 CS 32 27 x+(y+z) = (x+y)+z, associative laws x (y z) = (x y) z x+yz = (x+y)(x+z), distributive laws x (y+z) = (x y)+(x z) -(xy) = -x + -y, De Morgan s laws -(x+y) = (-x)(-y) x+xy = x, Absorption laws x(x+y) = x x+-x =, unit property x(-x) =, zero property 9 Nov 25 CS 32 28 Duality We can derive additional identities with the help of the dual of a Boolean expression. The dual of a Boolean expression is obtained by interchanging Boolean sums and Boolean products and interchanging s and s. 9 Nov 25 CS 32 29 Duality Examples: The dual of x(y + z) is x + yz. The dual of -x + (-y + z) is (-x + )((-y)z). The dual is essentially the complement, but with any variable x replaced by -x. (exercise 29, p. 88) The dual of a Boolean function F represented by a Boolean expression is the function represented by the dual of this expression. This dual function, denoted by F d, does not depend on the particular Boolean expression used to represent F. (exercise 3, page 88 [6 th ed. p.756]) 9 Nov 25 CS 32 3 5
9 Nov 25 Duality Therefore, an identity between functions represented by Boolean expressions remains valid when the duals of both sides of the identity are taken. We can use this fact, called the duality principle, to derive new identities. For example, consider the absorption law x(x + y) = x. By taking the duals of both sides of this identity, we obtain the equation x + xy = x, which is also an identity (and also called an absorption law). Definition of a Boolean Algebra All the properties of Boolean functions and expressions that we have discovered also apply to other mathematical structures such as propositions and sets and the operations defined on them. If we can show that a particular structure is a Boolean algebra, then we know that all results established about Boolean algebras apply to this structure. For this purpose, we need an abstract definition of a Boolean algebra. 9 Nov 25 CS 32 3 9 Nov 25 CS 32 32 Definition of a Boolean Algebra Definition: A Boolean algebra is a set B with two binary operations and, elements and, and a unary operation such that the following properties hold for all x, y, and z in B: x = x and x = x (identity laws) x (-x) = and x (-x) = (domination laws) (x y) z = x (y z) and (x y) z = x (y z) and (associative laws) x y = y x and x y = y x (commutative laws) x (y z) = (x y) (x z) and x (y z) = (x y) (x z) (distributive laws) 9 Nov 25 CS 32 33 Boolean Algebras Examples of Boolean Algebras are:. The algebra of all subsets of a set U, with + =, =, - = complement, =, = U. 2. The algebra of propositions with symbols p, p 2,,p n, with + =, =, - =, = F, = T. 3. If B,, B n are Boolean Algebras, so is B.. B n, with operations defined coordinatewise. 9 Nov 25 CS 32 34 6