number theory and counting method - kmuttstaff.kmutt.ac.th/~isurnich/ftp/cmm 131/03 number...Β Β·...
TRANSCRIPT
DivisorsDefinition
π and π are integers π β 0
π divides π if there exists π satisfying π = πππ βΆ the quotient, π βΆ the divisor, π βΆ the number
If π divides π : π|π
π does not divides π : π β€ π
Ex. 21 = 3.73|21, 3 is a divisor (factor) of 21
There exist an integer π such that
π = ππ, π, π β πΌ+, 1 β€ πTherefore, π β€ ππ = π.
TheoremLet π, π and π be integers
(a) if π|π and π|π thenπ|(π + π)
(b) if π|π and π|π thenπ|(π β π)
(c) if π|π then π|ππ
proof
(a) Suppose d|m and d|n by definitionπ = ππ1
and π = ππ2
Thus (π + π) = π(π1 + π2)
Therefor
There exist π1 + π2 is the quotient of it, (a) is proof
Prime and Composite number
β’ An integer greater than 1 whose only positive divisors are itself and 1 is called prime.
β’ An integer greater than 1 that is not prime is called composite
Ex.
23 is prime
34 is composite because it is divided by 17
If π > 1 is composite, then βπ, 1 < π < π
To test use 2,3,β¦ , π β 1
If no integer in this list divides π, then π is prime
Composite number theorem (cont.)
A positive integer π greater than 1 is composite if and only if π has a divisor π satisfying 2 β€ π β€ π
Proof
- If π is composite, then π has a divisor π satisfying 2 β€π β€ π
- If π has a divisor π satisfying 2 β€ π β€ π then π is composite
Ex1 Determine whether 43 is πππππ
Try 2,3,β¦ , 21 = 43
None of these number divides 43 agree with the condition π mod π = 0
β΄ 43 is πππππ
Ex2. Determine 451
Try 2,3,β¦ , 21 = β 451β
It was founded that 11 is agree with the condition π mod π = 0
β΄ 451 is ππππππ ππ‘π
Fundamental Theorem of Arithmetic
β’ Any integer greater than 1 can be written as a product of primes. Moreover, if the primes are written in non decreasing order the factorization is unique.
β’ The number of primes is infinite
Ex. Produce a prime larger than 112,3,5,7,11 are ππππππ
Letπ = 2 β 3 β 5 β 7 β 11 + 1 = 2311
2311 is πππππ
The greatest common divisor (GCD)
Definition
Let π and π be integers with not both π and π zero. The gdc is an integer that divides both π and π.
Denote πππ(π, π)
Ex. The positive divisor of 30 are1, 2, 3, 5, 6, 10, 15, 30
The positive divisor of 105 are1, 3, 5, 7, 15, 21, 35, 105
The common positive1, 3, 5, 15
Thusπππ 30,105 = 15
It can be also find by looking carefully at their prime factorization30 = 2 β 3 β 5, 105 = 3 β 5 β 7
3 and 5 are the prime factorization of 30 and 105 thus πππ(30,105) = 3 β 5 = 15
Ex. The positive divisors of 30 are1, 2, 3, 5, 6, 10, 15, 30
The positive divisors of 105 are1, 3, 5, 7, 15, 21, 35, 105
The common divisors of 30 and 105 are1,3,5,15
And gcd 30,105 = 15
Ex2. Find the gcd by looking at their prime factorization30 = 2 β 3 β 5 105 = 3 β 5 β 7
The common prime factorization for 30 and 105 are 3 and 5
Thus gcd(30,105) = 3 β 5 = 15
GDC with prime factorization
Theorem
Let π and π be integers, π > 1, π > 1 with prime factorizationπ = π1
π1 β π2π2 β―ππ
ππ
and π = π1
π1 β π2π2 β―ππ
ππ
If the prime ππ is not a factor of m, we let ππ = 0. Similarly, if the prime ππ is not a factor of π, we let ππ = 0 Then
gcd π, π = π1min π1,π1 β π2
min π2,π2 β―ππmin ππ,ππ
Ex. gcd(82320, 950796)82320 = 24 β 31 β 51 β 73 β 110
950796 = 22 β 31 β 50 β 74 β 111
gcd 82320, 950796 = 2min 4,2 β 3min 1,1 β 5min 1,0 β 7min 3,4 β 11min 0,1
= 22 β 31 β 50 β 73 β 110
= 4116
The least common multiple
Definition
Let π and π be positive integer. A common multiple of π and π is an integer that is divisible by both π and π, called the least common multiple.
πππ(π, π)
Ex. lcm(30,105) = 210
210 can be divided by both 30 and 105 and it is the least value30 = 2.3.5, 105 = 3.5.7
The lcm must contain 2, 3, 5, 7 thus lcm 30,105 = 2 β 3 β 5 β 7 = 210
Also find lcm() by looking at their prime factorization30 = 2 β 3 β 5, 105 = 3 β 5 β 7
πππ 30,105 = 2 β 3 β 5 β 7 = 210
LCM wit prime factorization
Let π and π be integers π > 1, π > 1 with prime factorizationsπ = π1
π1π2π2 β―ππ
ππ
and π = π1
π1π2π2 β―ππ
ππ
If the prime ππ is not a factor of π, we let ππ = 0, Similarly, if the prime ππ is not a factor of π, we let ππ = 0, then
πππ π, π = π1max π1,π1 π2
max π2,π2 β―ππmax ππ,ππ
Ex. lcm(82320, 950796)82320 = 24 β 31 β 51 β 73 β 110
950796 = 22 β 32 β 50 β 74 β 111
πππ 82320, 950796 = 2max 4,2 β 3max 1,2 β 5max 1,0 β 7max 3,4 β 11max 0,1
= 22 β 32 β 51 β 74 β 111 = 19015920
Note
The product of gcd and lcm is equal to the product of the pair of numbersgcd 30,105 β πππ 30,105 = 30 β 105 = 3150 = 15 β 210
Representations of Integers and integer algorithm
For base 2
bit : a binary digit, value either 0 or 1
For Decimal number3854 = 3 β 103 + 8 β 102 + 5 β 101 + 4 β 100
Representation of integer
let n= integer that need to represent by a serie of binary number
π = 1 β 2π + ππβ12πβ1 +β―+ π02
0
then2π β€ π
andπ = 1 β 2π + ππβ12
πβ1 +β―+ π020
β€ 1 β 2π + 1 β 2πβ1 +β―+ 1 β 20 = 2π+1 β 1< 2π+1
Basic principle
Multiplication principle
If an activity can be constructed in 1 successive steps and step 1 can be done in π1 ways, step 2 can then be done in π2 ways,β¦, and step t can then be done in ππ‘ ways, then the number of different possible activities is
π1 β π2β―ππ‘Addition principle
Suppose that π1, β¦ , ππ‘ are sets and that the ith set ππ has ππelements. If {π1, β¦ , ππ‘} is a pairwise disjoint family (i.e., if π β π, ππ β© ππ = β ),
the number of possible element that can be selected from π1or π2 or β¦ or ππ‘ is
π1 + π2 +β―+ ππ‘
How many menu sets can be select from each categories: main course, appetizers, beverages
Solution : 24 possible outcome
NHT,NHM,NHC,NHR,NCT,NCM,NCC,NCR,
NFT,NFM,NFC,NFR,SHT,SHM,SHC,SHR,
SCT,SCM,SCC,SCR,SFT,SFM,SFC,SFR
Ex1
(a) How many strings of length 4 can be formed using the letters ABCDE if repetitions are not allowed ?
5 β 4 β 3 β 2 = 120
(b) How many strings of part (a) begin with the letter B?1 β 4 β 3 β 2 = 24
(c) How many strings of part (a) do not begin with the letter B ?120 β 24 = 96
Ex2
In a digital picture, we wish to encode the amount of light at each point as an eight-bit string. How many values are possible at one point?
2 β 2 β 2 β 2 β 2 β 2 β 2 β 2 = 28 = 256
How many eight-bit strings begin either 101 or 111?
Bit 8,7,6 are tied together to form a bit and has 2 option 101 or 111
The 4 successive bit has the possible outcome 24
Thus2 β 2 β 2 β 2 β 2 = 64
Permutations and Combinations
A permutation of n distinct elements π₯1, β¦ , π₯π is an ordering of the π elements
π₯1β―π₯πTheorem :
There are n! permutations of n elementsπ π β 1 β¦2 β 1 = π!
Ex. How many permutations of the letters π΄π΅πΆπ·πΈπΉ contain substring π·πΈπΉ ?
4!
Ex. How many ways can 6 person be seated around a circular table?
(6 β 1)! = 5! = 120
r-permutation
An r-permutation of n (distinct) elements π₯1, π₯2, β¦ , π₯π is an ordering of an r-element subset of π₯1, π₯2, β¦ , π₯π . The number of r-permutations of a set of n distinct elements is denoted π π, π
π π, π = π π β 1 π β 2 β¦ π β π + 1 , π β€ π
=π!
π β π !
Ex. π = {π, π, π}, How many 2-permutations of π?
π 3,2 = 3 β 2 = 6
ππ, ππ, ππ, ππ, ππ, ππ
Ex. How many way can we select a chairperson, vice-chairperson, secretary, and treasurer from a group of 10 person?
π 10,4 = 10 β 9 β 8 β 7 = 5040
r-combination
Given a set π = {π₯1, π₯2, β¦ , π₯π} containing n distinct elements.
(a) an r-combination of π is an unordered selection of r-elements of π(i.e., and r-element subset of π)
(b) The number of r-combination of a set of n distinct elements is denotes πΆ(π, π) or
ππ
πΆ π, π =π π, π
π!=
π!
π β π ! π!
Ex. A group of five students, Mary, Boris, Rosa, Ahmad, and Nguyen, has decided to talk with the Mathematics Department chairperson about having the Mathematics Department offer more courses in discrete mathematic. The chairperson has said that she will speak with three of the students. How many way can these five students choose three of their group to talk with chairperson?
πΆ 5,3 = 10
Ex. How many ways can we select a committee of three from a group of 10 distinct person?
πΆ 10,3 = 120
Ex. An ordinary deck of 52 cards consist of four suits: clubs, diamonds, hearts, spades, of 13 denominations each ace, 2-10, jack, queen, king.
(a)How many (unordered) five card poker hands, selected from an ordinary 52-card deck, are there?
πΆ 52,5 = 2,598,960
(b) How many poker hands contain cards all of the same suit?4 β πΆ 13,5 = 5148
(c)How many poker hands contain three cards of one denomination and two cards of a second denomination?
13 β 12 β πΆ 4,3 β πΆ 4,2 = 3744
How many routes are there from the lower-left corner of an π Γ π square grid to the upper-right corner if we are restricted to travelling only to the right or upward?
πΆ(2π, π)
Introduction to discrete probability
The probability π(πΈ) of an event πΈ for the finite sample space π is
π πΈ =πΈ
π
Ex. Two fair dice are rolled. What is the probability that the sum of the numbers on the dice is 10?
Possible outcome for the sum is 10 : (4,6),(5,5),(6,4)
Outcome of the sample space S = 6Γ6
Thus
π πΈ =3
36Ex. 5 microprocessors are randomly selected from a lot of 1000 microprocessors
among which 20 are defective. Find the probability of obtaining no defective microprocessors.
π = πΆ 1000,5 , πΈ = πΆ 980,5π πΈ = 0.9037
Discrete Probability Theory
A probability function π assigns to each out come π₯ in a sample space π a number π(π₯)
so that
0 β€ π π₯ β€ 1, for all π₯ β π
and
π₯βπ
π(π₯) = 1
Ex. Suppose that a die is loaded so that the numbers 2 through 6 are equally likely to appear but that 1 is three times as likely as any other number to appear. To model this situation.
π 2 = π 3 = π 4 = π 5 = π 6 , π 1 = 3π 2
And
π 2 =1
8, π 1 = 3
1
8=3
8
Probability of event
Let πΈ be an event. The probability of πΈ, π(πΈ) is
π πΈ =
π₯βπΈ
π π₯
Ex. From the former example, find the probability of an odd number
π 1 + π 3 + π 5 =3
8+1
8+1
8=5
8
Note :
For a fair die
π πππ ππ’ππππ =1
2
Probability of complement of event
Let πΈ be an event. The probability of ΰ΄€πΈ, the complement of πΈ satisfiesπ πΈ + π ΰ΄€πΈ = 1
Union of event
Let πΈ1 and πΈ2 be events. Thenπ πΈ1 βͺ πΈ2 = π πΈ1 + π πΈ2 β π(πΈ1 β© πΈ2)
Corollary: union of mutual event
If πΈ1 and πΈ2 are mutually exclusive eventsπ πΈ1 βͺ πΈ2 = π πΈ1 + π πΈ2
Conditional probability
Let πΈ and πΉ be events, and assume that π πΉ > 0. The conditional probability of πΈ given πΉ is
π πΈ πΉ =π πΈ β© πΉ
π πΉ
Ex. E = die getting a sum of 10
F = at least one die show 5
πΈ β© πΉ: getting sum of 10 and at least one die show 5
π πΈ β© πΉ =1
36
π πΉ =11
36π πΈ πΉ = 1/11
Independent conditional event
Events E and F are independent ifπ πΈ β© πΉ = π πΈ π(πΉ)
Bayβs Theorem
Suppose that the possible classes are πΆ1, β¦ , πΆπ. Suppose further that each pair of classes is mutually exclusive and each item to be classified belongs to one of the classes. For a feature set πΉ, we have
π πΆπ πΉ =π πΉ πΆπ π πΆπ
Οπ=1π π πΉ πΆπ π πΆπ
Ex. At the telemarketing firm SellPhone , Dale, Rusty and Lee make calls. The following table shows the percentage of calls each caller makes and the percentage of the persons who are annoyed and hang up on each caller:
Let D denote the event βDale made the call,β let R denote the event βRusty made
the call.β let L denote the event βLee made the callβ and let H denote the event βthe
caller hung upβ. Find π(π·),
π(π ), π(πΏ), π(π»|π·), π(π»|π ), π(π»|πΏ), π(π·|π»), π(π |π»), π(πΏ|π») and π(π»)
π(π·) = 0.4, π(π ) = 0.25), π(πΏ) = 0.35π(π»|π·) = 0.2, π(π»|π ) = 0.55, π(π»|πΏ) = 0.3
π(π·|π») use Bayβs Theorem
π π· π» =π π» π· π π·
π π» π· π π· + π π» π π π + π π» πΏ π πΏ= 0.248
Similar for π π π» = 0.426π πΏ π» = 1 β π π π» β π π· π» = 0.326
Find π π» = π π» π· π π· + π π» π π π + π π» πΏ π πΏ = 0.3255
Caller
Dale Rusty Lee
Percent of calls 40 25 35
Percent of hang-ups 20 55 30
Generalized Permutations and Combinations
Theorem:
Suppose that a sequence π of π items has π1 identical objects of type 1, π2 identical objects of type 2,β¦, and ππ‘ identical objects type π‘. Then the number of orderings of π is
π!
π1! π2! β¦ππ‘!
Theorem:
If π is a set containing π‘ elements, the number of unordered π-elements selections from π, repetitions allowed is
πΆ π + π‘ β 1, π‘ β 1 = πΆ(π + π‘ β 1, π)
Ex. How many strings can be formed using the following letters?π πΌ π π πΌ π π π π πΌ
Choose 2 P: C(11,2)
Choose 4 S: C(9,4)
Choose 4 I: C(5,4)
The outcome:πΆ 11,2 πΆ 9,4 πΆ 5,4 = 34,650
Binomial Coefficients and Combinatorial Identities
π + π π = (π + π)(π + π)β―(π + π)π ππππ‘πππ
Ex.
π + π 3 = π + π π + π π + π
= πππ + πππ + πππ + πππ + πππ + πππ + πππ + πππ
= π3 + π2π + π2π + ππ2 + π2π + ππ2 + ππ2 + π3
= π3 + 3π2π + 3ππ2 + π3
π + π π =π
0πππ0 +
π1
ππβ1π1 +β―+π
π β 1π1ππβ1 +
ππ
π0ππ
Binomial theoremTheorem :
π + π π =
π=0
πππ
ππβπππ
Ex. π = 3
π + π 3 =30
π3π0 +31
π2π1 +32
π1π2 +33
π0π3
= π3 + 3π2π + 3ππ2 + π3
Ex. 3π₯ β 2π¦ 4
=40
3π₯ 4 β2π¦ 0 +41
3π₯ 3 β2π¦ 1 +42
3π₯ 2 β2π¦ 2
+43
3π₯ 1 β2π¦ 3 +44
3π₯ 0 β2π¦ 4
= 34π₯4 β 4 33π₯32π¦ + 6 32π₯222π¦2 β 4 3π₯23π¦3 + 24π¦4
= 81π₯4 β 216π₯3π¦ + 216π₯2π¦2 β 96π₯π¦3 + 16π¦4
Ex. Find the coefficient of π₯2π¦3π§4 in the expansion of π₯ + π¦ + π§ 9
We choose x 2 from 9 term, y 3 from 7 terms and z from 4 terms
Thus 92
73
44
=9!
2! 7!
7!
3! 4!=
9!
2! 3! 4!= 1260
Theoremπ + 1π
=π
π β 1+
ππ
, for 1 β€ π β€ π
Proof
|π| = π, choose π β π. Then πΆ(π + 1, π) is the number of k-element of π =π βͺ {π}. The k-element of Y can be divided into 2 classes
1. Subset of Y not containing a
2. Subset of Y containing a
For class 1 are just k-element subset of π =ππ
For class 2 consist of (k-1) element subset of X together with a, there are ππ β 1
.
Therefore π + 1π
=π
π β 1+
ππ
Ex. Show that
π=π
π
πΆ(π, π) = πΆ π + 1, π + 1
Use Theorem in the formπΆ π, π = πΆ π + 1, π + 1 β πΆ π, π + 1
To obtainπΆ π, π + πΆ π + 1, π + πΆ π + 2, π + β―+ πΆ π, π
= 1 + πΆ π + 2, π + 1 β πΆ π + 1, π + 1 + πΆ π + 3, π + 1β πΆ π + 2, π + 1 +β―+ πΆ π + 1, π + 1 β πΆ π, π + 1= πΆ(π + 1, π + 1)
Ex. Find the sum
1 + 2 +β―+ π
= πΆ 1,1 + πΆ 2,1 + β―+ πΆ(π, 1)= πΆ π + 1,2
=π + 1 π
2