CSE 5311 Notes 5: Trees. (Last updated 6/4/13 4:12 PM)

Size: px
Start display at page:

Download "CSE 5311 Notes 5: Trees. (Last updated 6/4/13 4:12 PM)"

Transcription

1 SE 511 Notes 5: Trees (Last updated 6//1 :1 PM) What is the optimal wa to organie a static tree for searching? n optimal (static) binar search tree is significantl more complicated to construct than an optimal list. 1. ssume access probabilities are known: kes are K 1 < K < < K n pi = probabilit of request for Ki qi = probabilit of request with Ki < request < Ki+1 q 0 = probabilit of request < K 1 qn = probabilit of request > Kn. ssume that levels are numbered with root at level 0. Minimie the epected number of comparisons to complete a search:. Eample tree: n n p j ( KeLevel( j) +1) + q j MissLevel j j=1 j=0 0 K 1p 1 K1 p1 K p q0 q1 K K5 p p5 q q q q5. Solution is b dnamic programming: Principle of optimalit - solution is not optimal unless the subtrees are optimal. ase case - empt tree, costs nothing to search.

2 pi+1 pj qi qj qi+1 qj-1 c( i, j) cost of subtree with kes K i+1,,k j c( i, j) alwas includes eactl p i+1,, p j and q i,,q j c( i,i) = 0 ase case, no kes, just misses for q i (request between K i and K i+1 ) Recurrence for finding optimal subtree: c( i, j) = w( i, j) + min ( c( i,k 1) + c( k, j) ) i<k j tries ever possible root ( k ) for the subtree with kes K i+1,,k j w( i, j) = p i p j + q i + + q j accounts for adding another probe for all kes in subtree : Left: pi pk 1 + qi + qk 1 Right: p k p j + q k + q j Root: p k Kk c(i,k-1) c(k,j) 5. Implementation: k-famil is all cases for c i,i + k. k-families are computed in ascending order from 1 to n. Suppose n = 5:

3 _0 1 _ 5 c( 0,0) c( 0,1) c( 0,) c( 0,) c 0, c( 1,1 ) c( 1, ) c( 1, ) c( 1, ) c( 1,5 ) c(,) c(,) c(,) c(,5) c(,) c(, ) c(,5) c(,) c(,5) c 5,5 c( 0,5) ompleit: O n space is obvious. O n time from: n k=1 k( n +1 k) where k is the number of roots for each c i,i + k in famil k. and n +1 k is the number of c( i,i + k) cases 6. Traceback - besides having the minimum value for each c( i, j), it is necessar to save the subscript for the optimal root for c i, j as r[i][j]. This also leads to Knuth s improvement: must have a ke with subscript no less than the ke and no greater than the ke subscript for the Theorem: The root for the optimal tree c i, j subscript for the root of the optimal tree for c i, j 1 root of optimal tree c( i +1, j). (These roots are computed in the preceding famil.) Proof: 1. onsider adding p j and q j to tree for c( i, j 1). Optimal tree for c i, j at the root or use one further to the right. must keep the same ke Ki+1 Kj-1. onsider adding p i+1 and q i to tree for c( i +1, j). Optimal tree for c i, j ke at the root or use one further to the left. must keep the same Ki+ Kj

4 7. nalsis of Knuth s improvement. case for k-famil will var in the number of roots to tr, but overall time is reduced to Each c i, j O n b using a telescoping sum: n n k n ( r[ i +1] [ i + k] r[ i] [ i + k 1] +1) = k= i=0 k= n = ( r[ n k +1] [ n] r[ 0] [ k 1] + n k +1) k= n n ( n 0 + n k +1) = ( n k +1) = O n k= k= r[ 1] [ k] r[ 0] [ k 1] +1 + r[ ] [ 1+ k] r[ 1] [ k] +1 + r[ ] [ + k] r[ ] [ 1+ k] r[ n k +1] [ n] r[ n k] [ n 1] +1 n=7; q[0]=0.06; p[1]=0.0; q[1]=0.06; p[]=0.06; q[]=0.06; p[]=0.08; q[]=0.06; p[]=0.0; q[]=0.05; p[5]=0.10; q[5]=0.05; p[6]=0.1; q[6]=0.05; p[7]=0.1; q[7]=0.05; for (i=1;i<=n;i++) ke[i]=i;

5 5 w[0][0]= w[0][1]= w[0][]= w[0][]= w[0][]= w[0][5]= w[0][6]= w[0][7]= w[1][1]= w[1][]= w[1][]= w[1][]= w[1][5]= w[1][6]= w[1][7]= w[][]= w[][]= w[][]= w[][5]= w[][6]= w[][7]= w[][]= w[][]= w[][5]= w[][6]= w[][7]= w[][]= w[][5]= w[][6]= w[][7]= w[5][5]= w[5][6]= w[5][7]= w[6][6]= w[6][7]= w[7][7]= ounts - root trick without root trick 77 verage probe length is trees in parenthesied prefi c(0,0) cost c(1,1) cost c(,) cost c(,) cost c(,) cost c(5,5) cost c(6,6) cost c(7,7) cost c(0,1) cost c(1,) cost c(,) cost c(,) cost c(,5) cost c(5,6) cost c(6,7) cost c(0,) cost (1,) c(1,) cost (,) c(,) cost (,) c(,5) cost (,) c(,6) cost (5,) c(5,7) cost (6,) c(0,) cost (1,) c(1,) cost (,) c(,5) cost (,5) c(,6) cost (,6) c(,7) cost (5,7) c(0,) cost (1,(,)) c(1,5) cost (,5(,)) c(,6) cost ((,),6) c(,7) cost (5(,),7) c(0,5) cost ((1,),5(,)) c(1,6) cost ((,),6) c(,7) cost ((,),7(6,)) c(0,6) cost ((1,),5(,6)) c(1,7) cost ((,),7(6,)) c(0,7) cost ((1,(,)),7(6,)) : c(0,) + c(,7) + w[0][7] =.7 : c(0,) + c(,7) + w[0][7] =.78 5: c(0,) + c(5,7) + w[0][7] =

6 SPLY TREES 6 Self-adjusting counterpart to VL and red-black trees dvantages - 1) no balance bits, ) some help with localit of reference, ) amortied compleit is same as VL and red-black trees isadvantage - worst-case for operation is O(n) lgorithms are based on rotations to spla the last node processed () to root position. Zig-Zig: 1. Single right rotation at.. Single right rotation at. (+ smmetric case) Zig-Zag: ouble right rotation at. (+ smmetric case) Zig: pplies ONLY at the root Single right rotation at. (+ smmetric case) Insertion: ttach new leaf and then spla to root.

7 7 eletion: 1. ccess node to delete, including spla to root.. ccess predecessor in left subtree and spla to root of left subtree.. Take right subtree of and make it the right subtree of. mortied nalsis of Splaing for Retrieval (aside): ctual cost (rotations) is for ig-ig and ig-ag, but 1 for ig. S() = number of nodes in subtree with as root ( sie ) r() = lg S() ( rank ) = r Φ T T Eamples:.=lg 5 E.=lg =lg E =lg 1.58=lg Φ=.9 1=lg Φ=6.9 Now suppose that the leaf in the second eample is retrieved. Two ig-igs occur.

8 E.=lg 5.=lg 5 8 =lg =lg 1.58=lg Φ=6.9 1=lg E 1=lg Φ=5. ˆ i = i + Φ( fter) Φ( efore) = =. 1+ lg n = 7.96 nother eample of splaing. There will be a ig-ag and a ig. E.17=lg 9 E.17=lg 9.17=lg 9 =lg H F 1=lg 1=lg G Φ=9.17 =lg I =lg H F 1=lg 1=lg G I Φ=9.17 =lg 1=lg Φ=9.98 E F 1=lg.81=lg 7 H G =lg I ˆ i = i + Φ fter Φ( efore) = = lg n =10.51 ompute amortied compleit of individual steps and then the complete splaing sequence: Lemma: If α > 0, β > 0, α + β 1, then lgα + lgβ. Proof: lgα + lgβ = lgαβ. αβ is maimied when α = β = 1, so ma lgα + lgβ =. ccess Lemma: Suppose 1) is node being splaed ) subtree rooted b has and r i 1 before ith step and r i after ith step S i 1 S i then ˆ i r i r i 1, ecept last step which has ˆ i 1+ r i r i 1.

9 Proof: Proceeds b considering each of the three cases for splaing: 9 Zig-Zig: ˆ i = i + Φ T i = + r i = + ri + r i (*) + ri Let α = S i 1 S i Φ( T i 1 ) + r i + r i ( ) r i 1 r i 1 r i 1 ( ) Potential changes onl in this subtree + ri ( ) ri 1 ri 1 ri = ri 1 ( ) + r i ( ) r i 1 r i 1 r i 1 + ri ( ) ri 1 ri ri, β = S i( ) S i, α > 0, β > 0, α + β = S i 1 S i +S i 1. ( is absent from numerator) Lemma conditions are satisfied, so lgα + lgβ. ppling logs to α and β gives: ri 1 + ri ( ) ri which ma be rearranged as: 0 ri ri 1 ri ( ) dd this to (*) to obtain: ˆ i r i r i 1 Zig-Zag:

10 ˆ i = i + Φ T i = + r i = + r i (**) + r i Φ( T i 1 ) + r i + r i ( ) r i 1 r i 1 r i 1 ( ) Potential changes onl in this subtree + r i ( ) r i 1 r i 1 r i = r i 1 ( ) + r i ( ) r i 1 r i 1 r i 1 Lemma ma be applied b observing that S i + S i ( ) S i and thus + S i( ) S i 1 S i S i lemma, lg S i S i + lg Si S i + r i ( ) r i + r i ( ) r i which can substitute into (**) r i r i ˆ i + ri = r i r i ri 1 r i 1 r i 1 Since r i 1 r i 10 Zig: ˆ i = i + Φ Ti =1+ ri =1+ r i 1+ r i 1+ r i Φ( Ti 1 ) + ri ri 1 ri 1 Potential changes onl in this subtree r i 1 r i 1 = r i r i 1 r i r i r i 1 r i 1 r i

11 ound on total amortied cost for an entire spla sequence: 11 m m 1 ˆ i = ˆ i + ˆ m i=1 i=1 m 1 r i i=1 = r m 1 ( r i 1 ) =1+ r m 1+ r m +1+ r m r m 1 r r m r m 1 r 0 =1+ lgn since is the root after the final rotation sides: If each node is assigned a positive weight and the sie of node, S(), is the sum of the weights in the subtree, other results ma be shown such as: Static Optimalit: Spla trees (online) perform within a constant factor of the optimal (static) binar search tree (offline) for a sequence of requests. ut the elusive goal remains: namic Optimalit onjecture: Spla trees (online) perform within a constant factor of the optimal (dnamic) binar search tree (offline) for a sequence of requests. In principle, this ma be attacked like MTF is dnamicall optimal. Man difficulties arise... Potential Function: Minimum number of rotations to transform a ST into another ST? Transformation: Suppose a ST with n nodes has kes 1... n. onstruct the regular (n+)-gon with vertices 0, 1,,..., n+1. If the ST has a subtree with root i, minimum ke min( i), and maimum ke ma( i), then include edges { i,min( i) 1} and { i,ma( i) +1}. lso, include edge { 0,n +1}. These edges give a triangulated polgon. ( bound of Ο loglog n as been shown:

12 1 ST rotation corresponds to flipping the diagonal of a quadrilateral: Rotate Left Rotate Right Ma also rotate the original ST left at 1 and right at 5.

13 SE 511 Notes 6: Skip Lists (Last updated 6//1 :1 PM) randomied data structure with performance characteristics similar to treaps, i.e. another alternative to balanced binar search trees. Paper available at ftp://ftp.cs.umd.edu/pub/skiplists/skiplists.pdf. dvantages: Simple algorithms, especiall for ordered retrieval Highl likel to perform as well as balanced trees. Less space: isadvantages: No balance bits. an be tuned to use fewer pointers per node (on average). oesn t handle etreme changes in number of records well. ad worse case (similar to hashing), but depends on random generator rather than data. urden on memor management due to varing sie nodes.

14 esign ecision : Probabilit 0 < p 0.5 (0.5 tpical) for determining number of pointers in a new node: p k 1 = probabilit of a node having at least k pointers 1 = Epected number of pointers (used) in each node. (geometric sum) 1 p haracteristics: Low p Fewer pointers in structure Increased search time (alwas epected to be logarithmic). High p More pointers in structure ecreased search time

Illinois Institute of Technology Department of Computer Science. Splay Trees. CS 535 Design and Analysis of Algorithms Fall Semester, 2018

Illinois Institute of Technology Department of Computer Science. Splay Trees. CS 535 Design and Analysis of Algorithms Fall Semester, 2018 Illinois Institute of Technolog epartment of omputer Science Spla Trees S 535 esign and nalsis of lgorithms Fall Semester, 2018 Spla trees are a powerful form of (leicographic) balanced binar trees devised

More information

AVL trees. AVL trees

AVL trees. AVL trees Dnamic set DT dnamic set DT is a structure tat stores a set of elements. Eac element as a (unique) ke and satellite data. Te structure supports te following operations. Searc(S, k) Return te element wose

More information

Chapter 6. Self-Adjusting Data Structures

Chapter 6. Self-Adjusting Data Structures Chapter 6 Self-Adjusting Data Structures Chapter 5 describes a data structure that is able to achieve an epected quer time that is proportional to the entrop of the quer distribution. The most interesting

More information

Outline for Today. Static Optimality. Splay Trees. Properties of Splay Trees. Dynamic Optimality (ITA) Balanced BSTs aren't necessarily optimal!

Outline for Today. Static Optimality. Splay Trees. Properties of Splay Trees. Dynamic Optimality (ITA) Balanced BSTs aren't necessarily optimal! Splay Trees Outline for Today Static Optimality alanced STs aren't necessarily optimal! Splay Trees self-adjusting binary search tree. Properties of Splay Trees Why is splaying worthwhile? ynamic Optimality

More information

A STUDY ON SPLAY TREES

A STUDY ON SPLAY TREES STUDY ON SPLY TREES LUÍS M. S. RUSSO bstract. We stud the dnamic optimalit conjecture, which predicts that spla trees are a form of universall efficient binar search tree, for an access sequence. We reduce

More information

Demonstrate solution methods for systems of linear equations. Show that a system of equations can be represented in matrix-vector form.

Demonstrate solution methods for systems of linear equations. Show that a system of equations can be represented in matrix-vector form. Chapter Linear lgebra Objective Demonstrate solution methods for sstems of linear equations. Show that a sstem of equations can be represented in matri-vector form. 4 Flowrates in kmol/hr Figure.: Two

More information

Splay trees (Sleator, Tarjan 1983)

Splay trees (Sleator, Tarjan 1983) Splay trees (Sleator, Tarjan 1983) 1 Main idea Try to arrange so frequently used items are near the root We shall assume that there is an item in every node including internal nodes. We can change this

More information

Simplification of State Machines

Simplification of State Machines T3 Lecture Notes State Reduction hapter 9 - of Simplification of State Machines This semester has been spent developing the techniques needed to design digital circuits. Now we can compile a list of just

More information

8. BOOLEAN ALGEBRAS x x

8. BOOLEAN ALGEBRAS x x 8. BOOLEAN ALGEBRAS 8.1. Definition of a Boolean Algebra There are man sstems of interest to computing scientists that have a common underling structure. It makes sense to describe such a mathematical

More information

Search Trees. Chapter 10. CSE 2011 Prof. J. Elder Last Updated: :52 AM

Search Trees. Chapter 10. CSE 2011 Prof. J. Elder Last Updated: :52 AM Search Trees Chapter 1 < 6 2 > 1 4 = 8 9-1 - Outline Ø Binary Search Trees Ø AVL Trees Ø Splay Trees - 2 - Outline Ø Binary Search Trees Ø AVL Trees Ø Splay Trees - 3 - Binary Search Trees Ø A binary search

More information

Data Structure. Mohsen Arab. January 13, Yazd University. Mohsen Arab (Yazd University ) Data Structure January 13, / 86

Data Structure. Mohsen Arab. January 13, Yazd University. Mohsen Arab (Yazd University ) Data Structure January 13, / 86 Data Structure Mohsen Arab Yazd University January 13, 2015 Mohsen Arab (Yazd University ) Data Structure January 13, 2015 1 / 86 Table of Content Binary Search Tree Treaps Skip Lists Hash Tables Mohsen

More information

Lecture 2 14 February, 2007

Lecture 2 14 February, 2007 6.851: Advanced Data Structures Spring 2007 Prof. Erik Demaine Lecture 2 14 February, 2007 Scribes: Christopher Moh, Aditya Rathnam 1 Overview In the last lecture we covered linked lists and some results

More information

Hamiltonicity and Fault Tolerance

Hamiltonicity and Fault Tolerance Hamiltonicit and Fault Tolerance in the k-ar n-cube B Clifford R. Haithcock Portland State Universit Department of Mathematics and Statistics 006 In partial fulfillment of the requirements of the degree

More information

Search Trees. EECS 2011 Prof. J. Elder Last Updated: 24 March 2015

Search Trees. EECS 2011 Prof. J. Elder Last Updated: 24 March 2015 Search Trees < 6 2 > 1 4 = 8 9-1 - Outline Ø Binary Search Trees Ø AVL Trees Ø Splay Trees - 2 - Learning Outcomes Ø From this lecture, you should be able to: q Define the properties of a binary search

More information

Problem. Maintain the above set so as to support certain

Problem. Maintain the above set so as to support certain Randomized Data Structures Roussos Ioannis Fundamental Data-structuring Problem Collection {S 1,S 2, } of sets of items. Each item i is an arbitrary record, indexed by a key k(i). Each k(i) is drawn from

More information

Chapter #6 EEE State Space Analysis and Controller Design

Chapter #6 EEE State Space Analysis and Controller Design hapter #6 EEE3-83 State Space nalsis and ontroller Design State feedack Linear Quadratic Regulator (LQR) Open and closed loop estimators Reduced Order Estimators (not assessed) racking Module Leader: Dr

More information

Roberto s Notes on Integral Calculus Chapter 3: Basics of differential equations Section 3. Separable ODE s

Roberto s Notes on Integral Calculus Chapter 3: Basics of differential equations Section 3. Separable ODE s Roberto s Notes on Integral Calculus Chapter 3: Basics of differential equations Section 3 Separable ODE s What ou need to know alread: What an ODE is and how to solve an eponential ODE. What ou can learn

More information

2 Push and Pull Source Sink Push

2 Push and Pull Source Sink Push 1 Plaing Push vs Pull: Models and Algorithms for Disseminating Dnamic Data in Networks. R.C. Chakinala, A. Kumarasubramanian, Kofi A. Laing R. Manokaran, C. Pandu Rangan, R. Rajaraman Push and Pull 2 Source

More information

Next: Pushdown automata. Pushdown Automata. Informal Description PDA (1) Informal Description PDA (2) Formal Description PDA

Next: Pushdown automata. Pushdown Automata. Informal Description PDA (1) Informal Description PDA (2) Formal Description PDA CE 2001: Introdution to Theor of Computation ummer 2007 uprakash Datta datta@s.orku.a Net: Pushdown automata dd stak to definition of Finite utomata Can serve as tpe of memor or ounter More powerful than

More information

. This is the Basic Chain Rule. x dt y dt z dt Chain Rule in this context.

. This is the Basic Chain Rule. x dt y dt z dt Chain Rule in this context. Math 18.0A Gradients, Chain Rule, Implicit Dierentiation, igher Order Derivatives These notes ocus on our things: (a) the application o gradients to ind normal vectors to curves suraces; (b) the generaliation

More information

Multi-Objective Weighted Sampling

Multi-Objective Weighted Sampling 1 Multi-Objective Weighted Sampling Edith Cohen Google Research Mountain View, CA, USA edith@cohenwangcom arxiv:150907445v6 [csdb] 13 Jun 2017 Abstract Multi-objective samples are powerful and versatile

More information

Integer Sorting on the word-ram

Integer Sorting on the word-ram Integer Sorting on the word-rm Uri Zwick Tel viv University May 2015 Last updated: June 30, 2015 Integer sorting Memory is composed of w-bit words. rithmetical, logical and shift operations on w-bit words

More information

Handout for Adequacy of Solutions Chapter SET ONE The solution to Make a small change in the right hand side vector of the equations

Handout for Adequacy of Solutions Chapter SET ONE The solution to Make a small change in the right hand side vector of the equations Handout for dequac of Solutions Chapter 04.07 SET ONE The solution to 7.999 4 3.999 Make a small change in the right hand side vector of the equations 7.998 4.00 3.999 4.000 3.999 Make a small change in

More information

Dependence and scatter-plots. MVE-495: Lecture 4 Correlation and Regression

Dependence and scatter-plots. MVE-495: Lecture 4 Correlation and Regression Dependence and scatter-plots MVE-495: Lecture 4 Correlation and Regression It is common for two or more quantitative variables to be measured on the same individuals. Then it is useful to consider what

More information

Chapter Adequacy of Solutions

Chapter Adequacy of Solutions Chapter 04.09 dequac of Solutions fter reading this chapter, ou should be able to: 1. know the difference between ill-conditioned and well-conditioned sstems of equations,. define the norm of a matri,

More information

Disjoint Sets : ADT. Disjoint-Set : Find-Set

Disjoint Sets : ADT. Disjoint-Set : Find-Set Disjoint Sets : ADT Disjoint-Set Forests Make-Set( x ) Union( s, s ) Find-Set( x ) : π( ) : π( ) : ν( log * n ) amortized cost 6 9 {,, 9,, 6} set # {} set # 7 5 {5, 7, } set # Disjoint-Set : Find-Set Disjoint

More information

CSE 5311 Notes 2: Binary Search Trees

CSE 5311 Notes 2: Binary Search Trees S Notes : inry Serch Trees (Lst updted /0/7 0: M) ROTTIONS c d Single left rottion t (K rotting edge ) Single right rottion t (K rotting edge ) d c c d F oule right rottion t F G F G Wht two single rottions

More information

The Maze Generation Problem is NP-complete

The Maze Generation Problem is NP-complete The Mae Generation Problem is NP-complete Mario Alviano Department of Mathematics, Universit of Calabria, 87030 Rende (CS), Ital alviano@mat.unical.it Abstract. The Mae Generation problem has been presented

More information

Note that r = 0 gives the simple principle of induction. Also it can be shown that the principle of strong induction follows from simple induction.

Note that r = 0 gives the simple principle of induction. Also it can be shown that the principle of strong induction follows from simple induction. Proof by mathematical induction using a strong hypothesis Occasionally a proof by mathematical induction is made easier by using a strong hypothesis: To show P(n) [a statement form that depends on variable

More information

INF Anne Solberg One of the most challenging topics in image analysis is recognizing a specific object in an image.

INF Anne Solberg One of the most challenging topics in image analysis is recognizing a specific object in an image. INF 4300 700 Introduction to classifiction Anne Solberg anne@ifiuiono Based on Chapter -6 6inDuda and Hart: attern Classification 303 INF 4300 Introduction to classification One of the most challenging

More information

Approximation: Theory and Algorithms

Approximation: Theory and Algorithms Approimation: Theor and Algorithms Edit Distance Compleit, Upper and Lower Bounds Nikolaus Augsten Free Universit of Bozen-Bolzano Facult of Computer Science DIS Unit 8 April, 009 Nikolaus Augsten (DIS)

More information

The Steiner Ratio for Obstacle-Avoiding Rectilinear Steiner Trees

The Steiner Ratio for Obstacle-Avoiding Rectilinear Steiner Trees The Steiner Ratio for Obstacle-Avoiding Rectilinear Steiner Trees Anna Lubiw Mina Razaghpour Abstract We consider the problem of finding a shortest rectilinear Steiner tree for a given set of pointn the

More information

Advanced Data Structures

Advanced Data Structures Simon Gog gog@kit.edu - Simon Gog: KIT The Research University in the Helmholtz Association www.kit.edu Predecessor data structures We want to support the following operations on a set of integers from

More information

Design and Analysis of Algorithms

Design and Analysis of Algorithms Design and Analysis of Algorithms 6.046J/18.401J LECTURE 7 Skip Lists Data structure Randomized insertion With high probability (w.h.p.) bound 7/10/15 Copyright 2001-8 by Leiserson et al L9.1 Skip lists

More information

Solutions to Two Interesting Problems

Solutions to Two Interesting Problems Solutions to Two Interesting Problems Save the Lemming On each square of an n n chessboard is an arrow pointing to one of its eight neighbors (or off the board, if it s an edge square). However, arrows

More information

Lecture VIII Keywords: tree-based data structures; binary search trees; red/black trees; flexible functional arrays; heaps; priority queues.

Lecture VIII Keywords: tree-based data structures; binary search trees; red/black trees; flexible functional arrays; heaps; priority queues. Bar search trees Lecture VIII Kewords: tree-based data structures; bar search trees; red/black trees; fleible functional arras; heaps; priorit queues. References: [MLWP, Chapters 4 and 7] [PFDS, Chapters

More information

1.1 Laws of exponents Conversion between exponents and logarithms Logarithm laws Exponential and logarithmic equations 10

1.1 Laws of exponents Conversion between exponents and logarithms Logarithm laws Exponential and logarithmic equations 10 CNTENTS Algebra Chapter Chapter Chapter Eponents and logarithms. Laws of eponents. Conversion between eponents and logarithms 6. Logarithm laws 8. Eponential and logarithmic equations 0 Sequences and series.

More information

UNCORRECTED SAMPLE PAGES. 3Quadratics. Chapter 3. Objectives

UNCORRECTED SAMPLE PAGES. 3Quadratics. Chapter 3. Objectives Chapter 3 3Quadratics Objectives To recognise and sketch the graphs of quadratic polnomials. To find the ke features of the graph of a quadratic polnomial: ais intercepts, turning point and ais of smmetr.

More information

Point Equilibrium & Truss Analysis

Point Equilibrium & Truss Analysis oint Equilibrium & Truss nalsis Notation: b = number of members in a truss () = shorthand for compression F = name for force vectors, as is X, T, and F = name of a truss force between joints named and,

More information

Lecture #8: We now take up the concept of dynamic programming again using examples.

Lecture #8: We now take up the concept of dynamic programming again using examples. Lecture #8: 0.0.1 Dynamic Programming:(Chapter 15) We now take up the concept of dynamic programming again using examples. Example 1 (Chapter 15.2) Matrix Chain Multiplication INPUT: An Ordered set of

More information

Linear regression Class 25, Jeremy Orloff and Jonathan Bloom

Linear regression Class 25, Jeremy Orloff and Jonathan Bloom 1 Learning Goals Linear regression Class 25, 18.05 Jerem Orloff and Jonathan Bloom 1. Be able to use the method of least squares to fit a line to bivariate data. 2. Be able to give a formula for the total

More information

Problem Set 4 Solutions

Problem Set 4 Solutions SE 26 igital omputers: Organization and Logical esign Jon Turner Problem Set 4 Solutions 1. Find a minimal logic expression for the NN/NOR circuit shown below. The circuit implements the expression ((()

More information

Uncertainty and Parameter Space Analysis in Visualization -

Uncertainty and Parameter Space Analysis in Visualization - Uncertaint and Parameter Space Analsis in Visualiation - Session 4: Structural Uncertaint Analing the effect of uncertaint on the appearance of structures in scalar fields Rüdiger Westermann and Tobias

More information

Strain Transformation and Rosette Gage Theory

Strain Transformation and Rosette Gage Theory Strain Transformation and Rosette Gage Theor It is often desired to measure the full state of strain on the surface of a part, that is to measure not onl the two etensional strains, and, but also the shear

More information

Language and Statistics II

Language and Statistics II Language and Statistics II Lecture 19: EM for Models of Structure Noah Smith Epectation-Maimization E step: i,, q i # p r $ t = p r i % ' $ t i, p r $ t i,' soft assignment or voting M step: r t +1 # argma

More information

A General Lower Bound on the I/O-Complexity of Comparison-based Algorithms

A General Lower Bound on the I/O-Complexity of Comparison-based Algorithms A General Lower ound on the I/O-Complexity of Comparison-based Algorithms Lars Arge Mikael Knudsen Kirsten Larsent Aarhus University, Computer Science Department Ny Munkegade, DK-8000 Aarhus C. August

More information

Advanced Data Structures

Advanced Data Structures Simon Gog gog@kit.edu - Simon Gog: KIT University of the State of Baden-Wuerttemberg and National Research Center of the Helmholtz Association www.kit.edu Predecessor data structures We want to support

More information

past balancing schemes require maintenance of balance info at all times, are aggresive use work of searches to pay for work of rebalancing

past balancing schemes require maintenance of balance info at all times, are aggresive use work of searches to pay for work of rebalancing 1 Splay Trees Sleator and Tarjan, Self Adjusting Binary Search Trees JACM 32(3) 1985 The claim planning ahead. But matches previous idea of being lazy, letting potential build up, using it to pay for expensive

More information

Outline. Computer Science 331. Cost of Binary Search Tree Operations. Bounds on Height: Worst- and Average-Case

Outline. Computer Science 331. Cost of Binary Search Tree Operations. Bounds on Height: Worst- and Average-Case Outline Computer Science Average Case Analysis: Binary Search Trees Mike Jacobson Department of Computer Science University of Calgary Lecture #7 Motivation and Objective Definition 4 Mike Jacobson (University

More information

Review of Essential Skills and Knowledge

Review of Essential Skills and Knowledge Review of Essential Skills and Knowledge R Eponent Laws...50 R Epanding and Simplifing Polnomial Epressions...5 R 3 Factoring Polnomial Epressions...5 R Working with Rational Epressions...55 R 5 Slope

More information

MAT 1275: Introduction to Mathematical Analysis. Graphs and Simplest Equations for Basic Trigonometric Functions. y=sin( x) Function

MAT 1275: Introduction to Mathematical Analysis. Graphs and Simplest Equations for Basic Trigonometric Functions. y=sin( x) Function MAT 275: Introduction to Mathematical Analsis Dr. A. Rozenblum Graphs and Simplest Equations for Basic Trigonometric Functions We consider here three basic functions: sine, cosine and tangent. For them,

More information

CS 395T Computational Learning Theory. Scribe: Mike Halcrow. x 4. x 2. x 6

CS 395T Computational Learning Theory. Scribe: Mike Halcrow. x 4. x 2. x 6 CS 395T Computational Learning Theory Lecture 3: September 0, 2007 Lecturer: Adam Klivans Scribe: Mike Halcrow 3. Decision List Recap In the last class, we determined that, when learning a t-decision list,

More information

8: Splay Trees. Move-to-Front Heuristic. Splaying. Splay(12) CSE326 Spring April 16, Search for Pebbles: Move found item to front of list

8: Splay Trees. Move-to-Front Heuristic. Splaying. Splay(12) CSE326 Spring April 16, Search for Pebbles: Move found item to front of list : Splay Trees SE Spring 00 pril, 00 Move-to-Front Heuristic Search for ebbles: Fred Wilma ebbles ino Fred Wilma ino ebbles Move found item to front of list Frequently searched items will move to start

More information

Problem: Data base too big to fit memory Disk reads are slow. Example: 1,000,000 records on disk Binary search might take 20 disk reads

Problem: Data base too big to fit memory Disk reads are slow. Example: 1,000,000 records on disk Binary search might take 20 disk reads B Trees Problem: Data base too big to fit memory Disk reads are slow Example: 1,000,000 records on disk Binary search might take 20 disk reads Disk reads are done in blocks Example: One block read can

More information

Trusses - Method of Sections

Trusses - Method of Sections Trusses - Method of Sections ME 202 Methods of Truss Analsis Method of joints (previous notes) Method of sections (these notes) 2 MOS - Concepts Separate the structure into two parts (sections) b cutting

More information

Exploiting Correlation in Stochastic Circuit Design

Exploiting Correlation in Stochastic Circuit Design Eploiting Correlation in Stochastic Circuit Design Armin Alaghi and John P. Haes Advanced Computer Architecture Laborator Department of Electrical Engineering and Computer Science Universit of Michigan,

More information

Copyright 2000, Kevin Wayne 1

Copyright 2000, Kevin Wayne 1 Divide-and-Conquer Chapter 5 Divide and Conquer Divide-and-conquer. Break up problem into several parts. Solve each part recursively. Combine solutions to sub-problems into overall solution. Most common

More information

7 Dictionary. 7.1 Binary Search Trees. Binary Search Trees: Searching. 7.1 Binary Search Trees

7 Dictionary. 7.1 Binary Search Trees. Binary Search Trees: Searching. 7.1 Binary Search Trees 7 Dictionary Dictionary: S.insert(): Insert an element. S.delete(): Delete the element pointed to by. 7.1 Binary Search Trees An (internal) binary search tree stores the elements in a binary tree. Each

More information

y R T However, the calculations are easier, when carried out using the polar set of co-ordinates ϕ,r. The relations between the co-ordinates are:

y R T However, the calculations are easier, when carried out using the polar set of co-ordinates ϕ,r. The relations between the co-ordinates are: Curved beams. Introduction Curved beams also called arches were invented about ears ago. he purpose was to form such a structure that would transfer loads, mainl the dead weight, to the ground b the elements

More information

Fundamental Algorithms

Fundamental Algorithms Fundamental Algorithms Chapter 5: Searching Michael Bader Winter 2014/15 Chapter 5: Searching, Winter 2014/15 1 Searching Definition (Search Problem) Input: a sequence or set A of n elements (objects)

More information

a. plotting points in Cartesian coordinates (Grade 9 and 10), b. using a graphing calculator such as the TI-83 Graphing Calculator,

a. plotting points in Cartesian coordinates (Grade 9 and 10), b. using a graphing calculator such as the TI-83 Graphing Calculator, GRADE PRE-CALCULUS UNIT C: QUADRATIC FUNCTIONS CLASS NOTES FRAME. After linear functions, = m + b, and their graph the Quadratic Functions are the net most important equation or function. The Quadratic

More information

THE KENNESAW STATE UNIVERSITY HIGH SCHOOL MATHEMATICS COMPETITION PART I MULTIPLE CHOICE NO CALCULATORS 90 MINUTES

THE KENNESAW STATE UNIVERSITY HIGH SCHOOL MATHEMATICS COMPETITION PART I MULTIPLE CHOICE NO CALCULATORS 90 MINUTES THE 008 009 KENNESW STTE UNIVERSITY HIGH SHOOL MTHEMTIS OMPETITION PRT I MULTIPLE HOIE For each of the following questions, carefull blacken the appropriate bo on the answer sheet with a # pencil. o not

More information

13 Dynamic Programming (3) Optimal Binary Search Trees Subset Sums & Knapsacks

13 Dynamic Programming (3) Optimal Binary Search Trees Subset Sums & Knapsacks 13 Dynamic Programming (3) Optimal Binary Search Trees Subset Sums & Knapsacks Average-case analysis Average-case analysis of algorithms and data structures: Input is generated according to a known probability

More information

CIS Spring 2018 (instructor Val Tannen)

CIS Spring 2018 (instructor Val Tannen) CIS 160 - Spring 018 (instructor Val Tannen) Lecture 11 Tuesday, February 0 PROOFS: STRONG INDUCTION Example 1.1 Any integer n can be written as the product of one or more (not necessarily distinct) prime

More information

2 Generating Functions

2 Generating Functions 2 Generating Functions In this part of the course, we re going to introduce algebraic methods for counting and proving combinatorial identities. This is often greatly advantageous over the method of finding

More information

Number Plane Graphs and Coordinate Geometry

Number Plane Graphs and Coordinate Geometry Numer Plane Graphs and Coordinate Geometr Now this is m kind of paraola! Chapter Contents :0 The paraola PS, PS, PS Investigation: The graphs of paraolas :0 Paraolas of the form = a + + c PS Fun Spot:

More information

Let s try an example of Unit Analysis. Your friend gives you this formula: x=at. You have to figure out if it s right using Unit Analysis.

Let s try an example of Unit Analysis. Your friend gives you this formula: x=at. You have to figure out if it s right using Unit Analysis. Lecture 1 Introduction to Measurement - SI sstem Dimensional nalsis / Unit nalsis Unit Conversions Vectors and Mathematics International Sstem of Units (SI) Table 1.1, p.5 The Seven Base Units What is

More information

Binary Search Trees. Dictionary Operations: Additional operations: find(key) insert(key, value) erase(key)

Binary Search Trees. Dictionary Operations: Additional operations: find(key) insert(key, value) erase(key) Binary Search Trees Dictionary Operations: find(key) insert(key, value) erase(key) Additional operations: ascend() get(index) (indexed binary search tree) delete(index) (indexed binary search tree) Complexity

More information

Applications of Gauss-Radau and Gauss-Lobatto Numerical Integrations Over a Four Node Quadrilateral Finite Element

Applications of Gauss-Radau and Gauss-Lobatto Numerical Integrations Over a Four Node Quadrilateral Finite Element Avaiable online at www.banglaol.info angladesh J. Sci. Ind. Res. (), 77-86, 008 ANGLADESH JOURNAL OF SCIENTIFIC AND INDUSTRIAL RESEARCH CSIR E-mail: bsir07gmail.com Abstract Applications of Gauss-Radau

More information

CONTINUOUS SPATIAL DATA ANALYSIS

CONTINUOUS SPATIAL DATA ANALYSIS CONTINUOUS SPATIAL DATA ANALSIS 1. Overview of Spatial Stochastic Processes The ke difference between continuous spatial data and point patterns is that there is now assumed to be a meaningful value, s

More information

Systems of Linear Equations: Solving by Graphing

Systems of Linear Equations: Solving by Graphing 8.1 Sstems of Linear Equations: Solving b Graphing 8.1 OBJECTIVE 1. Find the solution(s) for a set of linear equations b graphing NOTE There is no other ordered pair that satisfies both equations. From

More information

INF Introduction to classifiction Anne Solberg Based on Chapter 2 ( ) in Duda and Hart: Pattern Classification

INF Introduction to classifiction Anne Solberg Based on Chapter 2 ( ) in Duda and Hart: Pattern Classification INF 4300 151014 Introduction to classifiction Anne Solberg anne@ifiuiono Based on Chapter 1-6 in Duda and Hart: Pattern Classification 151014 INF 4300 1 Introduction to classification One of the most challenging

More information

ENS Lyon Camp. Day 2. Basic group. Cartesian Tree. 26 October

ENS Lyon Camp. Day 2. Basic group. Cartesian Tree. 26 October ENS Lyon Camp. Day 2. Basic group. Cartesian Tree. 26 October Contents 1 Cartesian Tree. Definition. 1 2 Cartesian Tree. Construction 1 3 Cartesian Tree. Operations. 2 3.1 Split............................................

More information

Dictionary: an abstract data type

Dictionary: an abstract data type 2-3 Trees 1 Dictionary: an abstract data type A container that maps keys to values Dictionary operations Insert Search Delete Several possible implementations Balanced search trees Hash tables 2 2-3 trees

More information

COMPUTING π(x): THE MEISSEL, LEHMER, LAGARIAS, MILLER, ODLYZKO METHOD

COMPUTING π(x): THE MEISSEL, LEHMER, LAGARIAS, MILLER, ODLYZKO METHOD MATHEMATICS OF COMPUTATION Volume 65, Number 213 Januar 1996, Pages 235 245 COMPUTING π(): THE MEISSEL, LEHMER, LAGARIAS, MILLER, ODLYZKO METHOD M. DELEGLISE AND J. RIVAT Abstract. Let π() denote the number

More information

The Cell Probe Complexity of Dynamic Range Counting

The Cell Probe Complexity of Dynamic Range Counting The Cell Probe Complexity of Dynamic Range Counting Kasper Green Larsen MADALGO, Department of Computer Science Aarhus University Aarhus, Denmark email: larsen@cs.au.dk August 27, 2012 Abstract In this

More information

1 ode.mcd. Find solution to ODE dy/dx=f(x,y). Instructor: Nam Sun Wang

1 ode.mcd. Find solution to ODE dy/dx=f(x,y). Instructor: Nam Sun Wang Fin solution to ODE /=f(). Instructor: Nam Sun Wang oe.mc Backgroun. Wen a sstem canges wit time or wit location, a set of ifferential equations tat contains erivative terms "/" escribe suc a namic sstem.

More information

CIRCUIT COMPLEXITY AND PROBLEM STRUCTURE IN HAMMING SPACE

CIRCUIT COMPLEXITY AND PROBLEM STRUCTURE IN HAMMING SPACE CIRCUIT COMPLEXITY AND PROBLEM STRUCTURE IN HAMMING SPACE KOJI KOBAYASHI Abstract. This paper describes about relation between circuit compleit and accept inputs structure in Hamming space b using almost

More information

An Information Theory For Preferences

An Information Theory For Preferences An Information Theor For Preferences Ali E. Abbas Department of Management Science and Engineering, Stanford Universit, Stanford, Ca, 94305 Abstract. Recent literature in the last Maimum Entrop workshop

More information

INTRODUCTION TO DIOPHANTINE EQUATIONS

INTRODUCTION TO DIOPHANTINE EQUATIONS INTRODUCTION TO DIOPHANTINE EQUATIONS In the earl 20th centur, Thue made an important breakthrough in the stud of diophantine equations. His proof is one of the first eamples of the polnomial method. His

More information

Dictionary: an abstract data type

Dictionary: an abstract data type 2-3 Trees 1 Dictionary: an abstract data type A container that maps keys to values Dictionary operations Insert Search Delete Several possible implementations Balanced search trees Hash tables 2 2-3 trees

More information

Computing Connected Components Given a graph G = (V; E) compute the connected components of G. Connected-Components(G) 1 for each vertex v 2 V [G] 2 d

Computing Connected Components Given a graph G = (V; E) compute the connected components of G. Connected-Components(G) 1 for each vertex v 2 V [G] 2 d Data Structures for Disjoint Sets Maintain a Dynamic collection of disjoint sets. Each set has a unique representative (an arbitrary member of the set). x. Make-Set(x) - Create a new set with one member

More information

Nova Scotia Examinations Mathematics 12 Web Sample 2. Student Booklet

Nova Scotia Examinations Mathematics 12 Web Sample 2. Student Booklet Nova Scotia Eaminations Mathematics Web Sample Student Booklet General Instructions - WEB SAMPLE* This eamination is composed of two sections with the following suggested time allotment: Selected-Response

More information

Trusses - Method of Joints

Trusses - Method of Joints Trusses - Method of Joints ME 22 Truss - efinition truss is a framework of members joined at ends with frictionless pins to form a stable structure. (Onl two-force members.) asic shape is a triangle. truss

More information

Optimal Control of Hybrid Systems Using Statistical Learning

Optimal Control of Hybrid Systems Using Statistical Learning Proceedings of the 44th IEEE onference on Decision and ontrol, and the European ontrol onference Seville, Spain, December 2-, Mo. Optimal ontrol of Hbrid Sstems Using Statistical Learning. ollaro,.t. bdallah,.

More information

Boolean Algebra and Logic Gates

Boolean Algebra and Logic Gates Boolean Algebra and Logic Gates Prof. Wangrok Oh Dept. of Information Communications Eng. Chungnam National Universit Prof. Wangrok Oh(CNU) / 5 Overview Aiomatic Definition of Boolean Algebra 2 Basic Theorems

More information

RELATIONS AND FUNCTIONS through

RELATIONS AND FUNCTIONS through RELATIONS AND FUNCTIONS 11.1.2 through 11.1. Relations and Functions establish a correspondence between the input values (usuall ) and the output values (usuall ) according to the particular relation or

More information

Quiz 1 Solutions. Problem 2. Asymptotics & Recurrences [20 points] (3 parts)

Quiz 1 Solutions. Problem 2. Asymptotics & Recurrences [20 points] (3 parts) Introduction to Algorithms October 13, 2010 Massachusetts Institute of Technology 6.006 Fall 2010 Professors Konstantinos Daskalakis and Patrick Jaillet Quiz 1 Solutions Quiz 1 Solutions Problem 1. We

More information

Part III. Data Structures. Abstract Data Type. Dynamic Set Operations. Dynamic Set Operations

Part III. Data Structures. Abstract Data Type. Dynamic Set Operations. Dynamic Set Operations Abstract Data Type Part III Data Structures An abstract data type (ADT) is defined by an interface of operations or methods that can be performed and that have a defined behavior. The data types in this

More information

The first change comes in how we associate operators with classical observables. In one dimension, we had. p p ˆ

The first change comes in how we associate operators with classical observables. In one dimension, we had. p p ˆ VI. Angular momentum Up to this point, we have been dealing primaril with one dimensional sstems. In practice, of course, most of the sstems we deal with live in three dimensions and 1D quantum mechanics

More information

Chapter R REVIEW OF BASIC CONCEPTS. Section R.1: Sets

Chapter R REVIEW OF BASIC CONCEPTS. Section R.1: Sets Chapter R REVIEW OF BASIC CONCEPTS Section R.: Sets. The elements of the set {,,,, 0} are all the natural numbers from to 0 inclusive. There are 9 elements in the set, {,,,,, 7,, 9, 0}.. Each element of

More information

EPIPOLAR GEOMETRY WITH MANY DETAILS

EPIPOLAR GEOMETRY WITH MANY DETAILS EPIPOLAR GEOMERY WIH MANY DEAILS hank ou for the slides. he come mostl from the following source. Marc Pollefes U. of North Carolina hree questions: (i) Correspondence geometr: Given an image point in

More information

Lecture 15 April 9, 2007

Lecture 15 April 9, 2007 6.851: Advanced Data Structures Spring 2007 Mihai Pătraşcu Lecture 15 April 9, 2007 Scribe: Ivaylo Riskov 1 Overview In the last lecture we considered the problem of finding the predecessor in its static

More information

Shannon-Fano-Elias coding

Shannon-Fano-Elias coding Shannon-Fano-Elias coding Suppose that we have a memoryless source X t taking values in the alphabet {1, 2,..., L}. Suppose that the probabilities for all symbols are strictly positive: p(i) > 0, i. The

More information

A Randomized Algorithm for Two Servers in Cross Polytope Spaces

A Randomized Algorithm for Two Servers in Cross Polytope Spaces A Randomied Algorithm for Two Servers in Cross Poltope Spaces Wolfgang Bein, Kauo Iwama, Jun Kawahara, Lawrence L. Larmore, and James A. Oravec Center for the Advanced Stud of Algorithms, School of Computer

More information

Chapter 6: Securing neighbor discovery

Chapter 6: Securing neighbor discovery Securit and Cooperation in Wireless Networks http://secowinet.epfl.ch/ the wormhole attack; centralized and decentralized wormhole detection mechanisms; 007 Levente Buttán and Jean-Pierre Hubau Introduction

More information

arxiv: v1 [cs.ds] 15 Feb 2012

arxiv: v1 [cs.ds] 15 Feb 2012 Linear-Space Substring Range Counting over Polylogarithmic Alphabets Travis Gagie 1 and Pawe l Gawrychowski 2 1 Aalto University, Finland travis.gagie@aalto.fi 2 Max Planck Institute, Germany gawry@cs.uni.wroc.pl

More information

Covariance and Correlation Class 7, Jeremy Orloff and Jonathan Bloom

Covariance and Correlation Class 7, Jeremy Orloff and Jonathan Bloom 1 Learning Goals Covariance and Correlation Class 7, 18.05 Jerem Orloff and Jonathan Bloom 1. Understand the meaning of covariance and correlation. 2. Be able to compute the covariance and correlation

More information

And similarly in the other directions, so the overall result is expressed compactly as,

And similarly in the other directions, so the overall result is expressed compactly as, SQEP Tutorial Session 5: T7S0 Relates to Knowledge & Skills.5,.8 Last Update: //3 Force on an element of area; Definition of principal stresses and strains; Definition of Tresca and Mises equivalent stresses;

More information

CS Data Structures and Algorithm Analysis

CS Data Structures and Algorithm Analysis CS 483 - Data Structures and Algorithm Analysis Lecture VII: Chapter 6, part 2 R. Paul Wiegand George Mason University, Department of Computer Science March 22, 2006 Outline 1 Balanced Trees 2 Heaps &

More information