4COSCOO2W MATHEMATICS FOR COMPUTING
Week 2 Seminar Tasks
Types of Numbers. Number Theory Basics. Modular Arithmetic. Sequences.
Introduction to Sets.
READING
Lecture 1 Notes (available on Blackboard)
Chapters 8, 12, 13. Croft, T and Davison R (2016) Foundation maths, 6th ed. Harlow: Pearson.
Chapters 2, 3, 12. Grossman, P., 2017. Discrete mathematics for computing. Bloomsbury
Publishing.
Chapter 1. McGregor, C., Nimmo, J. and Stothers, W., 2010. Fundamentals of university
mathematics. Elsevier.
Chapters 2, 4. Kundu, S. and Mazumder, S., 2022. Number Theory and Its Applications. CRC Press.
TASK 1. CONVERTING BETWEEN DECIMAL AND BINARY FOR COMPUTER DATA
REPRESENTATION
See Lecture 1 Notes – Slides 15-17
Task 1.1. Convert Decimal to Binary
1. A computer program needs to store the number of active users on a server. Currently, the
number of users is 27. Convert this decimal number to its binary equivalent.
2. A data packet1 in a network is identified by the ID 53. Convert this ID from decimal to
binary so that it can be stored efficiently in the computer's memory.
3. A system process requires 102 memory blocks to execute. Convert the decimal
number 102 to its binary form, as it will be represented this way in the system's memory.
Task 1.2. Convert Binary to Decimal
1. A device receives a signal represented by the binary number 11010. Determine the decimal
value of this binary number to understand the signal's corresponding integer value.
2. An error code is received in the binary format 111000. Convert this binary code to its
decimal equivalent to diagnose the issue correctly.
1 A packet is a small segment of a larger message. Data sent over computer networks, such as the Internet, is divided
into packets.
1
3. A computer reads a memory address stored as 1001101 in binary. Convert this binary
address to a decimal number so a user-friendly program can interpret it.
TASK 2. FUNDAMENTAL THEOREM OF ARITHMETIC IN THE CONTEXT OF
COMPUTING
See Lecture 1 Notes – Slide 23
Task 2.1. Memory Access. A computer's memory controller accesses memory in chunks, with
each chunk being of a prime size for optimisation. If a program needs 30 memory units at a time,
how can the memory controller break this down into prime-sized chunks?
Task 2.2. Data Storage and Primes. Given that a certain data storage system uses blocks of
prime sizes if the total storage is 420 units, into which prime-sized blocks can this storage be
uniquely factorised?
Task 2.3. Database Indexing. A database optimises its indexing by breaking down entries into
prime-numbered chunks. If an index consists of 945 entries, what prime-sized chunks are used?
TASK 3. DIVISION THEOREM
See Lecture 1 Notes – Slide 24
Task 3.1. Task Scheduling. A CPU2 has a maximum of 500 clock cycles to allocate to tasks. If a
task requires 73 clock cycles, how many full tasks can be scheduled, and how many clock cycles will
remain?
Task 3.2. File Compression. After compression, a file is reduced to 900MB. If storage blocks on
a disk can hold up to 256MB, how many full blocks will be used, and how much space will the last
block contain?
TASK 4. MODULAR ARITHMETIC
See Lecture 1 Notes – Slides 25-28
Task 4.1. Data Encryption. An encryption scheme adds 15 to a number and then takes modulo
12 to generate the cipher3. If the original number is 10, what is the ciphered number?
Task 4.2. Resource Allocation. A server handles requests using a modulus of 7 to distribute
them among databases. If a request number is 45, to which database will it be sent?
Task 4.3. Game Dev: Iceberg Drift. In an Arctic exploration game, a player moves on a circular
ice ring of 360 units, mirroring degrees on a compass. If the player's current position is at 40 units
and they move 240 units backwards, at what position will they land on the circular ice ring?
2A central processing unit (CPU) is a hardware component that's the core computational unit in a server
3In cryptography, a cipher (or cypher) is an algorithm for performing encryption or decryption—a series of well-
defined steps that can be followed as a procedure.
2
Task 3.3. [Challenge] Digital Signature Verification
A digital signature algorithm utilises a two-step verification mechanism. The first step applies a
transformation to the document number x using the formula y = Ax + B, where A and B are
constants. In the second step, the resulting number y undergoes a modular operation with modulus
M, resulting in the final verification code y mod M.
A user receives a document with a verification code of 8. The known constants are A = 4, B = 5, and
M = 11. The user also knows that the original document number x is a single-digit integer between 0
and 9 inclusive.
Determine the possible original document numbers x that could lead to the verification code of 8.
TASK 5. SEQUENCES
See Lecture 1 Notes – Slides 31-34.
Task 5.1: Arithmetic Sequence. Given the arithmetic sequence 3, 8, 13, 18, …, find the 15th term
of the sequence.
Task 5.2. Geometric Sequence. A geometric sequence starts with a term of 5 and has a common
ratio of 3. What is the 4th term in the sequence?
Task 5.3. Common Difference and Ratio. For the sequence 4, 10, 16, 22, …, determine whether
it's arithmetic or geometric. Find the common difference or ratio accordingly.
Task 5.4. Sequence Determination. Given the terms 6, 18, 54, 162, …, determine if the sequence
is arithmetic, geometric, or neither.
Task 5.5. Sequence Determination. Given the sequence 7, 21, 63, 189, …, determine its type
and calculate the 5th term.
Task 5.6. Finding the nth term. Given the arithmetic sequence 10, 7, 4, 1, …, find the formula
for the nth term.
Task 5.7: Advanced Memory Allocation. Memory chunks in a computer system are allocated
in blocks that follow a modified Fibonacci sequence. If the first two blocks are of sizes 3 MB and 5
MB, respectively, how big is the 7th block?