Giter Site home page Giter Site logo

mathematical-hodgepodge's Introduction

Mathematical-Hodgepodge

Small programs or code snippets I wrote that demonstrate or implement mathematical concepts

primes.c:

Generates a continuous sequence of successive prime numbers, displaying five at a time.

Note: This program will continue running until its process is killed.

This program requires POSIX functions in order to run, so if you're on Windows, make sure you run it in Cygwin.

Compilation: gcc -o primes primes.c

Usage: ./primes

funcplot.r

This is a small R script containing a single function. That function is basically a proof of concept for higher order functions that take arbitrary functions as parameters. You give it any real-valued numerical function as input, either the name of an existing function or a lambda expression, and it will plot that function in Cartesian coordinates.

I didn't create a package for this, since I didn't thank that was warranted for a single function, but you can easily copy and paste it into your code or into the R REPL if you want to use it. There's also documentation of the function including examples of how to use a named function or a lambda in the man page titled funcplot.Rd. You can place this file in any man directory used by R and then type ?funcplot to view the documentation.

Usage: funcplot( function, minimum, maximum, step )

godel.c

This is a proof of concept for Gödel numbering. It's a work in progress and is not finished yet, but when it's done, it will be able to encode any file as its Gödel number, using a product of prime numbers raised to the power of the 8-bit value stored in each byte. I also plan to create a decoder that will be able to recover a file from its Gödel number. Right now I've only managed to generate the terms of the Gödel number and store them in a text file. When the program is finished, these terms will be read from the file and multiplied together. Gödel numbers are huge, and can be hundreds or even thousands of digits. The program deals with this by using dc as a back-end to perform all the calculations, since dc is an arbitrary-precision calculator.

As with primes.c, this program uses POSIX functions as well as external Unix commands. Therefore, Windows users will need to run it in Cygwin.

Compilation: gcc -o godel godel.c

Usage: ./godel filename or cat filename | ./godel

mathematical-hodgepodge's People

Contributors

psychocod3r 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.