GithubHelp home page GithubHelp logo

mehrabkalantary / busy-beaver-problem Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 7.67 MB

An explanation of busy beaver problem with samples and codes

Python 100.00%
busy-beaver halting-problem theory-of-computation turing-machine

busy-beaver-problem's Introduction

Busy-Beaver-Problem

bb

The busy beaver problem is a fun theoretical computer science problem. Intuitively, the problem is to find the smallest program that outputs as many data as possible and eventually halts. More formally it goes like this โ€“ given an n-state Turing Machine with a two symbol alphabet {0, 1}, what is the maximum number of 1's that the machine can print on an initially blank tape (filled with 0's) before halting?

Let's denote B(n) to be the number of 1s that the busy beaver managed to put on the tape. This function B(n) is called the busy beaver function and it is the solution to the busy beaver problem. It grows like this:

  • B(1) = 1
  • B(2) = 4
  • B(3) = 6
  • B(4) = 13
  • B(5) = 4098

Turing Machine for n-state busy beaver

Turing Machine for 1-state busy beaver:

  • a0 -> h1r

Turing Machine for 2-state busy beaver:

  • a0 -> b1r | a1 -> b1l
  • b0 -> a1l | b1 -> h1r

Turing Machine for 3-state Busy Beaver:

  • a0 -> b1r | a1 -> h1r
  • b0 -> c0r | b1 -> b1r
  • c0 -> c1l | c1 -> a1l

Turing Machine for 4-state Busy Beaver:

  • a0 -> b1r | a1 -> b1l
  • b0 -> a1l | b1 -> c0l
  • c0 -> h1r | c1 -> d1l
  • d0 -> d1r | d1 -> a0r

To run the following code just pass number of states as command line argument

busy-beaver-problem's People

Contributors

mehrabkalantary avatar

Watchers

 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.