Lectures on Laws of Supply and Demand,

advertisement
Lectures on Laws of Supply and Demand,
Simple and Compound Interest and Logic
by Dr. Brendan Browne
Applications of the straight line equation
Demand and supply decisions by consumers, firms and governments determine the level
of economic activity within an economy. As these decisions play a vital role in business
and consumer activity, it is important to mathematically model and analyse them. This
can be done by modelling the simple laws of economics, namely the demand and
supply laws , by linear equations as a first approximate model.
There are several variables that influence the demand for a certain good or service X .
These may be expressed by the general demand function
P  f (Q, Y , T , A, O)
where
Q is the quantity demanded for good X
P is the price of good X
Y is the income of the consumer
T is the fashion or taste of the consumer
O is other factors if there are any.
The simplest model is
P  f (Q )
where the price depends mainly on the quantity(or other factors remain fixed or
negligible).This is called the law of demand in economics and the function f
the demand function.
The demand function P  f (Q ) can be modelled by the general simple linear equation
P  a  bQ
where a  0 and b  0 .
A plot of P  a  bQ with a  100 and b  0.5 is shown below.
Example The demand function is given by P  100  0.5Q .
(a) Find the slope and intercepts of P  100  0.5Q .(b) Plot P  100  0.5Q for
0  Q  220 (c) What is the quantity demanded when(i) P  5 ? (ii) P  20 ?
(d) Find an expression for the demand function in the form Q  g (P) .
Solution (a) slope=-0.5, intercepts 100 and 200 (b) Plot given below
(c) P  100  0.5Q  5  100  0.5Q  0.5Q  95  Q  190 .
P  100  0.5Q  20  100  0.5Q  0.5Q  80  Q  160 .
(d) P  100  0.5Q  0.5Q  100  P  Q  100 /(1 / 2)  1 /(1 / 2) P  Q  200  2 P
1
150
100
100 0.5Q
50
0
0
50
100
Q
2
150
200
Supply Function The law of supply is a basic law in economics and is given by the
linear equation
P  c  dQ
where c  0 and d  0 and of course P and Q are the price and quantity of a good X .
A plot of P  c  dQ where a  10 and b  0.5 is given below
Example
120
108
96
84
72
10 0.5Q 60
48
36
24
12
0
0
12
24
36
48
60
72
84
96
108
120
Q
Example The supply function is given by P  10  0.5Q .
Find(a) the slope and intercepts (b) plot P  10  0.5Q for 0  Q  120
(c) What is the price of the quantity Q  70
Solution (a) slope= +0.5 and intercepts vertical  10 and horizontal  20 (c)
Q=70  P  10  0.5(70)  45 .
3
Equilibrium in goods
Goods market equilibrium occurs when the quantity demanded Q d by consumers and the
quantity supplied Qs by the producers of a good is equal. Equivalently, market
equilibrium occurs when the price that a consumer is willing to pay Pd is equal to the
price that a producer is willing to accept Ps . The equilibrium condition then is expressed
as Qd  Qs and Pd  Ps .
In general this means that we have to solve two simultaneous linear equations
P  a  bQ and P  c  dQ .
Example The demand and supply functions for a good are given by
Pd  100  0.5Qd -----demand function
Ps  100  0.5Qs -----supply function
Calculate the equilibrium price and quantity graphically. Confirm your answer
algebraically.
Solution
Graphical solution is given below.
120
100
80
100 0.5Q
10 0.5Q
60
40
20
0
0
36.667
73.333
110
146.667
183.333
Q
Equilibrium point is approximately Q=89,P=55.
Algebraically Pd  Ps  100  0.5Q  10  0.5Q  Q  90
P  0.5Q  100
OR
Subtracting 2P  110  P  55
P  0.5Q  10
55  0.5Q  100  0.5Q  100  55  45  Q  90 .
4
220
Lectures on Logic
Logic
Introduction Logic(word comes from the Greek word “logos” meaning word, speech or
reason) is the mathematics of reasoning. The study of logic is the effort to determine the
conditions under which one is justified in passing from given statements, called premises,
to conclusions that is claimed to follow from them. Logical validity is a relationship
between the premises and the conclusion such that if the premises are true then the
conclusion is true.
Logic is fundamental important in information technology for the following reasons.
(i)Logic is used in writing computer code.
(ii)Logic particularly predicate logic is used in declarative languages such as
Prolog(stands for PROgramming in LOGic) for querying databases.
(iii)Formal specification documents are written in specification languages such as
Z which relies heavily on logic.
.
(iv)Proof of Correctness of programs uses techniques of logic to prove that if the
input variables satisfy certain specified predicates or properties, the output variables
produced by executing the program satisfy certain properties.
(v)Laws of logic are used in the design of the digital circuitry in the digital computer.
(vi)logic is the theoretical basis of relational data base theory and artificial intelligence.
Definition: Logic is the mathematics of reasoning. Logic in general comprises
Propositional Logic (that is logic, involving only propositions and logical connectives)
and Predicate Logic(that is logic involving predicates and quantifiers). One of the main
objectives of logic is to analyse and test the validity or otherwise of an argument. In
general you need both types of logic to analyse the most complicated arguments. First we
will study Propositional Logic.
5
Propositional Logic
Propositional logic is logic that consists only of propositions and not predicates.
To analyse an argument you must break the argument into its constituent ( smallest parts)
parts or atomic parts which are called propositions. These propositions are represented
in logic by capital letters usually from the start of the alphabet, such as A, B or C .More
complicated propositions are represented by compound proposition which are composed
of two or more propositions connected by logical connectives. The main logical
connectives are, and(  ), or (  ),not(
/
) ,conditional implication(  ) and
biconditional implication (  or  ).
Propositions are to logic as numbers are to arithmetic. We define a proposition and the
different logical connectives using truth tables which are the building blocks of logic.
Formal logic can represent the statements we use in English to communicate facts or
information. This it does, as we said, by using letters A, B and C to represent simple
statements or propositions and special symbols for logical connectives.
Definition: A proposition or statement is a simple statement that is either true(T) or
false(F). Whichever of these (T or F) is the case is called the true value of the
proposition.
Note Thus a proposition can have only two truth values either T or F.
Example 1 Consider the following statements. Are they propositions or not?
(i)
Twenty is less than thirty. (ii)How are you?
(iii) Come here. (iv) She is very talented.
(v) There are life forms on other planets.
Solution
(i) Is a proposition since it has a truth value namely F
(ii) Is a not proposition since it has no truth value—It is a question.
(iii) Is a not proposition since it has no truth value—It is a command.
(iv) Is a not proposition since it has no truth value—It is not well-defined
since she is not specified enough.
(v)It is a proposition since it has truth value T or F—We do not have to be able to
decide which for it to be a proposition.
6
Exercise 1
Which of the following are statements or propositions. Explain?
(a)The moon is made of green cheese. (b) He is certainly a tall man.
(c) Two is a prime number. (d)Will the game be soon over?
(e) Next year interest rates will rise. (f) Next year interest rates will fall.
(g) Give me your book.
(h)My laptop computer works. (i)Set up my computer.
(j)All my computer files are binary files.
Exercise 2 Determine whether each of the following sentences is a proposition.
(i)In 1998 William Clinton was president of the United States.
(ii)Compile my computer program.
(iii)What time is it?
(iv)Fifteen is an even number.
Explain.
Exercise 3 If p stands for the proposition “The specification is suitable” and
q stands for “The programming team is happy” write out in English
the meaning of the following symbolic statements.
(i)  p  q , (ii)  p  q    p  q  .
Note not A  A or A .
7
Consider the following statement “ This statement is false.”
This is an example of a self-referential statement(i. e. it makes a statement about itself)
Let us investigate its truth value. Assume it is true. Then the statement is false as it tells
us it is false. If we assume it is false then because the sentence is telling us it is false then
the sentence is true. This sentence is an example of a paradox and the only way to avoid
the difficulty is simply not to allow it as a proposition in logic. Thus in our logic we will
not allow self-referential statements.(This does not mean that there is no place for selfreference in logic. In fact some of the most important results in modern logic involve
self-referential propositions)
What about statements such as “ Ice cream is delicious. ” We will not consider this a
proposition because it is clearly a matter of choice or opinion. The reason for excluding
such statements as propositions is that in logic, mathematics and computer science
statements are very precisely defined and there is no doubt when a statement is a
proposition or not.
Connectives and Truth Tables
In English simple statements are combined with connecting words like and to make more
interesting compound statements. The truth value of the compound proposition depends
on the truth values of its separate propositions and the connectives. The most commonly
used connectives and their logic symbols are given below.
Logic Connective
Symbol


and
or(inclusive)
/
not
or 
 (conditional implication)
 or  (bicondional implication)
if then
if and only(iff)
8
Definition A compound proposition is two or more propositions combined by a
logical connective.
Example 2 “ If Brian and Angela are not both happy then either Brian is not happy or
Angela is not happy”.
This is an example of a compound proposition. Logic is not concerned with determining
the truth values of simple propositions( that depends on facts outside of logic) but in
determining the truth value of compound propositions because of its logical structure.
In the case above we will analyze it and show it is always true due to its structure.(You
can see this for this simple example just by thinking about it.)In fact it is what is called in
logic a tautology.
We will let letters A, B or C represent single propositions and we will now investigate
the truth values of some simple compound propositions with the most widely used logical
connectives. This we do by defining truth tables for the different connectives and these
tables are extremely important as they are basic tools of logic and must be remembered
off by heart.
Logical Connective and denoted  .
The expression A  B is called the conjunction of A and B . A and B are called the
conjucts of this compound proposition.
Its truth table is
A
T
T
F
F
B
T
F
T
F
Explanation
Let: A : Dublin is in Ireland.
B : 10 is greater than 7.
T  T is true.
T  F is false.
F  T is false
F  F is false.
All obvious and no controversy.
9
A B
T
F
F
F
Logical Connective—The Inclusive or denoted by 
The compound proposition A  B is called the disjunctioin of A and B . A and B
are called the disjuncts of the compound propositions.
The truth table for A  B is
A
T
T
F
F
B
T
F
T
F
A B
T
T
T
F
Explanation
Let: A : Dublin is in Ireland.
B : 10 is greater than 7.
T  T is true.
T  F is true.
F  T is true
F  F is false.
All obvious and no controversy.
Note The word or is used in English in two different ways.
Example 3 If a discount is available to anyone who is a student or pensioner it is
presumably available to someone who is both a student and a pensioner. This is the use
of the inclusive or (  ) that in a compound proposition is true if both propositions are
true.
There is another use of or in English called the exclusive or ( sometimes called XOR and
denoted by  ).
10
Example 4 On a menu in a restaurant we have “Soup or Salad comes as a starter”.
Restaurants almost always mean that the customers can take Soup or(  )
Salad but not both. This is an example of the exclusive or rather than the
inclusive or. Hence when both propositions are true in a compound
proposition with the exclusive or the compound proposition is false.
The truth table for A B is
A
T
T
F
F
B
T
F
T
F
A B
F
T
T
F
Explanation
All obvious except row 1 which is explained by restaurant menu above.
N.B. In logic we always use the inclusive or (  ) ,never the exclusive or (  ).
However the exclusive or (  ) is used in computer science particularly in
Cryptography and Network Security—see Cryptography and Network Security by
W.Stallings—Prentice-Hall 1999, ISBN-0-13-869017-0.
11
Logical Connective --Conditional Implication denoted by  has the following
truth table.
A
T
T
F
F
B
T
F
T
F
AB
T
F
T
T
Explanation
Let: A : You pass your summer examinations.
B : I will take you out for a drink.
I make the statement
If You pass your summer examinations then I will take you out for a drink.
In symbolic logic A  B .
(i)If you pass your summer examination and I take you out for a drink—then you
would agree that I did not tell a lie. T  T is true.—first row of truth table—
obvious.
(ii)If you pass your summer examination and I do not take you out for a drink—then
you would agree that I did tell a lie. T  F is false.— second row of truth
table— obvious.
(iii)If you do not pass your summer examination and I do take you out for a drink—
then you would agree that I did not tell a lie. F  T is true.— third row of
truth table— not so obvious.
(iv)If you do not pass your summer examination and I do not take you out for a
drink—then you would agree that I did not tell a lie. At least you would give me
the benefit of the doubt-- F  F is true.— third row of truth table— not so
obvious.
N. B. To avoid any ambiguity or controversy the above truth table is taken as a
definition of the logical connective  .In fact this truth table for  must hold
or the whole of logic would break down. In fact all the truth tables for their
logical connectives are considered definitions of their logical connective.
N.B. .This logical operator  must not be confused with the programming structure
If(condition) then. The purpose of the programming structure is to cause an
action when the if condition is true whereas the logical operator  is a binary
operation on propositions that is a method of combining two propositions to
give a new proposition.
12
Logical Connective --Biconditional Implication denoted by  or  has the following
truth table.
A
T
T
F
F
A  B or A  B
T
F
F
T
B
T
F
T
F
Explanation: This will be explained later when we have studied the concept of Logical
Equivalence.
All the above logical connectives are called binary logical connectives because they
connect two propositions .A logical connective that applies to one proposition is called a
unary logical connective. Such a connective is the not logical connective denoted by
/
or  .It has the following truth table.
A or A
F
T
A
T
F
It just reverses the truth values and explanation is obvious.
N.B You must remember all the above truth tables as they are the building blocks of
logic. For studying logic particularly for determining whether an argument is valid
or not, we will need them, as we will see. These truth tables are summarized in
following table.
A
T
T
F
F
B
T
F
T
F
A B
T
F
F
F
A B
T
T
T
F
13
AB
T
F
T
T
AB
T
F
F
T
A
F
T
Because of the richness of the English language words with different shades of meaning,
nonetheless in logic, have the same logical connectives. Thus
English word
and, but, also, moreover,
in addition
or
If A then B ,
A implies B , A only if B ,
A therfore B, B follows A ,
A is a sufficient condition B ,
B is a nessary condition A
A if and only if B
A is necessary and sufficient if B
Not A
It is false that A
It is not true that A
Logical connective

Logical Expression
A B

A B

AB
Equivalence
AB
Negation
A
Example 5 Using letters for the component statements, translate the following
compound statements into symbolic notation.
(a) If the horse is fresh, then the knight will win.(b) The knight will win only if the
horse is fresh and the armor is strong. (c) A fresh horse is a necessary condition
for the knight to win.(d) The knight will win if and only if ( iff) the armor is
strong.(e) A sufficient condition for the knight to win is that the armor is strong or
the horse is fresh.
Solution: Let A : The horse is fresh.
Let B : The knight will win.
Let C : The armor is strong.
(a) A  B . (b) B   A  C  . (c) B  A . (d) B  C . (e) C  A  B
Exercise 4 Using letters for component statements, translate the following compound
statements into symbolic logic notation.
(i)
If Brian wins the election, then tax rates will be reduced.
(ii)
Tax rates will be reduced only if Brian wins the election and the economy
remains strong.
(iii)
Tax rates will be reduced if the economy remains strong.
(iv)
A strong economy will follow from Brian winning the election.
(v)
The economy will remain strong iff Brian wins the election or tax rates are
reduced.
14
We can string statement letters, connectives, and parentheses( or brackets) together to
form new expressions, as in  A  B  B  A .
Of course, just as in a computer programming language, certain syntax rules(rules on
which strings are legitimate) prevail: for example,
A))    BC
would not be considered a legitimate string.
Definition: An expression that is a legitimate string is called a well-formed formula,
or wff.
To reduce the number of parentheses required in a wff, we stipulate an order in which
connectives are applied. This order of precedence is
(1) connectives within parentheses, innermost parentheses first.
(2) /, 
(3) ,  .
(4)  .
(5)  .


This means that the expression A  B  stands for A  B  , not  A  B  . Similarly,
A  B  C means  A  B  C , not A  B  C  .However, you use parentheses
anyway, just to be sure that there is no confusion. Wffs composed of statements letters
and connectives have truth values that depend on the truth values assigned to their
statement letters. We write the truth table for any wff by building up the components
parts, just as we did for  A  B  B  A .
N.B. It is often useful in the study of logic to analyse expressions such as  A  B  B , in
which A and B are treated as variables rather than symbols denoting specific
propositions. If we do this then  A  B  B is no longer a proposition but a logical
expression. We can think of a logical expression as we think of an expression containing
x in algebra. The expression cannot be evaluated unless x is assigned a value but this
does not prevent us from studying the expression and investigating its properties.
The truth value of the expression  A  B  B for each possible combination of truth
values of A and B can be found by constructing a truth table as follows.
A
B
B
T
T
F
T
F
T
F
T
F
F
F
T
Note:
If a logical expression contains two variables A, and
 A  B 
 A  B   B
F
T
F
F
T
T
T
F
B the table will have 2 2  4 lines.
If a logical expression contains three variables A, B and C the table will have 2 3  8 lines.
If a logical expression contains three variables A, B , CandD the table will have 2 4  16
lines.
15
Now ordinary statements in English can be translated in symbolic logic and visa versa
Examples of this are given below.
Example 6: Let A,B and C be the following statements
A: Roses are red. B: Violets are blue. C: Sugar is sweet.
Translate the following compound statements into symbolic logic notation.
(a)Roses are red and violets are blue.
(b)Roses are red and either violets are blue or sugar is sweet.
(c)Whenever violets are blue roses are red and sugar is sweet.
(d)Roses are red only if violets aren’t blue or sugar is sour.
(e)Roses are red and if sugar is sour, then either violets aren’t blue or sugar is sweet.
Solution
A: Roses are red. B: Violets are blue. C: Sugar is sweet.
(a) A  B . (b) A  ( B  C )
(c) Whenever violets are blue roses are red and sugar is sweet.
Is equivalent to--If violets are blue then roses are red and sugar is sweet.
B  ( A  C) .
(d) Roses are red only if violets aren’t blue or sugar is sour
is equivalent to-- If Roses are red the violets are not blue or sugar is not sweet.
is equivalent to-- A  ( B   C ) .
(e) A  [C   ( B   C ] .
Also of course symbolic logic can be translated back into ordinary English.
Example 7 Use A B and C as defined in Example above to translate the following
statements into English.
(a) B  C  (b) B   ( A  C ) (c) (C  A)  B (d) C  ( A  B)
(e) ( B  C )  A (f) A  ( B  C ) (g) ( A  B)  C  .
Solution
(a) B  C 
is equivalent to Violets are blue or sugar is sour(not sweet).

(b) B  ( A  C ) is equivalent to Violets are not blue or, if roses are red, then sugar is
sweet.
(c) (C  A)  B is equivalent to Suger is sweet and roses are not red, if and only if
violets are blue .
(d) C  ( A  B) is equivalent to
Suger is sweet, and roses are not red if and only if
violets are blue
(e) ( B  C )  A is equivalent to If it is false that both violets are blue and sugar is
sour ,then roses are red .
(f) A  ( B  C ) is equivalent to
(g) ( A  B)  C  . is equivalent to
Roses are red ,or violets are blue and sugar is sour.
Roses are red or violets are blue, and sugar is sour.
16
Example 8 Construct a truth table for the following wff
A  B  C  A  B  C ,
Solution
 A  B  A  B  C B  C 
A
T
T
T
T
F
F
F
B
T
T
F
F
T
T
F
C
T
F
T
F
T
F
T
T
T
F
F
F
F
F
T
T
T
F
T
F
T
F
F
F
F
F
T
T
T
F
T
T
T
A  B  C 
T
T
T
F
F
F
F
T
T
T
T
F
T
F
F
F
T
Exercise 5 Construct truth tables for the following wffs

(i) A   A  B  ,
(ii)  A  B   A  C   B  C  .
17
A  B  C  A  B  C 
Logical Equivalence, Tautologies and Laws of Logic.
Write the following propositions in symbolic form.
(1) “It is not the case that both the input file and the output file are not on the disc.”
(2) “Either the input file or the output file is on the disc.”
Also construct a truth table for these propositions.
Solution
Let A : The input file is on the disc.
B : The output file is on the disc.

Hence (1) in symbolic logic is  A^ B  while (2) in symbolic logic is A  B .
Constructing and combining the truth tables for both compound propositions we get
A
B
A
B
A  B 
 A  B 
A B
T
T
F
F
T
F
T
F
F
F
T
T
F
T
F
T
F
F
F
T
T
T
T
F
T
T
T
F

N.B.  A  B  and A  B have the same truth values no matter what the truth values of
the constituent propositions A and B .
This leads to next very important concept namely Logical Equivalence.
Definition: Logical Equivalence.
Two wffs or logical expressions (composed of the same variables) are logically
equivalent if they have the same truth values for every combination of the truth values
of the variables and are written P  Q .

i.e Let P   A^ B  and Q  A  B then from above P  Q .
Note: This means that one logical expression or wff’s can replaced by the other
without changing the truth values.
18
Example 9 Show that P   A  B  B  A and Q   A  B are logically
equivalent, that is P  Q .
Remember the truth table for A  B
A
T
T
F
F
A
T
T
F
F
AB
T
F
F
T
B
T
F
T
F
B
T
F
T
F
AB
T
F
T
T
BA
T
T
F
T
P   A  B  B  A
T
F
F
T
Q   A  B
T
F
F
T
The truth values in column for P   A  B  B  A and in column for
Q   A  B are the same for every combination of truth values for their constituent
variables A and B .Hence that P   A  B  B  A and Q   A  B are logically
equivalent, that is P  Q and this explains the truth table for A  B .
Example 10 Every compound statement is equivalent to a statement using only the
connectors of conjunction  and negation A .T o see this we need to find
equivalent wffs for A  B and A  B that use only conjunction  and
negation.
Hint: Show that (i) A  B  ( A  B ) (ii) A  B  ( A  B ) .
Solution
(a)
To show that (i) A  B  ( A  B )
A
B
A B
A
B
 A  B
 A  B 
T
T
F
F
T
F
T
F
T
T
T
F
F
F
T
T
F
T
F
T
F
F
F
T
T
T
T
F
Column 3 and Column 7 have the same truth values.
Hence A  B  ( A  B )
19
(b)
To show that A  B  ( A  B ) .
A
B
AB
B
A  B
 A  B 
T
T
F
F
T
F
T
F
T
F
T
T
F
T
F
T
F
T
F
T
T
F
T
T
Column 3 and Column 7 have the same truth values.
Hence A  B  ( A  B ) .

Exercise 6 Show that  A  B  and A  B are logically equivalent.
Laws of Logic: Some of these equivalences are so important in logic that some of the
most important equivalences comprise what are known as the laws ( axioms) of logic.
These laws(or axioms) satisfy a very similar structure to the laws( or axioms) of
algebra.
These laws are widely used
(1) to simplify logical expressions which are important in writing efficient code in most
programming languages.
(2) used in proof sequences which are alternative methods to truth tables for proving
logical equivalences and valid arguments.
These laws of logic are given below. The can all be proved by using truth tables.
20
1a A  B  B  A
Some Equivalences Or
The Laws of Logic
1b A  B  B  A commutative laws
2a ( A  B)  C  A  ( B  C ) 2b A  ( B  C )  ( A  B)  C associative laws
3a A  ( B  C )  ( A  B)  ( A  C ) 3b A  ( B  C )  ( A  B)  ( A  C )
distributive laws.
4a A  F (0)  A
4b A  T (1)  A identity laws.
5a A  A  T (1)
5b A  A  F (0) inverse law or complementary laws.
6a ( A  B)  A  B 
6b ( A  B)  A  B  de Morgan’s laws.
7a A  T (1)  T (1)
7b A  F (0)  F (0) annihilation laws.
8a A  ( A  B)  A
8b A  ( A  B)  A absorption laws.
9a A  A  A
9b A  A  A idempotent laws
10
A  B  A  B
11
A  B  ( A  B)  ( B  A)
implication law.
equivalence law.
( A)   A
12
double negation law.
Note 1 T=truth
and
F= false.
Note 2 not A  A  A and all the above laws can be proved using truth tables.
Note 3 Now some of these laws take the same form as some of the laws of algebra
with  replaced by  , + replaced by  and  replaced by  .
Also 1 replaced by T and 0 replaced by F .
The commutative, associative and identity laws are of this type and so
is the second distributive law
A  ( B  C )  ( A  B)  ( A  C )
because it corresponds to the familiar rule for
multiplying out brackets x  ( y  z )  ( x  y )  ( x  z ) .
2  (3  5)  2  3  2  5  16  16
However it is not the case with the first distributive law
A  ( B  C )  ( A  B)  ( A  C ) since
x  ( y  z)  ( x  y)  ( x  z)
2  (3  5)  (2  3)  (2  5) .Hence 17  35 .
Thus working with the laws of logic can sometimes have the same “feel” as
doing algebra with numbers, but it is essential to make sure that each step in
the solution to a problem can be justified using one of the laws of logic.
Note 4 identity laws A  F  A  A  0  A and A  T  A  A 1  A .
21
We will just prove some of these equivalences by constructing truth tables.
Example 11 Prove De Morgan’s laws of logic

namely  A  B   A  B  --(6a),
A
B
A B
 A  B 
A
B
A  B 
T
T
F
F
T
F
T
F
T
T
T
F
F
F
F
T
F
F
T
T
F
T
F
T
F
F
F
T

The truth values of the column for  A  B  is the same truth values as the column


for A  B  .Hence  A  B   A  B  , that is  A  B  is equivalent to
A  B  .
Note: You would never guess this. But it is a very important law as it is frequently used
in simplifying logical expressions.
Example 12
Prove the implication law, namely A  B  A  B --(11).
A
T
T
F
F
B
T
F
T
F
AB
T
F
T
T
A
F
F
T
T
B
T
F
T
F
A  B
T
F
T
T
The truth values of the column for A  B is the same truth values as the column
for A  B .Hence A  B  A  B , that is A  B is equivalent to A  B .
Note Thus we see that the logical connective  is not really a fundamental logical
connective as it can be represented by the fundamental logical connectives
namely, not ( / ) and or(  ).
.
Exercise 8 Prove De Morgan’s law of logic namely
22
 A  B   A  B  --(6b).
An important practical application of the laws of logic is the simplification of logical
expression in algorithms. De Morgan’s laws are often particularly useful in this type of
problem.
Example 15
An algorithm contains the following line
If not ( x  5 and x  10) then…
How could this be written more simply? Explain
Solution Using De Morgan’s Law we can simplify above expression by first
expressing it in symbolic logic as follows.
Let A : x  5 and
Let B : x  10
then If not ( x  5 and x  10) then… expressed in symbolic logic is

if  A  B  then
This is equivalent to
if  A  B then –by applying De Morgan’s law 6b.
But A = not x  5 = x  5 and B  = not x  10 = x  10 .
Hence we can write above line of code more simply as
If ( x  5 or x  10) then…
N.B The negation of x  5 is x  5 and
not
x  5.
Example 16 An algorithm contains the following line
If not ( x  7 or x  9) then…
How could this be written more simply? Explain.
Solution Using De Morgan’s Law we can simplify above expression by first
expressing it in symbolic logic as follows.
Let A : x  7 and
Let B : x  9
then If not ( x  7 or x  9) then … expressed in symbolic logic is

if  A  B  then
This is equivalent to
if  A  B then –by applying De Morgan’s law 6a.
But A = not x  7 = x  7 and B  = not x  9 = x  9 .
Hence we can write above line of code more simply as
If ( x  7 and x  9) then…
Exercise 10
An algorithm contains the following line
If not ( x  3 and x  6) then…
How could this be written more simply? Explain.
23
Another very important concept in logic is tautology. The reason tautology is so
important in logic is that it is essential for defining and testing whether an argument in
propositional logic is valid or not, a central preoccupation of logic.
Definition: A tautology is a wff which is always true for all truth values of its variables
or propositions.
Note: A tautology can be represented by 1.
Definition: A contradiction is a wff which is always false for all truth values of its
variables or propositions.
Note: A contradiction can e represented by 0.
Definition: A contingency is a wff which is has a mixture of truth (T) and false(F) for
all truth values of its variables or propositions.
To prove whether a wff is a tautology , contradiction or contingency we just construct its
truth table and if the last column of the truth table
(i)
is all T’s then the wff is a tautology,
(ii)
is all F’s then the wff is a contradiction,
(iii) is a mixture of T’s and F’s then the wff is a contingency.
Example of tautology is A  A as proved by its truth table.
To prove that A  A is a tautology. Just construct its truth table.
A
T
F
A
F
T
A  A
T
T
This is obviously a tautology if we let A : Today is Monday .
Then A  A : Today is Monday or Today is not Monday .
From the above truth tables since the final columns contain all T’s the wffs
A  A is a tautology.
N.B. A tautology is “intrinsically true” by its very structure. It is true no matter what
truth values its constituent variables or simple propositions have.
24
An example of a contradiction is the wff A  A as is obvious from its from its truth
table
A
T
F
A
F
T
A  A
F
F
From the above truth table since the final column contain all F’s the wffs
A  A is a contradiction. This is obvious if we let A : Today is Monday .
Then A  A : Today is Monday and Today is not Monday .
N.B. A contradiction is “intrinsically false” by its very structure. It is false no matter
what truth values its constituent variables or simple propositions have
An example of a contingency is A  B as is obvious from its truth table.
A
B
A B
T
T
T
T
F
F
F
T
F
F
F
F
Explanation
Let: A : Dublin is in Ireland.
B : 10 is greater than 7.
T  T is true.
T  F is false.
F  T is false
F  F is false.
Final column is a mixture of T’s and F’s and thus A  B is a contingency.
25
Example Construct truth tables for the following wffs and determine whether they are
tautologies , contradictions or contingencies.
(i) ( A  B)  B   A ,
(ii) A  ( B  A) ,
(iii) ( A  B)  C  A  ( B  C ) .
Solution
(i) .
A
B
T
T
T
F
F
T
F
F
Thus
(ii)
A
T
T
F
F
 A  B
T
F
F
F
B
F
T
F
T
 A  B  B  A is
B
T
F
T
F
A
F
F
T
T
B  A
 A  B  B  A
F
T
T
T
F
F
F
F
a contradiction because of all F’s in the last column.
B  A
T
T
F
T
A  B  A
T
T
T
T
Thus A  B  A is a tautology because of T’s in the last column.
26
(iii)
A B
C
 A  B  A  B  C B  C 
A  B  C 
A  B  C  A  B  C 
T
T
T
T
F
F
F
F
T
F
T
F
T
F
T
F
T
T
F
F
F
F
F
F
T
T
T
F
F
F
F
F
T
T
T
T
F
T
F
T
T
T
F
F
T
T
F
F
T
T
T
F
T
F
T
F
T
T
T
F
T
T
T
F
Thus  A  B  C  A  B  C  is neither a tautology or a contradiction because of
the mixture of T’ and F’’s in last column and hence it is a contingency.
Example To prove that ( A  B)  ( A  B ) is a tautology i.e. De Morgan’s Law 6b
A
 A  B
B
 A  B 
A
B
T
T
T
F
F
F
T
F
F
T
F
T
F
T
F
T
T
F
F
F
F
T
T
T
'S
Since in the last column all T ( A  B)  ( A  B )
A  B 
 A  B   ( A  B )
F
T
T
T
T
T
T
T
is a tautology.
Note: You must remember the truth table for  i.e.
A
T
T
F
F
B
T
F
T
F
AB
T
F
F
T
Note: In fact all valid equivalences are tautologies. This follows from the truth table for
 above. Thus if P and Q are wffs composed of the same variables or
simple propositions and P  Q that is, if P is equivalent to Q then P has the
same truth values as Q . Thus the wff P  Q will be a tautology by the truth table
for  above. Thus all the laws of logic that we had are tautologies.
27
Now the importance of the concept of tautology is that it is used in defining and
determining when an argument is valid or not, in propositional logic and this is
the central preoccupation of logic.
Exercise 11 Verify by constructing truth tables that the following wffs are tautologies.
(i) ( A)   A (ii) A  B  B (iii) A  ( A  B) and (iv) ( A  B)  A  B 
Exercise 12 Construct truth tables for the following well formed formulae(wffs).Identify
any tautologies or contradictions or contingencies.
(i) ( A  B)  ( A  B) (ii) A  ( A  B )
(iii) ( A  B)  A (iv) ( A  B)  [( A  C )  ( B  C )]
(v) ( A  B)  ( B   A) (vi) ( A  B )  ( A  B) (vii) [( A  B)  C ]  ( A  C )
28
Simple Interest
Simple interest does not take account of the time value of money. Simple interest is
calculated only on the principal and does not take into account the fact that interest can be
calculated on interest and is usually used for periods of less than a year.
The simple interest INT on an investment(or loan) of a present value(initial) amount at an
annual interest rate of r for a period of t years is
INT  PV * r * t
where INT  Interest and PV  Pr esent Value .
Thus the future value(FV or maturity value) of a simple interest investment of PV euros
at an annual rate of r for a period of t years is
FV  PV  INT  PV  PV * r * t  PV (1  r * t )
This is the amount that you would have at the end of the period. You can also solve for
the present value PV given the future value FV you expect at an interest rate r after a
certain number of years t namely,
FV
.
PV 
(1  r * t )
Example 1 Suppose € 500 is invested for 2 years at 6 % simple interest per year. What is
its future value or maturity value.
Solution
PV  €500 , r  0.06 and t  2 .
FV  PV (1  r * t )  500(1  0.06  2) .
 500(1.12)
= € 560 .
Note 1: The unit of time in simple interest transaction is the year. If the time is given in
months, convert the number of months to years by dividing by 12. If time is given in
days, convert the number of days to years by dividing by 365 in case of an exact interest
year or 360 in the case of an ordinary interest year.
Note 2: Banks sometimes use 365 days per year when computing interest on savings and
360 days when computing interest on loans.
29
Example 2 A person borrows €2500 at 8% simple interest per year. Find the future value
of the debt in
(a) 90 days assuming ordinary interest,
(b) 6 months assuming ordinary interest’
(c) 1.5 years assuming ordinary interest.
Solution
PV =€2500 r  0.08 .
90
 90 
thus FV  PV (1  r  t )  2500(1  0.08  
)
360
 360 
 2500(1.02)  2550 .
6
6
(b) t 
thus FV  PV (1  r  t )  2500(1  0.08   )
12
 12 
 2500(1.04)  2600 .
(c) t  1.5 thus FV  PV (1  r  t )  2500(1  0.08  1.5)
 2500(1.12)  2800 .
(a) t 
Now we also want to find the PV given the FV and the % rate r and the time period t .
FV  PV (1  r  t ) and so rearranging we get PV 
FV
.
(1  r  t )
Example 3
It is desired to find the value of an investment at 5% annual simple interest
if we want FV to be €12000 in 4 years time.
Solution FV  €12000, r  0.05 and t  4 .
FV
12000
12000


 10000 .
(1  r  t ) (1  0.05  4)
1.2
Hence an investment of €10000 will yield €12000 in 4 years time.
PV 
30
Compound Interest
Compound interest takes into account the time value of money of an investment.
Compounding means the interest is calculated not only on the initial invesrment but also
on the interest of previous period.
Example 4
Assume you deposit €1000 in a bank compounded quarterly. How much will the bank
owe you at the end of the year?.
Solution
Note: Compounding quarterly means that that eared interest is paid to your account at the
end of each 3 monthly period and that interest as well as the principal earns interest for
the next quarter. Using simple formula
FV  PV (1  r  t )
we can work FV at the end of 1th quarter as follows
1
FV  PV (1  r  t )  1000(1  0.08  ( ))  1000(1.02)  1020 .
4
Now €1020 is your new principal or PV at the start of the 2 th quarter.
At the end of the 2 th quarter , after interest is paid, the account will have
1
FV  PV (1  r  t )  1020(1  0.08  ( ))  1020(1.02)  1040.40 .
4
th
Similarly at the end of the 3 quarter
1
FV  PV (1  r  t )  1040.40(1  0.08  ( ))  1040.40(1.02)  1061.21 .
4
Finally at the end of the 4th quarter
FV=PV(1+r*t)=1061.21(1+0.08(1/4))=1061.21(1.02)
=1082.43.
How does the compound amount compare with the simple interest
FV=PV(1+r*t)=1000(1+0.08*1)=1080.00
Thus we see that the compounding quarterly yields 2.43 euro more than the simple
interest.
In general if PV is the principal or present value earning interest compounded m times a
year at an annual rate of r [ then by repeated use of the simple interest formula, using
i  r / m {the rate per period] the amount FV at the end of each period is
31
FV  PV (1  i )
-------end of the 1st period
FV  PV (1  i)(1  i)  PV (1  i) 2 ---end of the 2 nd period
FV  PV (1  i) 2 (1  i)  PV (1  i) 3 ---end of the 3 nd period
------------------------------FV  PV (1  i) n1 (1  i)  PV (1  i) n ----at the end of the n th period.
Thus we have the formula for Compound Interest namely,
FV  PV (1  i) n
where i 
r
and
m
r  annual rate
m  number of compounding periods per year
i  rate per compounding period
n  Total number of compounding periods
PV  Pr incipal ( present value)
FV  Amount( future value ) at the end of n periods .
Example 5 Someone invests €2500 at 8% annual rate compounded monthly. Find the
future value FV in (a) 3 months (b) 6 months and (c) 1.5 years. Compare with a similar
example we did previously but with simple interest.
Solution
(a) PV  2500 ,
r  0.08 ,
FV  PV (1  i) n , i 
0.08
, n3
12
0.08 3
)  2500(1.00666) 3  2550.33 .
12
0.08
0.08 6
)  2601.68
(b) i 
, n  6 , FV  2500(1 
12
12
FV  2500(1 
(c) i 
0.08
, n  18 ,
12
FV  2500(1 
0.08 18
)  2817.62
12
By comparing these results with results we get for similar data with simple interest rate
we see that the compound interest rate results in larger amounts than the simple interest
rates. Thus from the results above (a) we get €2550.33 with compound interest compared
with €2550.00 with simple interest (b) we get €2601.68 with compound interest
compared with €2600.00 with simple interest and (c) we get €2817.62 with compound
interest compared with €2800.00 with simple interest. Notice the difference between
these amounts increases with time.
32
Given the future value FV (or accumulated amount)we can find the present value PV
(or principal) at a given annual rate r after a given number of compounding periods. We
just reverse the formula
FV  PV (1  i) n
to
FV
 FV (1  i )  n .
(1  i ) n
Example 6 It is desired that the value of an investment at 5%, compounded monthly
should be €12000.00 in 4 years. What amount must be invested now?
PV 
Solution
FV  12000 , r  0.05 , i 
0.05
, n  48 .
12
FV
0.05  48
) = 12000  (1.0041667) 48
 FV (1  i )  n  12000  (1 
n
12
(1  i )
 12000  (0.81907)
 9828.85 .
FV
12000
 10000
Note If the investment was 5% simple interest PV 

1.2
(1  0.05  4)
PV 
Note Thus we see that under compound interest a smaller amount will yield the same
future value.
33
34
Download