Code Monkey home page Code Monkey logo

collatz's Introduction

collatz

A program to test the collatz conjecture1 in ocatve. This script computes various data related to the collatz conjecture, presenting them is suitable graphs

How to Use

To use the script you have to set some variables in the main file test_seq.m. Primarily the num variable. (Don't forget the semi-colen at the end of a line :)).

num = 500;

There are three other variables that control the behaviour of the program. The first one is single_run_flag:

single_run_flag = 0;

When you set this value to 0, the program runs for every collatz series between 1 to num. We can contol the plot with plot_collatz_data.

plot_collatz_data = 0;

When this is set to zero, only the stop time data is plotted. Otherwise when this is set to 1, every series between 1 and num is plotted in a seperate plot window.

When we set single_run_flag = 1 only one iteration of the collatz series is performed, and the series data is plotted.

Examples

single_run_flag = 1, for num = 27; :

single run with number = 27

single_run_flag = 0 (with plot_collatz_data = 0), for num = 5000; :

single run with number = 27

Footnotes

  1. Collatz Conjecture โ†ฉ

collatz's People

Contributors

sidhbhat avatar

Stargazers

 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.