0% found this document useful (0 votes)
34 views9 pages

Ismaeel

Uploaded by

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

Ismaeel

Uploaded by

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

FACULTY OF COMPUTING, LIBRARY, AND INFORMATION

SCIENCE

DCS 1103 COMPUTATIONAL MATHEMATICS


ASSIGNMENT ONE
Assignment Title: Applied Number Theory in Computing: Case Studies and
Problem-Solving with Divisibility, Modular Arithmetic, Congruence, and
Hashing Function
NAME: AKAMBAMU ISMAEL
REGESTRATION NUMBER:2024/A/DCS/4933/F
Case Study 1:

A software company is developing a system to distribute tasks among its


servers. The tasks need to be evenly divided based on server capacity, which
is determined by the number of processor cores. However, the company has
encountered a problem where the number of tasks (T) is not always divisible
by the number of processor cores (C). This causes some servers to handle
significantly more tasks than others, leading to performance issues.

a) Explain the concept of divisibility and provide a mathematical solution for


determining when the number of tasks (T) is divisible by the number of
processor cores (C).

b) If T = 150 and C = 12, determine whether the tasks can be evenly divided
among the servers. If not, find the remainder and suggest a strategy for
distributing the remaining tasks.

c) Describe how the concept of divisibility can be used in in distributed


computing environments.

Case Study 2:

In a secure online voting system, each voter is assigned a unique


identification number, and the system uses modular arithmetic to securely
encrypt votes before sending them to the server for counting. The system uses
the modulus operator to ensure that vote counts remain within a manageable
range while maintaining the secrecy of each individual vote.

a) Define modular arithmetic and explain its importance in number theory


and cryptography.
b) Suppose the encryption formula for each vote is given by E(v)=(v3+5)
mod 11, where is the voter’s ID number. If a voter has ID V=8, calculate the
encrypted value of the vote.

c) Discuss the use of modular arithmetic in encryption algorithms.

Case Study 3:

A bank uses a hashing function based on congruence relations to secure its


transaction data. Every transaction ID is hashed by taking its modulus with
respect to a prime number to reduce the size of the data and ensure efficient
processing. However, the bank has noticed that the hashing function is
occasionally producing collisions, where different transaction IDs are
assigned the same hash value.

a) Explain the concept of congruence in number theory and how it applies to


modular hashing.

b) If the hashing function is defined as h(x)=xmod 7, compute the hash


values for transaction IDs 34 and 27. Are these transaction IDs congruent
modulo 7?

c) Discuss the challenges posed by hash collisions in computing and how


congruence-based hashing can be optimized to minimize these collisions.

Case Study 4:

A social media platform uses a hashing function to manage its user data
efficiently. When users upload their profile pictures, the platform creates a
unique hash value for each image file. This allows the platform to quickly
retrieve or compare files by their hash values rather than processing the entire
image. Recently, the platform encountered an issue where two different
profile pictures generated the same hash value, leading to data corruption.

a) Define a hashing function and explain how it is related to number theory.


b) Given a simple hashing function H(x)=(5x+3) mod19, compute the hash
values for two different user IDs, x=11and x=24. Do these values produce the
same hash?

c) Explain the significance of hash functions in computing, particularly in


data integrity and security
SOLUTIONS

CASE STUDY 1:

a) Divisibility means that when a number (T) is divided by another (C),


there is no remainder.
Mathematically, T is divisible by C if T mod C = 0if there is a
remainder, it is not divisible
b) For T =150, C=12

Using the modulus operation,

150 mod12=6

Since the result is not 0, T is not divisible by C

And since there is a remainder of 6, it means that when the tasks are
divided by 12, 6 tasks would remain undistributed after assigning the tasks
equally

One strategy to distribute the remaining tasks could involve assigning the
extra tasks to any of the server, ensuring an even distribution of workload for
example you can allocate 1 extra task to 6 of the servers leaving (78mod
(5+1)) =13 tasks each while the remaining servers handle the remaining 72
tasks.

Strategy: assign 1 extra task to 6 servers

c) The concept of divisibility can be used in distributed computing


environments by utilizing tasks equitably across servers or cores to
enhance performance and resource utilization.
Understanding divisibility helps in planning the load balanced among
servers, reducing the risk of bottlenecks where some nodes become
overloaded while others are underutilized.

Case study 2

a) Modular arithmetic is a system of arithmetic for integers where


numbers wrap around upon reaching a certain value called the
modulus .it is defined by the equation a=b(modn)
In number theory, modular arithmetic is fundamental for
understanding properties of integers such as divisibility and
congruence.
In cryptography, it is crucial for secure communication ensuring that
data remains confidential and tamper proof through encryption and
decryption process
b) E(V)=(V3+5) mod 11 and voter ID V=8

V3=83=512

(V3+5) =512+5=517

Then 517mod11=4

The encrypted value of the vote for the voter ID 8 is 4

c) Modular arithmetic is used in encryption algorithms like RSA and


computations remain with a manageable range and to provide security
through the difficulty of solving modular equations such as factoring
large numbers.
Case study 3

a) Congruence in number theory refers to the relationship between two


integers that when divided by a third integer (the modulus), leave the
same remainder. This is expressed as [ a \equiv b \ (\text{mod} \ n)]
meaning a and b have the same remainder when divided by n.
In modular hashing, this is used to map large numbers to smaller,
fixed size values, ensuring efficient data processing.
The hashing function h(x) =xmod7 reduces any transaction ID x to a
value between 0 and 6by taking the remainder when x divided by 7.
This is a direct application of congruence where the modulus is 7 .
b) For transaction ID 34
h (34) =34mod7=6
For transaction ID 27
h (27) =27mod7=6
checking if 34 and 27 are congruent modulo 7
34mod7=6
27mod7=6
Since both remainders are 6
34=27(mod7)
Since the hash value for both transaction IDs 34 and 27 is 6, the
transaction IDS 34 and 27 are congruent modulo 7
c) Hashing collisions occur when different numbers produce the same
hash value.
In congruence modulo based hashing, this happens when two different
numbers have the same remainder when divided by the same modulus.

To minimize collisions;

One can use a larger prime modulus.

Implement collision resolution techniques like chaining or open addressing.

Employ more sophisticated hashing algorithms that distribute values more


uniformly.

Case study 4

a) A hashing function is mathematical function that maps data of


arbitrary size to a fixed size value. It is related to number theory
because it often involves modular arithmetic and properties of prime
numbers to ensure uniform distribution and minimize collisions.
b) Given the hashing function

h(x)=(5x+3) mod 19

For x=11

h (11) = (5*11+3) mod 19

58mod19=1
For x=24

h (24) = (5*24+3) mod 19

123mod=9

No because by comparing the hash values, x=11 and x=24 do not produce
the same hash value which does not indicate any collision

c) Hash functions are crucial in computing for data integrity and security

They ensure that data remains unchanged and can be verified quickly.

In security, they are used in password storage, digital signatures and


cryptographic protocols to ensure data authenticity and integrity.

END

You might also like