Ackermann’s Function Presentation by Upasana Pujari 9-Nov-2004.

Slides:



Advertisements
Similar presentations
Algorithmic Mechanism Design: an Introduction VCG-mechanisms for some basic network optimization problems: The Minimum Spanning Tree problem Guido Proietti.
Advertisements

Thresholds for Ackermannian Ramsey Numbers Authors: Menachem Kojman Gyesik Lee Eran Omri Andreas Weiermann.
Algorithm Design Methodologies Divide & Conquer Dynamic Programming Backtracking.
Types of Recursive Methods
The Greedy Method1. 2 Outline and Reading The Greedy Method Technique (§5.1) Fractional Knapsack Problem (§5.1.1) Task Scheduling (§5.1.2) Minimum Spanning.
New Mexico Computer Science For All
Nested and Excessive Recursion
Dave Lattanzi’s RRT Algorithm. General Concept Use dictionaries for trees Create a randomized stack of nodes Iterate through stack “Extend” each tree.
I/O-Efficient Batched Union-Find and Its Applications to Terrain Analysis Pankaj K. Agarwal, Lars Arge, Ke Yi Duke University University of Aarhus.
Recursive Definitions and Induction Proofs Rosen 3.4.
More on Recursive Methods KFUPM- ICS Data Structures.
Design and Analysis of Algorithms - Chapter 1
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
Recursion CS-240/CS341. What is recursion? a function calls itself –direct recursion a function calls its invoker –indirect recursion f f1 f2.
16/23/2015 9:48 AM6/23/2015 9:48 AM6/23/2015 9:48 AMRecursion Recursion Recursion is when a function calls itself to implement an algorithm. Really a paradigm.
Recursive Algorithms Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Lecture 16: Union and Find for Disjoint Data Sets Shang-Hua Teng.
T,  e  T c(e) = 50 G = (V, E), c(e) Minimum Spanning Tree.
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
Using Homogeneous Weights for Approximating the Partial Cover Problem
CSE 326: Data Structures Lecture #19 More Fun with Graphs Henry Kautz Winter Quarter 2002.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 16: Recursion.
Solution methods for Discrete Optimization Problems.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Design and Analysis of Algorithms - Chapter 11 Algorithm An algorithm is a.
November 3, 2009Theory of Computation Lecture 14: A Universal Program VI 1 Recursively Enumerable Sets Definition: We write: W n = {x  N |  (x, n) 
Recursion. Sum a list of numbers Iterative def sum(L): total = 0 for i in L: total += i return total Recursive def sum(L): if len(L) == 0: return 0 else:
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 14 School of Innovation, Design and Engineering Mälardalen University 2012.
PRALine A programming language for primitive recursive arithmetic Ben Braun, Joe Rogers The University of Texas at Austin November 28, 2012.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 19 Recursion.
1 CS 162 Introduction to Computer Science Chapter 4 Function Calls Herbert G. Mayer, PSU Status 11/9/2014.
Prof. S.M. Lee Department of Computer Science.
CS 6068 Parallel Computing Fall 2013 Lecture 10 – Nov 18 The Parallel FFT Prof. Fred Office Hours: MWF.
A Simple Algorithm for Stable Minimum Storage Merging Pok-Son Kim Kookmin University, Department of Mathematics, Seoul , Korea Arne Kutzner Seokyeong.
Computer Science: A Structured Programming Approach Using C1 6-9 Recursion In general, programmers use two approaches to writing repetitive algorithms.
Reading – Chapter 10. Recursion The process of solving a problem by reducing it to smaller versions of itself Example: Sierpinski’s TriangleSierpinski’s.
CSC 221: Recursion. Recursion: Definition Function that solves a problem by relying on itself to compute the correct solution for a smaller version of.
I/O-Efficient Batched Union-Find and Its Applications to Terrain Analysis Pankaj K. Agarwal, Lars Arge, Ke Yi Duke University University of Aarhus.
1 BIM304: Algorithm Design Time: Friday 9-12am Location: B4 Instructor: Cuneyt Akinlar Grading –2 Midterms – 20% and 30% respectively –Final – 30% –Projects.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 16, 2014.
Recursive Algorithms A recursive algorithm calls itself to do part of its work The “call to itself” must be on a smaller problem than the one originally.
Learning to Detect Faces A Large-Scale Application of Machine Learning (This material is not in the text: for further information see the paper by P.
Prof. Amr Goneid, AUC1 Analysis & Design of Algorithms (CSCE 321) Prof. Amr Goneid Department of Computer Science, AUC Part 1. Complexity Bounds.
CHAPTER 8 THE DISJOINT SET ADT §1 Equivalence Relations 【 Definition 】 A relation R is defined on a set S if for every pair of elements (a, b), a, b 
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 14 Mälardalen University 2010.
1 CS 163 Data Structures Chapter 6 Function Calls and Recursion Herbert G. Mayer, PSU Status 6/1/2015.
Lecture 2 What is a computational problem? What is an instance of a problem? What is an algorithm? How to guarantee that an algorithm is correct? What.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 14, 2014.
COMP 412, FALL Type Systems C OMP 412 Rice University Houston, Texas Fall 2000 Copyright 2000, Robert Cartwright, all rights reserved. Students.
Recursive Definitions
Recursion Data Structure Submitted By:- Dheeraj Kataria.
Recursive Algorithms Section 5.4.
RECURSION.
Analysis of Algorithms
More on Recursive Methods
Big O: Make it Simple Determine how complex the algorithm is, in relative to the size of the problem (e.g: List to be sorted) 'O' Stands for 'Order' -
Introduction to Computer Science - Alice
Recursive Thinking Chapter 9 introduces the technique of recursive programming. As you have seen, recursive programming involves spotting smaller occurrences.
Fundamentals of Functional Programming Languages
Recursive Thinking Chapter 9 introduces the technique of recursive programming. As you have seen, recursive programming involves spotting smaller occurrences.
CMSC 341 Disjoint Sets Based on slides from previous iterations of this course.
Adapted from slides by Marty Stepp, Stuart Reges & Allison Obourn.
Algorithm An algorithm is a finite set of steps required to solve a problem. An algorithm must have following properties: Input: An algorithm must have.
C H A P T E R T W O Syntax.
Recitation Outline C++ STL associative containers Examples
CSE 332: Data Abstractions Union/Find II
Union-Find.
Minimum Spanning Trees
Types of Recursive Methods
Divide and Conquer Merge sort and quick sort Binary search
Presentation transcript:

Ackermann’s Function Presentation by Upasana Pujari 9-Nov-2004

Function Definition Ackermann’s function was defined in 1920s by German mathematician and logician Wilhelm Ackermann (1896-1962). A(m,n), m,n  N such that, A(0, n) = n + 1, n 0; A(m,0) = A(m-1, 1), m > 0; A(m,n) = A(m-1, A(m, n-1)), m, n > 0;

Example - 1 A (1, 2) = A (0, A (1, 1) ) = A (0, A (0, A (1, 0) ) ) = 4 Simple addition and subtraction!!

Example - 2 A (2, 2) = A (1, A (2, 1) ) = A (1, A (1, A (2, 0) ) ) = 7

Ackermann’s Function It is a well defined total function. Computable but not primitive recursive. Grows faster than any primitive recursive function. It is µ-recursive. A(m,n) n = 0 n = 1 n = 2 n = 3 n = 4 m = 0 1 2 3 4 5 m = 1 6 m = 2 7 9 11 m = 3 13 29 61 125 m = 4 65533 265533 - 3 A(3, 265533 – 3) A(3, A(4,3)) m = 5 A(4, 65533) A(4, A(5,1)) A(4, A(5,2)) A(4, A(5,3)) m = 6 A(4,65533) A(5, A(5,1)) A(5, A(6,1) A(5, A(6,2) A(5, A(6,3)

Equivalent Definition A(0, n) = n + 1 A(1, n) = 2 + (n + 3) - 3 A(2, n) = 2 x (n + 3) - 3 A(3, n) = 2n + 3 – 3 A(4, n) = 222…2 – 3 (n + 3 terms) … Terms of the form 222…2 are known as power towers.

Arrow Notation Invented by Knuth (1976) Used to represent large numbers such as the power towers and Ackermann numbers. m ↑ n = mn m ↑↑ n = m ↑… ↑m = mm…m n n m ↑↑↑ n = m ↑↑… ↑↑m ↑↑ m = m ↑↑… ↑↑ mm…m n m

Sample Implementation Recursive version function ack (m, n) if m = 0 return n+1 else if m > 0 and n = 0 return ack (m-1, 1) else if m > 0 and n > 0 return ack (m-1, ack (m, n-1)) Partially iterative version while m ≠ 0 if n = 0 n := 1 else n:= ack (m, n-1) m := m – 1 return n + 1

Applications In Computational complexity of some algorithms Union-find algorithm Chazelle’s algorithm for minimum spanning tree In theory of recursive functions As a benchmark of a compiler’s ability to optimize recursion In specifying huge dimensions in certain theories such as Ramsey Theory

Benchmarking

Questions?