Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Department of Software Engineering

Formal Specification

Abdullah Ali Al-jehani


2816
Homework

1. What is the members of the set S = {x | x is the square of an integer and x < 100

Answer:
X = {1, 4, 9, 16, 25, 36, 49, 64, 81}
--------------------------------------------------------------------------------------------------------------------
-

2. What is the Cartesian product of A = {one, 2} and B = {a, b}?

Answer:
A*B = {(1, a), (1, b), (2, a), (2, b)}
--------------------------------------------------------------------------------------------------------------------
-

3. Using truth tables decide whether the following statement is a tautology:


P ∨ q ⇔ (¬p ∨ ¬q) ∧ q

Answer:

p q -p -q (-p∨-q) (-p∨-q) ∧q p∨q p∨q⇔(-p∨-q) ∧ q

T T F F F F T F

T F F T T F T F

F T T F T T T T

F F T T T F F T

Therefore, it is not a tautology


--------------------------------------------------------------------------------------------------------------------
-
4. Consider the following propositions:
P: Mathematicians are generous.
Q: Spiders hate algebra.
Write the compound propositions symbolized by:
(I) p ˄ q
(ii) ¬ (q ˅ p)
(iii) ¬ p˄ q
(iv) ¬p→ ¬q

Answer:
(i) p˄q
A. Mathematicians are generous and spiders hate algebra

(ii) ¬ (q ˅ p) => -q ˄-p


A. Spiders do not hate algebra and mathematicians are not generous.

(iii) ¬ p˄ q
A. Mathematicians are not generous and spiders hate algebra

(iv) ¬p→ ¬q
A. If mathematicians are not generous then spiders don’t hate algebra

----------------------------------------------------------------------------------------------------------------

5. Let p be the proposition ‘Today is Monday’ and q be ‘I’ll go to London’.


Write the following propositions symbolically.
(I) if today is Monday then I will not go to London.
(ii) Today is Monday or I’ll go to London, but not both.
(iii) I’ll go to London and today is not Monday.
(iv)If and only if today is not Monday then I will go to London.
Answer:
(I) p→-q
(ii) P⊕q
(iii) q˄-p
(iv)-p↔q

----------------------------------------------------------------------------------------------------------------

You might also like