Assignment 1: Propositional Logic: Mathematical Logic - A (MSH1B3)
Assignment 1: Propositional Logic: Mathematical Logic - A (MSH1B3)
Assignment 1: Propositional Logic: Mathematical Logic - A (MSH1B3)
NIM:
Class:
page 1 of 8
(b). :p ! :q
A NSWER : if stocks are not increasing, then interest rates are steady
(c). p $ q
A NSWER : stocks are increasing if and only if interest rates are steady
(d). :q _ (:p ^ q)
A NSWER : interest rates are not steady or stocks are not increasing and interest rates are steady
page 2 of 8
Name:
NIM:
Class:
Problem 3 (1.25 pts each) Determine whether the following statements are true or false.
(a). 2 + 2 = 4 if and only if 1 + 1 = 2
A NSWER : TRUE
(h). If 2 + 2 = 4, then 1 + 2 = 3.
A NSWER : TRUE
page 3 of 8
Problem 4 State the converse, contrapositive, and inverse of each of these conditional statements.
(a). [3 pts] If it snows tonight, then I will stay at home.
A NSWER :
converse: if I stay at home, then snow tonight
contrapositive: if I not stay at home, then not snowing tonight
inverse: if it not snows tonight, then i will not stay at home
(c). [4 pts] When I stay up late, it is necessary that I sleep until noon.
A NSWER :
converse: if I sleep until noon, then its mean I stay up late last night
contrapositive: if I not sleep until noon, then its mean I not stay up late last night
inverse: if I not stay up late, then that I not sleep until noon
page 4 of 8
Name:
NIM:
Class:
Problem 5 Determine the value of x after each of these statements is encountered in a computer program,
if x = 1 before the statement is reached.
(a). [3 pts] if (1 + 1 = 3) OR (2 + 2 = 3) then x := x + 1
A NSWER : 1
Problem 6 Express these system specifications using the logical connectives and following propositions:
p : the user enters a valid password
q : access is granted
r : the user has paid the subscription fee.
(a). [3 pts] Access is granted whenever the user has paid the subscription fee and enters a valid password
A NSWER : (p r) q
(b). [3 pts] Access is denied if the user has not paid the subscription fee
A NSWER : r q
(c). [4 pts] If the user has not entered a valid password but has paid the subscription fee, then access is
granted
A NSWER : (p r) q
page 5 of 8
Problem 7 Determine whether the following system specifications are consistent or not.
The diagnostic message is stored in the buffer or it is retransmitted.
The diagnostic message is not stored in the buffer.
If the diagnostic message is stored in the buffer, then it is retransmitted.
The diagnostic message is not retransmitted.
A NSWER :
Problem 8 Determine whether the following system specifications are consistent or not.
If the file system is not locked, then new messages will be queued.
If the file system is not locked, then the system is functioning normally, and conversely.
If new messages are not queued, then they will be sent to the message buffer.
If the file system is not locked, then new messages will be sent to the message buffer.
New messages will not be sent to the message buffer.
A NSWER :
page 6 of 8
Name:
NIM:
Class:
page 7 of 8
Problem 10 For each of these sets of premises, what relevant conclusion or conclusions can be drawn?
Explain the rules of inference used to obtain each conclusion from the premises. Please explain your
answer clearly.
(a). [3 pts]
If I play hockey, then I am sore the next day.
I use the whirlpool if I am sore.
I did not use the whirlpool.
A NSWER :
p = I play hockey
q = I am sore
r = I use the whirlpool
1. p q
(Premise)
2. q r
(Premise)
3. r
(Mremise)
4. q
(Modus Tollens from 2 and 3)
5. p
(Modus Tollens from 1 and 4)
So the conclusion is I did'n play hockey
(b). [4 pts]
If I work, it is either sunny or partly sunny (but not both).
I worked last Monday or I worked last Friday.
It was not sunny on Tuesday.
It was not partly sunny on Friday.
A NSWER :
page 8 of 8