0% found this document useful (0 votes)
3 views

Boolean Book

The document is an introduction to Mathematical Logic and Boolean Algebra, authored by Prof. Dr. Abdel-Mohsen Badawy and Dr. Tahany El-Sheikh. It covers topics such as propositional logic, first-order languages, Boolean algebra, and switching algebra, providing definitions, examples, and logical connectives. The content is structured into chapters with references for further reading.

Uploaded by

AMGAD SALAMA
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Boolean Book

The document is an introduction to Mathematical Logic and Boolean Algebra, authored by Prof. Dr. Abdel-Mohsen Badawy and Dr. Tahany El-Sheikh. It covers topics such as propositional logic, first-order languages, Boolean algebra, and switching algebra, providing definitions, examples, and logical connectives. The content is structured into chapters with references for further reading.

Uploaded by

AMGAD SALAMA
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 107

Tanta University

Faculty of Science
Department of Mathematics

Introduction to
Mathematical
Logic and Boolean Algebra
By
Prof. Dr. Abdel-Mohsen Badawy
Dr. Tahany El-Sheikh
References

[1] Herbert Enderton, A Mathematical Introduction to Logic,


Academic Press 2nd Ed., 2001.

[2] Harry J. Gensler, Introduction to Logic, Routledge, New York,


2nd Ed., 2010.

[3] White Sitt J. Eldon, Boolean Algebra and Its Applications,


Addison-Wesley Publishing Company, INC., 1962.
Contents

Page

Chapter 1 : Propositional Logic 1

Chapter 2 : First-Order Languages 19

Chapter 3 : Boolean Algebra 27

Chapter 4 : Ideals in Boolean Algebra 47

Chapter 5 : Switching Algebra 58


Chapter 1

Propositional Logic

Propositional logic is a mathematical system for reasoning about


propositions and how they relate to one-another.

Propositional logic enables us to:


 Formally encode how the truth of various propositions influences the
truth of other propositions.
 Determine if certain combination of propositions are always, some-
times, or never true.
 Determine whether certain combination of propositions logically
entail other combinations.

Propositional logic is a formal mathematical system whose syntax is


rigidly specified. Every statement in propositional logic consists of
propositional variables combined via logical connectives.

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.

There are two more "connectives": true and false.


The symbol  is a value that is always true.
The symbol  is a values that is always false.
These are often called connectives though they don't connect any thing.

Operator Precedence for Propositional Logic:






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.

Propositional logic studies arguments whose validity depends on "if-


then", "and", "or", "not".

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.

Notice that inclusive "or": p or q or both  p  q , exclusive "or"  p


or q but not or both  ( p  q )  ( p  q ) , ( p  q ) if p is true, then q is

true  we don't have p true and q false
┐ ( p  ┐q ) .

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
( pr) (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

We never get 1 1 0 , the argument is valid.


This argument is called Modus ponens.

3- (( p  q )  r )

┐q
_____
 r

p q r pq (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:

pq

┐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.

 There's a first case

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.

"  x " is called an existential quantifier. It claims that the formula


that follows is true for at least one value x.

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.

Generalizing the above, we have:


all (every)  ( x )
note all (not every)  ( x )

some  ( x )
no  ( x ) .

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 ) ) .

Sometimes the English sentence specifies a logical connective, then


we use the corresponding logical symbol, otherwise we use the connective
"  " in the case of "all … is …" for the middle connective, otherwise we use
"  " for the connective.

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.

Now, suppose that we have wffs with multiple or non-initial


quantifiers, then we may need to assume one side or its negation.

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

┐q ( b ) , and so is b is male ( p ( b ) ) and a is not ┐ p ( a ) .


2- A rule for forming quantificational wffs introduces "  " ("equal") =
use "  " for "is" if both sides are singular terms.

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

In this Language we study the sentences that are previously used in


the study of sets.

We begin with infinitely many distinct objects which we call


symbols, arranged as:

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 2: An atomic formula (or simply atom) is a predicate to argument


that are terms.

Any atom is defined to be a wff,


if N and V are wffs and x is a variable, then
(W ) ,
┐W , W  V , W  V , W V ,  x W , and  x W are wffs.

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).

Let us take the structure U with,


the set of natural numbers as the universe,
and < (less than) as the binary relation.
The sentence of this first-order language
 x y
┐y x ,
which asserts that "there is a natural number such that no natural number is
smaller" which is true.
So, we say that the sentence is true in U or that U is a model of the sentence.
Certain sentences of the formal language were true in the stricture and some
were false.
Let  be a wff of our language.
U a structure for the language,
s : V | U | a function from the set V of all variables into the universe | U |
of U.

- 21 -
The structure U is said to satisfy  with S, written as: ╞U  [ s ] if and only if

the translation of  determined by U where the variable x is translated as s ( x )


wherever it occurs free, is true.
Also, we define:
╞ U  [ s ] iff ╞U  [ s ] ,

╞ u (    )[ s ] if either ╞  [ s ] or ╞U  [s ] or both.

╞ U  x  [ s ] if for every d  | U | , we have ╞ U  [ s ( x | d ) ] .

s ( x | d ) is like s except at the variable x it assumes the valued,

 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,

p U  the set of pairs ( m , n ) such that m  n ,


U U
f  the successor function s, f ( n )  n 1,

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

extension function s of s, we have:


U U U
(i) s (f f v3 )  f (s (f v 3 ))  f f ( s (v 3 ) )
U U U U
f (f ( s (v 3 ) )  f (f ( 3  1) )

- 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.

(iii) s ( c )  cU  0 , the constant point,


U U
s (f f c )  f (f ( s (c ) ) )
U U U U
f f (s (c ) )  f (f (0))  S S (0)  2 .
(iv) ╞ U p c f v 1 [ s ] .

(Notice that ╞ U p t1 t 2 ...t n [ s ] iff ( s ( t1 ), ..., s ( t n ) )  pU ). So,

╞ 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 ] .

(Notice that ╞ U  x  [ s ] iff for every d  | U | , we have

╞ U  [ s ( x | d ) ] . So ╞U  [ s ] iff there exists m U such that,

╞U  [ s ( x | m ) ])

- 23 -
 pv 2 v 1 [ s (v 1 | m )] implies ( s (v 2 ), m )  pU  (1, m )  pU which

is not true if we take m  0 . Thus ╞U  [ s ( x | m ) ] , that is

╞  v 1 pv 2 v 1 [ s ] .

Theorem 1:
Assume that s1 and s 2 are functions from V into | u | which agree at

all variables that occur free in the wff  . Then


╞ U  [ s1 ] iff ╞U  [ s 2 ] .

An analogous fact is regarded to structures:


If U on B agree at all parameters that occur in  , then

╞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.

U is a model of a set  of sentences iff it is a model of every

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

the universe | U | and the binary relation p U

U  ( | U |; p U ) .

Characterize the class of all models of the following sentences:


1-  x  y x  y , which can be translated as for any two elements x
and y, we must have x  y . So, the universe has only one element,
and for the two binary relation: either be empty or that element is
related to itself, so, we have the structure ( A ; R ) , A is a set with
exactly one element, R   or R  A  A , is a model of the sentence.
2-  x  y p x y . The sentence is translated as: there is a relation
between any two elements. So, we have the structure ( A ; R ), A can
be any nonempty set, and R  A  A , is a model of the sentence.
3-  x  y
┐p x y . (No relation between any two elements). The
structure ( A ; R ) is a model of the sentence iff A is any nonempty
set, and R   .
4-  x  y p x y , which says: for every element x of the universe there
is an element y of the universe such that the x is related with y, i. e.,

( x , y )  pU ,  x .
Thus ( A ; R ) is a model iff the domain of R is A.

Let A  { a , b , c } , then we take for example:


R1  {( a , b ), ( b , b ), ( c , 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 ] .

4- ╞ U  x  [ s ] iff there is some d  | U | with the property

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

model of  . A sentences  is valid iff it is true in every structure.

- 26 -
Chapter 3

Boolean Algebra

Any algebraic structure is defined to be a non-empty set with one or


more operations, satisfying certain axioms.

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

From the symmetry of the two tables, B is commutative with respect to 


and  . It is easy to see that the distributive laws hold the element 0 is the
identity element for "  " , while the element 1 is the identity for "  " .

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 ,

(If B is a Boolean algebra, then | B |  2n , n  Z  . This condition is


necessary but not sufficient for B to be a Boolean algebra).
Since [1, x ]  x , and ( x , 120)  x ,  x  S .
 1 is the identity of "  " and 120 is the identity of "  " .

To see that each element has a complement, we must find an integer


x  S for the integer 2 such that
[ 2, x ]  120 and ( 2, x )  1 ,
since ( 2, 1)  ( 2, 3)  ( 2, 5)  ( 2, 15)  1 , but no one of [ 2, 1], [2, 3] ,
[ 2, 5] , and [ 2, 15] equals 120. Then 2 has no complement, hence ( S ; ,  )
is not a Boolean algebra.

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
0a  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  0a
 (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  ab  a a
 ( a  b )c  a ( a  b )
 ( a  b ) ( a  c ) .

- 36 -
(3)  (4)
( a  b ) ( a   c )  a a   ac  ab  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
 00  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).

Disjunctive Normal Form:

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 (  ) .

A particular class of functions is of special interest, namely, those


written as a sum of terms in which each term is a product involving all n
variables either with or without a prime.
y x  x y , x y z x y z ,
are examples of such a class.

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 yx 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
xy
xy
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 xy xy
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

Since a function is completely determined by the values it assumes


for each possible assignment of 0 and 1 to the respective variables, then if a
table represents such properties is given then the Boolean function is
constructed. Moreover the function in DNF may be written as follows:

For each set of conditions for which the function is to be 1, a


corresponding term is included in the DNF selected. The sum of terms gives
the function.

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 .

We can get the complement of any function in DNF. The complement


will contain exactly those terms of the complete normal form missing from
the given function.

For example the complement of the function x  y  z   x  y z   x y  z 


is
x y z  x y z  x y z  x  y z  x  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

the type f 1 ( x )  f 2 ( x )  ...  f n ( x ) , where f i ( x i ) is x i or x i for each

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

From the table we see that


f  u  v .

- 46 -
Chapter 4

Ideals in Boolean Algebra

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:

A ring R  ( R ; ,  , , 0, 1) is a Boolean ring if R satisfies x 2  x ,


 x  R , with unit, that is a Boolean ring is an idempotent with unit.

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

by 22 . The addition and multiplication on R are defined as:


( a0 , a1 )  ( b0 , b1 )  ( a0  b0 , a1  b1 ) ,

and
( a0 , a1 )  ( b0 , b1 )  ( a0  b0 , a1  b1 ) .

The set R with the two operations is a Boolean ring.

More generally the set of elements 2n , where


( a0 , a1 , ..., an 1 )  ( b0 , b1 , ..., bn 1 )  ( a0  b0 , a1  b1 , ..., an 1  bn 1 ) ,

( a0 , a1 , ..., an 1 )  ( b0 , b1 , ..., bn 1 )  ( a0  b0 , a1  b1 , ..., an 1  bn 1 )

is a Boolean ring.

Now, we need to go from Boolean algebra to a Boolean ring and vice


versa.

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  .

Now, B is a Boolean ring, then B  ( B ; 1 , 1 , ' , 0, 1) is a Boolean

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

R  ( R ;  ,  , ' , 0, 1) is a Boolean algebra with


(a  b )  a  b  a  b ,
(a  b )  a  b ,
a  1  a .

- 52 -
Now, R is a Boolean algebra, then R  ( R ; 1 , 1 , 1 , 0, 1) is a

Boolean ring. The relation between the defined operations on R and R is


given as:
a 1 b  ( a  b  )  ( a   b )  ( a  b  )  ( a   b )

 ( 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 .

A subset F of B is called a filter of B if


(i)' 1  F ,
(ii)' a , b  F  a  b  F ,

- 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
0I . (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)

From (1), (2) and (3), we have I is an ideal of B .


(ii) Suppose I is an ideal of B . Then
0I . (1)
If a , b  I , then
a  b I  a  b  a b  a b I . (2)
Then a  I and b  a , then
b  a  b a b I . (3)
So, I is an ideal of B.

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.

Let A be a non-empty set. Let Eq ( A ) denotes the set of all


equivalence relations on A. If 0  Eq ( A ) , then for 0  A , the equivalence
class (or coset) of a module  is the set
a |    {b  A |  b , a   ( b  a )} . The set A /   { a |  | a  A } .

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.

For example, if R is a ring and  is compatible,  is an equivalence


relation on R and if a1 , a2 , b1 , b2  F , a1  b1 (  a1 , b1   ) and,

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

An important application of Boolean algebra is the algebra of circuits.


The Boolean algebra is used in the design and simplification of complex
circuits in many kinds of electronic control devices such as electronic
computers and dial telephone switching systems. The algebra of circuits is an
algebra with two elements 0 and 1.

Our circuits involve only switches. A switch is designated by a single


letter a, b, c, … . If two switches operate so that they open and close
simultaneously, we designate them by the same letter. If they operate so that
the first is always open when the second is closed, and closed when the
second is open, we denote one of them by x and the second by x  .

A circuit consisting of two switches x and y connected in parallel is


denoted by x  y . If they are connected in series then we denote it by x y .
Thus to each series-parallel circuits, there corresponds an algebraic
expression; and conversely to each algebraic expression involving only "  " ,
"  " and ( ') , there corresponds a circuit.

For example the functions x y  z , x ( y  z )  z w are represented


by the circuits:

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.

Two circuits involving switches a, b, … are said to be equivalent if


the closure conditions of the two circuits are the same for any given position
of the switches involved. Two algebraic expressions are defined to be equal if
and only if they represent equivalent circuits.

For example, the following two circuits are equivalent:

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

The function is: ( ab  ac  a b  ) c ( b  a  c  ) .

(b) Construct a table of closure properties for the above circuit.

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

In the following we will concerned with


(a) Simplification of a given circuit which is known to have the desired
closure properties, and
(b) the design of circuits with given properties.

To simplify a circuit, we find the Boolean function which represents


the circuit, then simplify the function, and finally draw a new circuit diagram
realizing the simplified function.

- 60 -
Example 3:
Simplify the following circuits:
(1)
a

b c
b

a
b c

The Boolean function is


( ( a  b c )  a )b   b c  ,
which can be simplified as:
( a  b c  a ) b   b c   1  b   b c   b   b c 
 1  (b   c  )
 b c
b

c

(2)
a a a a

b b b b

c c c c

The Boolean function is:


f  ( a  b  c ) ( a   b  c ) ( a  b   c ) ( a  b   c ) .
We begin by simplifying the dual of f
 d ( f )  ab c  ab c  ab c  a b c
 ( a  a ) b c  ( a  a  ) b  c  b c  b  c

- 61 -
 (b  b  ) c  c
 d (d ( f ) )  c .

It has been shown that every series-parallel circuit corresponds to a


Boolean function and conversely that every Boolean function corresponds to
a series-parallel circuit. Boolean functions can also be found which reflect the
properties of other types of circuits.

Let us have a 3-terminal circuit as shown in the figure

x y u T2

T1 z
y
x y T3
w

This circuit is a combination of three 2-treminal circuits. So, we may


designate the various functions as follows:
f 12 will denote the 2-terminal circuit joining T1 to T 2 ;

f 13 that joining T1 to T 3 ; and

f 23 that joining T 2 to T 3 ,

for the given circuit we have:


f 12  ( x y   x  y ) z u  ,

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.

If we have a non-series parallel circuit and we want to reduce such


circuit to an equivalent circuit of series-parallel type, we use certain
transformations called wye-to-delta and delta-to-wye transformations.

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.

A delta circuit is a 3 terminal circuit in which the only common points


of any pair of the three 2-terminal circuits are the three terminals, each of
which is common to exactly two of the 2-terminal circuits.

The wye-to-delta transformation and the delta-to-wye transformation


are shown in figures (a) and (b) respectively.

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 ) .

Design of n-Terminal Circuits.


Here, we concerned with the design problem that can be treated as the
problem of combining a set of specified 2-terminal circuits into an n-terminal
circuit in such a way as to share switches or parts of circuits so far as
possible.

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

The two circuits can be combined as follows:


x
T2
y
T1  T 3 a

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 ) (xy 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 ) (xy 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

4.1. Symmetric Functions and their Circuits:

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 ,

Consider the following circuit:

3
z
z 2
y z
y z 1

x y z
T1 x y z 0 T2

This circuit is capable of realizing any symmetric function of three variables.


The numbers 0, 1, 2, and 3, correspond to characteristic numbers. A closed
circuit between T1 and position 2 results if and only if any two of the
switches are closed.

- 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

Symmetric circuit of x, y, and z with 1 as the characteristic


f ( x , y , z )  x y z  x  y z   x  y z

The bridge circuit of the function is shown in the following:

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

The bridge circuit of the function.

T2
z

x
T1

Symmetric circuit of x, y, and z with 3 as the characteristic number.

The same idea can be generalized for n variables.

4.2. "Shifting Down" Process:


Consider the symmetric function in x, y, z, u, v and w which has
characteristic numbers 1, 3, and 5 (numbers in arithmetic progression).

Let us start with a circuit for symmetric functions of six variables:

- 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

or can be draw as a bridge circuit as:

- 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   ab 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

The lower corresponds to levels 0, 3, and 6.

- 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)

7. Prove that in every Boolean Algebra if ax = bx and ax′ = ay ′ then


a=b

8. Prove that no Boolean Algebra can have exactly three distinct elements.

9. Express each of the following in DNF in the smallest possible number


of variables :

(a) (x + y + z)(xy + x′ z)′


(b) xyz + (x + y)(x + z)
(c) x′ yz + xy ′ z ′ + x′ y ′ z + x′ yz ′ + xy ′ z + x′ y ′ z ′

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

12. Find, by inspection, the complement of each of the following :

(a) (x + y + z)(x′ + y ′ + z ′ )
(b) (x + y)(x′ + z ′ )

13. change each of the following from CNF to DNF :

(a) (x + y ′ )(x′ + y)
(b) (x + y + z)(x + y + z ′ )(x + y ′ + z)(x + y ′ + z ′ )

14. Draw circuits which realize each of the following :

(a) (a + b)[cde + (f + g)h]


(b) u[v(y + x(z + t) + ws(x + y)]

4
15. Construct a table of closure properties for the function
(a + b′ + c)(a + bc′ ) + c′ d + d(b′ + c)

16. Draw a bridge circuit for the functions :

(a) (x′ u + x′ v ′ s + yu + yv ′ s)(x′ + z + w′ + v ′ s)(y + z + w′ + u)


(b) xw′ + y ′ uv + (xz + y ′ )(zw′ + uv)

17. construct a 3-terminal circuit to realize both of the following function


f = xzw + y ′ zw and g = xzw + y ′ zw + x′ y ′ z

18. construct a 4-terminal circuit to realize the following three functions,


sharing switches where possible
f = a(b + cd)(x + y) , g = a(bc + cd) and h = a(bc′ + b′ cd)

19. Draw as simple a circuit as possible for the symmetric functions given
below :

(a) xyz ′ w′ + xy ′ zw′ + x′ yzw′ + xy ′ z ′ w + x′ yz ′ w + x′ y ′ z ′ w′


(b) A symmetric function of four variables with characteristic numbers
0 and 3.

5
Mid-Term Exams
‫جامعــــــــة طنطا‬
‫ قسم الرياضيات‬-‫كليـــــــــــة العلوم‬
‫ املنطق الرياض ي والجبرالبولي‬/‫امتحانات فصلية في مقرر‬
‫ رياضيات وحاسب‬/‫الشعبة‬ ‫الثالث‬/‫املستوى‬
Exam (1)

Answer the following questions:


1) Define the following :
An argument – a well-formed formula – a partially ordered set. Give examples.
2) Test the validity for the following:
1. ∀𝑥(𝑝(𝑥) → 𝑞(𝑥))
2. ∃𝑥 𝑝(𝑥)

∴ ∃𝑥𝑞(𝑥)
3) Using DE and DU, we go from
(∃𝑥)(𝑝(𝑥) ∧ ∀𝑥 𝑞(𝑥)) to ……………..
(∃𝑥)(𝑝(𝑥) ∧ 𝑞(𝑥)) to ……………..
(∃𝑥)(𝑝(𝑥) → 𝑞(𝑥)) to ……………..

0106144598501148643888 ‫جامعة طنطا – كلية العلوم – قسم الرياضيات‬


‫جامعــــــــة طنطا‬
‫ قسم الرياضيات‬-‫كليـــــــــــة العلوم‬
‫ املنطق الرياض ي والجبرالبولي‬/‫امتحانات فصلية في مقرر‬
‫ رياضيات وحاسب‬/‫الشعبة‬ ‫الثالث‬/‫املستوى‬
Exam (2)

Answer the following questions:

1) Translate into wffs:


a) Both 𝑝 and either 𝑞 or 𝑟.
b) If 𝑝, then 𝑞 or 𝑟.
c) If 𝑝 then 𝑞 or 𝑟.
d) All integers are prime.
e) Not all integers are prime.
2) Define a Boolean algebra 𝐵. Show that if 𝐵 is a B.a, 𝑎, 𝑏 ∈ 𝐵, then
𝑎 ∙ 𝑎 = 𝑎, 𝑎 + 1 = 1 𝑎𝑛𝑑 (𝑎𝑏)′ = 𝑎′ + 𝑏 ′ .
3) Write the function (𝑥𝑦 ′ + 𝑦𝑧)′ + 𝑥′ in CNF in the three variables 𝑥, 𝑦 𝑎𝑛𝑑 𝑧. What is
the complement of this function?

0106144598501148643888 ‫جامعة طنطا – كلية العلوم – قسم الرياضيات‬


‫جامعــــــــة طنطا‬
‫كليـــــــــــة العلوم‪ -‬قسم الرياضيات‬
‫امتحانات فصلية في مقرر‪ /‬املنطق الرياض ي والجبرالبولي‬
‫الشعبة‪ /‬رياضيات وحاسب‬ ‫املستوى‪/‬الثالث‬
‫)‪Exam (3‬‬

‫‪Answer the following questions:‬‬

‫‪1) Using the truth-table test the validity of‬‬


‫𝑟 → )𝑞 ∧ 𝑝( ‪1.‬‬
‫𝑞¬ ‪2.‬‬
‫‪∴ ¬𝑟.‬‬
‫‪2) Provet that if 𝑎 + 𝑥 = 𝑏 + 𝑥 and 𝑎 + 𝑥 ′ = 𝑏 + 𝑥′, then 𝑎 = 𝑏.‬‬
‫‪3) Test the following argument:‬‬
‫𝑞→𝑝‬
‫𝑝¬‬
‫‪∴ ¬𝑞.‬‬

‫‪0106144598501148643888‬‬ ‫جامعة طنطا – كلية العلوم – قسم الرياضيات‬


‫جامعــــــــة طنطا‬
‫ قسم الرياضيات‬-‫كليـــــــــــة العلوم‬
‫ املنطق الرياض ي والجبرالبولي‬/‫امتحانات فصلية في مقرر‬
‫ رياضيات وحاسب‬/‫الشعبة‬ ‫الثالث‬/‫املستوى‬
Exam (4)

Answer the following questions:

1) Translate into logic and prove to be valid


1) All students are happy.
2) Someone is a student.
∴ Someone is happy.
2) For every pair of elements 𝑎 and 𝑏 in a Boolean algebra 𝐴, show that ̅̅̅̅̅̅̅
𝑎 + 𝑏 = 𝑎̅ ∙ 𝑏̅ and
̅̅̅̅̅̅
𝑎 ∙ 𝑏 = 𝑎̅ + 𝑏̅.
3) Write the following function in DNF:
𝑓(𝑥, 𝑦, 𝑧) = 𝑥̅ 𝑦 + 𝑧̅ + 𝑥𝑦𝑧
If 𝑓 = 𝑎̅𝑏 + 𝑏̅𝑐 + 𝑐𝑎̅. Find 𝑓 ̅ and check that 𝑓 + 𝑓 .̅

0106144598501148643888 ‫جامعة طنطا – كلية العلوم – قسم الرياضيات‬


‫جامعــــــــة طنطا‬
‫ قسم الرياضيات‬-‫كليـــــــــــة العلوم‬
‫ املنطق الرياض ي والجبرالبولي‬/‫إمتحان تطبيقي ملقرر‬
‫ علوم الحاسب‬/‫الشعبة‬ ‫الثالث‬/‫املستوى‬
/‫درجة األمتحان‬ 2020/12/28 : ‫التاريخ‬
/‫إسم الطالب‬

Answer the following questions:

1) Let 𝑈 be the structure defined as:


|𝑈| = ℕ, the set of natural numbers.
𝑝𝑈 = the set of pairs (𝑚, 𝑛) such that 𝑚 ≤ 𝑛.
𝑓 𝑈 = the successor function 𝑆, 𝑓 𝑈 (𝑛) = 𝑛 + 1.
𝑐 𝑈 = 0.
Let 𝑠: 𝑉 → ℕ be defined as 𝑠(𝑣𝑖 ) = 𝑖 − 1, 𝑠̅ is the extension function
of 𝑠. Show that
a) ⊨𝑈 𝑝𝑓𝑣1 𝑓𝑣5 [𝑠] b) ⊭ ∀𝑣1 𝑝𝑣1 𝑣2 [𝑠]
a) Let 𝑅 = (𝑅; +, −,0,1) be a Boolean ring and 𝑅̅ = (𝑅; ∨,∧,′ , 0,1)
be the corresponding Boolean Algebra. Show that:
b) 𝑎 ∧ (𝑏 ∨ 𝑐) = (𝑎 ∧ 𝑏) ∨ (𝑎 ∧ 𝑐).

0106144598501148643888 ‫جامعة طنطا – كلية العلوم – قسم الرياضيات‬


‫‪0106144598501148643888‬‬ ‫جامعة طنطا – كلية العلوم – قسم الرياضيات‬
‫جامعــــــــة طنطا‬
‫ قسم الرياضيات‬-‫كليـــــــــــة العلوم‬
‫ املنطق الرياض ي والجبرالبولي‬/‫إمتحان فصلى(أعمال سنة) مقرر‬
‫ علوم الحاسب‬/‫الشعبة‬ ‫الثالث‬/‫املستوى‬
/‫درجة األمتحان‬ 2020/12/14 : ‫التاريخ‬
/‫إسم الطالب‬

Answer the following questions:

1) Test for validity:


𝑝 → (𝑞 ∧ 𝑟)
𝑞∨𝑠 →𝑙
𝑠∨𝑝

∴𝑙
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.

0106144598501148643888 ‫جامعة طنطا – كلية العلوم – قسم الرياضيات‬


‫‪0106144598501148643888‬‬ ‫جامعة طنطا – كلية العلوم – قسم الرياضيات‬
‫جامعــــــــة طنطا‬
‫ قسم الرياضيات‬-‫كليـــــــــــة العلوم‬
‫ املنطق الرياض ي والجبرالبولي‬/‫إمتحان فصلى(أعمال سنة) مقرر‬
‫ رياضيات‬/‫الشعبة‬ ‫ الثالث‬/‫املستوى‬
/‫درجة األمتحان‬ 2020/12/14 : ‫التاريخ‬
/‫إسم الطالب‬

Answer the following questions:

1) Test for validity:


((𝑝 → 𝑞 ) → 𝑟) → 𝑠
¬𝑠
𝑝

∴𝑞
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) (𝑎 + 𝑏)′ = 𝑎′𝑏′, 𝑎, 𝑏 ∈ 𝐴.

0106144598501148643888 ‫جامعة طنطا – كلية العلوم – قسم الرياضيات‬


‫‪0106144598501148643888‬‬ ‫جامعة طنطا – كلية العلوم – قسم الرياضيات‬
Final Exams
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: (1) Time Allowed: 2 Hours

(Note: Exam has Two Pages).


Answer the following questions:
Question 1: (40 Marks)
a- Test the validity of the following arguments using the truth table test:
𝑝→𝑞
𝑞→𝑟
∴ 𝑝 → 𝑟.
(20 Marks)
b- Test the validity for the following:
∀𝑥(𝑝(𝑥) → 𝑞(𝑥))
∃𝑥(𝑝(𝑥) → ¬𝑟(𝑥))

∴ ∃𝑥(𝑞(𝑥) ∧ ¬𝑟(𝑥))
(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)

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: (2) Time Allowed: 2 Hours
Answer the following questions:
Question 1: (40 Marks)
a- Test the validity of the following arguments:
𝑝→𝑞 (using the truth assignment test)
𝑝
∴ 𝑞.
(15 Marks)
b- (using the truth table test)
(𝑝 ∧ 𝑞) → 𝑟
¬𝑞

∴ ¬𝑟
(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)

Question 4: (35 Marks)


a. Minimize the expression 𝑎̅𝑏𝑐 + 𝑎𝑑 + 𝑑̅(𝑏 + 𝑐) + 𝑎𝑐̅ + 𝑎̅𝑑 using the map method. (15 Marks)
b. Construct the truth table for the half adder, if the sum and carry is given as
̅̅̅̅̅̅̅̅̅̅̅̅̅̅
̅̅̅̅ ∙ ̅̅̅̅̅̅
̅̅̅̅ ∙ 𝐶, 𝐶 = ̅̅̅̅
𝑠 = (𝐴𝐴𝐵 𝐵𝐴𝐵 𝐴𝐵, then draw the corresponding circuit. (20 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: (3) Time Allowed: 2 Hours

(Note: Exam has Two Pages).


Answer the following questions:
Question 1: (40 Marks)
a) Test the validity of the following arguments using the truth table test:
𝑝→𝑞
𝑟→𝑠
𝑝∨𝑟
∴ 𝑞 ∨ 𝑠.
(20 Marks)
b) Translate into logic:
vi. Not any one is poor.
vii. If any one is evil, it will rain.
viii. Both 𝑝 and either 𝑞 or 𝑟.
ix. Some real numbers are integers.
x. At least two children are hungry.
(20 Marks)

Question 2: (35 Marks)


a) Define the following:
A term – an atom – a well-formed formula – a structure for a given first-order language.
(15 Marks)
b) Test the validity for the following:
∀𝑥(𝑝(𝑥) → 𝑞(𝑥))
∃𝑥(¬𝑝(𝑥) → 𝑟(𝑥))

∴ ∃𝑥(𝑞(𝑥) ∧ 𝑟(𝑥))
(20 Marks)

Question 3: (40 Marks)


a) Define Boolean algebra, then give examples. (10 Marks)
b) Let 𝐵 be a Boolean algebra, 𝑎, 𝑏 𝑎𝑛𝑑 𝑐 ∈ 𝐵, prove that if 𝑎𝑏 = 𝑎𝑐 𝑎𝑛𝑑 𝑎 + 𝑏 = 𝑎 + 𝑐 then 𝑏 = 𝑐.
(15 Marks)
′ ′
c) Simplify the function 𝑓(𝑎, 𝑏, 𝑐, 𝑑) = 𝑎 𝑏 𝑐 + 𝑏𝑐 + 𝑎𝑐.
(15 Marks)

(Please, Turn Of The Page)


Question 4: (35 Marks)
a) Write the following function in DNF in the three variables 𝑥, 𝑦, 𝑧:
𝐹(𝑥, 𝑦, 𝑧) = ((𝑥 + 𝑦 ′ + 𝑥𝑧)𝑥)′ (20 Marks)
b) Construct a 4-terminal circuit to realize all three of the functions specified by the following table:

𝒙 𝒚 𝒛 𝒇 𝒈 𝒉
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

(Note: Exam has Two Pages).


Answer the following questions:
Question 1: (40 Marks)
a) Test the validity of the following arguments using the truth table test:
(𝑝 ∧ 𝑞) → 𝑟
¬𝑞
∴ ¬𝑟.
(10 Marks)
b) Translate into logic:
1. No one is sick.
2. If any one is a student, it will rain.
3. Any one is a male or female.
4. Ahmed alone is hungry.
(10 Marks)
c) Determine the free variables in the following formulas:
1. ∃𝑥𝑝(𝑥, 𝑦) → 𝑞(𝑥).
2. ∃𝑥(𝑝(𝑥, 𝑦) → 𝑞(𝑥)).
3. 𝑝(𝑥) ∨ ∃𝑥𝑞(𝑥, 𝑦).
(20 Marks)
Question 2: (35 Marks)
a) Test the validity for the following:
∀𝑥(𝑝(𝑥) → 𝑞(𝑥))
∀𝑥 𝑝(𝑥)

∴ ∀𝑥 𝑞(𝑥)
(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)

(Please, Turn Of The Page)


Question 4: (35 Marks)
a) Provet that if 𝑎 + 𝑥 = 𝑏 + 𝑥 and 𝑎 + 𝑥 ′ = 𝑏 + 𝑥′, then 𝑎 = 𝑏. (10 Marks)
b) Change the function 𝑓 from DNF to CNF, where 𝑓 = 𝑥𝑦 + 𝑥 ′ 𝑦 + 𝑥′𝑦′. (10 Marks)
c) Consider the bridge circuit:
Q
b 𝑐’
a
T1 d T2
P R
c a

Apply the wye-to-delta transformation to give an equivalent series-parallel-circuit, henct the


Boolean function.
(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: (5) Time Allowed: 2 Hours

(Note: Exam has Two Pages).


Answer the following questions:
Question 1: (40 Marks)
a) Test the following argument for validity (using the indirect proof):
𝑝 → (𝑞 ∧ 𝑟)
𝑞 → (𝑝 ∧ 𝑟)
∴ (𝑝 ∨ 𝑞) → 𝑟
(10 Marks)
b) Translate into logic, then test for validity using the truth assignment test:
1. If it’s right for me to lie and not for right for you, then there’s a relevant difference between oyr
cases.
2. There is no relevant difference between our cases.
3. It’s not right for you to lie.
∴ It’s not right for me to lie.
(15 Marks)
c) Determine the free variables in the following formulas:
1. (∃𝑥)(𝑃(𝑥) → ∀𝑦(𝑄(𝑥, 𝑦)).
2. ((∀𝑥)𝑃(𝑥) → ∃𝑦𝑄(𝑥, 𝑦)).
3. (∃𝑥)𝑃(𝑐, 𝑓(𝑥, 𝑑)). (15 Marks)
Question 2: (40 Marks)
a) Test the following argument for validity:
1. (∀𝑥)(𝑝(𝑥) ∨ 𝑞(𝑥))
∴ ((∀𝑥)(𝑝(𝑥) ∨ (∀𝑥)𝑞(𝑥))
(10 Marks)
b) Show that a formula (∀𝑥)𝑝(𝑥) → (∀𝑥)𝑝(𝑥) ∨ 𝑞(𝑥) is a wff.
(10 Marks)
c) In the language of the set theory translate the following statements into logic:
For every set 𝑧 there is a set 𝑦 whose members are exactly the members of the members of 𝑧.
(10 Marks)
d) Define the following: A term – an atomic formula – a well formed formula – a structure for a first-
order language. (10 Marks)
Question 3: (35 Marks)
a) Prove that for any 𝑎, 𝑏 and 𝑐 in a Boolean algebra 𝐵:
1. 𝑎 + 𝑏 = 𝑏 ⟷ 𝑎 ∙ 𝑏 = 𝑎.
2. 𝑎𝑏 + 𝑏𝑐 + 𝑐𝑎 = (𝑎 + 𝑏)(𝑏 + 𝑐)(𝑐 + 𝑎).
(15 Marks)
b) Change form CNF to DNF the following:
(𝑥 + 𝑦 + 𝑧)(𝑥 + 𝑦 + 𝑧 ′ )(𝑥 + 𝑦 ′ + 𝑧)(𝑥 + 𝑦 ′ + 𝑧 ′ ) (10 Marks)
c) If we define a relation ≤ on a Boolean algebra 𝐵 as
𝑎 ≤ 𝑏 ⟷ 𝑎 + 𝑏 = 𝑏 ⟷ 𝑎 ∙ 𝑏 = 𝑎, then show that 𝑎 ≤ 𝑏 ⟷ 𝑎 ∙ 𝑏 = 0. (10 Marks)
(Please, Turn Of The Page)
Question 4: (35 Marks)
a) Construct a bridge circuit which realize the function
𝑓 = 𝑥𝑤 ′ + 𝑦 ′ 𝑢𝑣 + (𝑥𝑧 + 𝑦 ′ )(𝑧𝑤 ′ + 𝑢𝑣). (15 Marks)
b) Construct a 4-terminal circuit to realize the following three functions, sharing switches where
possible:
𝑓 = 𝑎(𝑏 + 𝑐𝑑)(𝑥 + 𝑦)
𝑔 = 𝑎(𝑏𝑐 + 𝑐𝑑)
ℎ = 𝑎(𝑏𝑐 ′ + 𝑏 ′ 𝑐𝑑)

(20 Marks)

With My Best Wishes.


Examiners Prof. Dr. Tahany El-Sheikh

You might also like