1 Summary: Binary and Logic

Size: px
Start display at page:

Download "1 Summary: Binary and Logic"

Transcription

1 1 Summary: Biary ad Logic Biary Usiged Represetatio : each 1-bit is a power of two, the right-most is for 2 0 : = = = Usiged Rage o bits is [0...(2 1)]. For =4 we have the rage [0=0000, 1=0001,..., 15=1111] Biary Two s Complemet Represetatio : same as usiged, except the power of two for the first bit (the sig bit) is with egative sig. Whe the siged bit is 0 its positive idetical with usiged trasformatio; whe its 1 that power of two is egative: = = = = = = = it is essetial to kow how may bits to use, to kow which bit is the sig bit for egatives: 7 bits two s complemet : -27 = bits two s complemet: -27 = Two s Complemet Rage o bits is [ (2 1 1)]. For = 4 we have the rage [-8=1000, -7=1001, -6=1010,... -1=1111, 0=0000, 1=0001,..., 7=0111] 3-Step rule to covert from base 10 to two s complemet egatives - write i biary 27 = flip the bits add oe additio works like i base 10 with carry bit 1+1 = write 0, carry 1 ; = write 1 carry 1 etc subtractio base2 : use additio of the egative value base 4 = 2 2 use every two bits i base 2 to make a bit i base 4: = = 0 (val = 2) (val = 1) (val = 1) 4 = = base 8 = 2 3 use every three bits i base 2 to make a bit i base 8: = = 0 (val = 4) (val = 5) 8 = 45 8 = base 16 = 2 4 use every four bits i base 2 to make a bit i base 16: = = (val = 2) (val = 5) 16 = = = = (val = 1) (val = 11) 16 = 1B 16 = = ay base, like base=3 : break the umber ito powers of 3, with coefficiets {0,1,2} = = =

2 LOGIC TABLE A B A B (AND) A B (OR) A B (XOR) (A B) (NAND) DNF (OR betwee clauses for out=1); CNF (OR betwee egated clauses for out=0). EXAMPLE: A B C output DN F CN F A B C A B C A B C A B C A B C A B C A B C A B C DNF = ( A B C) ( A B C) (A B C) (A B C) CNF = (A B C) (A B C) ( A B C) ( A B C) BOOLEAN ALGEBRA LAWS (1=true=T; 0=false=F) 2

3 LOGIC GATES 3

4 2 Summary : Mod, Number Theory, RSA divisio a to b 2 : r = a mod b a = bq+r; with quotiet q ad remaider r Z b = {0, 1, 2,..., b 1} recap mod operatios fast expoetiatio by writig expoet a sum of powers of 2. Example 3 2 = 9; 3 4 = 9 2 = 81 = 1 mod 10; 3 8 = 1 2 = 1 mod 10 ; 3 16 = 1 2 = 1 mod mod 10 = mod 10 = = 3 mod 10 = p e1 1 p e1 1 p e1 1...p et t uique decompositio ito primes gcd(a, b) = all commo (itersectio) primes (each with mi expoet) lcm(a, b) = uio of primes (each with max expoet) ab = all primes together (with sum of expoets) gcm(a, b) lcm(a, b) = ab a b meas a divides b same as a is factor of b same as b is multiple of a same as b = ak for some iteger k a, b have the same remaider mod if ad oly if divides their differece : a mod = b mod a b if prime p ab; the p a p b a, b are coprimes (or relatively prime) if they have o commo prime factors; the gcd(a, b) = 1 if ab ad a, coprimes gcd(a, ) = 1; the b if a ad m a ad gcd(, m) = 1; the m a after dividig a, b by their d = gcd(a, b), oe gets coprime umbers: gcd( a d, b d ) = 1 a has multiplicative iverse b = a 1 mod meas ab mod = 1. gcd(a, ) = 1 That is possible if ad oly if a iverse mod (if exists) ca be foud as a v 1 for iteger v with property a v = 1 mod (v = order of a). Tryig powers to obtai the order is iefficiet, ot practical for large. gcd-bezout-coefficiets (x, y) for (a, b) always exist to give the gcd(a, b) = ax + by. if a, b coprime, 1 = gcd(a, b) = ax + by. The x, y are the two iverses x = a 1 mod b ad y = b 1 mod a Euclid-Exteded fids x, y coefficiets by trasformig the problem(a, b) ito problem(b, r) recursively, ad the recursively-back computig the coefficiets. It is efficiet, eve for large a, b. Liear cipher y = ax + b mod works if ad oly if (a, ) are coprime, that is a 1 mod. decoder is x = (y b)a 1 mod The 4

5 Euler totiet ϕ() is the size of the set C ={remaiders coprime with }; i other words ϕ() = umber of coprimes smaller tha. Euler s theorem : a ϕ() = 1 mod for ay a C. So we have four ways to fid a 1, the iverse of a mod : 1) Brute force. Try differet values b < util oe works (ab = 1 mod ) 2) Best i practice. x, y = EuclidExted(a, ). The x = a 1 is the iverse mod. 3) Fid order v for a, so a v = 1 mod the a v 1 mod is the iverse of a. Cat do fast expoetiatio(v ukow); still usually faster tha method 1) 4) Best if ϕ() kow. ϕ() acts as a order for a (a ϕ() = 1), so the iverse is a 1 = a ϕ() 1. Power modulo is efficiet with fast expoetiatio. For primes p, ϕ(p) = p 1 so that theorem becomes Fermats theorem a p 1 = 1 mod p whe (a, p) coprimes Primality Test for. Try for several a < to see if a 1 mod = 1. if ay of the tests(a) gives NO, the certaily ot prime if all tests(a) gives YES, is likely prime (rare exceptios: Carmichael umbers) = pq (two primes) the ϕ() = (p 1)(q 1); so if a coprime with the a ϕ() = a (p 1)(q 1) = 1 mod or a (p 1)(q 1)k+1 = a mod for ay k RSA. if = pq (two large primes); e ad d = e 1 are each other iverse mod (p 1)(q 1) meas ed = 1 mod (p 1)(q 1). The a ed = a (p 1)(q 1)k+1 = a mod. is kow but the prime factors p, q are ot ad hard to fid. RSA public key for ecryptio is e. ENCRYPT(a) = a e mod RSA secret key for decryptio is d. DECRYPT(a e ) = (a e ) d mod = a RSA sigature: verify that oe has the correct secret key, by receivig (a, b = a d ) ad decryptig b with public key b e = (a d ) e mod = a Chiese Remider : if p, q are coprime, ay pair of remaiders (a Z p, b Z q ) correspods uiquely to a remaider x Z pq such that x mod p = a ad x mod q = b 5

6 3 Summary: Sets, Coutig, Permutatios & Combiatios Set builder otatio A = {positive itegers smaller tha 100 divisible with 7} = {x x Z; 0 < x < 100; 7 x} cout A via idexig A = {x x Z; 0 < x < 100; 7 x} = {7 i i Z; 1 i 14} A = 14 uio, itersectio, set differece, set symmetric differece A B = {x x A OR x B} A B = {x x A AND x B} A B = {x x A AND x / B} A B = (A B) (B A) = (A B) (A B) Cartesia Product A B = {(x, y) x A; y B} Product Rule: if ay elemet from A ca be combied with ay elemet from B, the the umber of combiatios is A B = A B power set of A is P(A) = the set of all subsets of A, icludig A ad ; P(A) = 2 A. Example: A = {x, y, z}. The P(A) = { ; {x}; {y}; {z}; {x, y}; {x, z}; {y, z}; {x, y, z}} iclusio-exclusio priciple : A B C = A + B + C A B A C B C + A B C Sum (Partitio) Rule : if = A B = A C = B C the A B C = A + B + C Pigeohole Priciple: if items are put ito k boxes, the at least oe box cotais at least k items Permutatios P (, k) ways to choose a sequece of k items out of. ORDER MATTERS. P (, k) = ( 1) ( 1)... ( k + 1) =! ( k)! Combiatios C(, k) = ( ( k) ways to choose a set of k items out of. ORDER DOESNT MATTER. ) k = ( 1) ( 1)... ( k + 1)/( k) =! k!( k)! P (, k) ca be thought of as choosig a set of k, the permute the elemets chose i all k! ways. Thus P (, k) = ( ) k k! =!! k! = k!( k)! ( k)! ( ) ( k = k) sice choosig k items to take is equivalet to choosig k to remai Biomial Theorem (x + y) = ( ) 0 x 0 y + ( ) 1 x 1 y ( ) x y 0 = k=0 ( k ) x k y k 6

7 x = 1, y = 1 : 2 = (1 + 1) = ( ( k=0 k) = ( 0) + ( 1) ) x = 1, y = 1 : 0 = ( 1 + 1) = ( ) k=0 k ( 1) k = ( ( 0) ( 1) ) ( 1) Pascal Formula ( ) ( +1 k = ( k) + ) k 1 Pascal Triagle applies his formula at every row: ( ( ( ( ( ( 0) 1) 2) 3) 4) 5) Balls i Bis: The umber of ways to throw idistiguishable balls ito m distiguishable bis B 1, B 2,..B m is couted by choosig m 1 bi-separator locatios out of + m 1 spots for balls ad separators. For example for = 10, m = 6 the throw with bi couts correspods to the followig choices of m 1 = 5 separator locatios amog m + 1 = 15 balls+separators: Balls i Bis cout is ( ) +m 1 m 1 circular permutatio : whe sittig people at a roud table the umber of ways to sit them (ot icludig rotatios) is by keepig oe chair-fixed ad permute the rest; thus ( 1)! ways. coutig with bijective fuctios: if a bijectio (pairig) ca be established betwee set A ad set B the they have the same size, A = B. A bijectio fuctio f has two properties - ijectivity (differet argumets produce differet values): x, y A; x y f(x) f(y) - surjectivity (all B are possible fuctio values): v B, x A, f(x) = v 7

8 4 Summary: Probability if Ω is a set of outcome/evets ad A Ω the uiform probability P r[x A] = A / Ω. There are 2 optios here for each outcome, either x A or x / A radom variables X, Y, X each partitio the space Ω by a certai criteria (for example X = object color, Y= object price, Z = object shape). They are called radom because ay object pulled at radom ca have ay of the values of X as color, ay value of Y as price, ad ay Z as shape. For short otatio we say P r(x, Y ) = P r(x = X, y = Y ) is the probability that a radom object has color x ad price y Bayes Theorem P r(y X) P (X) = P r(x, Y ) = P r(x Y ) P (Y ) which meas probability to have a particular (X = red, Y = 100) object is the probability to have (X = red) times probability to have (Y = 100, give that X = red) or vice versa. The equality is the same as sayig P r(y X) = margializatio of variable Y over variable X: P r(y ) = x P r(x = X) P r(x, Y ) = x P r(x = X) P r(y X). If X is biary with oly two possible values (X; X) (for example pass vs fail ) the we have P r(y ) = P r(x) P r(y X) + P r( X) P r(y X) with margializatio of Y over biary radom variable X we ca write Bayes as P r(x Y ) = P r(y X) P (X) P (Y ) = P r(y X) P (X) P r(x) P r(y X)+P r( X) P r(y X) P r(x Y ) P (Y ) P (X) Idepedet variables X, Y meas P (Y X) = P (Y ) which is to say Y does ot deped o X (price does ot deped o color). From Bayes this meas also P (X Y ) = P (X) ad P (X, Y ) = P (X) P (Y ) expected value (or mea) for a umeric-value radom variable is the average of values weighted by probabilities: E[X] = x x P r(x = X) = x x P r(x) expectatio ALWAYS distributes over sum, eve if variables are ot idepedet. But they have to have umeric values E[X + Y + Z] = E[X] + E[Y ] + E[Z] variace = avg distace-to-mea 2 weighted by probabilities var[x] = x (x mea)2 P r(x = X) = E[(X E[X]) 2 ] = E[X 2 + E 2 [X] 2XE[X]] = E[X 2 ] + 2E 2 [X] 2E 2 [X] = E[X 2 ] E 2 [X] variace distributes over sum ONLY IF X, Y are idepedet X, Y idepedet var(x + Y ) = var(x) + var(y ) etropy = radomess of X (the more radom, the higher the etropy) H[X] = x P r(x) log( 1 P r(x) ) Markov Chais 8

9 5 Summary: Order of Growth For Positive Fuctios i order of growth we care about the geeral asymptotic (large ) behaviour of f(). f() = 3 2 2log() 5 grows like 2 For example f = O(g) BIG-O meas f less or equal with g asymptotically. Formally f() C g() for 0 ad a costat C > 0. We ca pick C ad 0 to aythig we wat but oce picked they cat chage Example: f() = log(); g() = 2 f = O(g) Example: f() = ; g() = f = O(g) f = Ω(g) BIG-OMEGA meas f bigger or equal with g asymptotically. Formally f() D g() for 0 ad a costat D > 0. We ca pick D ad 0 to aythig we wat but oce picked they cat chage Example: f() = 2 log(); g() = 2 f = Ω(g) Example: f() = 2 ; g() = f = Ω(g) f = Θ(g) BIG-THETA meas f grows equal with g asymptotically. Formally D g() f() C g() for 0 ad a costats C > D > 0. We ca pick C > D > 0 ad 0 to aythig we wat. The iequality ca be stated i reverse D f() g() C f() for differet costats C, D it is logically equivalet. Example: f() = ; g() = f = Θ(g) Example: f() = ; g() = f = Θ(g) Example: f() = log a (); g() = log b ()(a > b > 1) f = Θ(g) f = o(g) small-o meas f strictly less tha g asymptotically. Formally f() < C g() for ANY costat C > 0 ad a properly chose C. Such iequality must be prove for ay costat C; equivaletly it meas lim f()/g() = 0 Example: f() = log(); g() = 2 f = o(g) Example: f() = ; g() = f = o(g) Example: f() = 2 ; g() = f = o(g) Example: f() = ; g() =! f = o(g) f = ω(g) small-omega meas f strictly bigger tha g asymptotically. Formally f() > D g() for ANY costat D > 0 ad a properly chose D. Such iequality must be prove for ay costat D; equivaletly it meas lim f()/g() = Example: f() = log(); g() = f = ω(g) Example: f() = ; g() = f = ω(g) i geeral if < asy stads for asymptotic behaviour we have log c () < asy < asy log c () < asy 2 < asy 3 < asy... < asy < asy 2 < asy 3 < asy... < asy! < asy 9

10 6 Summary: Sequeces, Series, Iductio liear sum of idices k=1 k = (+1) 2 arithmetic progressio sequece x k = ak + b = (a + b, 2a + b, 3a + b, 4a + b,...) Characteristic : differece betwee values (delta) is costat a Partial sum is k=1 x k = k=1 (ak + b) = a k=1 k + b = a (+1) + b 2 quadratic sum of idices k=1 k2 = (+1)(2+1) 6 quadratic progressio sequece x k = ak 2 + bk + c = (a + b + c, 4a + 2b + c, 9a + 3b + c, 16a + 4b + c,...) Characteristic : differece betwee values (delta) is arithmetic progressio 2ak + (a + b) Partial sum is k=1 x k = k=1 (ak2 + bk + c) = a k=1 k2 + b k=1 k + c = a (+1)(2+1) + b (+1) + c 6 2 geometric sum of idices with base r 1: k=0 rk = r+1 1 r 1 - if base r > 1: r+1 1 r 1 = Θ(r ) - if base r < 1: k=0 rk = lim > r +1 1 r 1 = 1 - if base r = 1: k=0 rk = = Θ(1) 1 r k=0 1 = + 1 = Θ() geometric progressio sequece x k = ar k = (a, ar, ar 2, ar 3,...) Characteristic : ratio betwee values is costat r Partial sum for r 1 is k=1 x k = k=1 ark = a k=1 rk = a r+1 1 r 1 harmoic series = k=1 k l() = Θ(log()) telescopig series k=1 (a k a k+1 ) = (a 1 a 2 ) + (a 2 a 3 ) + (a 4 a 5 ) (a a +1 ) = a 1 a +1-1 k=1 = k(k+1) k=1 ( 1 1 ) = 1 1 k k log( k k=1 ) = k+1 k=1 log( k ) = k+1 k=1 (log(k) log(k + 1)) = log(1) log( + 1) = log( + 1) Iductio formula proofs S = k=1 (...) = f() For example S = (+1) k=1 k = f() = 2 -Base case = 1, 2 : verify maually that S 1 = f(1), S 2 = f(2), etc -Iductio Step (weak). Statemet : S = f() S +1 = f( + 1) -Iductio Step proof. Idea: relate S +1 to S S +1 = S + delta(s +1 S ) = f() + delta(s +1 S ) =...(algebra)... = f( + 1) -Iductio Step (strog). Statemet : {S 1 = f(1); S 2 = f(2);...; S = f()} S +1 = f( + 1) -Iductio Step proof. Idea: relate S +1 to several previous S k (k ) S +1 = S +delta(s +1 S, S 1, etc) = f()+delta(s +1 S S 1...) =...(algebra)... = f(+1) 10

11 Iductio logic proofs S = predicate(). For example S = Ay biary three with vertices has depth at least log() -Base case = 1, 2,etc : verify maually the predicates S(1), S(2), etc. Might eed more tha 2 base cases -Iductio Step (weak). Statemet : S TRUE S +1 TRUE -Iductio Step proof. Idea: relate S +1 to S Start with a cofiguratio appropriate for S +1 (for example a tree with + 1 vertices). The reduce coveietly the setup to the previous size (for example igore a vertice). Apply S for this reduced problem, the usig the result coveietly deduce S +1 -Iductio Step (strog). Statemet : {S, S 1,,,, S base } TRUE S +1 TRUE -Iductio Step proof. Idea: relate S +1 to several previous S k, k Start with a cofiguratio appropriate for S +1 (for example a tree with + 1 vertices). The reduce coveietly the setup to several prior sizes k (for example remove a edge to get two smaller trees). Apply S k for these reduced problems, the usig the result coveietly deduce S +1 11

12 7 Summary : Algorithms ad Recurreces Liear Uordered Search : search the list/array util value foud or array fiished -best case : foud o first elemet Θ(1) -average case : foud about i the middle Θ(/2) = Θ() -worst case : ot foud after checkig all values = Θ() Liear Ordered Search : search the sorted list/array util value foud or array fiished -best case : foud o first elemet Θ(1) -average case : foud about i the middle, or value checked is already too high so give up Θ(/2) = Θ() -worst case : ot foud after checkig all values = Θ() Biary Search : search the sorted array by checkig the middle value ad recurse o appropriate half - T () = 1 + T (/2): 1 for the compariso ad T (/2) for the recursio o oe of the halves -best case : foud o first elemet Θ(1) -worst case : ot foud after halvig all the way to oe elemet = Θ(log()) -average case : foud after about half of the recursive calls Θ(log()) Bubble Sort: sort a array by fixig bubbles A[i], A[i + 1] that are i icorrect order, as log as they exist. -best case : o bubbles eed fixig, so a pass through is ecessary to verify, thus Θ() -worst case : all ( 2) = ( 1)/2 bubbles eeds fixig (array is fully backwards) = Θ( 2 ) -average case : about half of bubbles eeds fixig Θ( 2 ) Selectio Sort: fid array miimum, output it, remove it, the repeat for remaiig elemets, etc -fidig miimum i k elemets is liear Θ(k) -for each k =, 1, 2,..., 1 we eed liear effort, so total that is about + ( 1) = Θ( 2 ) -T () = + T ( 1); for fidig miimum, ad T ( 1) for recursig to a problem of size 1 Isert Sort: keep previously elemets sorted ad isert the ew elemet i the correct spot by swappig it from the right, util all elemets are sorted -OUT P UT k = [a 1, a 2,...a k ] sorted -OUT P UT k+ext = [a 1, a 2,...a k, v] compare v to the left ad swap if ecessary, util v is i the correct spot, i.e. whe the elemet o the left is ot bigger tha v -repeat for all elemets i iput order -best case: already sorted, o swaps; Θ() -worst case: backwards sorted, all swaps; Θ( 2 ) -average case: about half of all swaps; Θ( 2 ) Merge Sort: split i half, recurse o both sides to sort them, the merge the sorted halves ito a sorted output -T () = + 2T (/2); for mergig sorted halves, ad twice T (/2) for recursig to both half-sides -best/worst/average case: solvig the recurrece gives T () = Θ( log()) - optimal sortig time based o comparisos is Θ( log()), so Merge Sort is optimal i that sese. 12

13 Quick Sort: pick a radom a elemet v ad put it i its correct sorted positio p (v = A[p]); rearrage the array so the elemet left to the pivot p are smaller tha A[p], ad the oes right to the pivot are larger tha A[p] - the rearragemet takes Θ() - recurse o both sides, which ow ca be sorted idepedetly - T () = + T (p 1) + T ( p); for rearragemet, T (p 1) for recurrece o left side; T ( p) for recurrece o right side -best/avg case: pivot roughly i the middle; Θ( log()) -worst case: pivot always at extremes; Θ( 2 ) Sovig recurreces of the form T () = at (/b) + c for the order of growth: apply the recurrece iteratively few times to fid a patter for k iteratios, the figure out how the patter looks for the last/biggest k T () = at ( ) + b c = a[at ( ) + ( b 2 b )c ] + c = a 2 T ( ) + a( b 2 b )c + c = a 2 [at ( ) + ( ) c ] + a( b 3 b 2 b )c + c = a 3 T ( ) + a 2 ( ) c + a( b 3 b 2 b )c + c = a 3 [at ( ) + ( ) c ] + a 2 ( ) c + a( b 4 b 3 b 2 b )c + c = a 4 T ( ) + a 3 ( ) c + a 2 ( ) c + a( b 4 b 3 b 2 b )c + c (geeral patter after k iteratios) = a k T ( ) + k 1 a i ( ) c b k b i i= (last k = log b ()) log = a log b () b () 1 T (1) + a i ( ) c b i i=0 log = log b (a) T (1) + c b () 1 ( a ) i b c i=0 -if a = b c (c = log b (a)) that becomes Θ( c + c log b ()) = Θ( c log()) -if r = a/b c 1, applyig geometric series formula for base r, that becomes Θ( log b (a) + c rlog b () 1 r 1 ) -if r = a/b c < 1 a < b c c > log b (a)), it becomes Θ( log b (a) + c 1 1 r ) = Θ(log b (a) + c ) = Θ( c ) - if r = a/b c > 1 a > b c c < log b (a)) it becomes Θ( log b (a) + c r log b () ) = Θ( log b (a) + c log b (r) ) = = Θ( log b (a) + c log b (a) log b (bc) ) = Θ( log b (a) + c+log b (a) c ) = = Θ( log b (a) ) Fiboacci base F 0 = 0; F 1 = 1 ad recurrece F +1 = F + F 1, satisfies F = Θ(φ ) where φ is the positive root of quadratic equatio φ 2 = φ

14 8 Summary: Graphs Graph G = (V, E) has set of vertices V ad set of edges E; each edge e = (u, v) is a pair of vertices. Graphs are udirected if edges are udirected (u, v) = (v, u) (for all edges) or directed if ((u, v) (v, u)). Graphs ca be represeted by adjacecy matrix where A uv = 1 idicates edge (u, v) exists, or by liked lists per vertex. degree(u) = umber of edges icidet vertex u. Sum off all degrees is twice the umber of edges, because each edge (u, v) cotributes +1 to both degrees of u ad v path(u, v) = a sequece of edges startig from u edig i v. If graph is directed, edges have to be cosidered i their directio (see picture left for path ) cycle is a path that begis ad eds at the same vertex u (see picture right for cycle 2-5-4). udirected cycle that passes through u ad v ca be thought tas two differet paths betwee u ad v A coected compoet : a subgraph where there is a path betwee ay two odes. Graphs ca have several coected compoets, which of course are ot coected betwee them (left picture for udirected compoets; right for directed compoets) tree= coected graph with o cycles. A tree with V vertices must have exactly V 1 edges: less would discoect it; more would form cycles. Spaig tree = a tree that icludes all graph vertices. two below draw with red edges) There ca be multiple spaig trees (see 14

15 BFS=Breadth-First-Search traversal : start at a root-vertex (wave 0), look for immediate eighbors (wave 1); look at their ew eighbors (wave 2) etc. Edges used to discover eighbors (blue i the picture below) are called the BFS-edges ad form the BFS-tree BFS: the shortest path from u to v (by umber of edges) ca be foud ruig BFS from root u ad check the wave umber that fids v. If v ot foud, it meas that there is o path from u to v, or v is ureachable from u. DFS=Depth-First-Search traversal: go as deep as possible o the curret brach, before comig back to follow other braches. A immediate eighbor to the root is discovered oly oly after the etire subtree of the curret eighbor is explored (see picture). Edges used for DFS advace are marked i red ad form the DFS tree ; the picture below cotais two DFS trees because the first oe startig i A could ot explore the whole graph. Each vertes is marled with a discovery time ad a fiishig time. 15

1 Summary: Binary and Logic

1 Summary: Binary and Logic 1 Summary: Biary ad Logic Biary Usiged Represetatio : each 1-bit is a power of two, the right-most is for 2 0 : 0110101 2 = 2 5 + 2 4 + 2 2 + 2 0 = 32 + 16 + 4 + 1 = 53 10 Usiged Rage o bits is [0...2

More information

Trial division, Pollard s p 1, Pollard s ρ, and Fermat s method. Christopher Koch 1. April 8, 2014

Trial division, Pollard s p 1, Pollard s ρ, and Fermat s method. Christopher Koch 1. April 8, 2014 Iteger Divisio Algorithm ad Cogruece Iteger Trial divisio,,, ad with itegers mod Iverses mod Multiplicatio ad GCD Iteger Christopher Koch 1 1 Departmet of Computer Sciece ad Egieerig CSE489/589 Algorithms

More information

CS 270 Algorithms. Oliver Kullmann. Growth of Functions. Divide-and- Conquer Min-Max- Problem. Tutorial. Reading from CLRS for week 2

CS 270 Algorithms. Oliver Kullmann. Growth of Functions. Divide-and- Conquer Min-Max- Problem. Tutorial. Reading from CLRS for week 2 Geeral remarks Week 2 1 Divide ad First we cosider a importat tool for the aalysis of algorithms: Big-Oh. The we itroduce a importat algorithmic paradigm:. We coclude by presetig ad aalysig two examples.

More information

HOMEWORK 2 SOLUTIONS

HOMEWORK 2 SOLUTIONS HOMEWORK SOLUTIONS CSE 55 RANDOMIZED AND APPROXIMATION ALGORITHMS 1. Questio 1. a) The larger the value of k is, the smaller the expected umber of days util we get all the coupos we eed. I fact if = k

More information

CS161 Handout 05 Summer 2013 July 10, 2013 Mathematical Terms and Identities

CS161 Handout 05 Summer 2013 July 10, 2013 Mathematical Terms and Identities CS161 Hadout 05 Summer 2013 July 10, 2013 Mathematical Terms ad Idetities Thaks to Ady Nguye ad Julie Tibshirai for their advice o this hadout. This hadout covers mathematical otatio ad idetities that

More information

Lecture Overview. 2 Permutations and Combinations. n(n 1) (n (k 1)) = n(n 1) (n k + 1) =

Lecture Overview. 2 Permutations and Combinations. n(n 1) (n (k 1)) = n(n 1) (n k + 1) = COMPSCI 230: Discrete Mathematics for Computer Sciece April 8, 2019 Lecturer: Debmalya Paigrahi Lecture 22 Scribe: Kevi Su 1 Overview I this lecture, we begi studyig the fudametals of coutig discrete objects.

More information

CS166 Handout 02 Spring 2018 April 3, 2018 Mathematical Terms and Identities

CS166 Handout 02 Spring 2018 April 3, 2018 Mathematical Terms and Identities CS166 Hadout 02 Sprig 2018 April 3, 2018 Mathematical Terms ad Idetities Thaks to Ady Nguye ad Julie Tibshirai for their advice o this hadout. This hadout covers mathematical otatio ad idetities that may

More information

Analysis of Algorithms. Introduction. Contents

Analysis of Algorithms. Introduction. Contents Itroductio The focus of this module is mathematical aspects of algorithms. Our mai focus is aalysis of algorithms, which meas evaluatig efficiecy of algorithms by aalytical ad mathematical methods. We

More information

CS 330 Discussion - Probability

CS 330 Discussion - Probability CS 330 Discussio - Probability March 24 2017 1 Fudametals of Probability 11 Radom Variables ad Evets A radom variable X is oe whose value is o-determiistic For example, suppose we flip a coi ad set X =

More information

Model of Computation and Runtime Analysis

Model of Computation and Runtime Analysis Model of Computatio ad Rutime Aalysis Model of Computatio Model of Computatio Specifies Set of operatios Cost of operatios (ot ecessarily time) Examples Turig Machie Radom Access Machie (RAM) PRAM Map

More information

Model of Computation and Runtime Analysis

Model of Computation and Runtime Analysis Model of Computatio ad Rutime Aalysis Model of Computatio Model of Computatio Specifies Set of operatios Cost of operatios (ot ecessarily time) Examples Turig Machie Radom Access Machie (RAM) PRAM Map

More information

Problem Set 2 Solutions

Problem Set 2 Solutions CS271 Radomess & Computatio, Sprig 2018 Problem Set 2 Solutios Poit totals are i the margi; the maximum total umber of poits was 52. 1. Probabilistic method for domiatig sets 6pts Pick a radom subset S

More information

Complex Numbers Solutions

Complex Numbers Solutions Complex Numbers Solutios Joseph Zoller February 7, 06 Solutios. (009 AIME I Problem ) There is a complex umber with imagiary part 64 ad a positive iteger such that Fid. [Solutio: 697] 4i + + 4i. 4i 4i

More information

Math 155 (Lecture 3)

Math 155 (Lecture 3) Math 55 (Lecture 3) September 8, I this lecture, we ll cosider the aswer to oe of the most basic coutig problems i combiatorics Questio How may ways are there to choose a -elemet subset of the set {,,,

More information

REVIEW FOR CHAPTER 1

REVIEW FOR CHAPTER 1 REVIEW FOR CHAPTER 1 A short summary: I this chapter you helped develop some basic coutig priciples. I particular, the uses of ordered pairs (The Product Priciple), fuctios, ad set partitios (The Sum Priciple)

More information

Divide & Conquer. Divide-and-conquer algorithms. Conventional product of polynomials. Conventional product of polynomials.

Divide & Conquer. Divide-and-conquer algorithms. Conventional product of polynomials. Conventional product of polynomials. Divide-ad-coquer algorithms Divide & Coquer Strategy: Divide the problem ito smaller subproblems of the same type of problem Solve the subproblems recursively Combie the aswers to solve the origial problem

More information

It is always the case that unions, intersections, complements, and set differences are preserved by the inverse image of a function.

It is always the case that unions, intersections, complements, and set differences are preserved by the inverse image of a function. MATH 532 Measurable Fuctios Dr. Neal, WKU Throughout, let ( X, F, µ) be a measure space ad let (!, F, P ) deote the special case of a probability space. We shall ow begi to study real-valued fuctios defied

More information

In number theory we will generally be working with integers, though occasionally fractions and irrationals will come into play.

In number theory we will generally be working with integers, though occasionally fractions and irrationals will come into play. Number Theory Math 5840 otes. Sectio 1: Axioms. I umber theory we will geerally be workig with itegers, though occasioally fractios ad irratioals will come ito play. Notatio: Z deotes the set of all itegers

More information

Math 475, Problem Set #12: Answers

Math 475, Problem Set #12: Answers Math 475, Problem Set #12: Aswers A. Chapter 8, problem 12, parts (b) ad (d). (b) S # (, 2) = 2 2, sice, from amog the 2 ways of puttig elemets ito 2 distiguishable boxes, exactly 2 of them result i oe

More information

Injections, Surjections, and the Pigeonhole Principle

Injections, Surjections, and the Pigeonhole Principle Ijectios, Surjectios, ad the Pigeohole Priciple 1 (10 poits Here we will come up with a sloppy boud o the umber of parethesisestigs (a (5 poits Describe a ijectio from the set of possible ways to est pairs

More information

The Growth of Functions. Theoretical Supplement

The Growth of Functions. Theoretical Supplement The Growth of Fuctios Theoretical Supplemet The Triagle Iequality The triagle iequality is a algebraic tool that is ofte useful i maipulatig absolute values of fuctios. The triagle iequality says that

More information

CSE 191, Class Note 05: Counting Methods Computer Sci & Eng Dept SUNY Buffalo

CSE 191, Class Note 05: Counting Methods Computer Sci & Eng Dept SUNY Buffalo Coutig Methods CSE 191, Class Note 05: Coutig Methods Computer Sci & Eg Dept SUNY Buffalo c Xi He (Uiversity at Buffalo CSE 191 Discrete Structures 1 / 48 Need for Coutig The problem of coutig the umber

More information

CS 332: Algorithms. Linear-Time Sorting. Order statistics. Slide credit: David Luebke (Virginia)

CS 332: Algorithms. Linear-Time Sorting. Order statistics. Slide credit: David Luebke (Virginia) 1 CS 332: Algorithms Liear-Time Sortig. Order statistics. Slide credit: David Luebke (Virgiia) Quicksort: Partitio I Words Partitio(A, p, r): Select a elemet to act as the pivot (which?) Grow two regios,

More information

Sorting Algorithms. Algorithms Kyuseok Shim SoEECS, SNU.

Sorting Algorithms. Algorithms Kyuseok Shim SoEECS, SNU. Sortig Algorithms Algorithms Kyuseo Shim SoEECS, SNU. Desigig Algorithms Icremetal approaches Divide-ad-Coquer approaches Dyamic programmig approaches Greedy approaches Radomized approaches You are ot

More information

Randomized Algorithms I, Spring 2018, Department of Computer Science, University of Helsinki Homework 1: Solutions (Discussed January 25, 2018)

Randomized Algorithms I, Spring 2018, Department of Computer Science, University of Helsinki Homework 1: Solutions (Discussed January 25, 2018) Radomized Algorithms I, Sprig 08, Departmet of Computer Sciece, Uiversity of Helsiki Homework : Solutios Discussed Jauary 5, 08). Exercise.: Cosider the followig balls-ad-bi game. We start with oe black

More information

Bertrand s Postulate

Bertrand s Postulate Bertrad s Postulate Lola Thompso Ross Program July 3, 2009 Lola Thompso (Ross Program Bertrad s Postulate July 3, 2009 1 / 33 Bertrad s Postulate I ve said it oce ad I ll say it agai: There s always a

More information

Infinite Sequences and Series

Infinite Sequences and Series Chapter 6 Ifiite Sequeces ad Series 6.1 Ifiite Sequeces 6.1.1 Elemetary Cocepts Simply speakig, a sequece is a ordered list of umbers writte: {a 1, a 2, a 3,...a, a +1,...} where the elemets a i represet

More information

Chapter 6. Advanced Counting Techniques

Chapter 6. Advanced Counting Techniques Chapter 6 Advaced Coutig Techiques 6.: Recurrece Relatios Defiitio: A recurrece relatio for the sequece {a } is a equatio expressig a i terms of oe or more of the previous terms of the sequece: a,a2,a3,,a

More information

Name of the Student:

Name of the Student: SUBJECT NAME : Discrete Mathematics SUBJECT CODE : MA 65 MATERIAL NAME : Problem Material MATERIAL CODE : JM08ADM010 (Sca the above QR code for the direct dowload of this material) Name of the Studet:

More information

Algorithm Analysis. Algorithms that are equally correct can vary in their utilization of computational resources

Algorithm Analysis. Algorithms that are equally correct can vary in their utilization of computational resources Algorithm Aalysis Algorithms that are equally correct ca vary i their utilizatio of computatioal resources time ad memory a slow program it is likely ot to be used a program that demads too much memory

More information

LECTURE NOTES, 11/10/04

LECTURE NOTES, 11/10/04 18.700 LECTURE NOTES, 11/10/04 Cotets 1. Direct sum decompositios 1 2. Geeralized eigespaces 3 3. The Chiese remaider theorem 5 4. Liear idepedece of geeralized eigespaces 8 1. Direct sum decompositios

More information

MATH 304: MIDTERM EXAM SOLUTIONS

MATH 304: MIDTERM EXAM SOLUTIONS MATH 304: MIDTERM EXAM SOLUTIONS [The problems are each worth five poits, except for problem 8, which is worth 8 poits. Thus there are 43 possible poits.] 1. Use the Euclidea algorithm to fid the greatest

More information

Basic Sets. Functions. MTH299 - Examples. Example 1. Let S = {1, {2, 3}, 4}. Indicate whether each statement is true or false. (a) S = 4. (e) 2 S.

Basic Sets. Functions. MTH299 - Examples. Example 1. Let S = {1, {2, 3}, 4}. Indicate whether each statement is true or false. (a) S = 4. (e) 2 S. Basic Sets Example 1. Let S = {1, {2, 3}, 4}. Idicate whether each statemet is true or false. (a) S = 4 (b) {1} S (c) {2, 3} S (d) {1, 4} S (e) 2 S. (f) S = {1, 4, {2, 3}} (g) S Example 2. Compute the

More information

CSE 1400 Applied Discrete Mathematics Number Theory and Proofs

CSE 1400 Applied Discrete Mathematics Number Theory and Proofs CSE 1400 Applied Discrete Mathematics Number Theory ad Proofs Departmet of Computer Scieces College of Egieerig Florida Tech Sprig 01 Problems for Number Theory Backgroud Number theory is the brach of

More information

Lecture Notes for CS 313H, Fall 2011

Lecture Notes for CS 313H, Fall 2011 Lecture Notes for CS 313H, Fall 011 August 5. We start by examiig triagular umbers: T () = 1 + + + ( = 0, 1,,...). Triagular umbers ca be also defied recursively: T (0) = 0, T ( + 1) = T () + + 1, or usig

More information

x c the remainder is Pc ().

x c the remainder is Pc (). Algebra, Polyomial ad Ratioal Fuctios Page 1 K.Paulk Notes Chapter 3, Sectio 3.1 to 3.4 Summary Sectio Theorem Notes 3.1 Zeros of a Fuctio Set the fuctio to zero ad solve for x. The fuctio is zero at these

More information

Lecture 14: Graph Entropy

Lecture 14: Graph Entropy 15-859: Iformatio Theory ad Applicatios i TCS Sprig 2013 Lecture 14: Graph Etropy March 19, 2013 Lecturer: Mahdi Cheraghchi Scribe: Euiwoog Lee 1 Recap Bergma s boud o the permaet Shearer s Lemma Number

More information

CS / MCS 401 Homework 3 grader solutions

CS / MCS 401 Homework 3 grader solutions CS / MCS 401 Homework 3 grader solutios assigmet due July 6, 016 writte by Jāis Lazovskis maximum poits: 33 Some questios from CLRS. Questios marked with a asterisk were ot graded. 1 Use the defiitio of

More information

Lecture 10: Mathematical Preliminaries

Lecture 10: Mathematical Preliminaries Lecture : Mathematical Prelimiaries Obective: Reviewig mathematical cocepts ad tools that are frequetly used i the aalysis of algorithms. Lecture # Slide # I this

More information

distinct distinct n k n k n! n n k k n 1 if k n, identical identical p j (k) p 0 if k > n n (k)

distinct distinct n k n k n! n n k k n 1 if k n, identical identical p j (k) p 0 if k > n n (k) THE TWELVEFOLD WAY FOLLOWING GIAN-CARLO ROTA How ay ways ca we distribute objects to recipiets? Equivaletly, we wat to euerate equivalece classes of fuctios f : X Y where X = ad Y = The fuctios are subject

More information

P.3 Polynomials and Special products

P.3 Polynomials and Special products Precalc Fall 2016 Sectios P.3, 1.2, 1.3, P.4, 1.4, P.2 (radicals/ratioal expoets), 1.5, 1.6, 1.7, 1.8, 1.1, 2.1, 2.2 I Polyomial defiitio (p. 28) a x + a x +... + a x + a x 1 1 0 1 1 0 a x + a x +... +

More information

Lecture 2 February 8, 2016

Lecture 2 February 8, 2016 MIT 6.854/8.45: Advaced Algorithms Sprig 206 Prof. Akur Moitra Lecture 2 February 8, 206 Scribe: Calvi Huag, Lih V. Nguye I this lecture, we aalyze the problem of schedulig equal size tasks arrivig olie

More information

TEACHER CERTIFICATION STUDY GUIDE

TEACHER CERTIFICATION STUDY GUIDE COMPETENCY 1. ALGEBRA SKILL 1.1 1.1a. ALGEBRAIC STRUCTURES Kow why the real ad complex umbers are each a field, ad that particular rigs are ot fields (e.g., itegers, polyomial rigs, matrix rigs) Algebra

More information

A recurrence equation is just a recursive function definition. It defines a function at one input in terms of its value on smaller inputs.

A recurrence equation is just a recursive function definition. It defines a function at one input in terms of its value on smaller inputs. CS23 Algorithms Hadout #6 Prof Ly Turbak September 8, 200 Wellesley College RECURRENCES This hadout summarizes highlights of CLRS Chapter 4 ad Appedix A (CLR Chapters 3 & 4) Two-Step Strategy for Aalyzig

More information

Math 216A Notes, Week 5

Math 216A Notes, Week 5 Math 6A Notes, Week 5 Scribe: Ayastassia Sebolt Disclaimer: These otes are ot early as polished (ad quite possibly ot early as correct) as a published paper. Please use them at your ow risk.. Thresholds

More information

[ 11 ] z of degree 2 as both degree 2 each. The degree of a polynomial in n variables is the maximum of the degrees of its terms.

[ 11 ] z of degree 2 as both degree 2 each. The degree of a polynomial in n variables is the maximum of the degrees of its terms. [ 11 ] 1 1.1 Polyomial Fuctios 1 Algebra Ay fuctio f ( x) ax a1x... a1x a0 is a polyomial fuctio if ai ( i 0,1,,,..., ) is a costat which belogs to the set of real umbers ad the idices,, 1,...,1 are atural

More information

An Introduction to Randomized Algorithms

An Introduction to Randomized Algorithms A Itroductio to Radomized Algorithms The focus of this lecture is to study a radomized algorithm for quick sort, aalyze it usig probabilistic recurrece relatios, ad also provide more geeral tools for aalysis

More information

6.3 Testing Series With Positive Terms

6.3 Testing Series With Positive Terms 6.3. TESTING SERIES WITH POSITIVE TERMS 307 6.3 Testig Series With Positive Terms 6.3. Review of what is kow up to ow I theory, testig a series a i for covergece amouts to fidig the i= sequece of partial

More information

This Lecture. Divide and Conquer. Merge Sort: Algorithm. Merge Sort Algorithm. MergeSort (Example) - 1. MergeSort (Example) - 2

This Lecture. Divide and Conquer. Merge Sort: Algorithm. Merge Sort Algorithm. MergeSort (Example) - 1. MergeSort (Example) - 2 This Lecture Divide-ad-coquer techique for algorithm desig. Example the merge sort. Writig ad solvig recurreces Divide ad Coquer Divide-ad-coquer method for algorithm desig: Divide: If the iput size is

More information

Advanced Course of Algorithm Design and Analysis

Advanced Course of Algorithm Design and Analysis Differet complexity measures Advaced Course of Algorithm Desig ad Aalysis Asymptotic complexity Big-Oh otatio Properties of O otatio Aalysis of simple algorithms A algorithm may may have differet executio

More information

Properties and Tests of Zeros of Polynomial Functions

Properties and Tests of Zeros of Polynomial Functions Properties ad Tests of Zeros of Polyomial Fuctios The Remaider ad Factor Theorems: Sythetic divisio ca be used to fid the values of polyomials i a sometimes easier way tha substitutio. This is show by

More information

Lecture 12: November 13, 2018

Lecture 12: November 13, 2018 Mathematical Toolkit Autum 2018 Lecturer: Madhur Tulsiai Lecture 12: November 13, 2018 1 Radomized polyomial idetity testig We will use our kowledge of coditioal probability to prove the followig lemma,

More information

A Probabilistic Analysis of Quicksort

A Probabilistic Analysis of Quicksort A Probabilistic Aalysis of Quicsort You are assumed to be familiar with Quicsort. I each iteratio this sortig algorithm chooses a pivot ad the, by performig comparisios with the pivot, splits the remaider

More information

In algebra one spends much time finding common denominators and thus simplifying rational expressions. For example:

In algebra one spends much time finding common denominators and thus simplifying rational expressions. For example: 74 The Method of Partial Fractios I algebra oe speds much time fidig commo deomiators ad thus simplifyig ratioal epressios For eample: + + + 6 5 + = + = = + + + + + ( )( ) 5 It may the seem odd to be watig

More information

End-of-Year Contest. ERHS Math Club. May 5, 2009

End-of-Year Contest. ERHS Math Club. May 5, 2009 Ed-of-Year Cotest ERHS Math Club May 5, 009 Problem 1: There are 9 cois. Oe is fake ad weighs a little less tha the others. Fid the fake coi by weighigs. Solutio: Separate the 9 cois ito 3 groups (A, B,

More information

CIS 121 Data Structures and Algorithms with Java Spring Code Snippets and Recurrences Monday, February 4/Tuesday, February 5

CIS 121 Data Structures and Algorithms with Java Spring Code Snippets and Recurrences Monday, February 4/Tuesday, February 5 CIS 11 Data Structures ad Algorithms with Java Sprig 019 Code Sippets ad Recurreces Moday, February 4/Tuesday, February 5 Learig Goals Practice provig asymptotic bouds with code sippets Practice solvig

More information

Recursive Algorithms. Recurrences. Recursive Algorithms Analysis

Recursive Algorithms. Recurrences. Recursive Algorithms Analysis Recursive Algorithms Recurreces Computer Sciece & Egieerig 35: Discrete Mathematics Christopher M Bourke cbourke@cseuledu A recursive algorithm is oe i which objects are defied i terms of other objects

More information

ACO Comprehensive Exam 9 October 2007 Student code A. 1. Graph Theory

ACO Comprehensive Exam 9 October 2007 Student code A. 1. Graph Theory 1. Graph Theory Prove that there exist o simple plaar triagulatio T ad two distict adjacet vertices x, y V (T ) such that x ad y are the oly vertices of T of odd degree. Do ot use the Four-Color Theorem.

More information

Data Structures Lecture 9

Data Structures Lecture 9 Fall 2017 Fag Yu Software Security Lab. Dept. Maagemet Iformatio Systems, Natioal Chegchi Uiversity Data Structures Lecture 9 Midterm o Dec. 7 (9:10-12:00am, 106) Lec 1-9, TextBook Ch1-8, 11,12 How to

More information

CALCULUS BASIC SUMMER REVIEW

CALCULUS BASIC SUMMER REVIEW CALCULUS BASIC SUMMER REVIEW NAME rise y y y Slope of a o vertical lie: m ru Poit Slope Equatio: y y m( ) The slope is m ad a poit o your lie is, ). ( y Slope-Itercept Equatio: y m b slope= m y-itercept=

More information

0 1 sum= sum= sum= sum= sum= sum= sum=64

0 1 sum= sum= sum= sum= sum= sum= sum=64 Biomial Coefficiets I how may ways ca we choose elemets from a elemet set? There are choices for the first elemet, - for the secod,..., dow to - + for the th, yieldig *(-)*...*(-+). So there are 4*3=2

More information

1 Counting and Stirling Numbers

1 Counting and Stirling Numbers 1 Coutig ad Stirlig Numbers Natural Numbers: We let N {0, 1, 2,...} deote the set of atural umbers. []: For N we let [] {1, 2,..., }. Sym: For a set X we let Sym(X) deote the set of bijectios from X to

More information

Zeros of Polynomials

Zeros of Polynomials Math 160 www.timetodare.com 4.5 4.6 Zeros of Polyomials I these sectios we will study polyomials algebraically. Most of our work will be cocered with fidig the solutios of polyomial equatios of ay degree

More information

International Baccalaureate LECTURE NOTES MATHEMATICS HL FURTHER MATHEMATICS HL Christos Nikolaidis TOPIC NUMBER THEORY

International Baccalaureate LECTURE NOTES MATHEMATICS HL FURTHER MATHEMATICS HL Christos Nikolaidis TOPIC NUMBER THEORY Iteratioal Baccalaureate LECTURE NOTES MATHEMATICS HL FURTHER MATHEMATICS HL TOPIC NUMBER THEORY METHODS OF PROOF. Couterexample - Cotradictio - Pigeohole Priciple Strog mathematical iductio 2 DIVISIBILITY....

More information

Lesson 10: Limits and Continuity

Lesson 10: Limits and Continuity www.scimsacademy.com Lesso 10: Limits ad Cotiuity SCIMS Academy 1 Limit of a fuctio The cocept of limit of a fuctio is cetral to all other cocepts i calculus (like cotiuity, derivative, defiite itegrals

More information

1 Hash tables. 1.1 Implementation

1 Hash tables. 1.1 Implementation Lecture 8 Hash Tables, Uiversal Hash Fuctios, Balls ad Bis Scribes: Luke Johsto, Moses Charikar, G. Valiat Date: Oct 18, 2017 Adapted From Virgiia Williams lecture otes 1 Hash tables A hash table is a

More information

MT5821 Advanced Combinatorics

MT5821 Advanced Combinatorics MT5821 Advaced Combiatorics 1 Coutig subsets I this sectio, we cout the subsets of a -elemet set. The coutig umbers are the biomial coefficiets, familiar objects but there are some ew thigs to say about

More information

Quantum Computing Lecture 7. Quantum Factoring

Quantum Computing Lecture 7. Quantum Factoring Quatum Computig Lecture 7 Quatum Factorig Maris Ozols Quatum factorig A polyomial time quatum algorithm for factorig umbers was published by Peter Shor i 1994. Polyomial time meas that the umber of gates

More information

4.3 Growth Rates of Solutions to Recurrences

4.3 Growth Rates of Solutions to Recurrences 4.3. GROWTH RATES OF SOLUTIONS TO RECURRENCES 81 4.3 Growth Rates of Solutios to Recurreces 4.3.1 Divide ad Coquer Algorithms Oe of the most basic ad powerful algorithmic techiques is divide ad coquer.

More information

CHAPTER 10 INFINITE SEQUENCES AND SERIES

CHAPTER 10 INFINITE SEQUENCES AND SERIES CHAPTER 10 INFINITE SEQUENCES AND SERIES 10.1 Sequeces 10.2 Ifiite Series 10.3 The Itegral Tests 10.4 Compariso Tests 10.5 The Ratio ad Root Tests 10.6 Alteratig Series: Absolute ad Coditioal Covergece

More information

Classification of problem & problem solving strategies. classification of time complexities (linear, logarithmic etc)

Classification of problem & problem solving strategies. classification of time complexities (linear, logarithmic etc) Classificatio of problem & problem solvig strategies classificatio of time complexities (liear, arithmic etc) Problem subdivisio Divide ad Coquer strategy. Asymptotic otatios, lower boud ad upper boud:

More information

Combinatorially Thinking

Combinatorially Thinking Combiatorially Thiig SIMUW 2008: July 4 25 Jeifer J Qui jjqui@uwashigtoedu Philosophy We wat to costruct our mathematical uderstadig To this ed, our goal is to situate our problems i cocrete coutig cotexts

More information

Section 5.1 The Basics of Counting

Section 5.1 The Basics of Counting 1 Sectio 5.1 The Basics of Coutig Combiatorics, the study of arragemets of objects, is a importat part of discrete mathematics. I this chapter, we will lear basic techiques of coutig which has a lot of

More information

A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence

A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence Sequeces A sequece of umbers is a fuctio whose domai is the positive itegers. We ca see that the sequece,, 2, 2, 3, 3,... is a fuctio from the positive itegers whe we write the first sequece elemet as

More information

September 2012 C1 Note. C1 Notes (Edexcel) Copyright - For AS, A2 notes and IGCSE / GCSE worksheets 1

September 2012 C1 Note. C1 Notes (Edexcel) Copyright   - For AS, A2 notes and IGCSE / GCSE worksheets 1 September 0 s (Edecel) Copyright www.pgmaths.co.uk - For AS, A otes ad IGCSE / GCSE worksheets September 0 Copyright www.pgmaths.co.uk - For AS, A otes ad IGCSE / GCSE worksheets September 0 Copyright

More information

Books Recommended for Further Reading

Books Recommended for Further Reading Books Recommeded for Further Readig by 8.5..8 o 0//8. For persoal use oly.. K. P. Bogart, Itroductory Combiatorics rd ed., S. I. Harcourt Brace College Publishers, 998.. R. A. Brualdi, Itroductory Combiatorics

More information

Topic 9: Sampling Distributions of Estimators

Topic 9: Sampling Distributions of Estimators Topic 9: Samplig Distributios of Estimators Course 003, 2016 Page 0 Samplig distributios of estimators Sice our estimators are statistics (particular fuctios of radom variables), their distributio ca be

More information

LESSON 2: SIMPLIFYING RADICALS

LESSON 2: SIMPLIFYING RADICALS High School: Workig with Epressios LESSON : SIMPLIFYING RADICALS N.RN.. C N.RN.. B 5 5 C t t t t t E a b a a b N.RN.. 4 6 N.RN. 4. N.RN. 5. N.RN. 6. 7 8 N.RN. 7. A 7 N.RN. 8. 6 80 448 4 5 6 48 00 6 6 6

More information

Summary: Congruences. j=1. 1 Here we use the Mathematica syntax for the function. In Maple worksheets, the function

Summary: Congruences. j=1. 1 Here we use the Mathematica syntax for the function. In Maple worksheets, the function Summary: Cogrueces j whe divided by, ad determiig the additive order of a iteger mod. As described i the Prelab sectio, cogrueces ca be thought of i terms of coutig with rows, ad for some questios this

More information

Linear chord diagrams with long chords

Linear chord diagrams with long chords Liear chord diagrams with log chords Everett Sulliva Departmet of Mathematics Dartmouth College Haover New Hampshire, U.S.A. everett..sulliva@dartmouth.edu Submitted: Feb 7, 2017; Accepted: Oct 7, 2017;

More information

REVISION SHEET FP1 (MEI) ALGEBRA. Identities In mathematics, an identity is a statement which is true for all values of the variables it contains.

REVISION SHEET FP1 (MEI) ALGEBRA. Identities In mathematics, an identity is a statement which is true for all values of the variables it contains. The mai ideas are: Idetities REVISION SHEET FP (MEI) ALGEBRA Before the exam you should kow: If a expressio is a idetity the it is true for all values of the variable it cotais The relatioships betwee

More information

Recursive Algorithm for Generating Partitions of an Integer. 1 Preliminary

Recursive Algorithm for Generating Partitions of an Integer. 1 Preliminary Recursive Algorithm for Geeratig Partitios of a Iteger Sug-Hyuk Cha Computer Sciece Departmet, Pace Uiversity 1 Pace Plaza, New York, NY 10038 USA scha@pace.edu Abstract. This article first reviews the

More information

Putnam Training Exercise Counting, Probability, Pigeonhole Principle (Answers)

Putnam Training Exercise Counting, Probability, Pigeonhole Principle (Answers) Putam Traiig Exercise Coutig, Probability, Pigeohole Pricile (Aswers) November 24th, 2015 1. Fid the umber of iteger o-egative solutios to the followig Diohatie equatio: x 1 + x 2 + x 3 + x 4 + x 5 = 17.

More information

Math 609/597: Cryptography 1

Math 609/597: Cryptography 1 Math 609/597: Cryptography 1 The Solovay-Strasse Primality Test 12 October, 1993 Burt Roseberg Revised: 6 October, 2000 1 Itroductio We describe the Solovay-Strasse primality test. There is quite a bit

More information

NICK DUFRESNE. 1 1 p(x). To determine some formulas for the generating function of the Schröder numbers, r(x) = a(x) =

NICK DUFRESNE. 1 1 p(x). To determine some formulas for the generating function of the Schröder numbers, r(x) = a(x) = AN INTRODUCTION TO SCHRÖDER AND UNKNOWN NUMBERS NICK DUFRESNE Abstract. I this article we will itroduce two types of lattice paths, Schröder paths ad Ukow paths. We will examie differet properties of each,

More information

Unit 4: Polynomial and Rational Functions

Unit 4: Polynomial and Rational Functions 48 Uit 4: Polyomial ad Ratioal Fuctios Polyomial Fuctios A polyomial fuctio y px ( ) is a fuctio of the form p( x) ax + a x + a x +... + ax + ax+ a 1 1 1 0 where a, a 1,..., a, a1, a0are real costats ad

More information

(ii) Two-permutations of {a, b, c}. Answer. (B) P (3, 3) = 3! (C) 3! = 6, and there are 6 items in (A). ... Answer.

(ii) Two-permutations of {a, b, c}. Answer. (B) P (3, 3) = 3! (C) 3! = 6, and there are 6 items in (A). ... Answer. SOLUTIONS Homewor 5 Due /6/19 Exercise. (a Cosider the set {a, b, c}. For each of the followig, (A list the objects described, (B give a formula that tells you how may you should have listed, ad (C verify

More information

Math 61CM - Solutions to homework 3

Math 61CM - Solutions to homework 3 Math 6CM - Solutios to homework 3 Cédric De Groote October 2 th, 208 Problem : Let F be a field, m 0 a fixed oegative iteger ad let V = {a 0 + a x + + a m x m a 0,, a m F} be the vector space cosistig

More information

SOLVED EXAMPLES

SOLVED EXAMPLES Prelimiaries Chapter PELIMINAIES Cocept of Divisibility: A o-zero iteger t is said to be a divisor of a iteger s if there is a iteger u such that s tu I this case we write t s (i) 6 as ca be writte as

More information

Data Structures and Algorithm. Xiaoqing Zheng

Data Structures and Algorithm. Xiaoqing Zheng Data Structures ad Algorithm Xiaoqig Zheg zhegxq@fudaeduc What are algorithms? A sequece of computatioal steps that trasform the iput ito the output Sortig problem: Iput: A sequece of umbers

More information

Definitions and Theorems. where x are the decision variables. c, b, and a are constant coefficients.

Definitions and Theorems. where x are the decision variables. c, b, and a are constant coefficients. Defiitios ad Theorems Remember the scalar form of the liear programmig problem, Miimize, Subject to, f(x) = c i x i a 1i x i = b 1 a mi x i = b m x i 0 i = 1,2,, where x are the decisio variables. c, b,

More information

SNAP Centre Workshop. Basic Algebraic Manipulation

SNAP Centre Workshop. Basic Algebraic Manipulation SNAP Cetre Workshop Basic Algebraic Maipulatio 8 Simplifyig Algebraic Expressios Whe a expressio is writte i the most compact maer possible, it is cosidered to be simplified. Not Simplified: x(x + 4x)

More information

Sequences A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence

Sequences A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence Sequeces A sequece of umbers is a fuctio whose domai is the positive itegers. We ca see that the sequece 1, 1, 2, 2, 3, 3,... is a fuctio from the positive itegers whe we write the first sequece elemet

More information

CALCULATION OF FIBONACCI VECTORS

CALCULATION OF FIBONACCI VECTORS CALCULATION OF FIBONACCI VECTORS Stuart D. Aderso Departmet of Physics, Ithaca College 953 Daby Road, Ithaca NY 14850, USA email: saderso@ithaca.edu ad Dai Novak Departmet of Mathematics, Ithaca College

More information

Sequences, Mathematical Induction, and Recursion. CSE 2353 Discrete Computational Structures Spring 2018

Sequences, Mathematical Induction, and Recursion. CSE 2353 Discrete Computational Structures Spring 2018 CSE 353 Discrete Computatioal Structures Sprig 08 Sequeces, Mathematical Iductio, ad Recursio (Chapter 5, Epp) Note: some course slides adopted from publisher-provided material Overview May mathematical

More information

The multiplicative structure of finite field and a construction of LRC

The multiplicative structure of finite field and a construction of LRC IERG6120 Codig for Distributed Storage Systems Lecture 8-06/10/2016 The multiplicative structure of fiite field ad a costructio of LRC Lecturer: Keeth Shum Scribe: Zhouyi Hu Notatios: We use the otatio

More information

n m CHAPTER 3 RATIONAL EXPONENTS AND RADICAL FUNCTIONS 3-1 Evaluate n th Roots and Use Rational Exponents Real nth Roots of a n th Root of a

n m CHAPTER 3 RATIONAL EXPONENTS AND RADICAL FUNCTIONS 3-1 Evaluate n th Roots and Use Rational Exponents Real nth Roots of a n th Root of a CHAPTER RATIONAL EXPONENTS AND RADICAL FUNCTIONS Big IDEAS: 1) Usig ratioal expoets ) Performig fuctio operatios ad fidig iverse fuctios ) Graphig radical fuctios ad solvig radical equatios Sectio: Essetial

More information

Average-Case Analysis of QuickSort

Average-Case Analysis of QuickSort Average-Case Aalysis of QuickSort Comp 363 Fall Semester 003 October 3, 003 The purpose of this documet is to itroduce the idea of usig recurrece relatios to do average-case aalysis. The average-case ruig

More information

4.1 Sigma Notation and Riemann Sums

4.1 Sigma Notation and Riemann Sums 0 the itegral. Sigma Notatio ad Riema Sums Oe strategy for calculatig the area of a regio is to cut the regio ito simple shapes, calculate the area of each simple shape, ad the add these smaller areas

More information

COMP285 Midterm Exam Department of Mathematics

COMP285 Midterm Exam Department of Mathematics COMP85 Midterm Exam Departmet of Mathematics Fall 010/011 - November 8, 010 Name: Studet Number: Please fiish withi 90 miutes. All poits above 100 are cosidered as bous poit. You ca reach maximal 1 poits.

More information