Sie sind auf Seite 1von 9

CQB1003 Discrete Mathematics

Semester January 2009

Tutorial 1(title : Number Representation and Logic


Due Date : 15 February 2009
Name : Mohd Fauzi Bin Aziz(kj0870331)
: Sivagenasan A/L Pertheban(kj0870310)
Course Code : CQB1003
Lecturer’s name : Noor Lees Ismail
Answer ALL questions. (100 marks)

1. Convert each of the following base 10 numbers into its equivalent form in the indicated base:
a) 500 to base 2
28 27 26 25 24 23 22 21 20
256 128 64 32 16 8 4 2 1
1 1 1 1 1 0 1 0 0
=1111101002

b) 798 to base 8
8 798
8 99 -6
8 12 -3
1 -4
= 14368

c) 1023 to base 16

16 1023
16 63 - 15
3 - 15
= 3FF16

d) 4532 to base 2
212 211 210 29 28 27 26 25 24 23 22 21 20
4096 2048 1024 512 256 128 64 32 16 8 4 2 1
1 0 0 0 1 1 0 1 1 0 1 0 0

= 10001101101002

(12 marks)

2. Convert 110111001102 to octal and to hexadecimal


Octal

4 2 1 4 2 1 4 2 1 4 2 1
0 1 1 0 1 1 1 0 0 1 1 0
3 3 4 6
= 33468

Hexadecimal

8 4 2 1 8 4 2 1 8 4 2 1
0 1 1 0 1 1 1 0 0 1 1 0
6 E 6
= 6E616

(6 marks)
3. Convert each of the numbers in the indicated base to binary
a) 2528
2 5 2
4 2 1 4 2 1 4 2 1
0 1 0 1 0 1 0 1 0
= 101010102

b) AFE016
A F E 0
8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1
1 0 1 0 1 1 1 1 1 1 1 0 0 0 0 0
= 10101111111000002

c) 40778
4 0 7 7
4 2 1 4 2 1 4 2 1 4 2 1
1 0 0 0 0 0 1 1 1 1 1 1
= 1000001111112

d) 8FC16
8 F C
8 4 2 1 8 4 2 1 8 4 2 1
1 0 0 0 1 1 1 1 1 1 0 0
=1000111111002

(12 marks)

4. Give the negation of each of the following statements.


a) It will rain tomorrow or it will snow tomorrow
It will rain not tomorrow or it will not snow tomorrow

b) If you drive, then I will walk


If you not drive, then I will not walk

c) If it snows today, then I will go skiing tomorrow.


If it not snows today, then I will not go skiing tomorrow.

d) Every person in this class understands mathematical induction.


Every person in this class do not understands mathematical induction
(8 marks)
5. Let p and q be the propositions:-
p : You drive over 65 miles per hour
q : You get a speeding ticket

Write the following propositions using p and q and logical connectives.

a) You do not drive over 65 miles per hour.


¬p

b) You do not drive over 65 miles per hour, but you do not get a speeding ticket.
¬ p→¬ q

c) You will get a speeding ticket if you drive over 65 miles per hour.
q→p

d) Driving over 65 miles per hour is sufficient for getting a speeding ticket.
p→q

e) You will get a speeding ticket, but you do not drive over 65 miles per hour.
¬ q→¬ p

f) Whenever you get a speeding ticket, you are driving over 65 miles per hour.
q→p
(12 marks)

6. State the converse and contrapositive of each of the following implications.


a) If it is snow today, I will ski tomorrow
converse : I will ski tomorrow if today it’s snow
contrapositive: I will not ski tomorrow if today not snow

b) If you try hard, then you will win


converse : You will win if you try hard
contrapositive: You will not win if you not try hard.

c) You sleep late if it is Saturday


converse : If Saturday you’ll sleep late
contrapositive: If it’s not Saturday you will not sleep late

(6 marks)
7. Find a proposition for the truth table below.

p q ¬q p∧¬ q p∨¬ q p→¬ q p⊕¬ q p↔¬ q ¬ (p∨¬ q)


T T F F T F T F F

T F T T T T F T F

F T F F F T F T T

F F T F T T T F F

Answer: ¬ (p∨ ¬ q)

(3 marks)

8. Construct the truth table


a) (p→ q) ↔ (¬q→ ¬ p)

p q ¬q ¬p p→ q (¬q→ ¬ p) (p→ q) ↔ (¬q→ ¬ p)

T T F F T T T

T F T F F F T

F T F T T T T

F F T T T T T

(4 marks)

b) (¬p ∨ q) ⊕ (p ⊕ ¬q)

p q ¬q ¬p (¬p ∨ q) (p ⊕ ¬q) (¬p ∨ q) ⊕ (p ⊕ ¬q)


T T F F T T F

T F T F F F F

F T F T T F T

F F T T T T F

(4 marks)
c) ¬p ∧ (¬ (q∨ ¬r))

p q r ¬p ¬r (q∨ ¬r) (¬ (q∨ ¬r) ¬p ∧ (¬ (q∨ ¬r))


T T T F F T F F

T T F F T T F F

T F T F F F T F

T F F F T T F F

F T T T F T F F

F T F T T T F F

F F T T F F T T

F F F T T T F F

(4 marks)

d) (p→ ¬q) ∧ [(q ∧ ¬r) → (p ∨ r)]

p q r ¬q ¬r p→ ¬q q ∧ ¬r (p ∨ r) ANSWER

T T T F F F F T T F

T T F F T F T T T F

T F T T F T F T T T

T F F T T T F T T T

F T T F F T F T T T

F T F F T T T F F F

F F T T F T F T T T

F F F T T T F F T T

(5 marks)
e) [(p ∨ q) ∧ r] → (p ∧ ¬q)

p q r ¬q (p ∨ q) (p∨q) ∧ r (p∧¬q) [(p ∨ q) ∧ r] → (p ∧ ¬q)


T T T F T T F F

T T F F T F F T

T F T T T T T T

T F F T T F T T

F T T F T T F F

F T F F T F F T

F F T T F F F T

F F F T F F F T

(4 marks)
f) [(p↔ q) ∨ (p→ ¬r)] → (¬q ∧ p)

p q r ¬q ¬r (p↔ q) p→ ¬r (p↔q)∨(p→¬r [(p↔q)∨(p→¬r)]→(¬q∧p)


T T T F F T F T F

T T F F T T T T F

T F T T F F F F T

T F F T T F T T T

F T T F F F T T F

F T F F T F T T F

F F T T F T T T F

F F F T T T T T F

(5 marks)
9. Determine whether the two propositions in each pair are logically equivalent.
a) p ∨ (q ∧ r), (p ∧ q ) ∨ (p ∧ r)
p q r q∧r p∨(q∧r) p∧q p∧r (p ∧ q ) ∨ (p ∧ r)
T T T T T T T T

T T F F T T F T

T F T F T F T T

T F F F T F F F

F T T T T F F F

F T F F F F F F

F F T F F F F F

F F F F F F F F

Answer: since both value not the same, the


Conclusion is each pair are NOT LOGICALLY EQUIVALENT
(5 marks)
b) p  (¬q ∧ r), ¬ p∨ ¬(r→q)

p q r ¬p ¬ (¬q ∧ r) p(¬q∧r) r→q ¬(r→q) ¬p∨¬(r→


T T T F F
q F F T F q) F

T T F F F F F T F F

T F T F T T T F T T

T F F F T F F T F F

F T T T F F T T F T

F T F T F F T T F T

F F T T T T T F T T

F F F T T F T T F T

Answer: since both value is the same, the


Conclusion is each pair are LOGICALLY EQUIVALENT

(5 marks)
10. Determine whether (¬p ∧ (p → q)) → ¬q is a tautology.

p q ¬p ¬q (p → q) (¬p ∧ (p → q)) (¬p ∧ (p → q)) → ¬


T T F F T F T
q
T F F T F F T

F T T F T T F

F F T T T T T

Answer: not all the value gives true, for the conclusion it is not a tautology.

(5 marks)

*** END OF QUESTION PAPER ***

Das könnte Ihnen auch gefallen