GithubHelp home page GithubHelp logo

ayazhafiz / ackermann_func Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yuul/ackermann_func

0.0 2.0 0.0 232 KB

Ackermann Function with more languages

License: MIT License

Shell 7.61% C 9.21% C++ 9.00% Crystal 5.64% Elixir 5.43% F# 4.85% Java 10.47% JavaScript 6.48% MATLAB 5.38% OCaml 4.72% Python 8.79% Ruby 4.93% Racket 4.62% Rust 5.80% Swift 7.06%

ackermann_func's Introduction

ackermann_func

Implements the Ackermann function in multiple languages as a fun side project

The Ackermann function is an example of a deeply recursive function, but despite this, has been proven to be completely computable. The Ackermann function grows at a very quick rate due to its highly recursive nature. As such, the function is often difficult to compute for values of m greater than 4. Despite that the function is so intricate, it is also stated very simply

The function is defined as here as:

if m = 0, it will return n+1 else if m > 0 and n = 0, it will return ackermann(m-1, 1) else returns ackermann(m-1, ackermann(m, n-1))

The last step is where the recursion gets more complex, as one of the parameters is itself the ackermann function.

The goal of this project is to implement the Ackermann function in as many languages as possible, as the function itself is quite easy to understand. This project reveals how different languages vary in terms of syntax and structure.

For more information on the Ackermann function, https://en.wikipedia.org/wiki/Ackermann_function and http://mathworld.wolfram.com/AckermannFunction.html both provide good information. In addition, a video on Computerphile also explains the function https://youtu.be/i7sm9dzFtEI.

ackermann_func's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.