Week 2 - Functions and Modular Arithmetic

Sunday, 17 February 2019

3:46 PM

Machine generated alternative text:
The floorof x is defined to be the largest integer smallerthan x. Similarly the ceiling of x is defined to be the smallest integer bigger than x. We use 
the notation La;] forthe floor and for the ceiling. Evaluate the following: 
a) 
[9.2] 
Submit part 
Correct. This is the floor of9.2. You were awarded 1 mark. 
You scored 1 mark for this part. 
Score: 1/1 
Answered 
b) 
[9.21 
10 
Submit part 
Correct. This is the ceiling of9.2. You were awarded 1 mark. 
You scored 1 mark for this part. 
Score: 1/1 
Answered

 

Machine generated alternative text:
c) 
[—9.2] 
-10 
d) 
[—9.21 
Submit part 
Correct. This is the floor of —9.2. You were awarded 1 mark. 
You scored 1 mark for this part. 
Score: 1/1 
Answered 
Submit part 
Correct. This is the ceilingof —9.2. You were awarded 1 mark. 
You scored 1 mark forthis part. 
Score: 1/1 
Answered

 

Machine generated alternative text:
By definition, a function f : A B has the property that a uniquely determines f(a). But can f(a) also uniquely determine a? Ifso we say that the 
function is injective or one-to-one. 
Formally, a function is said to be injective when f(xl) = f(X2) implies that xl = :r2. 
a) 
Prove that the floor function L J : R Z is notinjectivebyfindingtwo values such Lr.r1J — 
9.1 and o — 
Gap 1 
[r.r2J but Tl 0. 
There is no mark available for this part. 
Gap 2 
Based on your choice of:rl and an, l:cl] 
required. You were awarded 1 mark. 
You scored 1 mark for this part. 
9 
Submit part 
Lam] as 
Score: 1/1 
Answered

 

Machine generated alternative text:
b) 
Which of the following functions are injective? 
—1 
Submit part 
You chose a correct answer. You were awarded 1 mark. 
h(x) is injective because it is continuous and W (x) > 0. You 
were awarded 1 mark. 
You scored 2 marks for this pan. 
Score: 2/2 
Answered

 

Machine generated alternative text:
Consider the example 
• The setof possible inputs Z is called the domain. 
• The setof possible outputs R is called the codomain. 
A function must be defined for every element of its domain, but the codomain may contain additional elements that are unused. 
a) 
The set of actualoutputs is called the range and may be different to the codomain. In other words, the range is the set of all elements that are actually 
mapped to, or in the language of sets 
What is the range of f? 
OZ OZ+ 
Range(f) {bl f(a) = b, a Z} 
OR 
Submit part 
You chose a correct answer. You were awarded 1 mark. 
You scored 1 mark forthis part. 
Score: 1/1 
Answered

 

Machine generated alternative text:
b) 
If the codomain and range are equal the function is said to be surjective or onto. The function f is not surjective because the codomain is different to 
the range. The codomain is 
OZ ON OR 
Submit part 
You chose a correct answer. You were awarded 1 mark. 
You scored 1 mark forthis part. 
Score: 1/1 
Answered 
c) 
Select all functions that are surjective. For this question the set of positive rational numbers is denoted by Q 
Üf1 : Z + Z, fl@) : Z, f2@) 
Submit part 
You chose a correct answer. You were awarded 1 mark. 
You chose a correct answer. You were awarded 1 mark. 
You scored 2 marks for this part. 
Score: 2/2 
Answered

 

A function which is both surjective and injective is said to be bijective. 
This is an important property because it guarantees that f : A B has an inverse function 
Let's prove that the function f : R R defined by 
has an inverse. 
a) 
Prove that f(r.r) surjective. 
Assume that b e R. We must find some a such that f(a) 
If b = Othen choose a = 0. 
Otherwise, b 0 and then choose a 
) = band so the function is surjective. 
In either case, a 
0 
b. There are two cases to consider. 
Gap 1 
Submit part 
Your answer is numerically correct. You were awarded 1 mark. 
You scored 1 mark for this part. 
Score: 1/1 
Answered

 

b) 
Prove that f(r.r) is injective. 
Assume that f(r.ro) = f(r.rl). We must prove that xo 
If f(xo) = — Othen = = 
Otherwise, f(xo) — 
f@l) 0 and then 
In either case, xo — and so the function is injective. 
c) 
an. There are two cases to consider. 
f(To) 
f(T.1 ) 
Submit part 
Gap 1 
Your answer is correct. You were awarded 1 mark. 
You scored 1 mark for this part. 
Score: 1/1 
Answered 
Because f is surjective and injective, it is bijective and therefore has an inverse. 
In this case we can actually see that f is its own inverse because 
Submit part 
Gap 1 
Your answer is numerically correct. You were awarded 1 mark. 
You scored 1 mark for this part. 
Score: 1/1

 

The concept of modular arithmetic is already familiar from everyday life. 
a) 
If you go to bed at 23:00 and sleep for 8 hours, at what time will you wake up? Give your answer in 24-hourformat. 
Submit part 
You chose a correct answer. You were awarded 1 mark. 
You scored 1 mark forthis part. 
Score: 1/1 
Answered 
b) 
If you go to bed at 10:00 and sleep for 8 hours, at what time will you wake up? Give your answer in 12-hourformat. 
6:00 
Submit part 
You chose a correct answer. You were awarded 1 mark. 
You scored 1 mark forthis part. 
Score: 1/1 
Answered

 

c) 
Deep in thought about discrete mathematics, you lost track of day and night. You glance at a 12-hour clock that reads 11:00. What time is it in 24-hour 
time (tick all that could be true)? 
01:00 
23:00 
02:00 
13:00 
oo:oo 
03:00 
14:00 
04:00 
1500 
os:oo 
16:00 
06:00 
17:00 
07:00 
18:00 
08:00 
19:00 
og:oo 
20:00 
lo:oo 
21:00 
11:00 
22:00 
Submit part 
You chose a correct answer. You were awarded 1 mark. 
You chose a correct answer. You were awarded 1 mark. 
You scored 2 marks forthis part. 
Score: 2/2 
Answered

 

Machine generated alternative text:
Given integers a, b Zwe can writea in the form 
qb + r 
for some q, r e Z where0 r < p. The numbers q and r are called the quotient and remainderwhen a is divided by b: 
b 
In modular arithmetic, or mod (b), our interest is focused on the remainder. 
a) 
Which numbers have a remainder of 3 when divided by 5? These numbers would be considered equal in 
z 18 
09 z--2 
mod (5). 
Submit part 
8 = 1 x 5 + 3 and so has remainder 3. You were awarded 0.25 
marks. 
—2 = (—1) x 5 + 3 and so has remainder 3. You were awarded 
0.25 marks. 
—7 = (—2) x 5 + 3 and so has remainder 3. You were awarded 
0.25 marks. 
18 = 3 x 5 + 3 and so has remainder 3. You were awarded 0.25 
marks. 
You scored 1 mark for this part. 
Score: 1/1 
Answered

 

Machine generated alternative text:
b) 
Which numbers are equal to 2 in 
025 
mod (8)? 
011 
Submit part 
10 = 1 x 8 + 2 and so has remainder 2. You were awarded 0.25 
marks. 
—6 = (—1) x 8 + 2 and so has remainder2. You were awarded 
0.25 marks. 
2 = (0) x 8 + 2 and so has remainder2. You were awarded 0.25 
marks. 
—14 = (—2) x 8 + 2 and so has remainder2. You were 
awarded 0.25 marks. 
You scored 1 mark for this part. 
Score: 1/1 
Answered

 

Machine generated alternative text:
c) 
A number a is a multiple of b precisely when a = qbfor some number q. In terms of modular arithmetic we would say this as a 
because a has no remainderwhen divided by b. 
Enter a non-zero numberwhich is equal to 0 mod (5) and also equal to 0 mod (8). 
0 
mod (b) 
Submit part 
0 — 0 mod (5). 
0 — 0 mod (8). 
You scored 1 mark for this part. 
Score: 1/1 
Answered

 

Machine generated alternative text:
A number n divides a when a = nqfor some q. 
Any number which divides both a and b is called a common divisor of a and b, the largest common divisor is called the greatest common divisor and 
is denoted gcd(a, b). 
a) 
As a consequence of these definitions, every number n divides zero because 0 
So gcd(154, 0) is 
b) 
What is gcd(561, 68)? 
The procedure is to use the identity 
gcd(a, b) 
to simplify the question. 
Compute 561 (mod 68). 
Submit part 
Your answer is correct. You were awarded 1 mark. 
You scored 1 mark for this part. 
Score: 1/1 
Answered 
= gcd(a (mod b), b). 
Submit part

 

Machine generated alternative text:
Hence gcd(561, 68) = gcd(17, 68). We can simplify this again using the identity 
gcd(a, b) = gcd(a,b (mod a)). 
Compute 68 (mod 17). 
Submit part 
Your answer is correct. You were awarded 1 mark. 
You scored 1 mark for this pan. 
Score: 1/1 
Answered 
So you see the method of re-applying these identities will simplify the question to something managable: 
gcd(561, 68) = gcd(17, 68) = gcd(17, 0). 
(Your score will not be affected.) 
Hide steps 
Submit part 
You revealed the steps. 
Your answer is correct. You were awarded 3 marks. 
Because you received full marks for the part, your answers to the 
steps aren't counted. 
You scored 3 marks for this pan.

 

 

Created with Microsoft OneNote 2016.