About this lecture. Three Methods for the Same Purpose (1) Aggregate Method (2) Accounting Method (3) Potential Method.

Size: px
Start display at page:

Download "About this lecture. Three Methods for the Same Purpose (1) Aggregate Method (2) Accounting Method (3) Potential Method."

Transcription

1 About this lecture Given a data structure, amortized analysis studies in a sequence of operations, the average time to perform an operation Introduce amortized cost of an operation Three Methods for the Same Purpose (1) Aggregate Method (2) Accounting Method (3) Potential Method This Lecture 2

2 Super Stack Your friend has created a super stack, which, apart from PUSH/POP, supports: SUPER-POP(k): pop top k items Suppose SUPER-POP never pops more items than current stack size ThetimeforSUPER-POP is O(k) ThetimeforPUSH/POP is O(1) 3

3 Super Stack Suppose we start with an empty stack, and we have performed n operations But we don t knowtheorder Questions: Worst-case time of a SUPER-POP? Ans. O(n) time [why?] Total time of n operations in worst case? Ans. O(n 2 ) time [correct, but not tight] 4

4 Super Stack Though we don t know the order of the operations, we still know that: There are at most n PUSH/POP Time spent on PUSH/POP = O(n) # items popped by all SUPER-POP cannot exceed total # items ever pushed into stack Time spent on SUPER-POP = O(n) So, total time of n operations = O(n)!!! 5

5 Amortized Cost So far, there are no assumptions on n and the order of operations. Thus, we have: For any n and any sequence of n operations, worst-case total time = O(n) We can think of each operation performs in average O(n) / n = O(1) time We say amortized cost = O(1) per operation (or, each runs in amortized O(1) time) 6

6 Amortized Cost In general, we can say something like: OP 1 runs in amortized O(x) time OP 2 runs in amortized O(y) time OP 3 runs in amortized O(z) time Meaning: For any sequence of operations with #OP 1 = n 1,#OP 2 = n 2,#OP 3 = n 3, worst-case total time = O(n 1 x + n 2 y + n 3 z) 7

7 Binary Counter Let us see another example of implementing a k-bit binary counter At the beginning, count is, and the counter will be like (assume k=5): which is the binary representation of the count 8

8 Binary Counter When the counter is incremented, the content will change Example: content of counter when: count = 5 cost = 2 count = 6 The cost of the increment is equal to the number of bits flipped 9

9 Special case: Binary Counter When all bits in the counter are 1, an increment resets all bits to count = MAX cost = k count = The cost of the corresponding increment is equal to k, the number of bits flipped 1

10 Binary Counter Suppose we have performed n increments Questions: Worst-case time of an increment? Ans. O(k) time Total time of n operations in worst case? Ans. O(nk) time [correct, but not tight] 11

11 Binary Counter Let us denote the bits in the counter by b, b 1, b 2,, b k-1, starting from the right b 4 b 3 b 2 b 1 b Observation: b i is flipped only once in every 2 i increments Precisely, b i is flipped at x th increment x is divisible by 2 i 12

12 Amortized Cost So, for n increments, the total cost is: i= to k b n /2 i c i= to k ( n /2 i ) 2n By dividing total cost with #increments, amortized cost of increment = O(1) 13

13 Aggregate Method The computation of amortized cost of an operation in super stack or binary counter follows similar steps: 1. Find total cost (thus, an aggregation ) 2. Divide total cost by #operations This method is called Aggregate Method 14

14 About this lecture Previous lecture shows Aggregate Method This lecture shows two more methods: (2) Accounting Method (3) Potential Method 2

15 Accounting Method In real life, a bank account allows us to save our excess money, and the money can be used later when needed We also have an easy way to check the savings In amortized analysis, the accounting method is very similar 3

16 Accounting Method Each operation pays an amortized cost if amortized cost actual cost, wesavethe excess in the bank Else, we use savings to help the payment Often, savings can be checked easily based on the objects in the current data structure Lemma: For a sequence of operations, if we have enough to pay for each operation, total actual cost total amortized cost 4

17 Super Stack (Take 2) Recall that apart from PUSH/POP, a super stack, supports: SUPER-POP(k): pop top k items in k time Let us now assign the amortized cost for each operation as follows: PUSH =$2 POP or SUPER-POP =$ 5

18 Super Stack (Take 2) Questions: Which operation saves money to the bank when performed? Which operation needs money from the bank when performed? How to check the savings in the bank? 6

19 Super Stack (Take 2) Does our bank have enough to pay for each SUPER-POP operation? Ans. When SUPER-POP is performed, each popped item donates its corresponding $1 to help the payment Enough $$ to pay for each SUPER-POP 7

20 Super Stack (Take 2) Conclusion: Amortized cost of PUSH =2 Amortized cost of POP/SUPER-POP = Meaning: For any sequence of operations with #PUSH = n 1,#POP = n 2,#SUPER-POP = n 3, total actual cost 2n 1 8

21 Binary Counter (Take 2) Let us use accounting method to analyze increment operation in a binary counter, whose initial count = We assign amortized cost for each increment = $2 Recall: actual cost = #bits flipped 9

22 Binary Counter (Take 2) Observation: In each increment operation, at most one bit is set from to 1 (whereas the remaining bits are set from 1 to ). E.g., count = 4 count = count = 5 count = 6 1

23 Binary Counter (Take 2) Lemma: Savings = # of 1 s inthecounter Proof: By induction To show amortized cost =$2isenough, we use $1 to pay for flipping some bit x from to 1, and store the excess $1 For other bits being flipped (from 1 to ), each donates its corresponding $1 to help in paying the operation Enough to pay for each increment 11

24 Binary Counter (Take 2) Conclusion: Amortized cost of increment =2 Meaning: For n increments (with initial count = ) total actual cost 2n Question: What s wrong if initial count? 12

25 Accounting Method (Remarks) In contrast to the aggregate method, the accounting method may assign different amortized costs to different operations Another thing: To help the analysis, we usually link each excess $ to a specific object in the data structure (such as an item in a stack, or a bit in a binary counter) called the credit stored in the object 13

26 Potential Method Inphysics,anobjectatahigherplace has more potential energy (due to gravity) than an object at a lower place More potential Less potential 14

27 Potential Method The potential energy can usually be measured by some function of the status of the object (in fact, its height) In amortized analysis, the potential method is very similar It uses a potential function to measure the potential of a data structure, based on its current status 15

28 Potential Method Thus, potential of a data structure may increase or decrease after an operation The potential is similar to the $ in the accounting method, which can be used to help in paying an operation 16

29 Potential Method Each operation pays an amortized cost, and If potential increases by d after an operation, we need: amortized cost actual cost + d If potential decreases by d after an operation, we need: amortized cost + d actual cost 17

30 Potential Method To combine the above, we let = potential function D i = data structure after i th operation c i i = actual cost of i th operation = amortized cost of i th operation Then, we always need: i c i + D i D i-1 18

31 Potential Method Because smaller amortized cost gives better (tighter) analysis, so in general, we set: i = c i + D i D i-1 Consequently, after n operations, total amortized cost = total actual cost + D n D 19

32 Potential Method Any such that D i D for all i should work, as it implies total amortized cost at any time total actual cost at any time Our target is to find the best such so that amortized cost can be minimized 2

33 Super Stack (Take 3) Let us now use potential method to analyze the operations on a super stack Define such that for a super stack S Thus we have: S = #itemsins D =, and D i D for all i 21

34 Super Stack (Take 3) PUSH increases potential by 1 amortized cost of PUSH =1+1=2 POP decreases potential by 1 amortized cost of POP =1+(-1)= SUPER-POP(k) decreases potential by k amortized cost of SUPER-POP = k +(-k) = [Assume: Stack has enough items before POP/SUPER-POP] 22

35 Super Stack (Take 3) Conclusion: Because D =,and D i D for all i, total amortized cost total actual cost Then, by setting amortized cost for each operation accordingly (according to what??): amortized cost = O(1) 23

36 Binary Counter (Take 3) Let us now use potential method to analyze the increment in a binary counter Define such that for a binary counter B Thus we have: B = #bitsinb which are 1 D =, and D i D for all i Assume: initial count = 24

37 Binary Counter (Take 3) From our previous observation, at most 1 bit is set from to 1, the corresponding increase in potential is at most 1 Now, suppose the i th operation resets t i bits from 1 to actual cost c i = t i +1 potential change = (-t i )+1 amortized cost i = c i + potential change = 2 25

38 Binary Counter (Take 3) Conclusion: Because D =,and D i D for all i, total amortized cost total actual cost Then, by setting amortized cost for each operation accordingly: amortized cost = 2 = O(1) 26

39 Potential Method (Remarks) Potential method is very similar to the accounting method: we can save something ($/potential) now, which can be used later It usually gives a neat analysis, as the cost of each operation is very specific However, finding a good potential function can be extremely difficult (like magic) Analyzing Union-Find data structure 27

CS4311 Design and Analysis of Algorithms. Lecture 14: Amortized Analysis I

CS4311 Design and Analysis of Algorithms. Lecture 14: Amortized Analysis I CS43 Design and Analysis of Algorithms Lecture 4: Amortized Analysis I About this lecture Given a data structure, amortized analysis studies in a sequence of operations, the average time to perform an

More information

CS473-Algorithms I. Lecture 12. Amortized Analysis. Cevdet Aykanat - Bilkent University Computer Engineering Department

CS473-Algorithms I. Lecture 12. Amortized Analysis. Cevdet Aykanat - Bilkent University Computer Engineering Department CS473-Algorithms I Lecture 12 Amortized Analysis 1 Amortized Analysis Key point: The time required to perform a sequence of data structure operations is averaged over all operations performed Amortized

More information

Lecture 7. Analysis of algorithms: Amortized Analysis. January Lecture 7

Lecture 7. Analysis of algorithms: Amortized Analysis. January Lecture 7 Analysis of algorithms: Amortized Analysis January 2014 What is amortized analysis? Amortized analysis: set of techniques (Aggregate method, Accounting method, Potential method) for proving upper (worst-case)

More information

COMP251: Amortized Analysis

COMP251: Amortized Analysis COMP251: Amortized Analysis Jérôme Waldispühl School of Computer Science McGill University Based on (Cormen et al., 2009) T n = 2 % T n 5 + n( What is the height of the recursion tree? log ( n log, n log

More information

Unit 6: Amortized Analysis

Unit 6: Amortized Analysis : Amortized Analysis Course contents: Aggregate method Accounting method Potential method Reading: Chapter 17 Y.-W. Chang 1 Amortized Analysis Why Amortized Analysis? Find a tight bound of a sequence of

More information

CMSC 441: Design & Analysis of Algorithms

CMSC 441: Design & Analysis of Algorithms CMSC 441: Design & Analysis of Algorithms Hillol Kargupta http://www.cs.umbc.edu/~hillol/ hillol@cs.umbc.edu Today s Topics Amortized analysis April 19, 2011 CMSC 641 2 Amortized Analysis Aggregate Method

More information

Homework #4. CMSC351 - Spring 2013 PRINT Name : Due: Thu Apr 16 th at the start of class

Homework #4. CMSC351 - Spring 2013 PRINT Name : Due: Thu Apr 16 th at the start of class Homework #4 CMSC351 - Spring 2013 PRINT Name : Due: Thu Apr 16 th at the start of class o Grades depend on neatness and clarity. o Write your answers with enough detail about your approach and concepts

More information

Max Registers, Counters and Monotone Circuits

Max Registers, Counters and Monotone Circuits James Aspnes 1 Hagit Attiya 2 Keren Censor 2 1 Yale 2 Technion Counters Model Collects Our goal: build a cheap counter for an asynchronous shared-memory system. Two operations: increment and read. Read

More information

Splay Trees. Splay Trees - 1

Splay Trees. Splay Trees - 1 Splay Trees In balanced tree schemes, explicit rules are followed to ensure balance. In splay trees, there are no such rules. Search, insert, and delete operations are like in binary search trees, except

More information

> asympt( ln( n! ), n ); n 360n n

> asympt( ln( n! ), n ); n 360n n 8.4 Heap Sort (heapsort) We will now look at our first (n ln(n)) algorithm: heap sort. It will use a data structure that we have already seen: a binary heap. 8.4.1 Strategy and Run-time Analysis Given

More information

15-451/651: Design & Analysis of Algorithms October 23, 2018 Lecture #16: Online Algorithms last changed: October 22, 2018

15-451/651: Design & Analysis of Algorithms October 23, 2018 Lecture #16: Online Algorithms last changed: October 22, 2018 15-451/651: Design & Analysis of Algorithms October 23, 2018 Lecture #16: Online Algorithms last changed: October 22, 2018 Today we ll be looking at finding approximately-optimal solutions for problems

More information

Lecture 5: Tuesday, January 27, Peterson s Algorithm satisfies the No Starvation property (Theorem 1)

Lecture 5: Tuesday, January 27, Peterson s Algorithm satisfies the No Starvation property (Theorem 1) Com S 611 Spring Semester 2015 Advanced Topics on Distributed and Concurrent Algorithms Lecture 5: Tuesday, January 27, 2015 Instructor: Soma Chaudhuri Scribe: Nik Kinkel 1 Introduction This lecture covers

More information

Maximum Contiguous Subsequences

Maximum Contiguous Subsequences Chapter 8 Maximum Contiguous Subsequences In this chapter, we consider a well-know problem and apply the algorithm-design techniques that we have learned thus far to this problem. While applying these

More information

Vertical Asymptotes. We generally see vertical asymptotes in the graph of a function when we divide by zero. For example, in the function

Vertical Asymptotes. We generally see vertical asymptotes in the graph of a function when we divide by zero. For example, in the function MA 223 Lecture 26 - Behavior Around Vertical Asymptotes Monday, April 9, 208 Objectives: Explore middle behavior around vertical asymptotes. Vertical Asymptotes We generally see vertical asymptotes in

More information

15-451/651: Design & Analysis of Algorithms November 9 & 11, 2015 Lecture #19 & #20 last changed: November 10, 2015

15-451/651: Design & Analysis of Algorithms November 9 & 11, 2015 Lecture #19 & #20 last changed: November 10, 2015 15-451/651: Design & Analysis of Algorithms November 9 & 11, 2015 Lecture #19 & #20 last changed: November 10, 2015 Last time we looked at algorithms for finding approximately-optimal solutions for NP-hard

More information

Lecture 6. 1 Polynomial-time algorithms for the global min-cut problem

Lecture 6. 1 Polynomial-time algorithms for the global min-cut problem ORIE 633 Network Flows September 20, 2007 Lecturer: David P. Williamson Lecture 6 Scribe: Animashree Anandkumar 1 Polynomial-time algorithms for the global min-cut problem 1.1 The global min-cut problem

More information

Lecture 14: Examples of Martingales and Azuma s Inequality. Concentration

Lecture 14: Examples of Martingales and Azuma s Inequality. Concentration Lecture 14: Examples of Martingales and Azuma s Inequality A Short Summary of Bounds I Chernoff (First Bound). Let X be a random variable over {0, 1} such that P [X = 1] = p and P [X = 0] = 1 p. n P X

More information

Outline for this Week

Outline for this Week Binomial Heaps Outline for this Week Binomial Heaps (Today) A simple, fexible, and versatile priority queue. Lazy Binomial Heaps (Today) A powerful building block for designing advanced data structures.

More information

1 Solutions to Tute09

1 Solutions to Tute09 s to Tute0 Questions 4. - 4. are straight forward. Q. 4.4 Show that in a binary tree of N nodes, there are N + NULL pointers. Every node has outgoing pointers. Therefore there are N pointers. Each node,

More information

PAULI MURTO, ANDREY ZHUKOV

PAULI MURTO, ANDREY ZHUKOV GAME THEORY SOLUTION SET 1 WINTER 018 PAULI MURTO, ANDREY ZHUKOV Introduction For suggested solution to problem 4, last year s suggested solutions by Tsz-Ning Wong were used who I think used suggested

More information

4 Martingales in Discrete-Time

4 Martingales in Discrete-Time 4 Martingales in Discrete-Time Suppose that (Ω, F, P is a probability space. Definition 4.1. A sequence F = {F n, n = 0, 1,...} is called a filtration if each F n is a sub-σ-algebra of F, and F n F n+1

More information

Node betweenness centrality: the definition.

Node betweenness centrality: the definition. Brandes algorithm These notes supplement the notes and slides for Task 11. They do not add any new material, but may be helpful in understanding the Brandes algorithm for calculating node betweenness centrality.

More information

Data Analysis and Statistical Methods Statistics 651

Data Analysis and Statistical Methods Statistics 651 Data Analysis and Statistical Methods Statistics 651 http://www.stat.tamu.edu/~suhasini/teaching.html Lecture 7 (MWF) Analyzing the sums of binary outcomes Suhasini Subba Rao Introduction Lecture 7 (MWF)

More information

CS599: Algorithm Design in Strategic Settings Fall 2012 Lecture 6: Prior-Free Single-Parameter Mechanism Design (Continued)

CS599: Algorithm Design in Strategic Settings Fall 2012 Lecture 6: Prior-Free Single-Parameter Mechanism Design (Continued) CS599: Algorithm Design in Strategic Settings Fall 2012 Lecture 6: Prior-Free Single-Parameter Mechanism Design (Continued) Instructor: Shaddin Dughmi Administrivia Homework 1 due today. Homework 2 out

More information

Outline for this Week

Outline for this Week Binomial Heaps Outline for this Week Binomial Heaps (Today) A simple, flexible, and versatile priority queue. Lazy Binomial Heaps (Today) A powerful building block for designing advanced data structures.

More information

Heaps. Heap/Priority queue. Binomial heaps: Advanced Algorithmics (4AP) Heaps Binary heap. Binomial heap. Jaak Vilo 2009 Spring

Heaps. Heap/Priority queue. Binomial heaps: Advanced Algorithmics (4AP) Heaps Binary heap. Binomial heap. Jaak Vilo 2009 Spring .0.00 Heaps http://en.wikipedia.org/wiki/category:heaps_(structure) Advanced Algorithmics (4AP) Heaps Jaak Vilo 00 Spring Binary heap http://en.wikipedia.org/wiki/binary_heap Binomial heap http://en.wikipedia.org/wiki/binomial_heap

More information

NOTES ON FIBONACCI TREES AND THEIR OPTIMALITY* YASUICHI HORIBE INTRODUCTION 1. FIBONACCI TREES

NOTES ON FIBONACCI TREES AND THEIR OPTIMALITY* YASUICHI HORIBE INTRODUCTION 1. FIBONACCI TREES 0#0# NOTES ON FIBONACCI TREES AND THEIR OPTIMALITY* YASUICHI HORIBE Shizuoka University, Hamamatsu, 432, Japan (Submitted February 1982) INTRODUCTION Continuing a previous paper [3], some new observations

More information

Algorithmic Game Theory and Applications. Lecture 11: Games of Perfect Information

Algorithmic Game Theory and Applications. Lecture 11: Games of Perfect Information Algorithmic Game Theory and Applications Lecture 11: Games of Perfect Information Kousha Etessami finite games of perfect information Recall, a perfect information (PI) game has only 1 node per information

More information

CS 237: Probability in Computing

CS 237: Probability in Computing CS 237: Probability in Computing Wayne Snyder Computer Science Department Boston University Lecture 12: Continuous Distributions Uniform Distribution Normal Distribution (motivation) Discrete vs Continuous

More information

Lecture 5 January 30

Lecture 5 January 30 EE 223: Stochastic Estimation and Control Spring 2007 Lecture 5 January 30 Lecturer: Venkat Anantharam Scribe: aryam Kamgarpour 5.1 Secretary Problem The problem set-up is explained in Lecture 4. We review

More information

Chapter 7. Registers & Register Transfers. J.J. Shann. J. J. Shann

Chapter 7. Registers & Register Transfers. J.J. Shann. J. J. Shann Chapter 7 Registers & Register Transfers J. J. Shann J.J. Shann Chapter Overview 7-1 Registers and Load Enable 7-2 Register Transfers 7-3 Register Transfer Operations 7-4 A Note for VHDL and Verilog Users

More information

Heaps

Heaps AdvancedAlgorithmics (4AP) Heaps Jaak Vilo 2009 Spring Jaak Vilo MTAT.03.190 Text Algorithms 1 Heaps http://en.wikipedia.org/wiki/category:heaps_(structure) Binary heap http://en.wikipedia.org/wiki/binary_heap

More information

PAULI MURTO, ANDREY ZHUKOV. If any mistakes or typos are spotted, kindly communicate them to

PAULI MURTO, ANDREY ZHUKOV. If any mistakes or typos are spotted, kindly communicate them to GAME THEORY PROBLEM SET 1 WINTER 2018 PAULI MURTO, ANDREY ZHUKOV Introduction If any mistakes or typos are spotted, kindly communicate them to andrey.zhukov@aalto.fi. Materials from Osborne and Rubinstein

More information

The potential function φ for the amortized analysis of an operation on Fibonacci heap at time (iteration) i is given by the following equation:

The potential function φ for the amortized analysis of an operation on Fibonacci heap at time (iteration) i is given by the following equation: Indian Institute of Information Technology Design and Manufacturing, Kancheepuram Chennai 600 127, India An Autonomous Institute under MHRD, Govt of India http://www.iiitdm.ac.in COM 01 Advanced Data Structures

More information

Topic 5 Sources of Finance. N5 Business Management

Topic 5 Sources of Finance. N5 Business Management Topic 5 Sources of Finance N5 Business Management 1 Learning Intentions / Success Criteria Learning Intentions Sources of finance Success Criteria By end of this topic you will be able to describe: sources

More information

Design and Analysis of Algorithms 演算法設計與分析. Lecture 9 November 19, 2014 洪國寶

Design and Analysis of Algorithms 演算法設計與分析. Lecture 9 November 19, 2014 洪國寶 Design and Analysis of Algorithms 演算法設計與分析 Lecture 9 November 19, 2014 洪國寶 1 Outline Advanced data structures Binary heaps(review) Binomial heaps Fibonacci heaps Data structures for disjoint sets 2 Mergeable

More information

On the Optimality of a Family of Binary Trees Techical Report TR

On the Optimality of a Family of Binary Trees Techical Report TR On the Optimality of a Family of Binary Trees Techical Report TR-011101-1 Dana Vrajitoru and William Knight Indiana University South Bend Department of Computer and Information Sciences Abstract In this

More information

Design and Analysis of Algorithms 演算法設計與分析. Lecture 8 November 16, 2016 洪國寶

Design and Analysis of Algorithms 演算法設計與分析. Lecture 8 November 16, 2016 洪國寶 Design and Analysis of Algorithms 演算法設計與分析 Lecture 8 November 6, 206 洪國寶 Outline Review Amortized analysis Advanced data structures Binary heaps Binomial heaps Fibonacci heaps Data structures for disjoint

More information

Lecture 14: Basic Fixpoint Theorems (cont.)

Lecture 14: Basic Fixpoint Theorems (cont.) Lecture 14: Basic Fixpoint Theorems (cont) Predicate Transformers Monotonicity and Continuity Existence of Fixpoints Computing Fixpoints Fixpoint Characterization of CTL Operators 1 2 E M Clarke and E

More information

IEOR E4004: Introduction to OR: Deterministic Models

IEOR E4004: Introduction to OR: Deterministic Models IEOR E4004: Introduction to OR: Deterministic Models 1 Dynamic Programming Following is a summary of the problems we discussed in class. (We do not include the discussion on the container problem or the

More information

Fibonacci Heaps CLRS: Chapter 20 Last Revision: 21/09/04

Fibonacci Heaps CLRS: Chapter 20 Last Revision: 21/09/04 Fibonacci Heaps CLRS: Chapter 20 Last Revision: 21/09/04 1 Binary heap Binomial heap Fibonacci heap Procedure (worst-case) (worst-case) (amortized) Make-Heap Θ(1) Θ(1) Θ(1) Insert Θ(lg n) O(lg n) Θ(1)

More information

Advanced Algorithmics (4AP) Heaps

Advanced Algorithmics (4AP) Heaps Advanced Algorithmics (4AP) Heaps Jaak Vilo 2009 Spring Jaak Vilo MTAT.03.190 Text Algorithms 1 Heaps http://en.wikipedia.org/wiki/category:heaps_(structure) Binary heap http://en.wikipedia.org/wiki/binary

More information

Options and Derivatives

Options and Derivatives Options and Derivatives For 9.220, Term 1, 2002/03 02_Lecture17 & 18.ppt Student Version Outline 1. Introduction 2. Option Definitions 3. Option Payoffs 4. Intuitive Option Valuation 5. Put-Call Parity

More information

Advanced Leveraged Buyouts and LBO Models Quiz Questions

Advanced Leveraged Buyouts and LBO Models Quiz Questions Advanced Leveraged Buyouts and LBO Models Quiz Questions Types of Debt Transaction and Operating Assumptions Sources & Uses Pro-Forma Balance Sheet Adjustments Debt Schedules Linking and Modifying the

More information

Lecture l(x) 1. (1) x X

Lecture l(x) 1. (1) x X Lecture 14 Agenda for the lecture Kraft s inequality Shannon codes The relation H(X) L u (X) = L p (X) H(X) + 1 14.1 Kraft s inequality While the definition of prefix-free codes is intuitively clear, we

More information

Notes on the symmetric group

Notes on the symmetric group Notes on the symmetric group 1 Computations in the symmetric group Recall that, given a set X, the set S X of all bijections from X to itself (or, more briefly, permutations of X) is group under function

More information

Swaps and Inversions

Swaps and Inversions Swaps and Inversions I explained in class why every permutation can be obtained as a product [composition] of swaps and that there are multiple ways to do this. In class, I also mentioned, without explaining

More information

Finding Equilibria in Games of No Chance

Finding Equilibria in Games of No Chance Finding Equilibria in Games of No Chance Kristoffer Arnsfelt Hansen, Peter Bro Miltersen, and Troels Bjerre Sørensen Department of Computer Science, University of Aarhus, Denmark {arnsfelt,bromille,trold}@daimi.au.dk

More information

Design and Analysis of Algorithms. Lecture 9 November 20, 2013 洪國寶

Design and Analysis of Algorithms. Lecture 9 November 20, 2013 洪國寶 Design and Analysis of Algorithms 演算法設計與分析 Lecture 9 November 20, 2013 洪國寶 1 Outline Advanced data structures Binary heaps (review) Binomial heaps Fibonacci heaps Dt Data structures t for disjoint dijitsets

More information

CSE 21 Winter 2016 Homework 6 Due: Wednesday, May 11, 2016 at 11:59pm. Instructions

CSE 21 Winter 2016 Homework 6 Due: Wednesday, May 11, 2016 at 11:59pm. Instructions CSE 1 Winter 016 Homework 6 Due: Wednesday, May 11, 016 at 11:59pm Instructions Homework should be done in groups of one to three people. You are free to change group members at any time throughout the

More information

A1: American Options in the Binomial Model

A1: American Options in the Binomial Model Appendix 1 A1: American Options in the Binomial Model So far we were dealing with options which can be excercised only at a fixed time, at their maturity date T. These are european options. In a complete

More information

COMP Analysis of Algorithms & Data Structures

COMP Analysis of Algorithms & Data Structures COMP 3170 - Analysis of Algorithms & Data Structures Shahin Kamali Binomial Heaps CLRS 6.1, 6.2, 6.3 University of Manitoba Priority queues A priority queue is an abstract data type formed by a set S of

More information

Notes on Natural Logic

Notes on Natural Logic Notes on Natural Logic Notes for PHIL370 Eric Pacuit November 16, 2012 1 Preliminaries: Trees A tree is a structure T = (T, E), where T is a nonempty set whose elements are called nodes and E is a relation

More information

Lecture 8 Feb 16, 2017

Lecture 8 Feb 16, 2017 CS 4: Advanced Algorithms Spring 017 Prof. Jelani Nelson Lecture 8 Feb 16, 017 Scribe: Tiffany 1 Overview In the last lecture we covered the properties of splay trees, including amortized O(log n) time

More information

Welcome again to our Farm Management and Finance educational series. Borrowing money is something that is a necessary aspect of running a farm or

Welcome again to our Farm Management and Finance educational series. Borrowing money is something that is a necessary aspect of running a farm or Welcome again to our Farm Management and Finance educational series. Borrowing money is something that is a necessary aspect of running a farm or ranch business for most of us, at least at some point in

More information

Introduction to Greedy Algorithms: Huffman Codes

Introduction to Greedy Algorithms: Huffman Codes Introduction to Greedy Algorithms: Huffman Codes Yufei Tao ITEE University of Queensland In computer science, one interesting method to design algorithms is to go greedy, namely, keep doing the thing that

More information

Discrete Mathematics for CS Spring 2008 David Wagner Final Exam

Discrete Mathematics for CS Spring 2008 David Wagner Final Exam CS 70 Discrete Mathematics for CS Spring 2008 David Wagner Final Exam PRINT your name:, (last) SIGN your name: (first) PRINT your Unix account login: Your section time (e.g., Tue 3pm): Name of the person

More information

Design and Analysis of Algorithms

Design and Analysis of Algorithms Design and Analysis of Algorithms Instructor: Sharma Thankachan Lecture 9: Binomial Heap Slides modified from Dr. Hon, with permission 1 About this lecture Binary heap supports various operations quickly:

More information

MA 1125 Lecture 05 - Measures of Spread. Wednesday, September 6, Objectives: Introduce variance, standard deviation, range.

MA 1125 Lecture 05 - Measures of Spread. Wednesday, September 6, Objectives: Introduce variance, standard deviation, range. MA 115 Lecture 05 - Measures of Spread Wednesday, September 6, 017 Objectives: Introduce variance, standard deviation, range. 1. Measures of Spread In Lecture 04, we looked at several measures of central

More information

x is a random variable which is a numerical description of the outcome of an experiment.

x is a random variable which is a numerical description of the outcome of an experiment. Chapter 5 Discrete Probability Distributions Random Variables is a random variable which is a numerical description of the outcome of an eperiment. Discrete: If the possible values change by steps or jumps.

More information

Lecture 9 Feb. 21, 2017

Lecture 9 Feb. 21, 2017 CS 224: Advanced Algorithms Spring 2017 Lecture 9 Feb. 21, 2017 Prof. Jelani Nelson Scribe: Gavin McDowell 1 Overview Today: office hours 5-7, not 4-6. We re continuing with online algorithms. In this

More information

Lecture 19: March 20

Lecture 19: March 20 CS71 Randomness & Computation Spring 018 Instructor: Alistair Sinclair Lecture 19: March 0 Disclaimer: These notes have not been subjected to the usual scrutiny accorded to formal publications. They may

More information

Finance 197. Simple One-time Interest

Finance 197. Simple One-time Interest Finance 197 Finance We have to work with money every day. While balancing your checkbook or calculating your monthly expenditures on espresso requires only arithmetic, when we start saving, planning for

More information

It is used when neither the TX nor RX knows anything about the statistics of the source sequence at the start of the transmission

It is used when neither the TX nor RX knows anything about the statistics of the source sequence at the start of the transmission It is used when neither the TX nor RX knows anything about the statistics of the source sequence at the start of the transmission -The code can be described in terms of a binary tree -0 corresponds to

More information

3/7/13. Binomial Tree. Binomial Tree. Binomial Tree. Binomial Tree. Number of nodes with respect to k? N(B o ) = 1 N(B k ) = 2 N(B k-1 ) = 2 k

3/7/13. Binomial Tree. Binomial Tree. Binomial Tree. Binomial Tree. Number of nodes with respect to k? N(B o ) = 1 N(B k ) = 2 N(B k-1 ) = 2 k //1 Adapted from: Kevin Wayne B k B k B k : a binomial tree with the addition of a left child with another binomial tree Number of nodes with respect to k? N(B o ) = 1 N(B k ) = 2 N( ) = 2 k B 1 B 2 B

More information

The Real Numbers. Here we show one way to explicitly construct the real numbers R. First we need a definition.

The Real Numbers. Here we show one way to explicitly construct the real numbers R. First we need a definition. The Real Numbers Here we show one way to explicitly construct the real numbers R. First we need a definition. Definitions/Notation: A sequence of rational numbers is a funtion f : N Q. Rather than write

More information

CMSC 474, Introduction to Game Theory 16. Behavioral vs. Mixed Strategies

CMSC 474, Introduction to Game Theory 16. Behavioral vs. Mixed Strategies CMSC 474, Introduction to Game Theory 16. Behavioral vs. Mixed Strategies Mohammad T. Hajiaghayi University of Maryland Behavioral Strategies In imperfect-information extensive-form games, we can define

More information

1 Online Problem Examples

1 Online Problem Examples Comp 260: Advanced Algorithms Tufts University, Spring 2018 Prof. Lenore Cowen Scribe: Isaiah Mindich Lecture 9: Online Algorithms All of the algorithms we have studied so far operate on the assumption

More information

Lecture 3. Chapter 4: Allocating Resources Over Time

Lecture 3. Chapter 4: Allocating Resources Over Time Lecture 3 Chapter 4: Allocating Resources Over Time 1 Introduction: Time Value of Money (TVM) $20 today is worth more than the expectation of $20 tomorrow because: a bank would pay interest on the $20

More information

Math 167: Mathematical Game Theory Instructor: Alpár R. Mészáros

Math 167: Mathematical Game Theory Instructor: Alpár R. Mészáros Math 167: Mathematical Game Theory Instructor: Alpár R. Mészáros Midterm #1, February 3, 2017 Name (use a pen): Student ID (use a pen): Signature (use a pen): Rules: Duration of the exam: 50 minutes. By

More information

Online Algorithms SS 2013

Online Algorithms SS 2013 Faculty of Computer Science, Electrical Engineering and Mathematics Algorithms and Complexity research group Jun.-Prof. Dr. Alexander Skopalik Online Algorithms SS 2013 Summary of the lecture by Vanessa

More information

Square Timer v3.5.x Users Guide

Square Timer v3.5.x Users Guide Square Timer v3.5.x Users Guide The Square Timer program, also called SQT, is a very useful program for the purpose of time/price squaring. W. D. Gann determined decades ago that there was a mathematical

More information

Regret Minimization and Security Strategies

Regret Minimization and Security Strategies Chapter 5 Regret Minimization and Security Strategies Until now we implicitly adopted a view that a Nash equilibrium is a desirable outcome of a strategic game. In this chapter we consider two alternative

More information

This is How Is the Statement of Cash Flows Prepared and Used?, chapter 12 from the book Accounting for Managers (index.html) (v. 1.0).

This is How Is the Statement of Cash Flows Prepared and Used?, chapter 12 from the book Accounting for Managers (index.html) (v. 1.0). This is How Is the Statement of Cash Flows Prepared and Used?, chapter 12 from the book Accounting for Managers (index.html) (v. 1.0). This book is licensed under a Creative Commons by-nc-sa 3.0 (http://creativecommons.org/licenses/by-nc-sa/

More information

Retirement Income Planning With Annuities. Your Relationship With Your Finances

Retirement Income Planning With Annuities. Your Relationship With Your Finances Retirement Income Planning With Annuities SAMPLE Your Relationship With Your Finances E SA MP L There are some pretty amazing things that happen around the time of retirement. For many, it is a time of

More information

Retirement Income Planning With Annuities. Your Relationship With Your Finances

Retirement Income Planning With Annuities. Your Relationship With Your Finances Retirement Income Planning With Annuities Your Relationship With Your Finances There are some pretty amazing things that happen around the time of retirement. For many, it is a time of incredible change,

More information

Cash Flow Statement [1:00]

Cash Flow Statement [1:00] Cash Flow Statement In this lesson, we're going to go through the last major financial statement, the cash flow statement for a company and then compare that once again to a personal cash flow statement

More information

Chapter 8 Statistical Intervals for a Single Sample

Chapter 8 Statistical Intervals for a Single Sample Chapter 8 Statistical Intervals for a Single Sample Part 1: Confidence intervals (CI) for population mean µ Section 8-1: CI for µ when σ 2 known & drawing from normal distribution Section 8-1.2: Sample

More information

Tug of War Game. William Gasarch and Nick Sovich and Paul Zimand. October 6, Abstract

Tug of War Game. William Gasarch and Nick Sovich and Paul Zimand. October 6, Abstract Tug of War Game William Gasarch and ick Sovich and Paul Zimand October 6, 2009 To be written later Abstract Introduction Combinatorial games under auction play, introduced by Lazarus, Loeb, Propp, Stromquist,

More information

12 Steps to Improved Credit Steven K. Shapiro

12 Steps to Improved Credit Steven K. Shapiro 12 Steps to Improved Credit Steven K. Shapiro 2009 2018 sks@skscci.com In my previous article, I wrote about becoming debt-free and buying everything with cash. Even while I was writing the article, I

More information

Structural Induction

Structural Induction Structural Induction Jason Filippou CMSC250 @ UMCP 07-05-2016 Jason Filippou (CMSC250 @ UMCP) Structural Induction 07-05-2016 1 / 26 Outline 1 Recursively defined structures 2 Proofs Binary Trees Jason

More information

Maximizing Purchasing Power: Make the Most of Your Credit Score

Maximizing Purchasing Power: Make the Most of Your Credit Score When life happens... Maximizing Purchasing Power: Make the Most of Your Credit Score Consolidated Credit Counseling Services, Inc. 5701 West Sunrise Boulevard Fort Lauderdale, FL 33313 1-800-210-3481 How

More information

Approximate Revenue Maximization with Multiple Items

Approximate Revenue Maximization with Multiple Items Approximate Revenue Maximization with Multiple Items Nir Shabbat - 05305311 December 5, 2012 Introduction The paper I read is called Approximate Revenue Maximization with Multiple Items by Sergiu Hart

More information

The Central Limit Theorem. Sec. 8.2: The Random Variable. it s Distribution. it s Distribution

The Central Limit Theorem. Sec. 8.2: The Random Variable. it s Distribution. it s Distribution The Central Limit Theorem Sec. 8.1: The Random Variable it s Distribution Sec. 8.2: The Random Variable it s Distribution X p and and How Should You Think of a Random Variable? Imagine a bag with numbers

More information

Budgeting: 101 Financial Literacy Program

Budgeting: 101 Financial Literacy Program Program Schedule Budgeting: 101 Financial Literacy Program Introduction: 5 minutes Introduce yourself - Name, company, mention that you are a CPA. Ask the students - What does CPA stand for? Briefly explain

More information

Issues. Senate (Total = 100) Senate Group 1 Y Y N N Y 32 Senate Group 2 Y Y D N D 16 Senate Group 3 N N Y Y Y 30 Senate Group 4 D Y N D Y 22

Issues. Senate (Total = 100) Senate Group 1 Y Y N N Y 32 Senate Group 2 Y Y D N D 16 Senate Group 3 N N Y Y Y 30 Senate Group 4 D Y N D Y 22 1. Every year, the United States Congress must approve a budget for the country. In order to be approved, the budget must get a majority of the votes in the Senate, a majority of votes in the House, and

More information

CSE 100: TREAPS AND RANDOMIZED SEARCH TREES

CSE 100: TREAPS AND RANDOMIZED SEARCH TREES CSE 100: TREAPS AND RANDOMIZED SEARCH TREES Midterm Review Practice Midterm covered during Sunday discussion Today Run time analysis of building the Huffman tree AVL rotations and treaps Huffman s algorithm

More information

Introduction To The Income Statement

Introduction To The Income Statement Introduction To The Income Statement This is the downloaded transcript of the video presentation for this topic. More downloads and videos are available at The Kaplan Group Commercial Collection Agency

More information

Recall: Data Flow Analysis. Data Flow Analysis Recall: Data Flow Equations. Forward Data Flow, Again

Recall: Data Flow Analysis. Data Flow Analysis Recall: Data Flow Equations. Forward Data Flow, Again Data Flow Analysis 15-745 3/24/09 Recall: Data Flow Analysis A framework for proving facts about program Reasons about lots of little facts Little or no interaction between facts Works best on properties

More information

FOCUS NOTE. Even the most mature microfinance. Asset and Liability Management for Deposit-Taking Microfinance Institutions

FOCUS NOTE. Even the most mature microfinance. Asset and Liability Management for Deposit-Taking Microfinance Institutions FOCUS NOTE No. 55 June 2009 Karla Brom Asset and Liability Management for Deposit-Taking Microfinance Institutions Even the most mature microfinance institutions (MFIs) need to pay attention to their balance

More information

Chapter 6: Supply and Demand with Income in the Form of Endowments

Chapter 6: Supply and Demand with Income in the Form of Endowments Chapter 6: Supply and Demand with Income in the Form of Endowments 6.1: Introduction This chapter and the next contain almost identical analyses concerning the supply and demand implied by different kinds

More information

Create your own contest on the web's #1 free stock market game site.

Create your own contest on the web's #1 free stock market game site. Contest Guidelines Create your own contest on the web's #1 free stock market game site. Join the 2,000+ teachers, professors, clubs, offices, and other groups that have created their own contests. Its

More information

Sharon s Spending Plan Story

Sharon s Spending Plan Story Sharon s Spending Plan Story Food Savings Debt Other Transportation Housing Have you ever planned to put some money into savings only to find that there s nothing left to save at the end of the month?

More information

Problem Set 2: Answers

Problem Set 2: Answers Economics 623 J.R.Walker Page 1 Problem Set 2: Answers The problem set came from Michael A. Trick, Senior Associate Dean, Education and Professor Tepper School of Business, Carnegie Mellon University.

More information

Sublinear Time Algorithms Oct 19, Lecture 1

Sublinear Time Algorithms Oct 19, Lecture 1 0368.416701 Sublinear Time Algorithms Oct 19, 2009 Lecturer: Ronitt Rubinfeld Lecture 1 Scribe: Daniel Shahaf 1 Sublinear-time algorithms: motivation Twenty years ago, there was practically no investigation

More information

So we turn now to many-to-one matching with money, which is generally seen as a model of firms hiring workers

So we turn now to many-to-one matching with money, which is generally seen as a model of firms hiring workers Econ 805 Advanced Micro Theory I Dan Quint Fall 2009 Lecture 20 November 13 2008 So far, we ve considered matching markets in settings where there is no money you can t necessarily pay someone to marry

More information

IB Interview Guide: Case Study Exercises Three-Statement Modeling Case (30 Minutes)

IB Interview Guide: Case Study Exercises Three-Statement Modeling Case (30 Minutes) IB Interview Guide: Case Study Exercises Three-Statement Modeling Case (30 Minutes) Hello, and welcome to our first sample case study. This is a three-statement modeling case study and we're using this

More information

5.7 Probability Distributions and Variance

5.7 Probability Distributions and Variance 160 CHAPTER 5. PROBABILITY 5.7 Probability Distributions and Variance 5.7.1 Distributions of random variables We have given meaning to the phrase expected value. For example, if we flip a coin 100 times,

More information

March 30, Why do economists (and increasingly, engineers and computer scientists) study auctions?

March 30, Why do economists (and increasingly, engineers and computer scientists) study auctions? March 3, 215 Steven A. Matthews, A Technical Primer on Auction Theory I: Independent Private Values, Northwestern University CMSEMS Discussion Paper No. 196, May, 1995. This paper is posted on the course

More information

Purchase Price Allocation, Goodwill and Other Intangibles Creation & Asset Write-ups

Purchase Price Allocation, Goodwill and Other Intangibles Creation & Asset Write-ups Purchase Price Allocation, Goodwill and Other Intangibles Creation & Asset Write-ups In this lesson we're going to move into the next stage of our merger model, which is looking at the purchase price allocation

More information