Amodb: N R N+R 1 R N+R 1 N 1
Amodb: N R N+R 1 R N+R 1 N 1
Amodb: N R N+R 1 R N+R 1 N 1
Number Theory: Product rule- the # of ways to do the procedure is |A1| * |A2| (If
Notes: 3|12 = 12/3 => 4, 3 ∤ 7 bc 7/3 is not an int there are n ways of doing something, and m ways of doing
a|b if remainder = 0, if a|b => b = k*a, a != 0 another thing after that, then there are n * m ways to perform both
1) If a|b and a|c, then a|(b+c) actions.
2) If a|b and b|c, then a|c Ex) a “word” is any string of seven (7) letters of the English
3) If a|b, then a|b*c for all ints c alphabet, with repeated letters allowed, how many words are
Ex) p/disp: if a|b & c|d, then (ac)|(b+d) => FALSE=> 3|9 & 2|4 != there? Each word is of length 7 and each position may take one of
6 ∤13 the 26 letters in English alphabet. The choice for each position is
Ex2) p/disp: for all non-0 integers a, b, if a|b and b|a, then a= b. independent of other positions, thus we use the product rule; there
=>TRUE=> a|b => b = Some int k *a, b|a => a = k2 *b, b = k * are 267 = 26 × 26 × 26 × 26 × 26 × 26 × 26 total words.
(k2*b), => b= k*k2b=> 1=kk2=>k=k2=1, => k=1 => b = 1*a, a = Ex) bit strings of length 12: how many begin with 10? 29 words.
1*b => b=a, a=b => a=b Begin w/. 11 and end in 10? 28
Modulus: Sum rule- the # of ways to do the procedure is |A1| + |A2|
a mod b = the remainder of a | b => 12 mod 3 = 0, (13/5 = 2 If there are n choices for one action, and m choices for another
remainder 3=>> 13 mod 5 = 3), 12 mod 5 = 2, aka remainder of action and the two actions cannot be done at the same time, then
a/b there are n + m ways to choose one of these actions.)
mod (a, b) = r, if a = bk + r, aka remainder of a/b == a mod b Subtraction rule- |A1| + |A2| - |A1 ꓵ A2|
(a+b) mod m = ((a mod m) + (b mod m)) mod m Ex) bit strings of length 12: begin w/. 11 (210) OR end w/. 10
ab mod m = ((a mod m) (b mod m)) mod m (210)? Begin and end = 28 => 2*210 -28
Ex) Is mod (a, b) = mod (b,a) ? => NO => Let a= 10, b = 6, mod Division rule- Let S be a set of n items partitioned into cells of
(10, 6) = 4, mod (6, 10) = 6 => 4 != 6 size d. Then the number of cells in the partition is n d .
a ≡ b mod m, if m|a-b or m|b-a Ex) bit strings of length 12: exactly 4 ones? 12!/4!*8! (12 total/ 4
a ≡ b mod m iff mod(a,b) = mod(b,m) 1s * 8 0s)
a + c ≡ b + c mod m Ex) DNA bases contain 1 of 4 values : A, C, T, G. How many
a * c ≡ b * c mod m no division!! length 8 sequences start w/. C and end w/. C? 46. Contain exactly
(a + b) mod m = [(a mod m) + (b mod m)] mod m 4 C’s? 8!/4! *4!4!4! Contain exactly 1 of the 4 bases? 4.
(a · b) mod m = [(a mod m) · (b mod m)] mod m Ex) pick cards 1 at a time w/.o replacement from 52 cards. Min #
Ex) if a ≡ b(mod m) and c ≡ d(mod m), then ac ≡ bd (mod m)? => of cards to pick to guarantee: a pair? 14 cards. 3 of a kind? 27.
TRUE => a ≡ b(mod m) => a-b = km, c ≡ d (mod m) => c-d = Ex) Let |A| = 4 and |B| = 10, find # of functions f: A->B. 104. # of
k2m, ac ≡ bd (mod m) => ac -bd = k3 m, ak ≡ bk (mod m), a = km 1-1 functions A->B? 10*9*8*7. |A| = 10, |B| = 4, # of 1-1
+b.. etc Eval. ac-bd => (km+b) (k2m+d) -bd…=> divisible by m, functions f: A->B? 0.
so ac ≡ bd (mod m) Ex) # of subsets of S = {1,2, 3... ,10} that contain 5? 29 That
Ex2) find ints such that a+b = ab(mod 5). => (a+b) -ab = k*5 => b contain neither 5 nor 6? 28. That contain 5 & 6? 28. That contain
– ab +a = 5k, -a(b-1) +a = 5k, a(1-b) +a => b- ab +a +1 -1 = 5k => no odd #s? 25.
-b(a-1)(b-1) -1 = 5k =>(a-1) (b-1) = 5k+1a = 4, b= 3, k = 1 Permutations: order MATTERS.
Ex3) Find all ints such that x ≡ 5 (mod 13). => x mod 13 = 5 mod Repetition: n!/(n-r)!, no rep: nr
13 => 5 mod 13 = 5 =>> x mod 13 = 5 => x = 5+- some multiple Comninations: order does NOT matter
of 13 −21 mod 13=5, 5 mod 13=5 , 31 mod 13=5 x = -21, 5,
31
Prime Numbers: divisible only by 1 and the # itself (>=2)
Rep: (nr ) = n!/ (r!(n-r)!), no rep: (n+ r−1
r )
= ( n+ r−1
n−1 )
Fundamental Thm of Arithmetic: every integer can be represented Ex) How many binary strings of len 14 contain @ most 3 ones?
uniquely as a product of primes:
Ex) 100 = 2*2*5*5 = 2252 (143 )+(142)+( 141)+(140 )
If n is composite int, it has a prime divisor <= √ n Ex) How many ways are there to select five players from a 10-
Ex) show 107 is a prime number. If 107 is composite, then it has a member tennis team to make a trip to a match at another school?
prime divisor smaller than √107 ≈ 10.34. Primes smaller than 10
are 2, 3, 5, and 7. None of it divides 107, thus 107 must prime (2P Non distinct Objects: n!/( n1!* n2!*…* nn!)
-1) Ex)How many different strings can be made by reordering the
letters of the word SUCCESS?
GCD: greatest common divisor, if = to 1, then #s are relatively Solution: There are seven possible positions for the three Ss,
prime two Cs, one U, and one E.
Ex) gcd(24, 36): prime factorization of 24 = 23 * 3, ‘ ‘ of 30 = 22 * The three Ss can be placed in C(7,3) different ways, leaving four
32 => gcd = 22 * 3 = 12 positions free.
gcd(a,0) = a(a/a & a/0) The two Cs can be placed in C(4,2) different ways, leaving two
gcd(a,a) = a(a/a & a/a) positions free.
gcd(a,b) = gcd(b,a) The U can be placed in C(2,1) different ways, leaving one
Euclidian Algorithm: if r(remainder of a/b)= a mod b, then position free. The E can be placed in C(1,1) way.
gcd(a,b) = gcd(b,r) By the product rule, the number of different strings is
Ex) gcd(1000, 625) => (375 = r of 1000/675) => 1000 = 625(1)
+375 gcd(625, 375) => 625 = 375(1) + 250 gcd(375, 250) Pigeon Hole: given n objects, place in k boxes, one box will
=> 375 = 250(1) +125 gcd(250, 125) => 250 = 125(2) + 0 contain @ least ⌈n/k⌉ objects
gcd = 125 Ex) Among 100 people there are at least ⌈100/12⌉ = 9 who were
born in the same month.
∞
Binomial Thm.: (x+y)n = ∑ x n− j y j
j=0
*48)/ (525 )
Ex) prob that a random k-digit decimal is also a valid octal #(digit
betwn 0 & 8) =>base8/base10 => (7*8k-1) / (9*10k-1)
Ex) pick two cards @ random form 52 cards: prob both are
diamonds? ¼ * 4/17 prob cards form a pair? 1* 3/51
Conditional: Probability of A given B P(A|B) = P(A ꓵ B)
/P(B)== P(B ꓵ A)/P(B)
Ex) What is the probability that when two dice are rolled, the sum
of the numbers on the two dice is 7 ? By the product rule there are
62 = 36 possible outcomes. Six of these sum to 7. So, the
probability of obtaining a 7 is 6/36 = 1/6.