Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

exam solutions Number Theory

Rating
-
Sold
-
Pages
3
Grade
A
Uploaded on
02-11-2022
Written in
2020/2021

The modules introduce mathematical tools required in the study of computer science. Topics include: 1.Logic and proof techniques 2.Number theory 3.Sequences and Mathematical Induction 4.Set theory, Functions and Relations 5.Counting and Probability 6.Graphs and Trees It is the backbone of CS. Concepts and notations from DM are useful in studying the describing objects and problems in all branches of CS, such as algorithms, programming languages, theorem proving and software development.Modeling with DM is an extremely important problem solving skill.

Show more Read less
Institution
Course

Content preview

CS1231(S) Tutorial 7: Number Theory II
Solutions
National University of Singapore

2019/20 Semester 1


1. Compute gcd(a, b) for the following pairs of a and b, and express gcd(a, b) in the form
ax + by where x, y ∈ Z.
(a) a = 17, b = 5;
(b) a = 275, b = 407.

Solution. Using the Euclidean algorithm, you should get:
(a) gcd(17, 5) = 1 = 17(−2) + 5(7);
(b) gcd(407, 275) = 11 = 407(−2) + 275(3).
2. Prove the following statement:
  
∀a, b, c ∈ Z (a | c) ∧ (b | c) ∧ (gcd(a, b) = 1) → (ab | c)

Solution.
1. Let a, b, c ∈ Z such that a | c, b | c and gcd(a, b) = 1.
2. Since a | c, there exists k ∈ Z such that c = ka.
3. Since b | c, there exists l ∈ Z such that c = lb.
4. Since gcd(a, b) = 1, there exist x, y ∈ Z such that ax + by = 1.
5. Thus c = c(ax + by) (by (4)) = cax + cby = lb(ax) + ka(by) (by (3) and (2))
= ab(lx + ky).
6. Since l, x, k, y ∈ Z, we have lx + ky ∈ Z, and so ab | c.
This can also be proved by considering the prime factorisations of a, b, and c.
3. Let a, b ∈ Z. Prove that if x, y ∈ Z such that ax + by = gcd(a, b), then (gcd(x, y) exists
and) gcd(x, y) = 1.

Solution. Let a0 = gcd(a,b)
a
and b0 = b
gcd(a,b) . Then a0 , b0 ∈ Z, and a0 x + b0 y = 1.
Therefore gcd(x, y) = 1.

4. Let a, b ∈ Z, not both zero. Show that for all n ∈ Z, n is an integer linear combination
of a and b (i.e. there exist x, y ∈ Z such that ax + by = n) if and only if gcd(a, b) | n.
(Hint: use Bézout’s Identity for the ‘if’ direction).




1

Written for

Course

Document information

Uploaded on
November 2, 2022
Number of pages
3
Written in
2020/2021
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$8.31
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
chrisbarn

Get to know the seller

Seller avatar
chrisbarn universitas sumatera utara
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 year
Number of followers
0
Documents
4
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions