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