CMSC 441: Design & Analysis of Algorithms

Size: px
Start display at page:

Download "CMSC 441: Design & Analysis of Algorithms"

Transcription

1 CMSC 441: Design & Analysis of Algorithms Hillol Kargupta

2 Today s Topics Amortized analysis April 19, 2011 CMSC 641 2

3 Amortized Analysis Aggregate Method Accounting Method Potential Method April 19, 2011 CMSC 641 3

4 Aggregate Method n operations take time T(n) Average cost of an operation = T(n)/n April 19, 2011 CMSC 641 4

5 Example: Stack Operations Operations: Push(S, x) runs in O(1) Pop(S) runs in O(1) Multi-Pop(S, k) runs in min(s, k) when the stack contains s objects Analysis of a sequence of n Push, Pop, and Multi-Pop operations Worst case behavior of Multi-Pop is O(n) So all operations costs O(n 2 )? April 19, 2011 CMSC 641 5

6 More Careful Analysis Each item can be popped only once A total of O(n) time complexity Average cost per operation is O(n)/n=O(1) No probabilistic reasoning is involved April 19, 2011 CMSC 641 6

7 Accounting Method Assign different charges to different operations: Some more or less than they actually cost Charge each operation an amortized cost Amount not used saved in bank Later operations can use saved money Balance must not go negative April 19, 2011 CMSC 641 7

8 Example: Stack Operations Cost distributions: Push: 2 Pop: 0 Multi-Pop: 0 April 19, 2011 CMSC 641 8

9 Potential Method Prepaid work as potential energy Can be released to pay for future operations Associated with the whole data structure instead of the specific objects in the data structure April 19, 2011 CMSC 641 9

10 Example: Stack Operations Adopt a scheme for defining potential energy Compute amortized cost for Push Pop Multi-Pop April 19, 2011 CMSC

11 Accounting Method Example: Dynamic Tables Implementing a table (e.g., hash table) for dynamic data, want to make it small as possible Problem: if too many items inserted, table may be too small Idea: allocate more memory as needed April 19, 2011 CMSC

12 Dynamic Tables 1. Init table size m = 1 2. Insert elements until number n > m 3. Generate new table of size 2m 4. Reinsert old elements into new table 5. (back to step 2) What is the worst-case cost of an insert? O(n)? April 19, 2011 CMSC

13 Analysis Of Dynamic Tables Let c i = cost of ith insert c i = i if i-1 is exact power of 2; 1 otherwise Example: Operation Table Size Cost Insert(1) April 19, 2011 CMSC

14 Analysis Of Dynamic Tables Let c i = cost of ith insert c i = i if i-1 is exact power of 2, 1 otherwise Example: Operation Table Size Cost Insert(1) Insert(2) April 19, 2011 CMSC

15 Analysis Of Dynamic Tables Let c i = cost of ith insert c i = i if i-1 is exact power of 2, 1 otherwise Example: Operation Table Size Cost Insert(1) Insert(2) Insert(3) April 19, 2011 CMSC

16 Analysis Of Dynamic Tables Let c i = cost of ith insert c i = i if i-1 is exact power of 2, 1 otherwise Example: Operation Table Size Cost Insert(1) Insert(2) Insert(3) Insert(4) April 19, 2011 CMSC

17 Analysis Of Dynamic Tables Let c i = cost of ith insert c i = i if i-1 is exact power of 2, 1 otherwise Example: Operation Table Size Cost Insert(1) Insert(2) Insert(3) Insert(4) Insert(5) April 19, 2011 CMSC

18 Analysis Of Dynamic Tables Let c i = cost of ith insert c i = i if i-1 is exact power of 2, 1 otherwise Example: Operation Table Size Cost Insert(1) Insert(2) Insert(3) Insert(4) Insert(5) Insert(6) April 19, 2011 CMSC

19 Analysis Of Dynamic Tables Let c i = cost of ith insert c i = i if i-1 is exact power of 2, 1 otherwise Example: Operation Table Size Cost Insert(1) Insert(2) Insert(3) Insert(4) Insert(5) Insert(6) Insert(7) April 19, 2011 CMSC

20 Analysis Of Dynamic Tables Let c i = cost of ith insert c i = i if i-1 is exact power of 2, 1 otherwise Example: Operation Table Size Cost Insert(1) Insert(2) Insert(3) Insert(4) Insert(5) Insert(6) Insert(7) Insert(8) April 19, 2011 CMSC

21 Analysis Of Dynamic Tables Insert(1) Insert(2) Insert(3) Insert(4) 4 1 Insert(5) Insert(6) 8 1 Insert(7) 8 1 Insert(8) 8 1 Insert(9) Let c i = cost of ith insert c i = i if i-1 is exact power of 2, 1 otherwise Example: Operation Table Size Cost April 19, 2011 CMSC

22 Aggregate Analysis n Insert() operations cost n i= 1 lg n j ci n + 2 = n + (2n 1) < 3n j = 0 Average cost of operation = (total cost)/(# operations) < 3 Asymptotically, then, a dynamic table costs the same as a fixed-size table Both O(1) per Insert operation April 19, 2011 CMSC

23 Accounting Analysis Charge each operation $3 amortized cost Use $1 to perform immediate Insert() Store $2 When table doubles $1 reinserts old item, $1 reinserts another old item Point is, we ve already paid these costs Constant (amortized) cost per operation April 19, 2011 CMSC

24 The Potential Method Same as accounting method: something prepaid is used later. Different from accounting method The prepaid work not as credit, but as potential energy, or potential. The potential is associated with the data structure as a whole rather than with specific objects within the data structure.

25 The Potential Method (cont.) Initial data structure D 0, n operations, resulting in D 0, D 1,, D n with costs c 1, c 2,, c n. A potential function Φ: {D i } R (real numbers) Φ(D i ) is called the potential of D i. Amortized cost c i ' of the ith operation is: c i ' = c i + Φ(D i ) - Φ(D i-1 ). (actual cost + potential change) i=1 n c i '= i=1 n (c i + Φ(D i ) - Φ(D i-1 )) = i=1n c i + Φ(D n ) - Φ(D 0 )

26 The Potential Method (cont.) If Φ(D n ) Φ(D 0 ), then total amortized cost is an upper bound of total actual cost. But we do not know how many operations, so Φ(D i ) Φ(D 0 ) is required for any i. It is convenient to define Φ(D 0 )=0,and so Φ(D i ) 0, for all i. If the potential change is positive (i.e., Φ(D i ) - Φ(D i- 1)>0), then c i ' is an overcharge (so store the increase as potential), otherwise, undercharge (discharge the potential to pay the actual cost).

27 Potential method: stack operation Potential for a stack is the number of objects in the stack. So Φ(D 0 )=0, and Φ(D i ) 0 Amortized cost of stack operations: PUSH: Potential change: Φ(D i )- Φ(D i-1 ) =(s+1)-s =1. Amortized cost: c i ' = c i + Φ(D i ) - Φ(D i-1 )=1+1=2. POP: Potential change: Φ(D i )- Φ(D i-1 ) =(s-1) s= -1. Amortized cost: c i ' = c i + Φ(D i ) - Φ(D i-1 )=1+(-1)=0. MULTIPOP(S,k): k'=min(s,k) Potential change: Φ(D i )- Φ(D i-1 ) = k'. Amortized cost: c i ' = c i + Φ(D i ) - Φ(D i-1 )=k'+(-k')=0. So amortized cost of each operation is O(1), and total amortized cost of n operations is O(n). Since total amortized cost is an upper bound of actual cost, the worse case cost of n operations is O(n).

28 Potential method: binary counter Define the potential of the counter after the ith INCREMENT is Φ(D i )=b i, the number of 1 s. clearly, Φ(D i ) 0. Let us compute amortized cost of an operation Suppose the ith operation resets t i bits. Actual cost c i of the operation is at most t i +1. If b i =0, then the ith operation resets all k bits, so b i-1 =t i =k. If b i >0, then b i =b i-1 -t i +1 In either case, b i b i-1 -t i +1. So potential change is Φ(D i ) - Φ(D i-1 ) b i-1 -t i +1-b i-1 =1-t i. So amortized cost is: c i ' = c i + Φ(D i ) - Φ(D i-1 ) t i +1+1-t i =2. The total amortized cost of n operations is O(n). Thus worst case cost is O(n).

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

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

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

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

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

About this lecture. Three Methods for the Same Purpose (1) Aggregate Method (2) Accounting Method (3) Potential Method. 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

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

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

> 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

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

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

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

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

Fibonacci Heaps Y Y o o u u c c an an s s u u b b m miitt P P ro ro b blle e m m S S et et 3 3 iin n t t h h e e b b o o x x u u p p fro fro n n tt..

Fibonacci Heaps Y Y o o u u c c an an s s u u b b m miitt P P ro ro b blle e m m S S et et 3 3 iin n t t h h e e b b o o x x u u p p fro fro n n tt.. Fibonacci Heaps You You can can submit submit Problem Problem Set Set 3 in in the the box box up up front. front. Outline for Today Review from Last Time Quick refresher on binomial heaps and lazy binomial

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

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

COSC160: Data Structures Binary Trees. Jeremy Bolton, PhD Assistant Teaching Professor

COSC160: Data Structures Binary Trees. Jeremy Bolton, PhD Assistant Teaching Professor COSC160: Data Structures Binary Trees Jeremy Bolton, PhD Assistant Teaching Professor Outline I. Binary Trees I. Implementations I. Memory Management II. Binary Search Tree I. Operations Binary Trees A

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

Outline for Today. Quick refresher on binomial heaps and lazy binomial heaps. An important operation in many graph algorithms.

Outline for Today. Quick refresher on binomial heaps and lazy binomial heaps. An important operation in many graph algorithms. Fibonacci Heaps Outline for Today Review from Last Time Quick refresher on binomial heaps and lazy binomial heaps. The Need for decrease-key An important operation in many graph algorithms. Fibonacci Heaps

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

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

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

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

Chapter 12 Module 4. AMIS 310 Foundations of Accounting

Chapter 12 Module 4. AMIS 310 Foundations of Accounting Chapter 12, Module 4 AMIS 310: Foundations of Accounting Slide 1 CHAPTER 1 MODULE 1 AMIS 310 Foundations of Accounting Professor Marc Smith Hi everyone welcome back! Let s continue our discussion of cost

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

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

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

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

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

CTL Model Checking. Goal Method for proving M sat σ, where M is a Kripke structure and σ is a CTL formula. Approach Model checking!

CTL Model Checking. Goal Method for proving M sat σ, where M is a Kripke structure and σ is a CTL formula. Approach Model checking! CMSC 630 March 13, 2007 1 CTL Model Checking Goal Method for proving M sat σ, where M is a Kripke structure and σ is a CTL formula. Approach Model checking! Mathematically, M is a model of σ if s I = M

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

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

Stochastic Dual Dynamic Programming

Stochastic Dual Dynamic Programming 1 / 43 Stochastic Dual Dynamic Programming Operations Research Anthony Papavasiliou 2 / 43 Contents [ 10.4 of BL], [Pereira, 1991] 1 Recalling the Nested L-Shaped Decomposition 2 Drawbacks of Nested Decomposition

More information

2 all subsequent nodes. 252 all subsequent nodes. 401 all subsequent nodes. 398 all subsequent nodes. 330 all subsequent nodes

2 all subsequent nodes. 252 all subsequent nodes. 401 all subsequent nodes. 398 all subsequent nodes. 330 all subsequent nodes ¼ À ÈÌ Ê ½¾ ÈÊÇ Ä ÅË ½µ ½¾º¾¹½ ¾µ ½¾º¾¹ µ ½¾º¾¹ µ ½¾º¾¹ µ ½¾º ¹ µ ½¾º ¹ µ ½¾º ¹¾ µ ½¾º ¹ µ ½¾¹¾ ½¼µ ½¾¹ ½ (1) CLR 12.2-1 Based on the structure of the binary tree, and the procedure of Tree-Search, any

More information

CSCE 750, Fall 2009 Quizzes with Answers

CSCE 750, Fall 2009 Quizzes with Answers CSCE 750, Fall 009 Quizzes with Answers Stephen A. Fenner September 4, 011 1. Give an exact closed form for Simplify your answer as much as possible. k 3 k+1. We reduce the expression to a form we ve already

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

Bond Calculation Tool

Bond Calculation Tool Bond Calculation Tool This tool is an expansion of the Bond calculation included in the original HP-12C calculator. It allows to calculate Annual or Semi-Annual bonds with 30/360 (30 days months and 360

More information

Priority Queues 9/10. Binary heaps Leftist heaps Binomial heaps Fibonacci heaps

Priority Queues 9/10. Binary heaps Leftist heaps Binomial heaps Fibonacci heaps Priority Queues 9/10 Binary heaps Leftist heaps Binomial heaps Fibonacci heaps Priority queues are important in, among other things, operating systems (process control in multitasking systems), search

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

Chapter wise Question bank

Chapter wise Question bank GOVERNMENT ENGINEERING COLLEGE - MODASA Chapter wise Question bank Subject Name Analysis and Design of Algorithm Semester Department 5 th Term ODD 2015 Information Technology / Computer Engineering Chapter

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

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

Linear functions Increasing Linear Functions. Decreasing Linear Functions

Linear functions Increasing Linear Functions. Decreasing Linear Functions 3.5 Increasing, Decreasing, Max, and Min So far we have been describing graphs using quantitative information. That s just a fancy way to say that we ve been using numbers. Specifically, we have described

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

Risk aversion in multi-stage stochastic programming: a modeling and algorithmic perspective

Risk aversion in multi-stage stochastic programming: a modeling and algorithmic perspective Risk aversion in multi-stage stochastic programming: a modeling and algorithmic perspective Tito Homem-de-Mello School of Business Universidad Adolfo Ibañez, Santiago, Chile Joint work with Bernardo Pagnoncelli

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

Black-Scholes and Game Theory. Tushar Vaidya ESD

Black-Scholes and Game Theory. Tushar Vaidya ESD Black-Scholes and Game Theory Tushar Vaidya ESD Sequential game Two players: Nature and Investor Nature acts as an adversary, reveals state of the world S t Investor acts by action a t Investor incurs

More information

Multi-armed bandit problems

Multi-armed bandit problems Multi-armed bandit problems Stochastic Decision Theory (2WB12) Arnoud den Boer 13 March 2013 Set-up 13 and 14 March: Lectures. 20 and 21 March: Paper presentations (Four groups, 45 min per group). Before

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

Income and Health II: Absolute income, relative income, and health

Income and Health II: Absolute income, relative income, and health Income and Health : Absolute income, relative income, and health Chris Auld Economics 318 January 23, 2013 Does personal income affect Recall: we know income and health are positively correlated: people

More information

CIS 540 Fall 2009 Homework 2 Solutions

CIS 540 Fall 2009 Homework 2 Solutions CIS 54 Fall 29 Homework 2 Solutions October 25, 29 Problem (a) We can choose a simple ordering for the variables: < x 2 < x 3 < x 4. The resulting OBDD is given in Fig.. x 2 x 2 x 3 x 4 x 3 Figure : OBDD

More information

PRIORITY QUEUES. binary heaps d-ary heaps binomial heaps Fibonacci heaps. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley

PRIORITY QUEUES. binary heaps d-ary heaps binomial heaps Fibonacci heaps. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley PRIORITY QUEUES binary heaps d-ary heaps binomial heaps Fibonacci heaps Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley http://www.cs.princeton.edu/~wayne/kleinberg-tardos Last updated

More information

Fundamental Algorithms - Surprise Test

Fundamental Algorithms - Surprise Test Technische Universität München Fakultät für Informatik Lehrstuhl für Effiziente Algorithmen Dmytro Chibisov Sandeep Sadanandan Winter Semester 007/08 Sheet Model Test January 16, 008 Fundamental Algorithms

More information

Option Properties Liuren Wu

Option Properties Liuren Wu Option Properties Liuren Wu Options Markets (Hull chapter: 9) Liuren Wu ( c ) Option Properties Options Markets 1 / 17 Notation c: European call option price. C American call price. p: European put option

More information

Resource Reservation Servers

Resource Reservation Servers Resource Reservation Servers Jan Reineke Saarland University July 18, 2013 With thanks to Jian-Jia Chen! Jan Reineke Resource Reservation Servers July 18, 2013 1 / 29 Task Models and Scheduling Uniprocessor

More information

Thursday, March 3

Thursday, March 3 5.53 Thursday, March 3 -person -sum (or constant sum) game theory -dimensional multi-dimensional Comments on first midterm: practice test will be on line coverage: every lecture prior to game theory quiz

More information

Algorithms PRIORITY QUEUES. binary heaps d-ary heaps binomial heaps Fibonacci heaps. binary heaps d-ary heaps binomial heaps Fibonacci heaps

Algorithms PRIORITY QUEUES. binary heaps d-ary heaps binomial heaps Fibonacci heaps. binary heaps d-ary heaps binomial heaps Fibonacci heaps Priority queue data type Lecture slides by Kevin Wayne Copyright 05 Pearson-Addison Wesley http://www.cs.princeton.edu/~wayne/kleinberg-tardos PRIORITY QUEUES binary heaps d-ary heaps binomial heaps Fibonacci

More information

Space-Efficient Manifest Contracts. Michael Greenberg Princeton University POPL 2015

Space-Efficient Manifest Contracts. Michael Greenberg Princeton University POPL 2015 Space-Efficient Manifest Contracts Michael Greenberg Princeton University POPL 2015 (First-order) contracts Specifications Written in code Checked at runtime 2 (First-order) contracts Specifications Written

More information

Scenario Generation and Sampling Methods

Scenario Generation and Sampling Methods Scenario Generation and Sampling Methods Güzin Bayraksan Tito Homem-de-Mello SVAN 2016 IMPA May 9th, 2016 Bayraksan (OSU) & Homem-de-Mello (UAI) Scenario Generation and Sampling SVAN IMPA May 9 1 / 30

More information

Data Structures. Binomial Heaps Fibonacci Heaps. Haim Kaplan & Uri Zwick December 2013

Data Structures. Binomial Heaps Fibonacci Heaps. Haim Kaplan & Uri Zwick December 2013 Data Structures Binomial Heaps Fibonacci Heaps Haim Kaplan & Uri Zwick December 13 1 Heaps / Priority queues Binary Heaps Binomial Heaps Lazy Binomial Heaps Fibonacci Heaps Insert Find-min Delete-min Decrease-key

More information

1) S = {s}; 2) for each u V {s} do 3) dist[u] = cost(s, u); 4) Insert u into a 2-3 tree Q with dist[u] as the key; 5) for i = 1 to n 1 do 6) Identify

1) S = {s}; 2) for each u V {s} do 3) dist[u] = cost(s, u); 4) Insert u into a 2-3 tree Q with dist[u] as the key; 5) for i = 1 to n 1 do 6) Identify CSE 3500 Algorithms and Complexity Fall 2016 Lecture 17: October 25, 2016 Dijkstra s Algorithm Dijkstra s algorithm for the SSSP problem generates the shortest paths in nondecreasing order of the shortest

More information

Chapter 7. Sampling Distributions and the Central Limit Theorem

Chapter 7. Sampling Distributions and the Central Limit Theorem Chapter 7. Sampling Distributions and the Central Limit Theorem 1 Introduction 2 Sampling Distributions related to the normal distribution 3 The central limit theorem 4 The normal approximation to binomial

More information

The REAL ESTATE MASTER IIIX calculator lets you perform mortgage loan and financing problems with ease!

The REAL ESTATE MASTER IIIX calculator lets you perform mortgage loan and financing problems with ease! REAL ESTATE MASTER IIIX The REAL ESTATE MASTER IIIX calculator lets you perform mortgage loan and financing problems with ease! Quickly Solve: Time-Value-of-Money (TVM) Problems: Find Loan Amount, Term,

More information

FE610 Stochastic Calculus for Financial Engineers. Stevens Institute of Technology

FE610 Stochastic Calculus for Financial Engineers. Stevens Institute of Technology FE610 Stochastic Calculus for Financial Engineers Lecture 13. The Black-Scholes PDE Steve Yang Stevens Institute of Technology 04/25/2013 Outline 1 The Black-Scholes PDE 2 PDEs in Asset Pricing 3 Exotic

More information

sample-bookchapter 2015/7/7 9:44 page 1 #1 THE BINOMIAL MODEL

sample-bookchapter 2015/7/7 9:44 page 1 #1 THE BINOMIAL MODEL sample-bookchapter 2015/7/7 9:44 page 1 #1 1 THE BINOMIAL MODEL In this chapter we will study, in some detail, the simplest possible nontrivial model of a financial market the binomial model. This is a

More information

Statistical Intervals. Chapter 7 Stat 4570/5570 Material from Devore s book (Ed 8), and Cengage

Statistical Intervals. Chapter 7 Stat 4570/5570 Material from Devore s book (Ed 8), and Cengage 7 Statistical Intervals Chapter 7 Stat 4570/5570 Material from Devore s book (Ed 8), and Cengage Confidence Intervals The CLT tells us that as the sample size n increases, the sample mean X is close to

More information

6.854J / J Advanced Algorithms Fall 2008

6.854J / J Advanced Algorithms Fall 2008 MIT OpenCourseWare http://ocw.mit.edu 6.854J / 18.415J Advanced Algorithms Fall 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. 18.415/6.854 Advanced

More information

Another Look at Normal Approximations in Cryptanalysis

Another Look at Normal Approximations in Cryptanalysis Another Look at Normal Approximations in Cryptanalysis Palash Sarkar (Based on joint work with Subhabrata Samajder) Indian Statistical Institute palash@isical.ac.in INDOCRYPT 2015 IISc Bengaluru 8 th December

More information

2.1 Mean-variance Analysis: Single-period Model

2.1 Mean-variance Analysis: Single-period Model Chapter Portfolio Selection The theory of option pricing is a theory of deterministic returns: we hedge our option with the underlying to eliminate risk, and our resulting risk-free portfolio then earns

More information

A Formal Study of Distributed Resource Allocation Strategies in Multi-Agent Systems

A Formal Study of Distributed Resource Allocation Strategies in Multi-Agent Systems A Formal Study of Distributed Resource Allocation Strategies in Multi-Agent Systems Jiaying Shen, Micah Adler, Victor Lesser Department of Computer Science University of Massachusetts Amherst, MA 13 Abstract

More information

Basic Data Structures. Figure 8.1 Lists, stacks, and queues. Terminology for Stacks. Terminology for Lists. Chapter 8: Data Abstractions

Basic Data Structures. Figure 8.1 Lists, stacks, and queues. Terminology for Stacks. Terminology for Lists. Chapter 8: Data Abstractions Chapter 8: Data Abstractions Computer Science: An Overview Tenth Edition by J. Glenn Brookshear Chapter 8: Data Abstractions 8.1 Data Structure Fundamentals 8.2 Implementing Data Structures 8.3 A Short

More information

Stochastic Models. Introduction to Derivatives. Walt Pohl. April 10, Department of Business Administration

Stochastic Models. Introduction to Derivatives. Walt Pohl. April 10, Department of Business Administration Stochastic Models Introduction to Derivatives Walt Pohl Universität Zürich Department of Business Administration April 10, 2013 Decision Making, The Easy Case There is one case where deciding between two

More information

October 9. The problem of ties (i.e., = ) will not matter here because it will occur with probability

October 9. The problem of ties (i.e., = ) will not matter here because it will occur with probability October 9 Example 30 (1.1, p.331: A bargaining breakdown) There are two people, J and K. J has an asset that he would like to sell to K. J s reservation value is 2 (i.e., he profits only if he sells it

More information

Efficient Rebalancing of Taxable Portfolios

Efficient Rebalancing of Taxable Portfolios Efficient Rebalancing of Taxable Portfolios Sanjiv R. Das & Daniel Ostrov 1 Santa Clara University @JOIM La Jolla, CA April 2015 1 Joint work with Dennis Yi Ding and Vincent Newell. Das and Ostrov (Santa

More information

TIM 206 Lecture Notes: Inventory Theory

TIM 206 Lecture Notes: Inventory Theory TIM 206 Lecture Notes: Inventory Theory Prof. Kevin Ross Scribes: Vidyuth Srivatsaa, Ramya Gopalakrishnan, Mark Storer and Rolando Menchaca Contents 1 Main Ideas 1 2 Basic Model: Economic Order Quantity

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

Economi Capital. Tiziano Bellini. Università di Bologna. November 29, 2013

Economi Capital. Tiziano Bellini. Università di Bologna. November 29, 2013 Economi Capital Tiziano Bellini Università di Bologna November 29, 2013 Tiziano Bellini (Università di Bologna) Economi Capital November 29, 2013 1 / 16 Outline Framework Economic Capital Structural approach

More information

Decision Trees: Booths

Decision Trees: Booths DECISION ANALYSIS Decision Trees: Booths Terri Donovan recorded: January, 2010 Hi. Tony has given you a challenge of setting up a spreadsheet, so you can really understand whether it s wiser to play in

More information

Monte Carlo Methods in Structuring and Derivatives Pricing

Monte Carlo Methods in Structuring and Derivatives Pricing Monte Carlo Methods in Structuring and Derivatives Pricing Prof. Manuela Pedio (guest) 20263 Advanced Tools for Risk Management and Pricing Spring 2017 Outline and objectives The basic Monte Carlo algorithm

More information

Optimal Dam Management

Optimal Dam Management Optimal Dam Management Michel De Lara et Vincent Leclère July 3, 2012 Contents 1 Problem statement 1 1.1 Dam dynamics.................................. 2 1.2 Intertemporal payoff criterion..........................

More information

A t S + b r t T B (h i + 1) (t S + t T ) C h i (t S + t T ) + t S + b t T D (h i + n) (t S + t T )

A t S + b r t T B (h i + 1) (t S + t T ) C h i (t S + t T ) + t S + b t T D (h i + n) (t S + t T ) Suppose we have a primary B+-tree index where the leaves contain search keys and RIDs, and the RIDs point to the records in a file that is ordered on the index search key. Assume that the blocks in the

More information

Priority queue. Advanced Algorithmics (6EAP) Binary heap. Heap/Priority queue. Binomial heaps: Merge two heaps.

Priority queue. Advanced Algorithmics (6EAP) Binary heap. Heap/Priority queue. Binomial heaps: Merge two heaps. Priority queue Advanced Algorithmics (EAP) MTAT.03.38 Heaps Jaak Vilo 0 Spring Insert Q, x Retrieve x from Q s.t. x.value is min (or max) Sorted linked list: O(n) to insert x into right place O() access-

More information

On the Optimality of a Family of Binary Trees

On the Optimality of a Family of Binary Trees On the Optimality of a Family of Binary Trees Dana Vrajitoru Computer and Information Sciences Department Indiana University South Bend South Bend, IN 46645 Email: danav@cs.iusb.edu William Knight Computer

More information

DRAFT. 1 exercise in state (S, t), π(s, t) = 0 do not exercise in state (S, t) Review of the Risk Neutral Stock Dynamics

DRAFT. 1 exercise in state (S, t), π(s, t) = 0 do not exercise in state (S, t) Review of the Risk Neutral Stock Dynamics Chapter 12 American Put Option Recall that the American option has strike K and maturity T and gives the holder the right to exercise at any time in [0, T ]. The American option is not straightforward

More information

Chapter 7. Sampling Distributions and the Central Limit Theorem

Chapter 7. Sampling Distributions and the Central Limit Theorem Chapter 7. Sampling Distributions and the Central Limit Theorem 1 Introduction 2 Sampling Distributions related to the normal distribution 3 The central limit theorem 4 The normal approximation to binomial

More information

The Uncertain Volatility Model

The Uncertain Volatility Model The Uncertain Volatility Model Claude Martini, Antoine Jacquier July 14, 008 1 Black-Scholes and realised volatility What happens when a trader uses the Black-Scholes (BS in the sequel) formula to sell

More information

Monte-Carlo Planning: Introduction and Bandit Basics. Alan Fern

Monte-Carlo Planning: Introduction and Bandit Basics. Alan Fern Monte-Carlo Planning: Introduction and Bandit Basics Alan Fern 1 Large Worlds We have considered basic model-based planning algorithms Model-based planning: assumes MDP model is available Methods we learned

More information

ECON Chapter 6: Economic growth: The Solow growth model (Part 1)

ECON Chapter 6: Economic growth: The Solow growth model (Part 1) ECON3102-005 Chapter 6: Economic growth: The Solow growth model (Part 1) Neha Bairoliya Spring 2014 Motivations Why do countries grow? Why are there poor countries? Why are there rich countries? Can poor

More information

Efficient Rebalancing of Taxable Portfolios

Efficient Rebalancing of Taxable Portfolios Efficient Rebalancing of Taxable Portfolios Sanjiv R. Das 1 Santa Clara University @RFinance Chicago, IL May 2015 1 Joint work with Dan Ostrov, Dennis Yi Ding and Vincent Newell. Das, Ostrov, Ding, Newell

More information

Assessing Model Stability Using Recursive Estimation and Recursive Residuals

Assessing Model Stability Using Recursive Estimation and Recursive Residuals Assessing Model Stability Using Recursive Estimation and Recursive Residuals Our forecasting procedure cannot be expected to produce good forecasts if the forecasting model that we constructed was stable

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

PARELLIZATION OF DIJKSTRA S ALGORITHM: COMPARISON OF VARIOUS PRIORITY QUEUES

PARELLIZATION OF DIJKSTRA S ALGORITHM: COMPARISON OF VARIOUS PRIORITY QUEUES PARELLIZATION OF DIJKSTRA S ALGORITHM: COMPARISON OF VARIOUS PRIORITY QUEUES WIKTOR JAKUBIUK, KESHAV PURANMALKA 1. Introduction Dijkstra s algorithm solves the single-sourced shorest path problem on a

More information

Dynamic Networks for Peer-to-Peer Systems. Peer-to-Peer Systems (P2P) Main (Ideal) Characteristics. Half-Decentralized Sytems

Dynamic Networks for Peer-to-Peer Systems. Peer-to-Peer Systems (P2P) Main (Ideal) Characteristics. Half-Decentralized Sytems Dynamic Networks for Peer-to-Peer Systems Pierre Fraigniaud CNRS Lab. de Recherche en Informatique (LRI) Univ. Paris-Sud, Orsay Joint work with Philippe Gauron (LRI) Peer-to-Peer Systems (P2P) Opposed

More information

Optimally Thresholded Realized Power Variations for Lévy Jump Diffusion Models

Optimally Thresholded Realized Power Variations for Lévy Jump Diffusion Models Optimally Thresholded Realized Power Variations for Lévy Jump Diffusion Models José E. Figueroa-López 1 1 Department of Statistics Purdue University University of Missouri-Kansas City Department of Mathematics

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

UNIT 6 1 What is a Mortgage?

UNIT 6 1 What is a Mortgage? UNIT 6 1 What is a Mortgage? A mortgage is a legal document that pledges property to the lender as security for payment of a debt. In the case of a home mortgage, the debt is the money that is borrowed

More information

Chapter 4 Inflation and Interest Rates in the Consumption-Savings Model

Chapter 4 Inflation and Interest Rates in the Consumption-Savings Model Chapter 4 Inflation and Interest Rates in the Consumption-Savings Model The lifetime budget constraint (LBC) from the two-period consumption-savings model is a useful vehicle for introducing and analyzing

More information

Budget Management In GSP (2018)

Budget Management In GSP (2018) Budget Management In GSP (2018) Yahoo! March 18, 2018 Miguel March 18, 2018 1 / 26 Today s Presentation: Budget Management Strategies in Repeated auctions, Balseiro, Kim, and Mahdian, WWW2017 Learning

More information

1 Binomial Tree. Structural Properties:

1 Binomial Tree. Structural Properties: Indian Institute of Information Technology Design and Manufacturing, Kancheepuram Chennai 600, India An Autonomous Institute under MHRD, Govt of India http://www.iiitdm.ac.in COM 0 Advanced Data Structures

More information

16 MAKING SIMPLE DECISIONS

16 MAKING SIMPLE DECISIONS 247 16 MAKING SIMPLE DECISIONS Let us associate each state S with a numeric utility U(S), which expresses the desirability of the state A nondeterministic action A will have possible outcome states Result

More information