University College Dublin
An Coliste Ollscoile, Baile Atha Cliath
a
SEMESTER 1 EXAMINATION 2011/2012
MST10040
Combinatorics and Number Theory
Professor Richard Timoney
Dr. Patrick Murphy
Mr. Anthony Brown
Time Allowed: 2 hours
Instructions for Candidates

SEMESTER 2 EXAMINATION 2010/2011
MST 10040
Combinatorics and Number Theory
Professor Richard Timoney
Dr. Michel O Searcid
a
o
Dr. T. Unger
Dipl. Math. C. Ring
o
Time Allowed: 2 hours
Instructions for Candidates
Full marks will be awarded for complete answ

SEMESTER 1 EXAMINATION 2010/2011
MST 10040
Combinatorics and Number Theory
Dr. Michel O Searcid
a
o
Dr. T. Unger
Dipl. Math. C. Ring
o
Time Allowed: 2 hours
Instructions for Candidates
Full marks will be awarded for complete answers to all nine questions.

University College Dublin
An Coliste Ollscoile, Baile Atha Cliath
a
SEMESTER 2 EXAMINATION 2011/2012
MST10040
Combinatorics and Number Theory
Dr. Patrick Murphy
Dr. Thomas Unger
Mr. Anthony Brown
Time Allowed: 2 hours
Instructions for Candidates
Full mark

University College Dublin
An Coliste Ollscoile, Baile Atha Cliath
a
SEMESTER 1 EXAMINATION 2012/2013
MST10040
Combinatorics and Number Theory
Dr. Patrick Murphy
Dr. Nina Snigireva
Time Allowed: 2 hours
Instructions for Candidates
Full marks will be awarde

MST10040: Combinatorics and Number Theory
Dr Nina Snigireva
email: nina.snigireva@ucd.ie
Lecture 1
September 12, 2013
Dr Nina Snigireva
MST10040
September 12, 2013
1 / 24
Organisation
Midterm test (20%): week 7.
End of Semester exam (80%)
Dr Nina Snigirev

Fermats Little Theorem: examples
Example 1: Find the smallest positive integer x satisfying
258 x mod 53.
Example 2: Find the smallest positive integer a satisfying
344 a mod 47.
Lecture 22
MST10040
November 22, 2013
1 / 12
The Euler phi Function
Denition

The Chinese Remainder Theorem
The following problem was posed in the book Sun Tsu Suan-Ching
(approximately 4th century AD), written by the Chinese mathematician
Sun Zi, also known as Master Sun:
We have a number of things, but we do not know exactly how

Greatest Common Divisor
Denition
Let b and c be any two integers. A positive integer d is called the
greatest common divisor (gcd) of b and c if d divides both b and c
and is the largest integer with this property. We write gcd(b, c ) for the
gcd of b and

Congruences Modulo a Prime
Lemma
Let p be a prime. Then p divides
Lecture 21
p
m
MST10040
for 1 m p 1.
November 21, 2013
1/4
Congruences Modulo a Prime
Theorem
Let p be a prime and let n be a positive integer. Then
np n mod p
Lecture 21
MST10040
November

Relatively Prime Integers
Numbers whose gcd is 1 are said to be relatively prime.
Lecture 17
MST10040
November 7, 2013
1/9
Properties of Relatively Prime Integers
Theorem
Let b and c be relatively prime integers. Suppose that b divides a
product ce, where

Congruences
Theorem
If ca cb mod n, then a b mod (n/d ), where d = gcd(c , n).
Lecture 20
MST10040
November 15, 2013
1/9
Congruences
This theorem gets its maximum force when the requirement that
gcd(c , n) = 1 is added, for then the cancellation may be ac

Congruences
Denition
Let n be a non-zero integer. If a and b are integers, we say that a and
b are congruent modulo n if n exactly divides b a. We write
a b mod n
to signify that a and b are congruent modulo n.
Lecture 19
MST10040
November 14, 2013
1/2
Co

Prime Integers
Denition
An integer p > 1 is said to be a prime if its only integer divisors are p
and 1.
Notice that 2 is the only even prime.
The prime numbers are difcult to enumerate systematically, but the
rst few are 2, 3, 5, 7, 11, 13, 17, 19, 23, 2

Example
Two ways of approaching the same question.
Question
Out of 5 men and 7 women, a committee of 2 men and 3 women is to
be formed. In how many ways can this be done if one man and one
woman are married and cannot both be on the committee?
Answer:
Fir

The Division Algorithm
Recall that we denote the set of all integers by Z.
Denition
An integer c is said to divide an integer b if there is some integer d
with b = cd . We also say in this case that b is divisible by c .
Lecture 14
MST10040
October 25, 20

Base calculations: examples
Example 1: Express (6543)7 as a number in base 5.
Example 2: Write (10100100)2 + (11100010)2 as a number in base 4.
Lecture 15
MST10040
October 31, 2013
1/3
Hexadecimal Numbers
Hexadecimal (often abbreviated hex) is a base 16 n

Binomial Theorem
In applications of the binomial theorem, we wish to expand a power
(x + y )n , where n is a positive whole number and x and y are any
numbers, in terms of powers of x and y . To try to see a pattern, we
look at some examples for small n.

Sets revisited
Given two sets A and B , their union A B is the set whose elements
belong either to A or to B (or both),
and their intersection A B is the set whose elements belong to both A
and B .
The difference A \ B is the set of elements of A which ar

The Sieve Principle: examples
Example 1: Let S = cfw_1, 2, 3 . . . , 100. How many numbers in S are
multiples of 2 or 3?
Example 2: Let S = cfw_1, 2, 3 . . . , 100. How many numbers in S are
multiples of 2, 3 or 5?
Example 3: Let S = cfw_1, 2, 3 . . . , 1

The Pigeonhole Principle
Theorem (The Pigeonhole Principle)
If n pigeons have to be placed in m pigeonholes where n > m, there
must be at least one pigeonhole with more than one pigeon in it.
Proof: See the board.
Lecture 9
MST10040
October 10, 2013
1/3
T

Subsets of a Set
Suppose we are given a set S . A subset of S is a set T whose
elements are contained in S .
We allow the possibility that a subset actually contains no elements.
We call such a subset the empty subset of S and denote it by .
We also consi

Arrangements
Recall:
Permutations
n different objects can be arranged in n! ways, where
n! := n(n 1)(n 2) 3 2 1
Lecture 3
MST10040
September 26, 2013
1 / 10
Arrangements: more examples
Question
Given the digits 2, 4, 6 and 9, how many 4 gure numbers can b

PMI: Examples
If a1 , a2 , . . . , an , . . . , is a sequence of numbers, with a1 = 1, and if
the relation an+1 = 3an + 1 holds for all positive integers n, prove
that
3n 1
an =
.
2
Let Fn be the Fibonacci numbers dened by F0 = 0, F1 = 1, and
Fn = Fn1 + F