CS 350 Algorithms and Complexity
|
|
- Beryl Powers
- 5 years ago
- Views:
Transcription
1 CS 350 Algorthms and Complexty Wnter 2015 Lecture 8: Decrease & Conquer (contnued) Andrew P. Black Department of Computer Scence Portland State Unversty
2 Example: DFS traversal of undrected graph a b c d e f g h DFS traversal stack: DFS tree: 2
3 Decrease by a Constant Factor!bnary search and bsecton method ( 12.4)!exponentaton by squarng!multplcaton à la russe 3
4 Varable-sze decrease!eucld s algorthm!medan (or percentle) by partton!nm-lke games 4
5 Fndng the Medan!The Medan of an array of numbers s the mddle number, when sorted.!we can obvously fnd the medan by sortng the array, and then pckng the n k th element 2!How much work s that (n average case)? A. O(n) B. O(n lg n) C. O(n 2 ) D. somethng else 5
6 Medan n Lnear Tme?! Can we do better? " After all, sortng the whole array s more work than s needed to fnd the medan! Key nsght: generalze the problem! " Rather than seekng an algorthm for the th element, lets ok for the k th element, k [1..n] Suppose that we have a way of parttonng the array at element wth value p: How can ths help? l p p p r n 2 k 6
7 l r A = p p p!suppose that we are okng for the 10 th element, and: # A = 5 # Ap = 1 A Ap Ah " Then we can seek the 4 th element of Ah nstead! We have reduced the problem sze by a varable amount, n ths case A + Ap = 6 7
8 l r A = p p p A Ap Ah!Suppose that we are okng for the 10 th element, and: # A = 28 " Then we can seek the 10 th element of A nstead! We have reduced the problem sze by a varable amount, n ths case Ap + Ah 8
9 l r A = p p p!suppose that we are okng for the 8 th element, and: # A = 6 # Ap = 2 A Ap Ah " Then we can seek the 2 nd element of Ap nstead.! We have now solved the problem, because all the elements of Ap are p 9
10 Varable-sze decrease?!what s the connecton? " suppose that we have A[1:20] and are okng for the 7 th -smallest element: " run partton, fnd s = 9, say " Where do we ok for the 7 th -smallest element? A: A[1..20] B: A[1..8] C: A[1..9] D: A[10..20] 10
11 Varable-sze decrease?!what s the connecton? " suppose that we have A[1:20] and are okng for the 7 th -smallest element: " run partton, fnd s = 3, say " Where do we ok for the 7 th -smallest element? A: A[1..3] B: A[1..4] C: A[3..20] D: A[4..20] 11
12 What s the Effcency?!Dasgupta s analyss shows that: f we can do the partton n O(n) tme, then we can select the k th element n O(n) tme!how can we do partton n O(n) tme? Lomuto Partton Hoare Partton 12
13 Lomuto Partton!Whle algorthm s runnng: l s r p < p p?!invarant: " A[l] = p A[l+1.. s] < p A[s+1.. 1] p l s < r!establsh nvarant ntally: " p A[l]; s l; s+1 // makes < p nterval and p ntervals both empty 13
14 I don't lke Lumuto Partton l s r p < p p? 14
15 I don't lke Lumuto Partton!It does more swaps than necessary l s r p < p p? 14
16 I don't lke Lumuto Partton!It does more swaps than necessary l s r p < p p? " half of the swap s wasted!it confuses students! " Qucksort does not use the Lumuto Partton 14
17 Hoare Partton!Classc algorthm of computng!deveped n 1959, publshed n 1961.!Not only lnear, but pecularly effcent!!tony Hoare won the Turng Award for Qucksort, whch s based on ths algorthm... and some other thngs! 15
18 Partton: CACM (Vol 4) July 1961 ALGORITHM 63 PARTITION C. A. R. HOARE Eltt Brothers Ltd., Borehamwood, Hertfordshre, En procedure partton (A,M,N,I,J); value M,N; array A; nteger M,N,1,J; conunent I and J are output varables, and A s the array (w subscrpt bounds M:N) whch s operated upon by ths procedur Partton takes the value X of a random element of the array and rearranges the values of the elements of the array n such way that there exst ntegers I and J wth the folwng properte M _-< J < I =< NprovdedM < N A[R] =< XforM =< R _-< J A[R] = XforJ < R < I A[R] ~ Xfor I =< R ~ N The procedure uses an nteger procedure random (M,N) wh chooses equprobably a random nteger F between M and N, a also a procedure exchange, whch exchanges the values of ts tw parameters ; begn real X; nteger F; F := random (M,N); I:=M; J:=N; up: X := A[F]; for I : = I step 1 untl N do f X < A [I] then go to down; I:=N; down: forj := J step --1 untl M do f A[J]<X then go to change; J:=M; change: else f I < J then begn exchange (A[IL A[J]); I := I+ 1;J:= J - 1; go to up end f [ < F then begn exchange (A[IL A[F]) I:=I+l end else f F < J tllen begn exchange (A[F], A[J]) ; J:=J-1 end ; end partton 16
19 Partton: CACM (Vol 4) July 1961 ALGORITHM 63 PARTITION C. A. R. HOARE Eltt Brothers Ltd., Borehamwood, Hertfordshre, En procedure partton (A,M,N,I,J); value M,N; array A; nteger M,N,1,J; conunent I and J are output varables, and A s the array (w subscrpt bounds M:N) whch s operated upon by ths procedur Partton takes the value X of a random element of the array and rearranges the values of the elements of the array n such way that there exst ntegers I and J wth the folwng properte M _-< J < I =< NprovdedM < N A[R] =< XforM =< R _-< J A[R] = XforJ < R < I A[R] ~ Xfor I =< R ~ N The procedure uses an nteger procedure random (M,N) wh chooses equprobably a random nteger F between M and N, a also a procedure exchange, whch exchanges the values of ts tw parameters ; begn real X; nteger F; F := random (M,N); I:=M; J:=N; up: X := A[F]; for I : = I step 1 untl N do f X < A [I] then go to down; I:=N; down: forj := J step --1 untl M do f A[J]<X then go to change; J:=M; change: else f I < J then begn exchange (A[IL A[J]); I := I+ 1;J:= J - 1; go to up end f [ < F then begn exchange (A[IL A[F]) I:=I+l end else f F < J tllen begn exchange (A[F], A[J]) ; J:=J-1 end ; end partton 16
20 Partton: CACM (Vol 4) July 1961 ALGORITHM 63 PARTITION C. A. R. HOARE Eltt Brothers Ltd., Borehamwood, Hertfordshre, En procedure partton (A,M,N,I,J); value M,N; array A; nteger M,N,1,J; conunent I and J are output varables, and A s the array (w subscrpt bounds M:N) whch s operated upon by ths procedur Partton takes the value X of a random element of the array and rearranges the values of the elements of the array n such way that there exst ntegers I and J wth the folwng properte M _-< J < I =< NprovdedM < N A[R] =< XforM =< R _-< J A[R] = XforJ < R < I A[R] ~ Xfor I =< R ~ N The procedure uses an nteger procedure random (M,N) wh chooses equprobably a random nteger F between M and N, a also a procedure exchange, whch exchanges the values of ts tw parameters ; begn real X; nteger F; F := random (M,N); I:=M; J:=N; up: X := A[F]; for I : = I step 1 untl N do f X < A [I] then go to down; I:=N; down: forj := J step --1 untl M do f A[J]<X then go to change; J:=M; change: else f I < J then begn exchange (A[IL A[J]); I := I+ 1;J:= J - 1; go to up end f [ < F then begn exchange (A[IL A[F]) I:=I+l end else f F < J tllen begn exchange (A[F], A[J]) ; J:=J-1 end ; end partton 16
21 Partton: CACM (Vol 4) July 1961 ALGORITHM 63 PARTITION C. A. R. HOARE Eltt Brothers Ltd., Borehamwood, Hertfordshre, En procedure partton (A,M,N,I,J); value M,N; array A; nteger M,N,1,J; conunent I and J are output varables, and A s the array (w subscrpt bounds M:N) whch s operated upon by ths procedur Partton takes the value X of a random element of the array and rearranges the values of the elements of the array n such way that there exst ntegers I and J wth the folwng properte M _-< J < I =< NprovdedM < N A[R] =< XforM =< R _-< J A[R] = XforJ < R < I A[R] ~ Xfor I =< R ~ N The procedure uses an nteger procedure random (M,N) wh chooses equprobably a random nteger F between M and N, a also a procedure exchange, whch exchanges the values of ts tw parameters ; begn real X; nteger F; F := random (M,N); I:=M; J:=N; up: X := A[F]; for I : = I step 1 untl N do f X < A [I] then go to down; I:=N; down: forj := J step --1 untl M do f A[J]<X then go to change; J:=M; change: else f I < J then begn exchange (A[IL A[J]); I := I+ 1;J:= J - 1; go to up end f [ < F then begn exchange (A[IL A[F]) I:=I+l end else f F < J tllen begn exchange (A[F], A[J]) ; J:=J-1 end ; end partton 16
22 Partton: CACM (Vol 4) July 1961 ALGORITHM 63 PARTITION C. A. R. HOARE Eltt Brothers Ltd., Borehamwood, Hertfordshre, En procedure partton (A,M,N,I,J); value M,N; array A; nteger M,N,1,J; conunent I and J are output varables, and A s the array (w subscrpt bounds M:N) whch s operated upon by ths procedur Partton takes the value X of a random element of the array and rearranges the values of the elements of the array n such way that there exst ntegers I and J wth the folwng properte M _-< J < I =< NprovdedM < N A[R] =< XforM =< R _-< J A[R] = XforJ < R < I A[R] ~ Xfor I =< R ~ N The procedure uses an nteger procedure random (M,N) wh chooses equprobably a random nteger F between M and N, a also a procedure exchange, whch exchanges the values of ts tw parameters ; begn real X; nteger F; F := random (M,N); I:=M; J:=N; up: X := A[F]; for I : = I step 1 untl N do f X < A [I] then go to down; I:=N; down: forj := J step --1 untl M do f A[J]<X then go to change; J:=M; change: else f I < J then begn exchange (A[IL A[J]); I := I+ 1;J:= J - 1; go to up end f [ < F then begn exchange (A[IL A[F]) I:=I+l end else f F < J tllen begn exchange (A[F], A[J]) ; J:=J-1 end ; end partton Important features: random pvot double-ended search works n place two outputs 16
23 Hoare Partton method partton(a,, h) { def pvotindex = randombetween()and(h) def pvot = A[pvotIndex] var := 1 var := h+1 whle { do { := + 1 } whle { ( <= h).andalso {A[] <= pvot} } do { := 1 } whle { ( >= ).andalso {A[] >= pvot} } < } do { exchange(a,, ) } f ( < pvotindex) then { exchange(a,, pvotindex) ; := + 1 } elsef ( > pvotindex) then { exchange(a, pvotindex, ) ; := 1 } lst.wth(, ) } 17
24 Before partton begns: p h 7
25 Before partton begns: p h Leave elements that are already n the rght place: h 7
26 Before partton begns: p h Leave elements that are already n the rght place: h Now a[] p a[], so swap a[] and a[]: h 7
27 Before partton begns: p h Leave elements that are already n the rght place: h Now a[] p a[], so swap a[] and a[]: p h 7
28 Before partton begns: p h Leave elements that are already n the rght place: h Now a[] p a[], so swap a[] and a[]: p p h 7
29 Before partton begns: p h Leave elements that are already n the rght place: h Now a[] p a[], so swap a[] and a[]: p And contnue... p h h 7
30 when do we stop? And contnue... h untl and cross! p p h 19
31 when do we stop? And contnue... h untl and cross! p p h s ths possble? h 19
32 when do we stop? And contnue... h untl and cross! p p h s ths possble? p h 19
33 when do we stop? And contnue... h untl and cross! p p h s ths possble? p p h 19
34 when do we stop? And contnue... h untl and cross! p p h s ths possble? p p p h 19
35 when do we stop? And contnue... h untl and cross! p p h s ths possble? p p p p h 19
36 12 Cons! Ths problem s orgnally stated as: " You have a balance scale and 12 cons, 1 of whch s counterfet. The counterfet wegh less or more than the other cons. Can you determne the counterfet n 3 weghtngs, and tell f t s heaver or lghter?! A harder and more general problem s: " For some gven n > 1, there are (3 n 3)/2 cons, 1 of whch s counterfet. The counterfet wegh less or more than the other cons. Can you state a pror n weghtng experments wth a balance, wth whch you determne the counterfet con, and tell f t s heaver or lghter? 20
37 Problem: Bnary Inserton Sort Bnary nserton sort uses bnary search to fnd an approprate poston to nsert A[] among the prevously sorted A[0]... A[ 1]. In your work-groups, determne the worst-case effcency class of ths algorthm. Hnt: The order of growth of the worst-case number of key comparsons made by bnary nserton sort can be obtaned from formulas n Secton 4.1 and Appendx A. For ths algorthm, however, a key comparson s not the operaton that determnes the algorthm s effcency class. Whch operaton does? 21
38 Problem: Gray Code Use the decrease-by-one technque (Algorthm BRGC) to generate the bnary reflected Gray code for n = 4. 22
39 Problem: Gray Code Use the decrease-by-one technque (Algorthm BRGC) to generate the bnary reflected Gray code for n = n = 1 n = 2 n = 3 22
40 Problem: Gray Code Algorthm! Trace the folwng algorthm for generatng the Bnary Gray Code of order 4. Start wth code = 0000 output code for = 1 to 15 do: b poston of least sgnfcant 1 n bnary rep of code code XOR (bt b) output code 23
41 Nm!1 ple of n chps!players take turns removng 1 k m chps!the player removng the last chp wns m = 4 24
42 Nm!1 ple of n chps!players take turns removng 1 k m chps!the player removng the last chp wns m = 4 24
43 Nm!1 ple of n chps!players take turns removng 1 k m chps!the player removng the last chp wns m = 4 24
44 Nm!1 ple of n chps!players take turns removng 1 k m chps!the player removng the last chp wns m = 4 25
45 Nm!1 ple of n chps!players take turns removng 1 k m chps!the player removng the last chp wns m = 4 25
46 Nm!1 ple of n chps!players take turns removng 1 k m chps!the player removng the last chp wns m = 4 25
47 Multplcaton à la russe n m = ( n 2 2m f n s even n 1 2 2m + m f n s odd 26
48 You try t!!multply n m
49 You try t!!multply n m
50 You try t!!multply n m
51 You try t!!multply n m
CS 350 Algorithms and Complexity
CS 350 Algorithms and Complexity Spring 2015 Lecture 8: Decrease & Conquer (continued) Andrew P. Black Department of Computer Science Portland State University Ferrying Soldiers!A detachment of n soldiers
More informationCS 770G - Parallel Algorithms in Scientific Computing
References CS 770G - Parallel Algorthms n Scentfc Computng Parallel Sortng Introducton to Parallel Computng Kumar, Grama, Gupta, Karyps, Benjamn Cummngs. A porton of the notes comes from Prof. J. Demmel
More informationCHAPTER 17 Amortized Analysis
CHAPTER 7 Amortzed Analyss In an amortzed analyss, the tme requred to perform a sequence of data structure operatons s averaged over all the operatons performed. It can be used to show that the average
More informationCalculation of time complexity (3%)
Problem 1. (30%) Calculaton of tme complexty (3%) Gven n ctes, usng exhaust search to see every result takes O(n!). Calculaton of tme needed to solve the problem (2%) 40 ctes:40! dfferent tours 40 add
More information2.3 Nilpotent endomorphisms
s a block dagonal matrx, wth A Mat dm U (C) In fact, we can assume that B = B 1 B k, wth B an ordered bass of U, and that A = [f U ] B, where f U : U U s the restrcton of f to U 40 23 Nlpotent endomorphsms
More information: Numerical Analysis Topic 2: Solution of Nonlinear Equations Lectures 5-11:
764: Numercal Analyss Topc : Soluton o Nonlnear Equatons Lectures 5-: UIN Malang Read Chapters 5 and 6 o the tetbook 764_Topc Lecture 5 Soluton o Nonlnear Equatons Root Fndng Problems Dentons Classcaton
More informationDynamic Programming! CSE 417: Algorithms and Computational Complexity!
Dynamc Programmng CSE 417: Algorthms and Computatonal Complexty Wnter 2009 W. L. Ruzzo Dynamc Programmng, I:" Fbonacc & Stamps Outlne: General Prncples Easy Examples Fbonacc, Lckng Stamps Meater examples
More informationDesign and Analysis of Algorithms
Desgn and Analyss of Algorthms CSE 53 Lecture 4 Dynamc Programmng Junzhou Huang, Ph.D. Department of Computer Scence and Engneerng CSE53 Desgn and Analyss of Algorthms The General Dynamc Programmng Technque
More informationIntroduction to Algorithms
Introducton to Algorthms 6.046J/8.40J Lecture 7 Prof. Potr Indyk Data Structures Role of data structures: Encapsulate data Support certan operatons (e.g., INSERT, DELETE, SEARCH) Our focus: effcency of
More informationLecture 2 Solution of Nonlinear Equations ( Root Finding Problems )
Lecture Soluton o Nonlnear Equatons Root Fndng Problems Dentons Classcaton o Methods Analytcal Solutons Graphcal Methods Numercal Methods Bracketng Methods Open Methods Convergence Notatons Root Fndng
More informationProblem Set 9 Solutions
Desgn and Analyss of Algorthms May 4, 2015 Massachusetts Insttute of Technology 6.046J/18.410J Profs. Erk Demane, Srn Devadas, and Nancy Lynch Problem Set 9 Solutons Problem Set 9 Solutons Ths problem
More informationExercises. 18 Algorithms
18 Algorthms Exercses 0.1. In each of the followng stuatons, ndcate whether f = O(g), or f = Ω(g), or both (n whch case f = Θ(g)). f(n) g(n) (a) n 100 n 200 (b) n 1/2 n 2/3 (c) 100n + log n n + (log n)
More informationMath Review. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University
Math Revew CptS 223 dvanced Data Structures Larry Holder School of Electrcal Engneerng and Computer Scence Washngton State Unversty 1 Why do we need math n a data structures course? nalyzng data structures
More information= z 20 z n. (k 20) + 4 z k = 4
Problem Set #7 solutons 7.2.. (a Fnd the coeffcent of z k n (z + z 5 + z 6 + z 7 + 5, k 20. We use the known seres expanson ( n+l ( z l l z n below: (z + z 5 + z 6 + z 7 + 5 (z 5 ( + z + z 2 + z + 5 5
More informationCommon loop optimizations. Example to improve locality. Why Dependence Analysis. Data Dependence in Loops. Goal is to find best schedule:
15-745 Lecture 6 Data Dependence n Loops Copyrght Seth Goldsten, 2008 Based on sldes from Allen&Kennedy Lecture 6 15-745 2005-8 1 Common loop optmzatons Hostng of loop-nvarant computatons pre-compute before
More informationand problem sheet 2
-8 and 5-5 problem sheet Solutons to the followng seven exercses and optonal bonus problem are to be submtted through gradescope by :0PM on Wednesday th September 08. There are also some practce problems,
More informationErrors for Linear Systems
Errors for Lnear Systems When we solve a lnear system Ax b we often do not know A and b exactly, but have only approxmatons  and ˆb avalable. Then the best thng we can do s to solve ˆx ˆb exactly whch
More informationStanford University CS359G: Graph Partitioning and Expanders Handout 4 Luca Trevisan January 13, 2011
Stanford Unversty CS359G: Graph Parttonng and Expanders Handout 4 Luca Trevsan January 3, 0 Lecture 4 In whch we prove the dffcult drecton of Cheeger s nequalty. As n the past lectures, consder an undrected
More informationUniversity of Washington Department of Chemistry Chemistry 453 Winter Quarter 2015
Lecture 2. 1/07/15-1/09/15 Unversty of Washngton Department of Chemstry Chemstry 453 Wnter Quarter 2015 We are not talkng about truth. We are talkng about somethng that seems lke truth. The truth we want
More informationAttacks on RSA The Rabin Cryptosystem Semantic Security of RSA Cryptology, Tuesday, February 27th, 2007 Nils Andersen. Complexity Theoretic Reduction
Attacks on RSA The Rabn Cryptosystem Semantc Securty of RSA Cryptology, Tuesday, February 27th, 2007 Nls Andersen Square Roots modulo n Complexty Theoretc Reducton Factorng Algorthms Pollard s p 1 Pollard
More informationSpeeding up Computation of Scalar Multiplication in Elliptic Curve Cryptosystem
H.K. Pathak et. al. / (IJCSE) Internatonal Journal on Computer Scence and Engneerng Speedng up Computaton of Scalar Multplcaton n Ellptc Curve Cryptosystem H. K. Pathak Manju Sangh S.o.S n Computer scence
More information5 The Rational Canonical Form
5 The Ratonal Canoncal Form Here p s a monc rreducble factor of the mnmum polynomal m T and s not necessarly of degree one Let F p denote the feld constructed earler n the course, consstng of all matrces
More informationUsing T.O.M to Estimate Parameter of distributions that have not Single Exponential Family
IOSR Journal of Mathematcs IOSR-JM) ISSN: 2278-5728. Volume 3, Issue 3 Sep-Oct. 202), PP 44-48 www.osrjournals.org Usng T.O.M to Estmate Parameter of dstrbutons that have not Sngle Exponental Famly Jubran
More informationLINEAR REGRESSION ANALYSIS. MODULE IX Lecture Multicollinearity
LINEAR REGRESSION ANALYSIS MODULE IX Lecture - 30 Multcollnearty Dr. Shalabh Department of Mathematcs and Statstcs Indan Insttute of Technology Kanpur 2 Remedes for multcollnearty Varous technques have
More informationprinceton univ. F 13 cos 521: Advanced Algorithm Design Lecture 3: Large deviations bounds and applications Lecturer: Sanjeev Arora
prnceton unv. F 13 cos 521: Advanced Algorthm Desgn Lecture 3: Large devatons bounds and applcatons Lecturer: Sanjeev Arora Scrbe: Today s topc s devaton bounds: what s the probablty that a random varable
More informationMultilayer Perceptrons and Backpropagation. Perceptrons. Recap: Perceptrons. Informatics 1 CG: Lecture 6. Mirella Lapata
Multlayer Perceptrons and Informatcs CG: Lecture 6 Mrella Lapata School of Informatcs Unversty of Ednburgh mlap@nf.ed.ac.uk Readng: Kevn Gurney s Introducton to Neural Networks, Chapters 5 6.5 January,
More informationLine Drawing and Clipping Week 1, Lecture 2
CS 43 Computer Graphcs I Lne Drawng and Clppng Week, Lecture 2 Davd Breen, Wllam Regl and Maxm Peysakhov Geometrc and Intellgent Computng Laboratory Department of Computer Scence Drexel Unversty http://gcl.mcs.drexel.edu
More informationU.C. Berkeley CS294: Spectral Methods and Expanders Handout 8 Luca Trevisan February 17, 2016
U.C. Berkeley CS94: Spectral Methods and Expanders Handout 8 Luca Trevsan February 7, 06 Lecture 8: Spectral Algorthms Wrap-up In whch we talk about even more generalzatons of Cheeger s nequaltes, and
More informationReview of Taylor Series. Read Section 1.2
Revew of Taylor Seres Read Secton 1.2 1 Power Seres A power seres about c s an nfnte seres of the form k = 0 k a ( x c) = a + a ( x c) + a ( x c) + a ( x c) k 2 3 0 1 2 3 + In many cases, c = 0, and the
More informationOn the Best Case of Heapsort
JOURNAL OF ALGORITHMS 20, 20527 996 ARTICLE NO. 00 On the Best Case of Heapsort B. Bollobas Department of Pure Mathematcs, Unersty of Cambrdge, Cambrdge CB2 TN, Unted Kngdom T. I. Fenner Department of
More informationA PROBABILITY-DRIVEN SEARCH ALGORITHM FOR SOLVING MULTI-OBJECTIVE OPTIMIZATION PROBLEMS
HCMC Unversty of Pedagogy Thong Nguyen Huu et al. A PROBABILITY-DRIVEN SEARCH ALGORITHM FOR SOLVING MULTI-OBJECTIVE OPTIMIZATION PROBLEMS Thong Nguyen Huu and Hao Tran Van Department of mathematcs-nformaton,
More informationLecture 3: Probability Distributions
Lecture 3: Probablty Dstrbutons Random Varables Let us begn by defnng a sample space as a set of outcomes from an experment. We denote ths by S. A random varable s a functon whch maps outcomes nto the
More informationChapter Twelve. Integration. We now turn our attention to the idea of an integral in dimensions higher than one. Consider a real-valued function f : D
Chapter Twelve Integraton 12.1 Introducton We now turn our attenton to the dea of an ntegral n dmensons hgher than one. Consder a real-valued functon f : R, where the doman s a nce closed subset of Eucldean
More informationChapter 8 SCALAR QUANTIZATION
Outlne Chapter 8 SCALAR QUANTIZATION Yeuan-Kuen Lee [ CU, CSIE ] 8.1 Overvew 8. Introducton 8.4 Unform Quantzer 8.5 Adaptve Quantzaton 8.6 Nonunform Quantzaton 8.7 Entropy-Coded Quantzaton Ch 8 Scalar
More informationx = , so that calculated
Stat 4, secton Sngle Factor ANOVA notes by Tm Plachowsk n chapter 8 we conducted hypothess tests n whch we compared a sngle sample s mean or proporton to some hypotheszed value Chapter 9 expanded ths to
More informationA 2D Bounded Linear Program (H,c) 2D Linear Programming
A 2D Bounded Lnear Program (H,c) h 3 v h 8 h 5 c h 4 h h 6 h 7 h 2 2D Lnear Programmng C s a polygonal regon, the ntersecton of n halfplanes. (H, c) s nfeasble, as C s empty. Feasble regon C s unbounded
More informationExample: (13320, 22140) =? Solution #1: The divisors of are 1, 2, 3, 4, 5, 6, 9, 10, 12, 15, 18, 20, 27, 30, 36, 41,
The greatest common dvsor of two ntegers a and b (not both zero) s the largest nteger whch s a common factor of both a and b. We denote ths number by gcd(a, b), or smply (a, b) when there s no confuson
More informationIntroduction to Algorithms
Introducton to Algorthms 6.046J/18.401J Lecture 7 Prof. Potr Indyk Data Structures Role of data structures: Encapsulate data Support certan operatons (e.g., INSERT, DELETE, SEARCH) What data structures
More informationENTROPIC QUESTIONING
ENTROPIC QUESTIONING NACHUM. Introucton Goal. Pck the queston that contrbutes most to fnng a sutable prouct. Iea. Use an nformaton-theoretc measure. Bascs. Entropy (a non-negatve real number) measures
More informationAlgorithms And Programming I. Lecture 5 Quicksort
Algorithms And Programming I Lecture 5 Quicksort Quick Sort Partition set into two using randomly chosen pivot 88 31 25 52 14 98 62 30 23 79 14 31 2530 23 52 88 62 98 79 Quick Sort 14 31 2530 23 52 88
More informationChapter 3 Describing Data Using Numerical Measures
Chapter 3 Student Lecture Notes 3-1 Chapter 3 Descrbng Data Usng Numercal Measures Fall 2006 Fundamentals of Busness Statstcs 1 Chapter Goals To establsh the usefulness of summary measures of data. The
More informationfind (x): given element x, return the canonical element of the set containing x;
COS 43 Sprng, 009 Dsjont Set Unon Problem: Mantan a collecton of dsjont sets. Two operatons: fnd the set contanng a gven element; unte two sets nto one (destructvely). Approach: Canoncal element method:
More informationWeighted Voting Systems
Weghted Votng Systems Elssa Brown Chrssy Donovan Charles Noneman June 5, 2009 Votng systems can be deceptve. For nstance, a votng system mght consst of four people, n whch three of the people have 2 votes,
More informationCS 331 DESIGN AND ANALYSIS OF ALGORITHMS DYNAMIC PROGRAMMING. Dr. Daisy Tang
CS DESIGN ND NLYSIS OF LGORITHMS DYNMIC PROGRMMING Dr. Dasy Tang Dynamc Programmng Idea: Problems can be dvded nto stages Soluton s a sequence o decsons and the decson at the current stage s based on the
More informationHashing. Alexandra Stefan
Hashng Alexandra Stefan 1 Hash tables Tables Drect access table (or key-ndex table): key => ndex Hash table: key => hash value => ndex Man components Hash functon Collson resoluton Dfferent keys mapped
More informationCombining Constraint Programming and Integer Programming
Combnng Constrant Programmng and Integer Programmng GLOBAL CONSTRAINT OPTIMIZATION COMPONENT Specal Purpose Algorthm mn c T x +(x- 0 ) x( + ()) =1 x( - ()) =1 FILTERING ALGORITHM COST-BASED FILTERING ALGORITHM
More informationLecture 5 Decoding Binary BCH Codes
Lecture 5 Decodng Bnary BCH Codes In ths class, we wll ntroduce dfferent methods for decodng BCH codes 51 Decodng the [15, 7, 5] 2 -BCH Code Consder the [15, 7, 5] 2 -code C we ntroduced n the last lecture
More informationOutline and Reading. Dynamic Programming. Dynamic Programming revealed. Computing Fibonacci. The General Dynamic Programming Technique
Outlne and Readng Dynamc Programmng The General Technque ( 5.3.2) -1 Knapsac Problem ( 5.3.3) Matrx Chan-Product ( 5.3.1) Dynamc Programmng verson 1.4 1 Dynamc Programmng verson 1.4 2 Dynamc Programmng
More informationEdge Isoperimetric Inequalities
November 7, 2005 Ross M. Rchardson Edge Isopermetrc Inequaltes 1 Four Questons Recall that n the last lecture we looked at the problem of sopermetrc nequaltes n the hypercube, Q n. Our noton of boundary
More informationHomework 9 Solutions. 1. (Exercises from the book, 6 th edition, 6.6, 1-3.) Determine the number of distinct orderings of the letters given:
Homework 9 Solutons PROBLEM ONE 1 (Exercses from the book, th edton,, 1-) Determne the number of dstnct orderngs of the letters gven: (a) GUIDE Soluton: 5! (b) SCHOOL Soluton:! (c) SALESPERSONS Soluton:
More informationComplex Numbers Alpha, Round 1 Test #123
Complex Numbers Alpha, Round Test #3. Wrte your 6-dgt ID# n the I.D. NUMBER grd, left-justfed, and bubble. Check that each column has only one number darkened.. In the EXAM NO. grd, wrte the 3-dgt Test
More informationLearning Theory: Lecture Notes
Learnng Theory: Lecture Notes Lecturer: Kamalka Chaudhur Scrbe: Qush Wang October 27, 2012 1 The Agnostc PAC Model Recall that one of the constrants of the PAC model s that the data dstrbuton has to be
More informationAppendix B: Resampling Algorithms
407 Appendx B: Resamplng Algorthms A common problem of all partcle flters s the degeneracy of weghts, whch conssts of the unbounded ncrease of the varance of the mportance weghts ω [ ] of the partcles
More information8.4 COMPLEX VECTOR SPACES AND INNER PRODUCTS
SECTION 8.4 COMPLEX VECTOR SPACES AND INNER PRODUCTS 493 8.4 COMPLEX VECTOR SPACES AND INNER PRODUCTS All the vector spaces you have studed thus far n the text are real vector spaces because the scalars
More informationFinding Primitive Roots Pseudo-Deterministically
Electronc Colloquum on Computatonal Complexty, Report No 207 (205) Fndng Prmtve Roots Pseudo-Determnstcally Ofer Grossman December 22, 205 Abstract Pseudo-determnstc algorthms are randomzed search algorthms
More informationEEL 6266 Power System Operation and Control. Chapter 3 Economic Dispatch Using Dynamic Programming
EEL 6266 Power System Operaton and Control Chapter 3 Economc Dspatch Usng Dynamc Programmng Pecewse Lnear Cost Functons Common practce many utltes prefer to represent ther generator cost functons as sngle-
More informationFaster Searching by Elimination
Faster Searchng by Elmnaton Theodore S. Norvell Electrcal and Computer Engneerng Memoral Unversty December 6, 010 Abstract The SIMPLE system, under development at Memoral Unversty, allows abstract problem
More informationAlgorithms. Algorithms. Algorithms 2.2 M ERGESORT. mergesort bottom-up mergesort. sorting complexity divide-and-conquer
Algorthms Two classc sortng algorthms: mergesort and qucsort R OBERT S EDGEWICK K EVIN W AYNE Crtcal components n the world s computatonal nfrastructure. Full scentfc understandng of ther propertes has
More informationAn efficient algorithm for multivariate Maclaurin Newton transformation
Annales UMCS Informatca AI VIII, 2 2008) 5 14 DOI: 10.2478/v10065-008-0020-6 An effcent algorthm for multvarate Maclaurn Newton transformaton Joanna Kapusta Insttute of Mathematcs and Computer Scence,
More informationFinding Dense Subgraphs in G(n, 1/2)
Fndng Dense Subgraphs n Gn, 1/ Atsh Das Sarma 1, Amt Deshpande, and Rav Kannan 1 Georga Insttute of Technology,atsh@cc.gatech.edu Mcrosoft Research-Bangalore,amtdesh,annan@mcrosoft.com Abstract. Fndng
More informationVQ widely used in coding speech, image, and video
at Scalar quantzers are specal cases of vector quantzers (VQ): they are constraned to look at one sample at a tme (memoryless) VQ does not have such constrant better RD perfomance expected Source codng
More informationMin Cut, Fast Cut, Polynomial Identities
Randomzed Algorthms, Summer 016 Mn Cut, Fast Cut, Polynomal Identtes Instructor: Thomas Kesselhem and Kurt Mehlhorn 1 Mn Cuts n Graphs Lecture (5 pages) Throughout ths secton, G = (V, E) s a mult-graph.
More informationRetrieval Models: Language models
CS-590I Informaton Retreval Retreval Models: Language models Luo S Department of Computer Scence Purdue Unversty Introducton to language model Ungram language model Document language model estmaton Maxmum
More informationStatistical Inference. 2.3 Summary Statistics Measures of Center and Spread. parameters ( population characteristics )
Ismor Fscher, 8//008 Stat 54 / -8.3 Summary Statstcs Measures of Center and Spread Dstrbuton of dscrete contnuous POPULATION Random Varable, numercal True center =??? True spread =???? parameters ( populaton
More informationA New Scrambling Evaluation Scheme based on Spatial Distribution Entropy and Centroid Difference of Bit-plane
A New Scramblng Evaluaton Scheme based on Spatal Dstrbuton Entropy and Centrod Dfference of Bt-plane Lang Zhao *, Avshek Adhkar Kouch Sakura * * Graduate School of Informaton Scence and Electrcal Engneerng,
More informationExpected Value and Variance
MATH 38 Expected Value and Varance Dr. Neal, WKU We now shall dscuss how to fnd the average and standard devaton of a random varable X. Expected Value Defnton. The expected value (or average value, or
More informationU.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan 2/21/2008. Notes for Lecture 8
U.C. Berkeley CS278: Computatonal Complexty Handout N8 Professor Luca Trevsan 2/21/2008 Notes for Lecture 8 1 Undrected Connectvty In the undrected s t connectvty problem (abbrevated ST-UCONN) we are gven
More informationCISE301: Numerical Methods Topic 2: Solution of Nonlinear Equations
CISE3: Numercal Methods Topc : Soluton o Nonlnear Equatons Dr. Amar Khoukh Term Read Chapters 5 and 6 o the tetbook CISE3_Topc c Khoukh_ Lecture 5 Soluton o Nonlnear Equatons Root ndng Problems Dentons
More information2 More examples with details
Physcs 129b Lecture 3 Caltech, 01/15/19 2 More examples wth detals 2.3 The permutaton group n = 4 S 4 contans 4! = 24 elements. One s the dentty e. Sx of them are exchange of two objects (, j) ( to j and
More informationELEMENTARY SORTING ALGORITHMS
BBM 202 - ALGORITHMS DEPT. OF COMPUTER ENGINEERING ELEMENTARY SORTING ALGORITHMS Feb. 20, 2017 Acknowledgement: The course sldes are adapted from the sldes prepared by R. Sedgewck and K. Wayne of Prnceton
More information04 - Treaps. Dr. Alexander Souza
Algorths Theory 04 - Treaps Dr. Alexander Souza The dctonary proble Gven: Unverse (U,
More informationMERGESORT BBM ALGORITHMS DEPT. OF COMPUTER ENGINEERING ERKUT ERDEM. Mergesort. Feb. 27, 2014
ergesort BB 202 - ALGOITHS Basc plan. Dvde array nto two halves. ecursvely sort each half. erge two halves. DPT. OF COPUT NGINING KUT D GSOT nput G S O T X A P L sort left half G O S T X A P L sort rght
More informationComputing Correlated Equilibria in Multi-Player Games
Computng Correlated Equlbra n Mult-Player Games Chrstos H. Papadmtrou Presented by Zhanxang Huang December 7th, 2005 1 The Author Dr. Chrstos H. Papadmtrou CS professor at UC Berkley (taught at Harvard,
More informationCollege of Computer & Information Science Fall 2009 Northeastern University 20 October 2009
College of Computer & Informaton Scence Fall 2009 Northeastern Unversty 20 October 2009 CS7880: Algorthmc Power Tools Scrbe: Jan Wen and Laura Poplawsk Lecture Outlne: Prmal-dual schema Network Desgn:
More informationGeneral theory of fuzzy connectedness segmentations: reconciliation of two tracks of FC theory
General theory of fuzzy connectedness segmentatons: reconclaton of two tracks of FC theory Krzysztof Chrs Ceselsk Department of Mathematcs, West Vrgna Unversty and MIPG, Department of Radology, Unversty
More informationTornado and Luby Transform Codes. Ashish Khisti Presentation October 22, 2003
Tornado and Luby Transform Codes Ashsh Khst 6.454 Presentaton October 22, 2003 Background: Erasure Channel Elas[956] studed the Erasure Channel β x x β β x 2 m x 2 k? Capacty of Noseless Erasure Channel
More informationIntroduction to Information Theory, Data Compression,
Introducton to Informaton Theory, Data Compresson, Codng Mehd Ibm Brahm, Laura Mnkova Aprl 5, 208 Ths s the augmented transcrpt of a lecture gven by Luc Devroye on the 3th of March 208 for a Data Structures
More informationAlgorithms for factoring
CSA E0 235: Crytograhy Arl 9,2015 Instructor: Arta Patra Algorthms for factorng Submtted by: Jay Oza, Nranjan Sngh Introducton Factorsaton of large ntegers has been a wdely studed toc manly because of
More information2-Adic Complexity of a Sequence Obtained from a Periodic Binary Sequence by Either Inserting or Deleting k Symbols within One Period
-Adc Comlexty of a Seuence Obtaned from a Perodc Bnary Seuence by Ether Insertng or Deletng Symbols wthn One Perod ZHAO Lu, WEN Qao-yan (State Key Laboratory of Networng and Swtchng echnology, Bejng Unversty
More informationVARIATION OF CONSTANT SUM CONSTRAINT FOR INTEGER MODEL WITH NON UNIFORM VARIABLES
VARIATION OF CONSTANT SUM CONSTRAINT FOR INTEGER MODEL WITH NON UNIFORM VARIABLES BÂRZĂ, Slvu Faculty of Mathematcs-Informatcs Spru Haret Unversty barza_slvu@yahoo.com Abstract Ths paper wants to contnue
More informationValuated Binary Tree: A New Approach in Study of Integers
Internatonal Journal of Scentfc Innovatve Mathematcal Research (IJSIMR) Volume 4, Issue 3, March 6, PP 63-67 ISS 347-37X (Prnt) & ISS 347-34 (Onlne) wwwarcournalsorg Valuated Bnary Tree: A ew Approach
More informationA CLASS OF RECURSIVE SETS. Florentin Smarandache University of New Mexico 200 College Road Gallup, NM 87301, USA
A CLASS OF RECURSIVE SETS Florentn Smarandache Unversty of New Mexco 200 College Road Gallup, NM 87301, USA E-mal: smarand@unmedu In ths artcle one bulds a class of recursve sets, one establshes propertes
More informationarxiv:math/ v1 [math.co] 17 Sep 1998
arxv:math/9809095v1 [math.co] 17 Sep 1998 Multvson: An Intractable Impartal Game Wth a Lnear Wnnng Strategy Avezr S. Fraenkel 1. Introducton. Somethng s defntely wrong. If the game has a lnear wnnng strategy,
More informationA random variable is a function which associates a real number to each element of the sample space
Introducton to Random Varables Defnton of random varable Defnton of of random varable Dscrete and contnuous random varable Probablty blt functon Dstrbuton functon Densty functon Sometmes, t s not enough
More informationDynamic Programming. Preview. Dynamic Programming. Dynamic Programming. Dynamic Programming (Example: Fibonacci Sequence)
/24/27 Prevew Fbonacc Sequence Longest Common Subsequence Dynamc programmng s a method for solvng complex problems by breakng them down nto smpler sub-problems. It s applcable to problems exhbtng the propertes
More informationHiding data in images by simple LSB substitution
Pattern Recognton 37 (004) 469 474 www.elsever.com/locate/patcog Hdng data n mages by smple LSB substtuton Ch-Kwong Chan, L.M. Cheng Department of Computer Engneerng and Informaton Technology, Cty Unversty
More informationTHE SUMMATION NOTATION Ʃ
Sngle Subscrpt otaton THE SUMMATIO OTATIO Ʃ Most of the calculatons we perform n statstcs are repettve operatons on lsts of numbers. For example, we compute the sum of a set of numbers, or the sum of the
More informationThe Minimum Universal Cost Flow in an Infeasible Flow Network
Journal of Scences, Islamc Republc of Iran 17(2): 175-180 (2006) Unversty of Tehran, ISSN 1016-1104 http://jscencesutacr The Mnmum Unversal Cost Flow n an Infeasble Flow Network H Saleh Fathabad * M Bagheran
More information= 1.23 m/s 2 [W] Required: t. Solution:!t = = 17 m/s [W]! m/s [W] (two extra digits carried) = 2.1 m/s [W]
Secton 1.3: Acceleraton Tutoral 1 Practce, page 24 1. Gven: 0 m/s; 15.0 m/s [S]; t 12.5 s Requred: Analyss: a av v t v f v t a v av f v t 15.0 m/s [S] 0 m/s 12.5 s 15.0 m/s [S] 12.5 s 1.20 m/s 2 [S] Statement:
More informationSome Consequences. Example of Extended Euclidean Algorithm. The Fundamental Theorem of Arithmetic, II. Characterizing the GCD and LCM
Example of Extended Eucldean Algorthm Recall that gcd(84, 33) = gcd(33, 18) = gcd(18, 15) = gcd(15, 3) = gcd(3, 0) = 3 We work backwards to wrte 3 as a lnear combnaton of 84 and 33: 3 = 18 15 [Now 3 s
More informationLOW BIAS INTEGRATED PATH ESTIMATORS. James M. Calvin
Proceedngs of the 007 Wnter Smulaton Conference S G Henderson, B Bller, M-H Hseh, J Shortle, J D Tew, and R R Barton, eds LOW BIAS INTEGRATED PATH ESTIMATORS James M Calvn Department of Computer Scence
More informationp 1 c 2 + p 2 c 2 + p 3 c p m c 2
Where to put a faclty? Gven locatons p 1,..., p m n R n of m houses, want to choose a locaton c n R n for the fre staton. Want c to be as close as possble to all the house. We know how to measure dstance
More informationOutline. Communication. Bellman Ford Algorithm. Bellman Ford Example. Bellman Ford Shortest Path [1]
DYNAMIC SHORTEST PATH SEARCH AND SYNCHRONIZED TASK SWITCHING Jay Wagenpfel, Adran Trachte 2 Outlne Shortest Communcaton Path Searchng Bellmann Ford algorthm Algorthm for dynamc case Modfcatons to our algorthm
More informationNotes on Frequency Estimation in Data Streams
Notes on Frequency Estmaton n Data Streams In (one of) the data streamng model(s), the data s a sequence of arrvals a 1, a 2,..., a m of the form a j = (, v) where s the dentty of the tem and belongs to
More informationGeneralized Linear Methods
Generalzed Lnear Methods 1 Introducton In the Ensemble Methods the general dea s that usng a combnaton of several weak learner one could make a better learner. More formally, assume that we have a set
More informationChapter 5. Solution of System of Linear Equations. Module No. 6. Solution of Inconsistent and Ill Conditioned Systems
Numercal Analyss by Dr. Anta Pal Assstant Professor Department of Mathematcs Natonal Insttute of Technology Durgapur Durgapur-713209 emal: anta.bue@gmal.com 1 . Chapter 5 Soluton of System of Lnear Equatons
More informationLECTURE 9 CANONICAL CORRELATION ANALYSIS
LECURE 9 CANONICAL CORRELAION ANALYSIS Introducton he concept of canoncal correlaton arses when we want to quantfy the assocatons between two sets of varables. For example, suppose that the frst set of
More informationSelf-complementing permutations of k-uniform hypergraphs
Dscrete Mathematcs Theoretcal Computer Scence DMTCS vol. 11:1, 2009, 117 124 Self-complementng permutatons of k-unform hypergraphs Artur Szymańsk A. Paweł Wojda Faculty of Appled Mathematcs, AGH Unversty
More informationE Tail Inequalities. E.1 Markov s Inequality. Non-Lecture E: Tail Inequalities
Algorthms Non-Lecture E: Tal Inequaltes If you hold a cat by the tal you learn thngs you cannot learn any other way. Mar Twan E Tal Inequaltes The smple recursve structure of sp lsts made t relatvely easy
More informationThe Selection Problem - Variable Size Decrease/Conquer (Practice with algorithm analysis)
We have covered: Selecto, Iserto, Mergesort, Bubblesort, Heapsort Next: Selecto the Qucksort The Selecto Problem - Varable Sze Decrease/Coquer (Practce wth algorthm aalyss) Cosder the problem of fdg the
More information