Boolean Book
Boolean Book
Faculty of Science
Department of Mathematics
Introduction to
Mathematical
Logic and Boolean Algebra
By
Prof. Dr. Abdel-Mohsen Badawy
Dr. Tahany El-Sheikh
References
Page
Propositional Logic
Propositional Variables:
- Each proposition will be represented by a propositional variable.
- Propositional variables are usually represented as lower case letters,
such as p, q, r, s, …
- Each variable can take one of two values true or false.
Logical Connectives:
Not "
┐", and " ", or " ", if p is true, then ┐p is false. p q is
true only when both p and q are true. p q is true if at least one of them is
true. p q is true for all values except when p is true and f is false. If p is
false, p q doesn't guarantee any thing.
-1-
It is true, but not meaningful.
p q is true whenever p and q take the same value.
┐
All operations are right, associative, that is
p q r p (q r ) .
Definition 1:
An argument is a set of statements consisting of premises and a
conclusion. The premises are statements that give supporting evidence.
Definition 2:
A well-formed formula "wff" is a grammatically correct formula of
our language e., g.,
1- ( p q is read not p and q, that is p is false and q is true, while
┐
┐( p q ) is read not both p and q, that is at least one is false.
-2-
2- ( p ( q r ) ) : p and if q then r.
3- ( ( p q ) r ) : if p and q then r.
Example 1:
Translate into wffs:
Both not p and q : ( p q .
┐
Not both p and q :
┐( p q ) .
Both p and either q or r: ( p (q r ) ) .
If p, then q or r: ( p (q r )) .
If p then q or r: (( p q ) r ) .
If p then not both not q and not r: ( p ( q r )) .
┐┐ ┐
A truth table gives a logical diagram for a wff. It lists all possible
truth-value combinations for the letter and says whether the wff is true or
false in each case.
Unknown Evaluation:
We can sometimes figure out a formula's truth value if we don't know
the truth value of some letter. e. g., if p 1 and q is unknown, then we have
p q 1, q p 1,
if p 0 and q is unknown, then
p q 0, p q 1.
-3-
Example 2:
Assume that p 1, q 0 and r is unknown. Calculate the truth value
of each wff below:
( p r ),
┐ ( p r ), (r p ),
┐ (r
┐p ) , and ( q r )
1 r 1
( pr) (0 ?)
┐ 0 r 0
1 r 1
(p r) (1 ?)
0 r 0
(r
┐p ) ( r 0) 0
(q r ) ( 0 r ) 1 .
Definition 3:
The argument is said to be valid if there is no possible case has
premises all true and conclusion false that is
1
1
ــــ
0
The argument is said to be invalid if there is some possible case has premises
all true and conclusion false, that is
1
1
ــــ
0
To use the truth-table test on a propositional argument, construct a truth-table
showing the truth value of the premises and conclusion for all possible cases.
The argument is valid if no possible case has premises all true and conclusion
false.
-4-
Example 3:
Test the following argument
p q
p
┐ ـــــــــــــــــ
┐q
Here the premises are: p q and
┐p , the conclusion is ┐q . We construct
the truth table for the premises and conclusion.
p q p q ┐p ┐q
1 1 1 0 0
1 0 0 0 1
0 1 1 1 0
0 0 1 1 1
Line 3 gives the possibility of the case that all premises are true and the
conclusion false.
Thus the argument is invalid.
Examples 4:
1- p q
┐q
_____
┐p
p q p q ┐p ┐q
___ ___
1 1 0
___ ___
1 0 0
___ ___
0 1 0
0 0 1 1 1
-5-
Since we never get 1 1 0 , the argument is valid.
This argument is called Modus tollens.
2- p q
p
_____
q
p q p q p q
1 1 1 1 1
___ ___
1 0 0
___ ___
0 1 0
___ ___
0 0 0
3- (( p q ) r )
┐q
_____
r
┐
p q r pq (p q)r ┐q ┐r
___________ _____
1 1 1 1 0
___________ _____
1 1 0 1 0
1 0 1 0 1 1 0
_____
1 0 0 0 1 1
___________ _____
0 1 1 0 0
___________ _____
0 1 0 0 0
____ _____
0 0 1 0
____ _____
0 0 0 0
-6-
The third line gives 1 1 0 , so the argument is invalid.
The truth-assignment test:
In this test we follow the procedure:
Set each premise to 1 and conclusion to 0. Figure out the truth value of as
many letter as possible. The argument is valid iff no possible way to assign 1
and 0 to the letters will keep the premises all 1 and conclusion 0.
Example 5:
Using the truth-assignment test the following argument:
pq
┐p
_____
q
p q 1
┐p 1
q 0
p q 1
┐p 1
q 1
p q 1
┐p 1
q 0
The argument is valid since premise p q can't be true. So, we can't have
true premises and a false conclusion.
-7-
Example 6:
┐( p q )
p
________
q
┐
┐( p q ) 1
p 1
┐q 0
┐( p q ) 1
p 1
┐q 0
The argument is valid since we can't have 1 1 0.
Example 7:
Test the validity of the following argument:
- Some things are caused.
- Anything caused is caused by another.
- If some things are caused and anything caused is caused by another,
then either there's a first cause or there's an infinite series of past
causes. There is no infinite series of past causes.
Suppose that: p denotes: some things are caused, q denote any thing
caused is caused by another, r denotes there is a first cause, and s denotes
there's an infinite series of past causes. Thus we have the following:
-8-
p
q
( p q ) (r s )
s
┐
_____________________________________
r
p 1
q 1
( p q) ( r s ) 1 ( p q) ( r s ) 1
┐s 1
r 0
There is no 1 1 1 1 0.
Thus the argument is valid.
A quantifier is a sequence of the form " x " or " x " , where any
variable may replace " x " .
" x " is called a universal quantifier. It claims that the formula that follows
is true for all values of x.
Example 8:
Let p ( x ) denotes the formula x is a prime number. Then
( x ) p ( x ) means for all x, x is a prime or all are rime.
Example 9:
Let p ( x ) as in the previous example, then ( x ) p ( x ) means: for
some x, x is a prime, or some are prime.
Notice that
┐( x ) p ( x ) means not all are prime, or it is not the case
-9-
that, for all x, x is prime. While
┐( x ) p ( x ) means no one is prime or it is
not the case that, for some x, x is prime.
Example 10:
Let p ( x ) be as before, and q ( x ) means x is an odd number, then:
All are odd or prime ( x ) (q ( x ) p ( x ) ) .
( x )
Not every one is non-prime
┐ ┐p ( x ) .
Some aren't odd ( x ) q (x ) .
┐
( x )(q ( x )
No one is odd and non is prime
┐ ┐p ( x ) ) .
Either every number is odd or x is prime ( ( x ) q ( x ) p ( x ) ) .
Example 11:
Let p ( x ) denotes x is Egyptian, r ( x ) denotes x is rich, and s ( x )
denotes s is sad, then
- All Egyptians are rich ( x )( p (x ) r ( x )) .
- No Egyptians are rich ( x ) ( p (x ) r (x )).
┐
- All sad Egyptians are rich ( x )((s ( x ) p ( x )) r ( x )) .
- 10 -
which means: for all x, if x is sad and Egyptian x is rich.
- Not all Egyptians are rich ( x )( p ( x ) r ( x )) .
┐
It is not the case that, for all x is Egyptian, then x is rich.
- All are sad Egyptian ( x ) (s ( x ) p ( x ) ) ,
for all x, x is sad and Egyptian.
Example 12:
Translate the sentence: All dogs hate cats into a wff.
This sentence can be written as: All dogs are cat-haters, so the wff is
( x ) (d ( x ) c ( x ) ) .
Inference rules for quantifiers:
1-
┐( x ) p ( x ) ( x ) ┐p ( x ) .
2-
┐( x ) p ( x ) ( x ) ┐p ( x ) .
Notice that we can use these rules only if we have a wff that begins with
" " and then a quantifier; the rule moves the quantifier to the beginning
┐
of the formula, so we can later drop it.
3- Drop-existential rule (DE):
( x ) p ( x ) p (a ) (use a new constant).
Definition 4:
An instance of a variable occurs "freely" if it doesn't occur as part of a
wff that begins with a quantifier using that variables. e. g.,
p ( x ) ( x )q ( x ) ,
the first instance of " x " occur freely. So, we'd go from:
( x )( p (x ) ( x ) q (x )) to ( p ( a ) ( x )q ( x ) ) ,
( x )( p (x ) q ( x )) to ( p (a ) q ( x ) ) .
4- Drop universal rule (DU): ( x ) p ( x ) p ( a ) (use any constant).
- 11 -
Notice that we must replace the variable with the same constant
throughout.
( x )( p (x ) q ( x )) ( p (a ) q (a ) ) .
( x )( p (x ) q (x )) ( p ( a ) q (b ) ) .
Example 13:
Translate into logic and prove to be valid.
1- All logicians are funny.
2- Someone is a logician.
someone is funny.
p ( x ), x is logician, q ( x ), x is funny:
1- ( x ) ( p ( x ) q ( x ) ) .
2- ( x ) p ( x ) .
( x )q ( x )
3- Assume ( x ) q ( x ) .
┐
4- ( x ) q ( x ) rule.
┐
5- p ( a ) from 2 (DE).
6- p ( a ) q ( a ) from 1.
7- q ( a ) 5, 6.
8-
┐q ( a ) .
9- ( x ) q ( x ) (from 3; 7 contradicts 8).
Example 14:
1- ( x ) ( p ( x ) q ( x ) ) .
( x ) p (x ) .
2- Assume that
┐( x ) p ( x ) .
3- ( x )
┐p ( x ) .
- 12 -
4-
┐p ( a ) .
5- p ( a ) q ( a ) from 1.
6- p ( a ) from 5.
7- ( x ) p ( x ) (from 2, 4 contradicts 6).
Example 15:
1-
┐( x ) p ( x ) .
( x ) ( p (x ) q (x )) .
┐
2- Assume that
┐ ( x ) ┐( p ( x ) q ( x ) ) .
3- ( x ) ( p ( x ) q ( x ) ) .
4- ( x )
┐p ( x ) from 1.
5- p ( a ) q ( a ) from 3.
6-
┐p ( a ) 4, 5.
7- p ( a ) 5.
8- ( x ) p ( ( x ) q ( x ) from 2, 6 contradicts 7.
┐
Example 16:
1- ( x ) ( p ( x ) q ( x ) ) .
2- ( x ) p ( x ) .
( x )q ( x ) .
3- Assume
┐( x )q ( x ) .
4- ( x ) q ( x ) .
┐
5-
┐q ( a ) .
6- p ( a ) q ( a ) .
7-
┐p ( a ) .
8- p ( a ) .
- 13 -
9- ( x ) q ( x ) from 3, 7 contradicts 8.
Example 17:
1- ( x )( p (x ) q ( x )) .
2- ( x )( p ( x ) r (x )) .
┐
( x ) ( q ( x ) r ( x )) .
3- Assume
┐( x ) ( q ( x ) r ( x ) ) .
4- ( x ) (q ( x ) r ( x ) ) .
┐
5- ( x )( q ( x ) r ( x )) .
┐ ┐
6-
┐q ( a ) ┐r ( a ) .
7-
┐q ( a ) .
8-
┐r ( a ) .
9- p (a ) q (a ) .
10-
┐p ( a ) .
11-
┐p ( a ) r ( a ) .
12-
┐ ( ┐p ( a ) ) 8, 11.
13- p ( a ) .
14- ( x ) ( q ( x ) r ( x ) ) from 3, 10 contradicts 13.
Remark 1:
Here, there are some rules for translation from English sentences into
wffs:
1- To translate "any", first rephrase the sentence so it means the same
thing but doesn't use "any"
"Not any …" = "No …"
"If any …" = "If some …"
"Any …" = "All …"/
- 14 -
e. g., Not anyone is poor = No one is poor =
┐( x ) p ( x ) .
If any one is evil, it will rain = If someone is evil, it will rain
( ( x ) p ( x ) R ), p ( x ) denote x is evil, and R is the
statement: it will rain.
2- A second rule to translate any is to put a ( x ) at the beginning of
the wff, regardless of where the "any" occurs in the sentence. This
rule usually gives a different formula, but an equivalent one.
So, for the sentence:
1- Not any one is poor ( x ) p ( x ) = for all x, x isn't poor.
┐
2- If any one is evil, it will rain ( x ) ( p ( x ) R ) = for all x if x is
evil it will rain.
Example 18:
Translate into logic and test for validity:
If some are enslaved, the all have their freedom threatened.
If this person is enslaved, then I have my freedom threatened.
The first sentence is of the type if-then, which is translated into
( ( x ) p ( x ) ( x )q ( x ) ) ,
while for the second we have:
( p ( a ) q (b ) )
1- ( ( x ) p ( x ) ( x ) q ( x ) ) .
( p ( a ) q (b ) ) .
2- Assume
┐( p ( a ) q (b ) ) .
3- p ( a ) from 2.
- 15 -
4- q ( b ) from 2.
┐
5- Assume ( x ) p ( x ) .
┐
6- ( x ) p ( x ) .
┐
7-
┐p ( a ) .
8- ( x ) p ( x ) (from 5; 3, contradicts 7).
9- ( x ) q ( x ) from 1 and 8.
10- q ( b ) .
11- ( p ( a ) q ( b ) ) from 2; 4 contradicts 10).
Example 19:
1- Every one is male or female.
Either everyone is male or everyone is female.
Everyone is male or female is translated as:
( x )( p (x ) q ( x )) ,
p ( x ) denotes x is male, q ( x ) denotes x is female.
Either everyone is male or everyone is female is translated as:
( ( x ) p ( x ) ( x )q ( x ) )
1- ( x ) ( p ( x ) q ( x ) )
(( x ) p (x ) (( x q (x )) .
2- Assume
┐( ( x ) p ( x ) ( ( x q ( x ) ) .
3-
┐( x ) p ( x ) .
4-
┐( x ) q ( x ) .
5- ( x ) p ( x ) .
┐
6- ( x ) q ( x ) .
┐
7-
┐ p (a ) .
8-
┐q ( b ) .
- 16 -
9- ( p ( a ) q ( a ) ) .
10- ( p ( b ) q ( b ) ) .
11- q ( a ) from 7, 9/
12- q ( b ) from 8, 10.
So, it is invalid, for there is a as a female ( q ( a ) ) and b is not
Example 20:
Someone other than Ahmed is hungry which can be restated as:
someone besides Ahmed is hungry
Someone who isn't Ahmed is hungry
= For some x, x Ahmed and x is hungry
( x ) ( x r p ( x ) ), p ( x ) denotes x is hungry.
┐
Example 21:
At least two are hungry
For some x and y : x y , x is hungry, and y is hungry
( x )( y )( x y ( p ( x ) p ( y )) .
┐
Example 22:
Ahmed alone is hungry
= Ahmed is hungry and no one besides Ahmed is hungry
( p (a )
┐( x ) ( ┐ x a p ( x ) ) .
Examples 23:
For the identity proofs:
- 17 -
a- 1- p ( a )
2-
┐ p (b )
┐a b
3- Assume a b .
4- p ( b ) from 1, 3.
5-
┐a b from 3; 2 contradicts 4.
b- 1- ( x ) ( y ) x y .
┐
┐( x ) ( y ) y x .
2- Assume ( x ) ( y ) y x .
3- ( y ) a y from 1.
┐
4-
┐a b from 3.
5- ( y ) y c from 2.
6- b c from 5.
7- a c from 5.
8- a b from 6, 7.
9-
┐ ( x ) ( y ) y x from 2; 4 contradicts 8.
- 18 -
Chapter 2
First-Order Languages
I- Logical Symbols:
0- Parentheses: ( , ).
1- Sentential connective symbols: ,
┐.
2- Variables (one for each positive integer n).
3- Equality symbol (optimal): = .
II- Parameters:
0- Quantifier symbol: .
1- Predicate symbols: For each positive integer n, some set (possibly
empty) of symbols, called n-place predicate symbols.
2- Constant symbol: some set (possibly empty) of symbol)
3- Function symbols: For each positive integer n, some set (possible
empty) of symbols, called n place function symbols.
Examples 1:
1- For the language of set theory we have:
The equality symbol, predicate parameters in which one-two-place
predicate symbol is used, and a constant symbol .
2- For the language of elementary number theory we have:
- 19 -
Equality, two-place predicate symbol <, the constant symbol 0, one-
place function symbol S for successor, and two-place function
symbols: , , and E for addition, multiplication and exponentiation
respectively.
Example 2:
Translate into logic:
1- "There is no set of which every set is a member".
┐( a ) ( x ) ( x a ) .
2- "For any two sets, there is a set whose members are exactly the two
given sets".
( x ) ( y ) ( z ) ( t ) (t z t x t y ) .
3- "Any nonzero natural number is the successor of some number".
( x ) ( ( x 0) ( y ) x s y ) .
┐
Definition 1:
A term is either a variable, a constant, or a function applied to
arguments that are terms.
e. g., x, y, z, a (as a constant), f ( x , a ) , and g ( y ) are terms,
Definition 3:
A structure U for a given first-order language is a function whose
domain is the set of parameters and such that the function assigns.
- 20 -
1- to the symbol a nonempty set called the universe,
2- to each n-place predicate symbol p an n-ary relation, that is a set of n-
types of members of the universe,
3- to each constant symbol c a member of the universe,
4- to each n-place function symbol f an n-ary operations defined the
universe.
That is to say the function assigns meaning to the parameters.
Example 3:
Consider the language for set theory with a parameter is (two-place
predicate symbol).
- 21 -
The structure U is said to satisfy with S, written as: ╞U [ s ] if and only if
╞ u ( )[ s ] if either ╞ [ s ] or ╞U [s ] or both.
s ( y ) if y x
s (x | d )( y )
d if y x.
Example 4:
Assume that our language has the parameters , p (a two-place
predicate symbol), f ( a one-place function symbol), and a constant symbol.
U is the structure defined as follow:
| U | N , the set of all natural numbers,
cU 0 ,
or more breifly we can write
U ( N ; , s , 0) .
Let s : V N , s (v i ) i 1 ; that is s (v 1 ) 0, s (v 2 ) 1, ... . For the
- 22 -
S (S ( 2 ) 4 .
U U
(ii) s ( f v1 ) f ( s (v 1 ) ) f ( s (v 1 ) )
U
f ( 0 ) S ( 0 ) 1.
╞ p c f v 1 [ s ] means: ( s ( c ), s ( f v 1 ) ) p U
U
( 0, f ( s (v 1 ) ) ) p U ( 0, f U
( 0 ) ) p U ( 0, 1) pU
0 1 which is true.
(v) ╞ U p cv 1 [ s (v 1 | n ) ] .
Here, we replace v 1 by n, so
p c v 1 [ s (v 1 ) n ] ( s ( c ), n ) pU
( 0, n ) pU
i. e., 0 n , which is true, hence
╞ U p cv 1 [ s (v 1 | n ) ]
(vi) ╞ U v 1 pv 2 v 1 [ s ] .
╞U [ s ( x | m ) ])
- 23 -
pv 2 v 1 [ s (v 1 | m )] implies ( s (v 2 ), m ) pU (1, m ) pU which
╞ v 1 pv 2 v 1 [ s ] .
Theorem 1:
Assume that s1 and s 2 are functions from V into | u | which agree at
╞U [ s ] iff ╞ B [s ].
Corollary 1:
For a sentence , either:
1- U satisfies with every function S from V into | U | , and in this case
we say that is true in U, and written as ╞ U , or that U is a model of
, or
2- U does not satisfy with any such function, hen is false in U.
member of .
Example 5:
Let U be the real field, ( R ; 0, 1, , ) , and B is the rational field,
(Q ; 0, 1, , ) ,
The sentence ( x ) ( x , x 1 1) , translated as: there exists an element x in
- 24 -
the universe such that x 2 2 , equivalently there exists x such that x 2 ,
is true in U an false in B.
Example 6: Suppose that our given language has only the parameters and
p, where p is a two-place predict symbol. Then a structure U is determined by
U ( | U |; p U ) .
( x , y ) pU , x .
Thus ( A ; R ) is a model iff the domain of R is A.
- 25 -
or R 2 {( a, a ) , ( b , a ), ( c , a )} .
Notice that:
1- ╞ U ( )[ s ] iff ╞U [ s ] and ╞U [ s ] .
2- ╞ U ( )[ s ] iff ╞U [ s ] or ╞U [ s ] .
3- ╞ U ( )[ s ] iff ╞U [ s ] iff ╞U [ s ] .
that ╞ U [ s ( x | d ) ] .
Definition 4:
Let be a set of wffs, a wff. Then logically implies , written
╞ , iff for every structure U for the language and every function
S :V | U | such that U satisfies member of with S, U also satisfies with
S.
If { } , then we will write " ╞ " instead of { } ╞ .
Definition 5:
We say that and are logically equivalent ( ╞ ╡ ) iff ╞
and ╞ .
Definition 6:
A wff is valid iff ╞ (written simply ╞ ) , that is is valid iff
for every U and every s : V | U |, U satisfies with s.
Corollary 2:
For a set ; of sentences, ╞ iff every model of is also a
- 26 -
Chapter 3
Boolean Algebra
Definition 1:
A Boolean algebra consists of a class of elements B with two binary
operations " " and " " satisfying:
1- ( a, b B ) ( a b b a and a b b a ) , that is the two
operations are commutative.
a (b c ) a b a c ,
2- ( a, b , c B ) that is the two operations
a (b c ) ( a c ) ,
are distributive over each other/
3- 0 B and 1 B (two fixed elements) such that 0 a a 0 a ,
and 1 a a 1 a a B . The element 0 is always called the zero
element, it is the identity of ( B ; ) . The element 1 is the identity of
(B , ) .
(Note that 0 1 ).
4- For each element a B , there is an element a B (called the
complement of a) such that a a 1 and a a 0 .
Example 1:
Let B {0, 1} with the two operations and defined as in the
following tables
- 27 -
0 1 0 1
0 0 1 0 0 0
1 1 0 1 0 1
Example 2:
Let B { a, b , c , c , d } with the two operations and define as
a b c d a b c d
a a b c d a a a a a
b b b d d b a b a b
c c d c d c a a c c
d d d d d d a b c d
Here a is the identity of " " and d is the identity of " " .
Since a d d and a d a ,, then the complement of a is d and vice versa.
Now b c d and b c a , so c ( b ) is the complement of b ( c ) .
You can check for the validity of the commutative and distributive laws.
Hence ( B ; , ) is a Boolean algebra.
Example 3:
The structure ( Z ; , ) , the set of all integers with ordinary addition
and multiplication is not a Boolean algebra, for
2 ( 3 5) 2 15 17 ,
while
( 2 3) ( 2 5) 5 7 35 .
- 28 -
Example 4:
Let x be any non-empty set, and B ( X ) , the power set of X; that
is the set of all subsets of X
(X ) { A | A X }.
( ( X ); , , ' ) is a Boolean algebra, for A , B , C ( X ) implies
A X , B X and C X .
A B X A B (X ) ,
A B X A B (X ) ,
B is closed under and .
Since
A ( B C ) ( A B ) ( A C ) ,
and
A ( B C ) ( A B ) ( A C ) ,
then the distributive laws hold.
Since X and X X , then , X ( X ) , and A A , X A A ,
A (X ).
If A ( X ) , then A X and X \ A X . Let X | A A . From the
properties of set theory we have A A X and A A , thus A is the
complement of A.
Example 5:
Consider the set of all divisors of the integer number 30, B {1, 2, 3,
5, 10, 15, 30} . Define the two binary operations " " and " " as:
( a b ) [ a, b ] ,
the least common multiple of a and b,
( a b ) ( a, b )
the greatest common divisor of a and b.
- 29 -
Now we can construct the tables for " " and " " as follows:
1 2 3 5 6 10 15 30
1 1 2 3 5 6 10 15 30
2 2 2 6 10 6 10 30 30
3 3 6 3 15 6 30 15 30
5 5 10 15 5 30 10 15 30
6 6 6 6 30 6 30 30 30
10 10 10 30 10 30 10 30 30
15 15 30 15 15 30 30 15 30
30 30 30 30 30 30 30 30 30
1 2 3 5 6 10 15 30
1 1 1 1 1 1 1 1 1
2 1 2 1 1 2 2 1 2
3 1 1 3 1 3 1 3 3
5 1 1 1 5 1 5 5 5
6 1 2 3 1 6 2 3 6
10 1 2 1 5 2 10 5 10
15 1 1 3 5 3 5 15 15
30 1 2 3 5 6 10 15 30
We see that the set B is closed under the two operations, and B is
commutative w. r. t. " " and " " . For the distributive law, we can take for
example the three elements 3, 5, and 6.
Now,
[ ( 3, 5), 6] [1, 6] 6 (1)
([3, 6], [5, 6]) ( 6, 30 ) 6 (2)
Thus
[ ( 3, 5), 6] ([3, 6 ], [5, 6]) .
- 30 -
The integer 1 plays the role of the identity element for the operation " " (l.
c. m.). The integer 30 plays the role of the identity element for the operation
" " (g. c. d.). The elements 15, 10, 6, and 30 are the complements of 2, 3, 5,
and 1 respectively.
Notice that it is not the general case in which the set of all divisors of
a certain integer with the two operations defined above forms a Boolean
algebra. For example let
S {1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 20, 24, 30, 40, 60, 120} ,
the set of all divisors of the integer 120.
| S | 16 42 ,
Exercise:
Show that the set
B {1, 2, 3, 5, 6, 7, 10, 14, 15, 21, 30, 35, 42, 70, 105, 210} ,
with the two binary operations defined as above forms a Boolean algebra.
- 31 -
According to the symmetry of the axioms, the principle of duality can be
applied to obtain a statement or algebraic expression from the other just by
interchanging ( ) and ( ) and the identity elements 0 and 1.
Theorem 1:
Let B be a Boolean algebra, a, b; and c are three elements in B, then
1- a a a , and aa a,
2- a 1 1 , and a0 0,
3- a ab a , a (a b ) a ,
4- a ( b c ) ( a b ) c , a ( b c ) ( ab ) c .
Proof:
1- a a 0 , since 0 is the identity
a a a a , a is the complement of a
( a a ) ( a a ) , using the axiom of distribution
( a a )1
a a a
we can deduce the validity of the expression a a a , using the
principle of duality.
2- 0 a a a is the complement of a
a ( a 0) 0 is the additive identity
a a a 0 by distribution axiom
a 0
0a 0
interchange 0 with 1, and ( ) with ( ) , we have:
1 a 1.
- 32 -
3- a 1 a
(1 b ) a
1a b a
a b a
a ab .
Also,
a 0a
(0 b ) a
( 0 a ) (b a )
a (a b ) .
4- We prove the statement using more than one step.
a a (b c ) a
a (a c )
( a ab ) ( a c )
( a ab ) a ( a ab ) c
a ac ( ab ) c
a ( ab ) c …………………………………… (1)
a a ( b c ) ( a a ) ( a b c )
1( a b c )
a b c
( a b ) ( a c )
[ ( a a ) ( a b ) ]( a c )
( a ab ) ( a c )
a ( a c ) ( ab ) ( a c )
a ( ab ) c …………………………………… (2)
If we multiply the two equations (1) and (2), we obtain:
- 33 -
[ a a ( b c ) ][ a a ( b c ) ] [ a ( ab ) c ][ a ( ab ) c ]
[ a ( ab ) c ][ a a ( b c ) ] [ a ( b c ) a ][ a ( bc ) a ]
a ( b c ) a a
a (b c ) 0 a (b c )
[ a ( ab ) c ][ a ( ab ) c ] [ ( ab ) c a ][ ( ab ) c a ]
( ab ) c a a
( ab ) c 0 ( ab ) c .
From which we have a ( b c ) ( ab ) c .
Theorem 2:
The complement element a of the element is unique.
Proof:
Suppose that there are two complements x and y, hence a x 1 ,
a x 0 ; and a y 1, a y 0 .
x 1 x
(a y ) x
(a x y x )
0 y x
yx
x y 0
x y a y
(x a) y
1 y y .
It is easy to see that: ( a ) a , 0 1 and 1 0 .
Theorem 3:
For every a and b in a Boolean algebra B,
- 34 -
( ab ) a b and ( a b ) a b .
Proof:
To show that a b is the complement of ( ab ) , we must be prove
that ( ab ) ( a b ) 0 , and ( ab ) ( a b ) 1
( ab ) ( a b ) ( ab ) a ( ab ) b ( ba ) a ( ab ) b
b ( a a ) a ( b b ) 0 0 0
( ab ) ( a b ) ( ab a ) b
( a a ) ( b a ) b 1( b a ) b
b a b a ( b b ) a 1 1 .
Since the complement is unique, we have
( ab ) a b .
Also, by applying the principle of duality we have:
( a b ) a b .
Example 6:
Prove that if a, b, and c are elements in a Boolean algebra B for which
both conditions ab ac and a b a c hold, then it follows that b c .
b b ab
b ac
(b a ) ( b c )
( a c ) (b c )
c ab ac c ab
c ac c .
Notice that the cancellation law holds for the two operations simultaneously.
e. g., in the Boolean algebra ( ( X ), , ) , where X { x , y , z } .
Let a { x }, b { y , z }, c { y } , ab a b a c ac but b c .
- 35 -
a b a b { x , y , z } { x , y } a c ab .
Example 7:
a a b a b , a, b B
a a b ( a a ) ( a b )
1( a b ) a b .
Example 8:
Prove that if a x b x and a x b x , then a b .
( a x ) ( a x ) (b x ) (b x )
a ( a x ) x ( a x ) b (b x ) x ( b x )
a a x b b x a b .
Example 9:
Prove that any a, b and c in a Boolean algebra, the following four
expressions are equal:
1- ( a b ) ( a c ) ( b c ) , 2- ac a b b c ,
3- ( a b ) ( a c ) , 4- ac a b .
(1) (2)
( a b ) ( a c ) ( b c ) [ ( a b ) ( a c ) ]b [ ( a b ) ( a c ) c ]
( a b ) b ( a c ) ( a b ) ( a c ) c
b ( a c ) c ( a b )
a b b c ac b c
ac a b b c .
(2) (3)
ac a b b c ( a b ) c ab a a
( a b )c a ( a b )
( a b ) ( a c ) .
- 36 -
(3) (4)
( a b ) ( a c ) a a ac ab b c
ac a b b c
c ( a b ) a b c ( a a ) ( a b ) a b
c ( a a b ) a b
c a c ( a b ) a b
ac a b .
(4) (1)
ac a b ( ac a ) ( ac b )
( ( a a ) ( a c ) ) ( ( a b ) ( c b ) )
( a b ) ( a c ) (b c ) .
Definition 2:
A non-empty set P with a binary relation is said to be a partially
ordered set iff:
1- is reflexive, that is a a a A ,
2- is antisymmetric, that is if a b and b a , then a b ,
a, b A .
3- is transitive, that is if a b , and b c , then a c , a , b , c P .
Examples 10:
1- The set of all ve integers with a relation: a divides b or a is a
multiple of b.
2- Any non-empty set with a relation "is a subset of" is a partially
ordered set.
Definition 3:
Let B be a Boolean algebra. The order relation a b is defined by the
- 37 -
statement:
for every a and b in a Boolean algebra B, a b if and only if ab 0 .
Theorem 4:
( B ; ) is a partial ordered set.
Proof:
1- Since for any a B , a a 0 , then a a .
2- Let a b and b a . Then ab 0 and b a 0
a a 1 a ( b b ) ab ab
ab 0 ab (i)
b 1 b ( a a ) b
ab a b ab 0
ab (ii)
from (i) and (ii), we have a b .
3- Let a b and b , then ab 0 , and b c 0
ac a ( b b ) c
ab c ab c a ( b c ) ( ab ) c
00 0
a c .
Theorem 5:
Let be a Boolean algebra, is the order relation on B. Then we have,
1- If x y and x z , then x y z ,
2- If x y , then x y z from any z,
3- x y if and only if y x .
We prove (3).
- 38 -
Let x y , then x y 0 0 x y ( x ) y y ( x ) .
From this we have that y x . Conversely, if y x , then applying the
preceding statement, ( x ) ( y ) that is x y .
Example 11:
Prove that if a, b, and c are elements of a Boolean algebra B satisfying
the relation a b , then a b c b ( a c ) for every element c in B.
a b , then ab 0
b b 0 b ab ( b a ) ( b b ) b a (i)
a b c (a b )(a c )
b (a c ) , from (i).
Definition 4:
A Boolean function is any expression which represents the
combination of finite set of symbols, each representing a constant or a
variable, by the operations of ( ), ( ' ) , or ( ) .
Definition 5:
A Boolean function is said to be in disjunctive normal form (DNF) in
n variables x 1 , x 2 , ..., x n , for n 0 , if the function is a sum of terms of the
- 39 -
type f 1 ( x 1 ) f 2 ( x 2 ) ... f n ( x n ) where f i ( x i ) is x i or x i for each
i 1, 2, ..., n , and no two terms are identical. 0 and 1 are said to be in DNF
in n variables for any n 0 .
Theorem 6:
Every function in a Boolean algebra which contains no constants is
equal to a function in disjunctive normal form.
Example 12:
Express each of the following in DNE in the smallest possible number
of variables:
1- x y z ( x y ) ( x z )
x y x x x y y z
x y z x y z x y z .
2- ( x y x y z x y z x y z 't t )
( x y ) ( x y z ) ( x y z ) ( x y z t )t
x ( x y z ) ( x y z ) ( x y z t )t
y ( x y z ) ( x y z ) ( x y z t )t
x ( x y z ) ( x y z )t y ( x y z ) ( x y z t )t
x ( x ( y z ) ( y z ) )t y ( y ( x z ) ( x z t ) )t
x y z t x y z t x y z t x y z t
x y z t x y z t x y z t .
Example 13:
Write the following in DNF in the three variables x, y and z
x y
x y x ( y y ) ( z z ) y ( x x )( z z )
x y z x y z x y z x y z x y z x y z x y z
- 40 -
x y z
x y z x y z x y z x y z x y z x y z .
Definition 6:
The DNF in n variables which contains 2n terms is called the
complete disjunctive normal form in n variables. e. g.,
x y x yx y x y,
is a complete DNF in two variables and
x y z x y z x y z x y z x y z x y z x y z x y z
is a complete DNF in three variables.
Theorem 7:
If each of n variables is assigned the value 0 or 1 in an arbitrary, but
fixed, manner, then exactly one term of the complete DNF in the n variables
will have the value 1 and all other terms will have the value 0.
Corollary 1:
Two functions are equal if and only if their respective DNF contain
the same terms.
Example 14:
Write out the terms of the complete disjunctive normal form in x, y,
and z. Determine which term equal if
(i) x 1 and y z 0 , (ii) x y 1 and z 0 .
The complete DNF in x, y, and z is
x y z x y z x y z x y z x y z x y z x y z x y z .
(i) If x 1 and y z 0 , then the term x y z 1 and all the others
are zero.
(ii) If x y 1 and z 0 , then the term x y z 1 .
- 41 -
Example 15:
Write out all 16 possible functions of two variables x and y.
The functions are:
0
constant functions
1
x
y
x
y
x y
x y
x y
x y
x y
x y
xy
xy
x y x y
x y y x
These 16 functions are obtained from the tables given below:
x y x y 0 1 x y x y x y x y
1 1 0 0 0 1 1 1 0 0 1 1
1 0 0 1 0 1 1 0 0 1 1 1
0 1 1 0 0 1 0 1 1 0 1 0
0 0 1 1 0 1 0 0 1 1 0 1
- 42 -
x y x y
x Y x y x y x y x y xy xy
x y y x
1 1 0 0 0 1 0 0 0 1 0
1 0 0 1 1 0 1 0 0 0 1
0 1 1 0 1 0 0 1 0 0 1
0 0 1 1 1 0 0 0 1 1 0
Example 16:
Find and simplify the function specified by the following table:
x y Z f
1 1 1 0
1 1 0 (1)
1 0 1 (1)
1 0 0 0
0 1 1 0
0 1 0 (1)
0 0 1 (1)
0 0 0 0
- 43 -
f x y z x y z x y z x y z
y z ( x x ) y z ( x x )
y z y z .
Definition 7:
A Boolean function is said to be in conjunctive normal form (CNF) in
n variables x 1 , x 2 , ..., x n for n 0 , if the function is a product of factors of
i 1, 2, ..., n , and no two factors are identical. In addition, 0 and 1 are said
to be in CNF in n variables for n 0 .
Theorem 8:
Every function in a Boolean algebra which contains no constants is
equal to a function in CNF.
Example 17:
Write the function x y z ( x y ) ( x z ) in CNF.
x y z (x y )(x z )
(x y z (x y ))(x y z ( x z ))
(x y z x y )(x z )
(x y )( x z )
- 44 -
Definition 8:
The CNF in n variables which contains 2n factors is called the
complete CNF in n variables.
Theorem 9:
If each of n variables is assigned the value 0 or 1 in an arbitrary, but
fixed, manner, then exactly one factor of the complete CNF in the n variables
will have the value 0 and all other factors will have the value 1.
Corollary 2:
Two functions, each expressed in CNF in n variables, are equal if and
only if they contain identical factors.
Example 18:
Find and simplify the function f given by the following table:
x Y z f
1 1 1 [0]
1 1 0 1
1 0 1 [0]
1 0 0 1
0 1 1 1
0 1 0 1
0 0 1 [0]
0 0 0 [0]
f x y z x y z x y z x y z
x 'z ( y y ) x y ( z z )
x z x y .
- 45 -
It may be desirable to change a function from one normal form to the
other. In this case we apply the identities ( f ) f . Thus if f is given in
DNF, then f (applying Dé Morgan's law) gives the complement of the
function f .
Example 19:
Change the function from DNF to CNF,
f u v u v u v
f ( f ) ( (u v u v u v ) )
( ( u v ) ( u v ) ( u u ) )
u v
u v u v f
1 1 0 0 1
1 0 0 1 [0]
0 1 1 0 1
0 0 1 1 1
- 46 -
Chapter 4
Definition 1:
A non-empty set L together with two binary operations and
(called join and meet) on L is called a lattice if it satisfies:
L1 : x y y x, x y y x,
L2 : x (y z ) x (y z )
x (y z ) x (y z ),
L3 :x x x , x x x ,
L4 : x x ( x y ), x x (x y ), x , y , z L .
Definition 2:
An algebra ( L ; , , 0, 1) with two binary operations and two
nullary operations is a bounded lattice if it satisfies:
B L1 : ( L ; , ) is a lattice.
B L2 : x 0 0, x 1 1, x L .
Definition 3:
A distributive lattice is a lattice with L satisfies either of the
distributive laws:
x ( y z ) (x y ) (x z ) ,
x ( y z ) (x y ) (x z ) .
Definition 4:
A Boolean algebra is an algebra ( B ; , , ', 0, 1) with two binary,
one unary, and two nullary operation which satisfies:
- 47 -
B1 : ( B ; , ) is distributive lattice,
B2 : x 0 0, x 1 1,
B3 : x x 0, x x 1 .
Definition 5:
Example 1:
Let R {0, 1} with multiplication tables:
+ 0 1 0 1
0 0 1 1 0 0
1 1 0 0 0 1
Here, x x 0, x R ,
also, R is commutative,
the two elements ring is the simplest non-degenerate example of a
Boolean ring, and we denote it as the ordinary integer 2.
Proposition 1:
Let R be a Boolean ring, then
1- a a 0 , 2- a b b a , a, b R .
Proof:
( a a )2 a a
a2 a2 a 2 a2 a a
a a a a a a
a a 0.
- 48 -
So, the ring is of characteristic two.
Now ( a b )2 a b a 2 ab b a b 2 a b
ab b a 0 ab ( b a ) b a ,
that's R is commutative.
Example 2:
Let R be the set consists of ordered pairs ( p , q ) of elements 2, i.e.,
the four ordered pairs ( 0, 0) , ( 0, 1) , (1, 0 ) , (1, 1) . This set will be denoted
and
( a0 , a1 ) ( b0 , b1 ) ( a0 b0 , a1 b1 ) .
is a Boolean ring.
Theorem 1:
Let B ( B ; , , ', 0, 1) be a Boolean algebra. Define B to be the
algebra ( B ; , , , 0, 1) where
a b ( a b ) ( a b ) ,
a b a b ,
- 48 -
a a .
Then B is a Boolean ring.
Proof:
Let a , b , c B , then
(i) a 0 ( a 0 ) ( a 0) ( a 1) 0 a 1 a , so, 0 is the
identity.
(ii) a b ( a b ) ( a b ) ( b a ) ( b a ) B 1 .
(iii) a a ( a a ) ( a a ) 0 , a is the inverse of a.
(iv) a ( b c ) a [ ( b c ) ( b c ) ]
( a [ ( b c ) ( b c ) ] ) ( a [ ( b c )
( b c ) ])
( a [ ( b c ) ( b c )]) ( ( a ( b c ) )
( a (b c ) )
( a [ ( b c ) (b c ) ] ( ( a (b c ) )
( a (b c ) )
( a [(( b c ) b )(( b c ) c )] (( a (b c ))
( a (b c ) )
( a [ (( b b ) ( c b )) (( b c ) ( c c )) ])
( ( a (b c ) ) ( a ( b c ) )
( a ( ( c b ) ( b c ) ) ) ( ( a (b c ) )
( a (b c ) )
( a c b ) ( a b c ) ( a b v )
( a b c )
( c a b ) (c a b ) ( c a b )
(c a b )
- 49 -
[ c ( ( a b ) ( a b ) ) ] [c ( ( a b )
( a b ) ) ]
[c ( ( a b ) a ) ( ( a b ) b ) ) ]
[c ( ( a b ) ( a b ) ) ]
[c ( ( a b ) ( a b ) ) ] [c ( a b ) ]
[c ( ( a b ) ( a b ) ) ] [c ( a b ) ]
[ c ( ( a b ) ( a b ) ) ] [ c ( a b ) ]
[ c ( a b ) ] [ c ( a b ) ]
c ( a b ) ( a b ) c the associative law holds.
(v) a 1 a 1 a .
(vi) a ( b c ) a ( b c ) ( a b ) c ( a b ) c .
(vii) a ( b c ) a [ ( b c ) ( b c ) ]
( a (b ) ) ( a ( b c ) ) (1)
(a b ) (a c ) (a b ) (a c )
[ ( a b ) ( a c )] [ ( a b ) ( a c ) ]
[ ( a b ) ( a c ) ] [ ( a b ) ( a c ) ]
(a b c ) (a b c ) (2)
From (1) and (2), we have:
a (b c ) ( a b ) ( a c ) .
(viii) a a a a a
B is a Boolean ring.
Theorem 2:
Let R ( R ; , , , 0, 1) be a Boolean ring. Define R to be the
algebra
( R ; , , ' , 0, 1) ,
- 50 -
where
a b a b a b ,
a b a b ,
a 1 a .
Then R is a Boolean algebra.
Proof:
(1) a b a b ab b a b a b a .
(2) a a a a a 2 2 a a 0 a a .
(3) a (a ) a ( a b ) a a b a ( a b ) a ab ab a .
(4) a 0 a 0 0, a 1 a 1 a 1 2a 1 1.
(5) a ( b c ) a ( b c ) a ( b c b c )
a b a c a b c a b a c a2 b c
ab ac ( ab ) ( ac ) ( ab ) ( ac )
(a b ) (a c ) .
(6) a a a a a (1 a ) a a 2 a a 2 a 0
a a a a a a a (1 a ) a (1 a )
a 1 a a a2 1 0 1 .
Thus, R is a Boolean algebra.
Theorem 3:
Given B and R as above, we have:
B B, R R.
Proof:
Let B be a Boolean algebra ( B ; , , ' , 0, 1) , then B ( B; , , 0, 1)
is a Boolean ring with:
- 51 -
a b (a b ) ( a b ) ,
a b a b ,
a a .
algebra. The relation between the defined operations on B and B is given as:
(i) a 1 b a b ab a ( b ( a b ) )
a ( ( b ( a b ) ) ( b ( a b ) )
a ( (b ( a b ) ) (b a b ) )
a ( ( b a ) ( b b ) 0)
a (b a )
( a ( b a ') ) ( a ( b a ) )
( a (b a ) ) ( a b )
( ( a b ) a ) ( a b ) a ( a b )
( a a ) ( a b ) 1 ( a b )
a b .
(ii) a 1 b a b a b .
(iii) a 1 a (1 a ) (1 a )
(1 a ) ( 0 a )
(1 a ) 0 a .
Therefore, B B .
On the other hand, let R ( R ; , , , 0, 1) be a Boolean ring, then
- 52 -
Now, R is a Boolean algebra, then R ( R ; 1 , 1 , 1 , 0, 1) is a
( a b ) ( a b ) ( a b ) ( a b )
( a (1 b ) ) ( (1 a ) b ) 0
a ab b ab a b ,
a 1 b a b a b
1 a a a R R .
Definition 6:
Let R be a Boolean ring, then I R is an ideal of R iff:
(i) 0 I ,
(ii) a , b I a b I (since b b in a Boolean ring, then a b
a b I ).
(iii) a I , b R a b I .
Definition 7:
Let B ( B ; , , ' , 0, 1) be a Boolean algebra, I B is called
an ideal if
(i) 0 I ,
(ii) a , b I a b I ,
(iii) a I and b a b I .
- 53 -
(iii)' a F and b a b F .
Theorem 4:
Let B ( B ; , , ' , 0, 1) be a Boolean algebra. Then I is an ideal
of B iff I is an ideal of B .
Proof:
(i) Suppose I is an ideal of B. Then
0I . (1)
Now: a , b I a b a , a b b
a b , a b I
a b ( a b ) ( a b ) I (2)
If a I and b B . Then
a b a a b I
a b a b I (3)
Definition 8:
Let B ( B ; , , ' , 0, 1) be a Boolean algebra. If X B , then
X {a : a X } .
- 54 -
Lemma 1:
Given a Boolean algebra B. Then:
(a) I B , I is an ideal iff I is a filter.
(b) For F B , F is a filter iff F is an ideal.
Definition 9:
Let A be an algebra of type F and let Eq ( A ) . Then is a
congruence on A if satisfies the following compatibility property:
For each n-ary function symbol of f F and elements ai , bi A ; if
A A
ai , bi A , ai bi holds for 1 i n then f ( a1, ..., an ) f (b1, b2 , ..., bn )
holds.
a2 b 2 ( a2 , b 2 ) then we have:
( a1 a2 ) ( b1 b2 )
( a1 a2 ) ( b1 b 2 ) .
Theorem 5:
Let B be a Boolean algebra. If is a binary relation on B, then is a
congruence on B iff 0 / is an ideal, and for a , b B a, b iff
a b 0 / .
- 55 -
Proof:
Suppose is a congruence on B. So, is reflexive,
0, 0 0 0 / , (1)
if a , b 0 / , then a, 0 and b , 0
a b , 0 0 a b 0 / , (2)
if a 0 / and b a , then a, 0
a b , 0 b ( b , b ) b , 0
b 0 / . (3)
Thus 0 / is an ideal.
Now, a, b a b , b b .
But b b 0 a b. 0 .
Conversely, a b 0 / a b , 0 .
So, ( a b ) b , 0 b a 0, 0 b a 0, 0 b )
a, b .
Now, suppose 0 / is an ideal, and for a , b B
a, b iff a b 0 / .
Since a a 0 a a 0 / a, a , that is reflexive, (1)
For a B , if a, b a b 0 / b a 0 /
b , a , is symmetric (2)
if a, b , b , c , then
a c ( a b ) ( b c ) 0 / a, c
is reflexive (3)
is an equivalence relation on B.
To show that is compatible with the operations of B.
Let a1 , a2 , b1 , b2 B with a1 , a2 , b1 , b2 ,
- 56 -
( a1 b1 ) ( a2 b 2 ) ( a1 b1 ) ( a2 b 2 )
( a1 b1 ) [ ( a1 b 2 ) ( a1 b 2 ) ] ( a2 b 2 )
a1 ( b1 b2 ) ( a1 a2 ) b2 0 /
[ a1 , a2 a1 a 0 / ( a1 a2 ) b2 0 / (ideal),
also b1 , b 2 b1 b 2 0 / a1 ( b1 b2 ) 0 / ] .
So, a1 b1 , a2 b2 .
Next
( a1 b1 ) ( a2 b 2 ) ( a1 b1 a1 b1 ) ( a2 b2 a2 b 2 )
( a1 a2 ) (b1 b2 ) (a1 b1 a2 b2 ) 0/ ,
so a1 b1 , a2 2 .
Lastly,
a1 , a2 a1 a2 0 /
(1 a1 ) (1 a2 ) 0 / 1 a1 , 1 a2
a1 , a2 ,
hence is a congruence on B.
- 57 -
Chapter 5
Switching Algebra
x y x
, z
z w
z
- 58 -
We assign the value 1 to a letter if it represents a closed switch, and
the value 0 if it represents an open switch.
x y x
y
z y z
y (x z ) y x y z
Example 1:
Draw circuits which realize each of the following expressions:
(a) ab c ab ( d c e f )
a b c
d c
a b
e a
(b) a b ( c d e ) f g
a
d e
f g
- 59 -
Example 2:
(a) Find the function which represents the following circuit:
a b b
a c c a
a b c
a b c Circuit
1 1 1 0
1 1 0 1
1 0 1 0
1 0 0 0
0 1 1 0
0 1 0 0
0 0 1 0
0 0 0 1
- 60 -
Example 3:
Simplify the following circuits:
(1)
a
b c
b
a
b c
c
(2)
a a a a
b b b b
c c c c
- 61 -
(b b ) c c
d (d ( f ) ) c .
x y u T2
T1 z
y
x y T3
w
f 23 that joining T 2 to T 3 ,
f 13 ( x y x y ) z ( y w ) ,
f 23 u ( y w ) .
1
In general, for an n-terminal circuit, the n ( n 1) possible functions are
2
designated f i j , where f i j denotes the function corresponding 2-terminal
- 62 -
circuit joining T i to T j . Two n-terminal circuits are equivalent if each pair of
2-terminal circuits are equivalent or, if the functions representing the pair of
corresponding circuits are equal.
Definition 1:
A wye circuit is a 3-terminal circuit, where the three 2-terminal
circuits involved have a common point other than a terminal.
T2 T2
a b b
(a)
wye-to-delta
b c a c
T1 T3 T1 a c T3
T2
T2
x y
(b)
delta-to-wye
x x y
y
z z
T1 z T3 T1 T3
- 63 -
A generalization for wye-to-delta is shown as:
T3 T3
T2 T2 c
b
b c c
b b
c
a x a a x x
T1 T1 a x
Tn Tn
Suppose that we have the bridge circuit, a non-series parallel circuit, shown
in the figure below, and we need to find a Boolean function to represent the
circuit,
Q
a d
P S
T1 c T2
b e
R
Here, the point Q is the central point of a wye circuit with terminals P, R and
S. Applying the wye-to-delta transformation gives an equivalent series-
parallel-circuit.
T1 a d T2 a d
P a d S
T1 T2
c c a c c d
b e
b e
R
- 64 -
So, the bridge circuit is represented by the Boolean function
f 12 a d ( ac b ) ( c d e ) .
There are two methods of obtaining the Boolean function; examining the
circuit for all possible combinations of closed switches which allow a current
through the circuit, or broken lines through the circuit are drawn in all
possible ways in which the circuit may be broken.
So, for the bridge circuit above we can write the Boolean function as:
f 12 a d b e ac e b c d , or
f 12 ( a b ) ( d e ) ( a c e ) ( b c d ) .
Apply the three methods to find the Boolean function which represents the
following circuit simplify if possible.
Q
b c
a
T1 d T2
P R
c a
S
1st method (wye-to-delta transformation).
b
The point Q is the common point
T1 a b c T2
P a c R
b
c d d
a
a d
c
T1 T2
a b d d c
c a
- 65 -
f 12 ab c ( ab d c ) ( d c a )
2nd method
(1)
b
c
a
T1 T2
d a
c
(2)
f 12 ab c c a ab d a c d c
ab c c a ab d .
3rd method
b
c
a
T1 d T2
c a
f 12 ( ab c ) ( a c ) ( ab d a ) ( c d c )
( ab c ) ( ab d a ) ( a c ) (1 d )
ab ( a c ) c ( ab d a ) ( a c )
ab ( a c ) c c ( ab d a ) c a
- 66 -
ab ab c c a ab c a
a (b c ) .
Example 4:
Consider the two functions f a ( x y ) and g a x y . So we have
the following two circuits
x
T1 a T2 T3 a x y T4
y
x y T4
Example 5:
Construct a 3-terminal circuit to realize both of the following
functions:
f x z w y z w ,
g x z w y z w x y z ,
f x z w y z w ( x y ) z w (1)
g x z w y z w x y z
- 67 -
z ( x w y w x y )
z ( x w y w x y x x )
z (w ( x y ) x ( y x ) )
z ( ( x y ) (w x ) )
( x y ) z (w x ) (2)
The circuit will be designated as:
x w T1
T0 z
w
y T2
x
If the properties of the function are specified by a table, then we can
write each function in conjunctive normal form, and the common factors may
be found either from the table or from the functions.
Example 6:
Construct a 4-terminal circuit to realize all three of the functions
specified by the following table.
Share switches where possible.
Row x y z f g h
1 1 1 1 0 0 0
2 1 1 0 1 1 1
3 1 0 1 1 0 0
4 1 0 0 0 1 0
5 0 1 1 0 0 0
6 0 1 0 1 1 1
7 0 0 1 1 1 0
8 0 0 0 0 1 0
- 68 -
f ( x y z ) ( x y z )( x y z )( x y z ) ,
g ( x y z ) ( x y z ) ( x y z ) ,
h ( x y z )( x y z )( x y z )( x y z ) ( x y z )
(x y z ),
f ( x y z ) ( x y z ) (xy z ) (x y z )
(x y z )
g ( x y z ) ( x y z ) (x y z )
(x y z )
h ( x y z ) ( x y z ) (xy z ) (x y z )
x
y
T1
x x z
T0 y y x x x x
z z y y y y
T2
z z z z
T3
Definition 2:
A function of n variables x 1 , x 2 , ..., x n are said to be symmetric in
these variables if and only if the interchange of any pair of variables leaves
the function identically the same
The functions x y x y , x y z x y z x y z , and x y z x y z x y z
are all symmetric in x, y; x, y, z; and x, y, z respectively, while the function
x y y z is not symmetric in the variables x, y and z, for if we interchange
the pair x and y then we get x y x z not the same function.
- 69 -
The basis for the method of design of circuits for symmetric functions is
given as:
Theorem 1:
A necessary and sufficient condition that a function of n variables be
symmetric is that it may be specified by stating a set of numbers
n1, n 2 , ..., n k , 0 n i n , for i, such that if any set of exactly ni ,
i 1, 2, ..., k , of the variables are 1, then a function has the value 1 and not
otherwise.
The above numbers are called the characteristic numbers for the
function.
Example 7:
Consider the symmetric function x y x y . Now:
1st case, no variable takes the value 0, that is x y 0 , and x y 1
x y x y 1.
2nd case, one variable takes the value 1, the other takes the value 1, that is
either x 1 and y 0 or x 0 and y 1, x y x y 0 .
3rd case, two variables x and y take the value 1, the x y x y 1 0 1 .
Consequently the function x y x y has the characteristic numbers 0 and 2.
Remarks 1:
1- The product of two symmetric functions in the same variables is
symmetric and has for its characteristic numbers these numbers
common to both functions.
2- The sum of two symmetric functions in the same variables is
symmetric and has for its characteristic numbers all characteristic
numbers of either or both summands.
- 70 -
3- The complement of a symmetric function in n variables is symmetric
and has for its characteristic numbers all numbers from 0 to n
inclusive except those which are characteristic numbers of the given
function.
For example, the function x y x y is the complement of the function
x y x y of characteristic numbers 0 and 2. Hence x y x y has the
characteristic number 1,
x 1 and y 0 0 0 1 1 1,
x 0 and y 1 1 1 0 0 1,
while if
x y 0 x y x y 1 0 0 1 0,
and if
x y 1 x y x y 0 1 1 0 0 ,
3
z
z 2
y z
y z 1
x y z
T1 x y z 0 T2
- 71 -
T1 x y z T2
0
Symmetric circuit of x, y, and z with 0 the characteristic,
f ( x , y , z ) x y z .
y z T2
1
x y z
T1 x y
y
z
x
T1 y T2
z
x
y
z T2
y z
y
y y
T1 x
Symmetric circuit of x, y and z with 2 as
the characteristic number
- 72 -
y
x
z
T1 y
x
z
y
T2
z
x
T1
- 73 -
w
w
5
v w
v w
u v w
u v w
3
z u v w
A z B u C v D w
y z u v w
A y B z C u D v w
1
x y z u v w T2
T1 x y z u v w
A B C D
An equivalent circuit could be obtained by eliminating all but the first
two levels and connecting points A, B, C, and D to points A , B , C , and
D by the appropriate switch which formerly connected these points to
A , B , C , and D . In this case we may describe the circuit as consisting of
any path formed by an odd number of changes of level.
y z u v w
y z u v
x y z u v w
T2
T1 x y z u v
- 74 -
The lower level corresponds to levels 0, 2, 4, and 6, and the upper level to the
levels 1, 3, and 5 simultaneously.
Example 8:
Determine the characteristic of the following symmetric function,
then draw as simple a circuit as possible:
x y y z x z .
If x y z 0, then x y y z x z 0.
If x y z 1, then x y y z x z 1.
If x y 1 , and z 0 , then x y y z x z 1,
the same is true when x z 1 , and y 0 , or y z 1 , and x 0 .
If one and only one of the variables takes the 1, then
x y y z x z 0.
Thus x y y z x z is symmetric with characteristic numbers 2, and 3.
Referring to the circuit that realizes any symmetric function of three
variables; the circuit that realizes the function x y y z x z can be draw
as follows:
z T2
y z
y
x y
T1 x
- 75 -
x y
T1 y T2
y z
y
x
z
T1 T2
y z
A series-parallel circuit.
Example 9:
The function ab c ab c a b c ab c ab c is symmetric with
the number 2 as its characteristic number, so the circuit that realizes this
function can be drawn as follows:
c T2
b
b
a b c
T1 a b
Example 10:
Draw a circuit of a symmetric function of six variables with
characteristic numbers 0, 3, and 6.
(N. B. these numbers are in arithmetic progression).
We start by drawing a circuit for symmetric function of six variables
- 76 -
6
w
w
5
v w
v w 4
u v w
A u B v C w D
3
z u w
A z B u
C v
D w 2
y z u v w
y z u v w
1
x y z u v w
T1 x y z u v w T2
A B C D 0
Now the vertex A will be connected with A through z, B with B through
u, c with C through v and D with D through w. Thus the circuit is as
follows:
z u v
y z u v
z
y z u w
x y z u
T1 x y z u v w T2
- 77 -
Exercises in Mathematical Logic
and
Boolean Algebra
By
Dr. Tahany M. Elsheikh
Lectuer Of Mathematics
1
1. Translate into wffs :
• If p , then q or r.
• If not p , then not either q or r.
• If not p , then either not q or r.
• If it snows , then I’ll go outside and I’ll ski.
• Either p or q , and r.
• Either p , or q and r.
2. Assume that p = 1, q = 0 , and r is unknown. Calculate the truth value
of each wff below.
• r∧q
• r → ¬q
• r ∨ ¬q
• ¬q ∧ r
• q→r
• ¬p ∨ r
• r → ¬q
• r ∧ ¬p
• r∨q
3. Test the validity using the truth-assignment test :
p → (q ∨ r)
¬q
(a)
p
∴r
(p ∧ ¬q) → r
¬r
(b)
q
∴ ¬q
(¬p ∧ q) → r
¬r
(c)
q
∴p
2
(p ∧ q) ≡ r
(d) p
∴q
4. translate into logic , then test for validity :
(a) If you’re lost, then you shoud call for help or head downs. you’re
lost. ∴ you should call for help.
(b) If it’s right for me to lie and not right for you, then there’s a rele-
vant difference between our cases. There is no relevant difference
between our cases. It’s not right for you to lie. ∴ It’s not right for
me to lie.
5. Test the following for validity :
(p ∧ q) ∨ (r ∧ q)
(a) q→s
∴q∧s
p ≡ (q ∨ r)
(b) ¬q
∴p≡r
∀x p (x)
(c)
∴ ∀x (q(x) ∨ p(x))
∀x (p(x) → q(x))
(d) ∀x p (x)
∴ ∀x (q(x))
∃x ¬p(x)
(e) ∃x ¬q(x)
∴ ∃x (p(x) ≡ q(x))
∃x (p(x) ∧ q(x))
(f)
∴ ∀x (p(x) → q(x))
∀x (p(x) ∧ q(x)) → r(x)
(g) ∀x (s(x) → (q(x) ∧ ¬r(x)))
∴ ¬∃x (s(x) ∧ r(x))
∀x (p(x) → q(x))
(h) ∀x (p(x) → ¬q(x))
∴ ∀x ¬ (q(x))
3
6. Prove that for any a, b, and c in a Boolean algebra,
ab + bc + ca = (a + b)(b + c)(c + a)
8. Prove that no Boolean Algebra can have exactly three distinct elements.
10. Write each of the following in DNF in the three variables x, yandz :
(a) x′ z + xz ′
(b) (x + y)(x′ + y ′ )
11. Write each of the following in CNF in the three variables x, y and z :
(a) x′ z + xz ′
(b) (x + y)(x′ + z ′ )
(c) x
(a) (x + y + z)(x′ + y ′ + z ′ )
(b) (x + y)(x′ + z ′ )
(a) (x + y ′ )(x′ + y)
(b) (x + y + z)(x + y + z ′ )(x + y ′ + z)(x + y ′ + z ′ )
4
15. Construct a table of closure properties for the function
(a + b′ + c)(a + bc′ ) + c′ d + d(b′ + c)
19. Draw as simple a circuit as possible for the symmetric functions given
below :
5
Mid-Term Exams
جامعــــــــة طنطا
قسم الرياضيات-كليـــــــــــة العلوم
املنطق الرياض ي والجبرالبولي/امتحانات فصلية في مقرر
رياضيات وحاسب/الشعبة الثالث/املستوى
Exam (1)
∴ ∃𝑥𝑞(𝑥)
3) Using DE and DU, we go from
(∃𝑥)(𝑝(𝑥) ∧ ∀𝑥 𝑞(𝑥)) to ……………..
(∃𝑥)(𝑝(𝑥) ∧ 𝑞(𝑥)) to ……………..
(∃𝑥)(𝑝(𝑥) → 𝑞(𝑥)) to ……………..
∴𝑙
2) Translate into English languages:
The statement ∀𝑥∃𝑦 𝑝(𝑥, 𝑦) and its negation,
Where 𝑝(𝑥, 𝑦) denotes "𝑥 + 𝑦 = 0", 𝑥 and 𝑦 are real numbers.
3) Define a Boolean algebra. Give an example.
4) Let 𝐴 be a Boolean algebra, 𝑎, 𝑏 ∈ 𝐴, show that:
a) 𝑎𝑏 ′ = 0 and 𝑎𝑏 = 𝑎 are equivalent.
b) 𝑎 + 𝑏 ′ + (𝑎 + 𝑏′)𝑎′ 𝑏 + 𝑎′ 𝑏 = 1.
∴𝑞
2) Translate into English languages:
a) ∃𝑦∀𝑥 𝑝(𝑥, 𝑦).
b) ∀𝑥∃𝑦 𝑝(𝑥, 𝑦), where 𝑝(𝑥, 𝑦) denotes "𝑥 + 𝑦 = 0", 𝑥 and 𝑦 are
real numbers.
3) Define a poset. If 𝐴 is a Boolean algebra (𝐴; +, −),
Define 𝑎 ⊆ 𝑏 iff 𝑎𝑏 ′ = 0. Show that (𝐴; ⊆) is a poset.
4) In a Boolean algebra 𝐴, verify that:
a) 𝑎 + 𝑏 ′ + (𝑎 + 𝑏′)𝑎′ 𝑏 + 𝑎′ 𝑏 = 1.
b) (𝑎 + 𝑏)′ = 𝑎′𝑏′, 𝑎, 𝑏 ∈ 𝐴.
∴ ∃𝑥(𝑞(𝑥) ∧ ¬𝑟(𝑥))
(20 Marks)
Question 2: (35 Marks)
a- Translate into logic:
i. Both 𝑝 and either 𝑞 or 𝑟.
ii. If 𝑝 then 𝑞 or 𝑟.
iii. For all 𝑥, if 𝑥 is an integer, then 𝑥 is either positive or negative.
iv. Some real numbers are integers.
v. At least two children are hungry.
(15 Marks)
b- Define a structure 𝑈 for a given first-order language, consider the structure 𝑈 = (𝑁; ≤, 𝑆, 0) and let
𝑠: 𝑉 → 𝑁 be the function 𝑠(𝑣𝑖 ) = 𝑖 − 1.
i. Compute 𝑠̅(𝑓𝑓𝑓𝑣1 ).
ii. Is ⊨U 𝑝𝑓𝑣1 𝑐[𝑠] ?
(20 Marks)
Question 3: (40 Marks)
a- Let ℬ = (𝐵; +,∙) be a Boolean Algebra. Show that: 𝑎𝑏 + 𝑎̅𝑐 + 𝑏𝑐 = 𝑎𝑏 + 𝑎̅𝑐, 𝑎, 𝑏, 𝑐 ∈ 𝐵. (10 Marks)
b- The function 𝐹 = (𝑥 ′ + 𝑦 ′ + 𝑧 ′ )(𝑥 ′ + 𝑦 + 𝑧 ′ )(𝑥 + 𝑦 + 𝑧 ′ )(𝑥 + 𝑦 + 𝑧) is in CNF. Write 𝐹 in DNF,
then construct the table of this function. (15 Marks)
c- Find the Boolean function which represents the following circuits. Simplify if possible.
Q
b 𝑐’
a
T1 d T2
P R
c a
(15 Marks)
(Please, Turn Of The Page)
Question 4: (35 Marks)
a- Define a Boolean ring. If 𝑅 is a Boolean ring, show that 𝑅 must be:
i. Of characteristic 2 (i.e. 2𝑎 = 0, ∀𝑎 ∈ 𝑅).
ii. Commutative.
(20 Marks)
(𝐵;∨,∧, ′
b- Let ℬ = , 0,1) be a Boolean algebra. Prove that if 𝐼 is an ideal of 𝐵, then 𝐼 is an ideal of
̅
𝐵 (the corresponding Boolean ring). (15 Marks)
∴ ¬𝑟
(10 Marks)
c-
∀𝑥(𝑝(𝑥) → 𝑞(𝑥))
∃𝑥(𝑝(𝑥) → ¬𝑟(𝑥))
∴ ∃𝑥(𝑞(𝑥) ∧ ¬𝑟(𝑥))
(15 Marks)
Question 2: (30 Marks)
a. Study all parameters used in the first-order logic, then determine the parameters needed in the set
theory. (10 Marks)
b. Define a term – an atom – and a well formed formula. (10 Marks)
c. For the language of elementary number theory, translate the following into logic:
1. Any natural number is the successor of some number.
2. There is a natural number such that no natural number is smaller.
(10 Marks)
Question 3: (45 Marks)
a. Define a Boolean algebra, show that if 𝑎 𝑎𝑛𝑑 𝑏 are two elements in a Boolean algebra 𝐴, then 𝑎 +
𝑎 = 𝑎, 𝑎 ∙ 𝑎 = 𝑎 𝑎𝑛𝑑 ̅̅̅̅̅̅̅
𝑎 + 𝑏 = 𝑎̅ ∙ 𝑏̅. (15 Marks)
̅̅̅
b. Simplify the function 𝑓(𝑎, 𝑏, 𝑐, 𝑑) = 𝑎𝑏 + 𝑏𝑐 + 𝑎𝑏𝑑. (15 Marks)
̅
c. Write the following function in DNF: 𝑓(𝑎, , 𝑏, 𝑐 ) = (𝑎 + 𝑏)(𝑎̅ + 𝑏). (15 Marks)
∴ ∃𝑥(𝑞(𝑥) ∧ 𝑟(𝑥))
(20 Marks)
𝒙 𝒚 𝒛 𝒇 𝒈 𝒉
1 1 1 1 1 1
1 1 0 0 0 0
1 0 1 1 1 1
1 0 0 1 1 1
0 1 1 0 0 0
0 1 0 1 1 0
0 0 1 1 1 1
0 0 0 1 0 0
(15 Marks)
With My Best Wishes.
Examiners Prof. Dr. Tahany El-Sheikh
Tanta University
Faculty Of Science
Department of Mathematics
Final Term Exam For The First Semester
Programme Title: Mathematics and Computer Science Level: Three
Course Title: Boolean Algebra And Mathematical Logic Course Code: MA3113
Total Assignment Marks: 150 Marks Exam: (4) Time Allowed: 2 Hours
∴ ∀𝑥 𝑞(𝑥)
(15 Marks)
b) Test the validity for the following:
(∃𝑥)(∃𝑦) ¬𝑥 = 𝑦
∴ ¬(∃𝑥)(∀𝑦)𝑦 = 𝑥
(20 Marks)
Question 3: (40 Marks)
a) Define a Boolean algebra. Give two examples. (20 Marks)
b) Let 𝐵 be a Boolean algebra, 𝑎, 𝑏 ∈ 𝐵, prove that
1. 𝑎 + 𝑎𝑏 = 𝑎. and 𝑎(𝑎 + 𝑏) = 𝑎.
′ ′
2. (𝑎𝑏) = 𝑎 + 𝑏′.
3. Write 𝑥 + 𝑦′ in DNF in the three variables 𝑥, 𝑦 and 𝑧.
(20 Marks)
(20 Marks)