0% found this document useful (0 votes)
87 views8 pages

Discrete Mathematics Assignment

The document contains the solutions to several problems in discrete mathematics including: 1) Proving by mathematical induction that a sequence Bn is equal to a particular expression for all n. 2) Finding the time displayed on a 12-hour clock after a given number of hours have passed. 3) Computing values of expressions involving integers modulo 19. 4) Computing inverses and exponents modulo various numbers using the Euclidean algorithm and Fermat's little theorem. 5) Finding the memory locations assigned by a hashing function to customer records. 6) Encrypting and decrypting messages using RSA public-key cryptography with given public and private keys.

Uploaded by

Maxine Mutasa
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)
87 views8 pages

Discrete Mathematics Assignment

The document contains the solutions to several problems in discrete mathematics including: 1) Proving by mathematical induction that a sequence Bn is equal to a particular expression for all n. 2) Finding the time displayed on a 12-hour clock after a given number of hours have passed. 3) Computing values of expressions involving integers modulo 19. 4) Computing inverses and exponents modulo various numbers using the Euclidean algorithm and Fermat's little theorem. 5) Finding the memory locations assigned by a hashing function to customer records. 6) Encrypting and decrypting messages using RSA public-key cryptography with given public and private keys.

Uploaded by

Maxine Mutasa
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/ 8

MAXINE RUMBIDZAYI MUTASA 200732

DISCRETE MATHEMATICS END OF SEMESTER EXAMINATION


QUESTION ONE
1 3
a) Let ℬ = Prove by the Principle of Mathematical Induction that
0 4
1 4𝑛 −1
ℬ= for n = 1,2,3
0 4𝑛
1 3
ℬ=
0 4

Proving by Mathematical induction:


P(1) is true

When P(k+1) is true:


𝑘
ℬ 𝑘 = 1 4 −1
0 4𝑘

=ℬ 𝑘+1 = ℬ 𝑘 ℬ
𝑘 1 3
= 1 4 −1
0 4𝑘 0 4
𝑘+1
=ℬ 𝑘 = 1 4 −1
0 4𝑘+1
𝟏 𝟒𝒏 −𝟏
Proving 𝓑𝒏 =
𝟎 𝟒𝒏

b) What time does a 12-hour clock read


i) 80 hours after it reads 11:00?
80 mod 12 = 6.6
6*12 = 72
80-72 = 8
8:00 + 11:00 = 19:00
Therefore, the clock will read 7:00pm
ii) 40 hours before it reads 12:00?
40 mod 24 = 16
Hence 16 hrs before 12.00 is 4hrs before 12.00
Therefore, the clock will read 8.00
iii) 100 hours after it reads 6:00?
100 mod 12 = 8.3
10 hrs before 6.00 is 10.00
Therefore, the clock reads 10.00

c) Suppose that a and b are integers, a ≡ 11 (mod 19), and b ≡ 3 (mod 19). Find the integer
c with 0 ≤ c ≤ 18 such that

i) c ≡ 13a (mod 19)


13*11 =143
143 = 10(mod19)
ii) c ≡ 7a + 3b (mod 19)
77 +9 =1+9
=10(mod19)
iii) c ≡ 2a^2 + 3b^2(mod 19)
2*11^2+3*3^2=2*7+3*9=14+27=41
=3(mod19)
d) i) Find an inverse of 101 modulo 4620.
Using Euclidean Algorithm to show that gcd(101,4620) =1
4620 = 101*45+75
101 = 1.75 +26
75 = 2*26 + 23
26 = 1*23 + 3
23= 7*3 +2
3=1*2 + 1
2=2*1 +0
Gcd(101,4620)=1

Using modular reducing Bezout identity: 𝑎 𝑏 + 𝑐𝑚 = 1 ⇒ mod m: ab ≡ 1 ⇒ 1 ≡ 𝑏 −1


Where a b c is a =4620b + 101c
Therefore -35 * 4620 + 1601* 101 = 1
Mod 4620: 1601 * 101 ≡ 1
Therefore 1601 is an inverse of 101 modulo 4620

ii) 7^222 mod 11


Using Fermat’s little theorem: 710 ≡ 1 (𝑚𝑜𝑑 11)

(710 )^𝑘 ≡1(mod11)

Therefore 7222 = 722∗10+2 = (710 )22 72 ≡ (1)22 ∗ 49 ≡ 5(𝑚𝑜𝑑 11)

Hence , 7^222 mod 11 = 5

e) e) Using the Euclidean algorithm find integers 𝑠 and 𝑡 satisfying that gcd (190, 34) = 𝑠(190) +
𝑡(34).
gcd(190,34) = 5(190) + t(34)

190 = 5*34 + 20
34 = 1*20 + 14
20 = 1*14 + 6
14= 2*6 + 2
6 = 3*2

20 = 190-5*34
14 = 34 = t*20
14 = 34 –(190-5*34)
= 34 -190 + 5*34
=-1(190) + 6*34
2= 14-2*6
2=-1 * 190 + 6*34 -2*6
2=[-1(190) + 6(34) -2(20-14)
=[-1(190) + 6(34) – 2[190-5(34) + 190 -6(34)]
=190 +6(34) – 2[2(190) -11(34)]
=-1(190) + 6(34) – 4(190) + 22(34)
= -5(190) + 28(34)

Therefore s= -5 and t= 28

f) UPCs Retail products are identified by their Universal Product Codes (UPCs). The most common
form of a UPC has 12 decimal digits: the first digit identifies the product category, the next five
digits identify the manufacturer, the following five identify the particular product, and the last
digit is a check digit. The check digit is determined by the congruence 3x1 + x2 + 3x3 + x4 + 3x5 +
x6 + 3x7 + x8 + 3x9 + x10 + 3x11 + x12 ≡ 0 (mod 10)

i) (a)Suppose that the first 11 digits of a UPC are 79357343104. What is the check digit?
3𝑥1 + 𝑥2 + 3𝑥3 + 𝑥4 + 3𝑥5 + 𝑥6 + 3𝑥7 + 𝑥8 + 3𝑥9 + 𝑥10 + 3𝑥11 + 𝑥12
≡ 0(𝑚𝑜𝑑10)

= 46
(Adding positions) = 26 + 46
= 72
(Subtracting the last digit from the previous calculation)
10 – 2 = 8
Therefore 8 is the check digit
ii) Is 041331021641 a valid UPC?
3𝑥1 + 𝑥2 + 3𝑥3 + 𝑥4 + 3𝑥5 + 𝑥6 + 3𝑥7 + 𝑥8 + 3𝑥9 + 𝑥10 + 3𝑥11 + 𝑥12
≡ 0(𝑚𝑜𝑑10)
3(0) + 4 + 3(1) + 3 + 5(3) + 1 = 3(0) + 2 + 3(1) + 6 + 3(4) + 1 ≡ 0 (mod 10)
= 50 ≡0(mod 10)
=10/(50 -0)
Therefore 041331021641 is a valid UPC because 10 is divisible by (50 – 0)

g) Find the memory locations assigned by the hashing function h(k) = k mod 111 to the records of
customers with Social Security numbers 064212848 and 037149212.
h (064212848)
= 064212848 mod 111 = 14
h (037149212)
= 037149212 mod 111 = 65

h) In this question suppose that Alice and Bob have these public keys and corresponding private
keys: (nAlice, eAlice) = (2867, 7) = (61 ・ 47, 7), dAlice = 1183 and (nBob, eBob) = (3127, 21) =
(59 ・ 53, 21), dBob = 1149. First express your answers without carrying out the calculations.
Then, using a computational aid, if available, perform the calculation to get the numerical
answers.
i) Alice wants to send to all her friends, including Bob, the message “SELL EVERYTHING” so that he
knows that she sent it. What should she send to her friends, assuming she signs the message
using the RSA cryptosystem?
Given the message SELL EVERYTHING Let A=0, B=1, C=2, D=3, E=4, F=5 ,G=6, H=7, I=8, J=9, K=10,
L=11, M=12, N=13, O=14, P=15, Q=16, R= 17, S=18, T=19, U=20, V=21, W=22, X=23, Y=24, Z=25

Regrouping into to groups of 4 digits:


1804 1111 0421 0421 0417 2419 0708 1308

Decrypting each block using decryption transformation:


𝐷(2867,7) = 𝐷𝑛,𝑒 = 𝑥 𝑑 𝑚𝑜𝑑 𝑛 = 𝑥 1183 𝑚𝑜𝑑 2867
Therefore, Alice sends the encrypted message as follows:
2186 2087 1279 1251 0326 0816 1948
ii) Alice wants to send to Bob the message “BUY NOW” so that he knows that she sent it and so that
only Bob can read it. What should she send to Bob, assuming she signs the message and then encrypts it
using Bob’s public key?

Given the message BUY NOW Let A=0, B=1, C=2, D=3, E=4, F=5 ,G=6, H=7, I=8, J=9, K=10, L=11, M=12,
N=13, O=14, P=15, Q=16, R= 17, S=18, T=19, U=20, V=21, W=22, X=23, Y=24, Z=25

01 20 24 13 14 22

Regrouping: 0120 2413 1422

Encrypting each block using encryption transformation:

𝐸3127,21 = 𝐷𝑛,𝑒 = 𝑥 𝑒 𝑚𝑜𝑑 𝑛 = 𝑥 21 𝑚𝑜𝑑 3127

Therefore the message Alice sends is as follows: 2711 2080 0280

b) Step 1

Alice and Bob should agree on a large prime p and a non-zero integer g modulo p. It is best that they use
g such that its order in 𝔽*p is a large prime.

Step 2

Alice picks a secret integer 𝑎 that she does not share with anyone while Bob picks an integer 𝑏 which he
keeps in secret. They should both use their secret integers such that:

A ≡ 𝒈ᵃ (𝒎𝒐𝒅 𝒑) and 𝐁ᶦ ≡ 𝐠ᵇ (𝐦𝐨𝐝 p)

(Alice and Bob compute this respectively)

Step 3

After computing these values, Alice and Bob should exchange them. Therefore Alice sends A to Bob and
Bob sends B to Alice.

Step 4

Bob will now take the number that Alice sent and does the exact same operation with it.

Therefore 𝑩𝒂 𝒎𝒐𝒅 𝒑

Step 5

Alice will do the same thing with Bob’s result that he sent to her such that :

𝑨𝒃 𝒎𝒐𝒅 𝒑

Due to the property of modulo exponents, Alice and Bob get their answers in step 4 and 5 and that’s
what they use as their shared secret.

(𝒈𝒂 𝒎𝒐𝒅 𝒑)𝒃 𝒎𝒐𝒅 𝒑 = 𝒈𝒂𝒃 𝒎𝒐𝒅 𝒑


(𝒈𝒃 𝒎𝒐𝒅 𝒑)𝒂 𝒎𝒐𝒅 𝒑 = 𝒎𝒐𝒅 𝒑

j) Find the domain and range of these functions.


i) the function that assigns to each pair of positive integers the maximum of these two
integers.
Domain: {(𝑥, 𝑦)|𝑥 = 1,2,3 … . 𝑎𝑛𝑑 𝑦 = 1,2,3}
= {(𝑥, 𝑦)|𝑥 ⋲ 𝑁 − {0} 𝑦 ⋲ 𝑁 − {0}}
= (𝑵 − {𝟎}𝒙 (𝑵 − {𝟎})
Range: {1,2,3,….} = N-{0}
ii) the function that assigns to each positive integer the number of the digits 0, 1, 2, 3, 4, 5, 6,
7, 8, 9 that do not appear as decimal digits of the integer.
Domain: {1,2,3,….} =N –{0}
Range: the set {0,1,2,3,4,5,6,7,8,9}

k) Find 𝑓𝑜𝑔, 𝑔𝑜𝑓 where 𝑓(𝑥) = 2𝑥 + 1 and 𝑔(𝑥) = 3 x −1 , 𝑥  1

f(x) = 2x+1

g(x) = 3/x-1

𝑓𝑜𝑔 = 2(3/x-1)+1
(6/x-1)+ 1
=x+5/x-1
𝑔𝑜𝑓= 3/(2x+1)-1
= 5/2x

l) Let f : Z → Z be such that 𝑓 (𝑥) = 𝑥 + 1. Is 𝑓 invertible, and if it is, what is its inverse?
Proving for bijection:
if 𝑓(𝑥) = 𝑓(𝑦) then 𝑥 = 𝑦

x + 1 = y+ 1
x = y+1-1

x=y
Therefore: 𝑓(𝑥) is injective

Proving for surjective: 𝑓(𝑥) = 𝑥 + 1, 𝑥 = 𝑦 − 1

f(x) = (y-1)+1

f(x)=y
Therefore 𝑓(𝑥) is surjective

Thus 𝒇(𝒙) is bijective because it is surjective as well as injective, therefore it is invertible


Computing the inverse: 𝑦 = 𝑥 + 1
x = y-1
therefore inverse : 𝑓 −1 (y)= y-1 or g(y)=y-1

m) Show that if 𝑎𝑑 − 𝑏𝑐 ≠ 0, then the function 𝑓(𝑥) = 𝑎𝑥+𝑏 /𝑐𝑥+𝑑 is one-to-one and find its inverse
𝑎𝑥+𝑏
Let y = f(x) =
(𝑐𝑥+𝑑)

Thus (𝑦(𝑐𝑥 + 𝑑) = 𝑎𝑥 + 𝑏

cxy + dy = ax+b

cxy-ax=b-dy

𝑥(𝑐𝑦 − 𝑎) = 𝑏 − 𝑑𝑦

(𝑏−𝑑𝑦)
𝑥= (𝑐𝑦−𝑎)

(𝑏−𝑑𝑦)
𝑥 = 𝑓 −1 (𝑦) = 𝑐𝑦−𝑎
𝒃−𝒅𝒙
Therefore, the function 𝑓(𝑥) = 𝑎𝑥+𝑏 /𝑐𝑥+𝑑 if one-to-one is 𝒇−𝟏 (𝒙) = 𝒄𝒙−𝒂

n) Find the domain and range of the following function given by


√(3𝑥−5)(𝑥+4)
f(x) = 𝑥 3 −16𝑥

(3𝑥 − 5)(𝑥 + 4) ≥ 0
Therefore, range is (3𝑥 − 5) ≥ 0 𝑜𝑟 (𝑥 + 4) ≥ 0

3x/3 ≥ 5/3 or x ≥ - 4

x ≥ 5/3

x^3 – 16𝑥 ≠ 0

𝑥(𝑥 2 − 16) ≠ 0

Therefore, the domain is 𝑥(𝑥 − 4)(𝑥 + 4) ≠ 0

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