0% found this document useful (0 votes)
57 views6 pages

Discrete Mathematics Final Examination - Solutions

Uploaded by

21s01abt020
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views6 pages

Discrete Mathematics Final Examination - Solutions

Uploaded by

21s01abt020
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Discrete mathematics final examination – solutions

Section A

1) B (1 mk)
2) B (1 mk)
3) B (1 mk)
4) C (1 mk)
5) B (1 mk)
6) Negate the statement; All students do not take coffee. (do not use the statement, it is not
the case…or it is not true….) (1 mk)
Some students take coffee.
7) Determine the check digit for the ISBN – 13 digit 978-8-120-31502 (2 mks)
9 + 8 + 1 + 0 + 1 + 0 + 𝑥 + 3(7 + 8 + 2 + 3 + 5 + 2) = 0𝑚𝑜𝑑 10
19 + 𝑥 + 81 = 0 𝑚𝑜𝑑 10
𝑥 + 100 => 𝑥 = 0
8) Outline an area where each of the following concepts can be applied in technology,
graph theory, permutation functions, logic. (3 mks)
Graph theory – designing networks; permutation functions – cryptography/ciphers; logic –
automating reason for machines.
9) Explain a cryptosystem (2 mks)
It is a structure with 5 -tuples is (P, C, E, D, K) – P set of plaintexts, C – set of ciphertexts, E –
Encrypting functions, D – Decrypting functions, and K set of keys.

10) Explain rule of inference (2 mk)

A compound proposition that is a tautology and involves an implication e.g. modus ponens.

11) State without proof the De Morgan’s laws of logic (2 mk)


Conjunction and disjunction interchanges under negation.
12) Explain a mathematical proof (1 mk)
It is an inferential argument for a mathematical statement, showing that the stated assumptions
logically guarantee the conclusion.
(An argument that establishes the truth of a theorem)
13) Use the Euclidean algorithm to show that the gcd (846 , 264) satisfy the Bezout’s
theorem. (4 mks)
846 = 264 ⋅ 3 + 54
264 = 54 ⋅ 4 + 48
54 = 48 ⋅ 1 + 6
48 = 6 ⋅ 8 + 0
 6 = 54 − 1(48) = 54 − 1[264 − 4(54)] = 54 − 1(264) + 4(54) = 5(54) − 1(264)
 6 = 5[846 − 3(264)] − 1(264) = 5(846) − 15(264) − 1(264)
 6 = 5(846) − 16(264)
14) Explain a major weakness of shift cipher and explain how affine cipher address this. (2
mks)
It is easy to hack or crack due to the frequency rate of the alphabet use. Affine complicates the
function by adding a multiplication factor.

15) Define the following terms and illustrate each with a relevant example: a proposition, a
theorem, and an axiom (6 mks)
Proposition is a statement that can be a signed a value e.g. today is Sunday.
Theorem is a proposition that has been proved to be true e.g. Pythagoras theorem.
An axiom is a statement that is assumed to be true e.g. a + b = b + a where a and b are any real
numbers.

Section B
Question 1 (Compulsory – 20 marks)
4 1 2 3 1 2 3 4
a) Consider the following permutation functions: p1 = ( ) ; 𝑝2 = ( )
3 4 1 2 2 4 1 3
hence evaluate; p−1 2 ∘ p2 ∘ p1
−1
(2 marks)
1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
p−1 −1
2 ∘ p2 ∘ p1 = ( )∘( )∘( )=( )
3 1 4 2 2 4 1 3 2 3 4 1 2 3 4 1
b) Consider the statement; If I do not read then I will not go home. Write down its
converse and design a logic gate for the negation of the converse. (3 marks)
(Use p: I will not read; q: I will not go home)
If I will not go home, then I will not read i.e. 𝑞 → 𝑝
Its negation is ¬(𝑞 → 𝑝) ≡ 𝑞 ∧ ¬𝑝

Alternatively correct circuit.


c) Let set A = {1,2,3,4} with relation R =
{(1,1), (1,2), (1,3), (2,1), (2,2), (2,3), (3,3), (3,4), (2,4), (4,1), (4,4)}. Hence.
i) Write MR (1 mark)
1 1 1 0
𝑀𝑅 = (1 1 1 1)
0 0 1 1
1 0 0 1
ii) Construct the diagraph for the relation (1 mark)

d) Show whether the following is a rule of inference. (2 marks)


¬𝑞
𝑝→𝑞
∴ ¬𝑝
We need to show ¬𝑞 ∧ (𝑝 → 𝑞) → ¬𝑝 is a tautology (alternatively show validity).
𝑝 𝑞 𝑝→𝑞 ¬𝑞 ¬𝑞 ∧ (𝑝 → 𝑞) ¬𝑝 ¬𝑞 ∧ (𝑝 → 𝑞) → ¬𝑝
1 1 1 0 0 0 1
1 0 0 1 0 0 1
0 1 1 0 0 1 1
0 0 1 1 1 1 1

Alternatively, prove by contradiction that the argument is invalid i.e. the conclusion is false, and the
assumptions are all true i.e.
1. ¬𝑝 is F
2. 𝑝 → 𝑞 is T (with p as T and q as T)
3. ¬𝑞 is F
Which is a contradiction, the argument is valid.

e) Determine the inverse of 17 (mod 31) using the Euclidean algorithm method (show
working). (4 marks)
17𝑥 = 1(𝑚𝑜𝑑 31) => (17, 31) = 1
31 = 17 × 1 + 14
17 = 14 × 1 + 3
14 = 3 × 4 + 2
3=2×1+1
=> 1 = 3 − 1(2)
1 = 3 − 1[14 − 4(3)] = 3 − 1(14) + 4(3) = 5(3) − 1(14)
1 = 5[17 − 1(14)] − 1(14) = 5(17) − 6(14)
1 = 5(17) − 6[31 − 1(17)] = 5(17) − 6(31) + 6(17)
∴ 1 = 11(17) − 6(31)
Hence, we have.
11(17)(mod 31) − 6(31)(mod 23) = 1 (mod 31)
11(17)(mod 31) = 1 (mod 31)
Hence the inverse of 17 is 11 mod 31.

Alternatively use Cayley table.

f) Solve the following linear congruence (show working); (4 marks)


13x ≡ 7(mod 33)
Introduce another parameter t such that 13𝑡 = 1 𝑚𝑜𝑑 33 𝑖. 𝑒.
13𝑥𝑡 ≡ 7𝑡(𝑚𝑜𝑑 33)
Hence, we have.
𝑥 = 7𝑡 𝑚𝑜𝑑 33
Since 13 and 33 are relatively prime then 13𝑡 + 33𝑠 = 1
=> 33 = 2(13) + 7
13 = 1(7) + 6
7 = 1(6) + 1
Hence, we get.
1 = 7 − 6 = 7 − (13 − 7)
1 = 2(7) − 13
1 = 2(33 − 2 ⋅ 13) − 13
1 = 2(33) − 4(13) − 13 = 2(33) − 5(13)
1 = 33(2) + 13(−5)
𝑜𝑢𝑟 𝑡 = −5 𝑎𝑛𝑑 𝑠 = 2
Hence, we have.
𝑥 = 7(−5)𝑚𝑜𝑑 33 = 7(33 − 5)𝑚𝑜𝑑 33 = 7(28)𝑚𝑜𝑑 33 = 196 𝑚𝑜𝑑 33 = 31 𝑚𝑜𝑑 33
𝑥 = 31

1) Show that if n is a positive integer then (n3 + n) is even (3 marks)


When n is even
𝑛 = 2𝑘 𝑓𝑜𝑟 𝑠𝑜𝑚𝑒 𝑘 ∈ 𝑅 => 𝑛3 + 𝑛 = (2𝑘)3 + 2𝑘 = 8𝑘 3 + 2𝑘 = 2(4𝑘 3 + 𝑘)
𝑖𝑓 4𝑘 3 + 𝑘 = 𝐾 𝑡ℎ𝑒𝑛 𝑛3 + 𝑛 = 2𝐾 − 𝑒𝑣𝑒𝑛
When n is odd
𝑛 = 2𝑘 + 1 𝑓𝑜𝑟 𝑠𝑜𝑚𝑒 𝑘 ∈ 𝑅 => 𝑛3 + 𝑛 = (2𝑘 + 1)3 + (2𝑘 + 1)
= 8𝑘 3 + 12𝑘 2 + 6𝑘 + 1 + 2𝑘 + 1
= 8𝑘 3 + 12𝑘 2 + 8𝑘 + 2
= 2(4𝑘 3 + 6𝑘 2 + 4𝑘 + 1)
𝑖𝑓 4𝑘 3 + 6𝑘 2 + 4𝑘 + 1 = 𝐾 𝑡ℎ𝑒𝑛 𝑛3 + 𝑛 = 2𝐾 − 𝑒𝑣𝑒𝑛
Question 2 (10 marks) – Optional
a) Use logic connectives to write the following statements.
(i) It is not the case that for every student x there exists a student y such that
student x works smarter than y. (1 mark)
¬(∀𝑥∃𝑦, 𝐹(𝑥, 𝑦)) where 𝐹(𝑥, 𝑦) − 𝑥 𝑤𝑜𝑟𝑘𝑠 𝑠𝑚𝑎𝑟𝑡𝑒𝑟 𝑡ℎ𝑎𝑛 𝑦
(ii) Some students are illogical or not all phones are smartphone. (1 mark)
( ∃𝑥, 𝑝(𝑥)) ∨ (∃ 𝑦 , ¬ 𝑞(𝑦)) where 𝑝(𝑥) − 𝑖𝑙𝑙𝑜𝑔𝑖𝑐𝑎𝑙 𝑠𝑡𝑢𝑑𝑒𝑛𝑡𝑠, 𝑞(𝑦)𝑠𝑚𝑎𝑟𝑡𝑝ℎ𝑜𝑛𝑒𝑠
b) Consider the argument.
If 11 is less than 6, then 11 is not a prime number
11 is not less than 6
∴ 11 is a prime number
Let p: 11 is less than 6, and q: 11 is a prime number. Hence.
(i) Write the following argument using logic connectives. (2 marks)
𝑝 → ¬𝑞
¬𝑝
𝑞
(ii) Determine the validity of the argument. (3 marks)
NB: Use truth table or rule of inference
1. 𝑞 𝑖𝑠 𝐹
2. ¬ 𝑝 𝑖𝑠 𝑇
3. 𝑝 → ¬𝑞 𝑖𝑠 𝑇, 𝑠𝑖𝑛𝑐𝑒 𝑝 𝑖𝑠 𝐹 𝑓𝑟𝑜𝑚 (2)𝑎𝑛𝑑 ¬𝑞 𝑖𝑠 𝑇 𝑓𝑟𝑜𝑚 (1)
∴ 𝑡ℎ𝑒 𝑎𝑟𝑔𝑢𝑚𝑒𝑛𝑡 𝑖𝑠 𝑖𝑛𝑣𝑎𝑙𝑖𝑑
c) Evaluate; (12345) ∘ (5634)(27) ∘ (4652317) and determine the number and length
of the cycles of the solution. (3 marks)
1 2 3 4 5 6 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7
( )∘( )∘( )
2 3 4 5 1 6 7 1 7 4 5 6 3 2 7 3 1 6 2 5 4
1 2 3 4 5 6 7
=( )
3 5 2 4 7 6 1
= (13257)
1 cycle, length 5

Question 3 (10 marks) – Optional


a) Using the transposition cipher based on the permutation of the set {1,2,3,4,5} with
p(1) = 5, p(2) = 3, p(3) = 4, p(4) = 1, p(5) = 2, to.
i) Encrypt the plaintext; THE DUST STORM AND A FOOL (2 marks)
plaintext T H E D U S T S T O R M A N D A F O O L

ciphertext D U H E T T O T S S N D M A R O L F O A
ii) Decrypt the ciphertext; NEJEM DTYEOCLISHFRSSAAYMDOEEHRT
(2 marks)
ME ENJOYED THIS CLASS FROM DAY THREE

b) Use Fermat’s Little theorem to simplify; (3 marks)


65 (mod 18 3+11 18 3 11 11
7 19) = (7 ) (mod 19) = (7 ) × 7 mod 19 = 7 mod 19 = 11

c) Prove by mathematical induction that for all positive integers n (3 marks)


3 + 11 + ⋯ + (8n − 5) = 4n2 − n
𝑝(1) = 4 − 1 = 3
Assume it is true for 𝑛 = 𝑘
3 + 11 + ⋯ + (8k − 5) = 4k 2 − k
𝑇ℎ𝑒𝑛 𝑤𝑒 𝑝𝑟𝑜𝑣𝑒 𝑓𝑜𝑟 𝑛 = 𝑘 + 1
3 + 11 + ⋯ + (8k − 5) + 8(k + 1) − 5 = 4k 2 − k + 8(k + 1) − 5
RHS becomes.
4k 2 − k + 8(k + 1) − 5 = 4k 2 − 𝑘 + 8𝑘 + 8 − 5
= 4𝑘 2 + 7𝑘 + 3
= 4𝑘 2 + 4𝑘 + 3𝑘 + 3
= 4𝑘(𝑘 + 1) + 3(𝑘 + 1)
= (4𝑘 + 3)(𝑘 + 1)
This is 4𝑛2 − 𝑛 with 𝑛 = 𝑘 + 1, hence it is true for all positive integers.

‘And now, Lord, what wait I for? My hope is in thee.’


Psalms 39:7 (RSV)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy