## Snippets tagged mathematics

• ### Primitive Pythagorean triples

Primitive Pythagorean triples generator. It uses an Algorithm found on Wolfram MathWorld and the F# PowerPack matrix library.

46 people like this

Posted: 12 years ago by Cesar Mendoza

• ### RSK algorithm

Implements a bijective mapping between permutations and pairs of standard Young tableaux, both having the same shape. http://en.wikipedia.org/wiki/Robinson%E2%80%93Schensted_correspondence

4 people like this

Posted: 11 years ago by Ademar Gonzalez

• ### fast Fourier transforms (FFT)

Naive "school-book" implimentation.

14 people like this

Posted: 10 years ago by Kaspar

• ### Simple KMeans clustering in 2D

I needed a crude k-means (http://en.wikipedia.org/wiki/K-means_clustering) clustering method for a one off test of something, and decided to try to do in F# for learning purposes

1 people like this

Posted: 9 years ago by @BrockSamsonUK

• ### Fourth order Runge-Kutta ODE solver

This is a simple and direct implementation of fourth order runge-kutta ordinary differential equation solver algorithm. In the main function three use cases are shown.

3 people like this

Posted: 8 years ago by Antonio Prestes GarcĂ­a

• ### Collatz Conjecture Tester

A simple test program that prints the number of steps taken when evaluating the Collatz Conjecture. More info here: https://www.youtube.com/watch?v=5mFpVDpKX70

1 people like this

Posted: 6 years ago by Avnish C. Patel

• ### Combinatorial functions

Here is my F# take on some combinatorial functions from the book "Introduction to Functional Programming" by Richard Bird and Philip Wadler.

5 people like this

Posted: 11 years ago by Cesar Mendoza

• ### Calculate PI number

PI number calculation based on the wikipedia page(http://en.wikipedia.org/wiki/Pi#cite_note-59). I used Newton's , Machine's and Ramanujan's formula. (updated: line 21: Seq.take => Seq.truncate)

4 people like this

Posted: 11 years ago by nagat01

• ### Primes

Generates the Prime Number Sequence.

1 people like this

Posted: 10 years ago by AdamSpeight2008

• ### Generate simple linear equation systems

Generates simple systems of linear equations, suitable for being solved by someone who's just started learning about them. Change the ranges to make them suitable for solving without a calculator.

1 people like this

Posted: 9 years ago by Anonymous

• ### Fun with Generic Bit Manipulation

Some generic functions that use bit manipulation. They work for all signed integer types and are faster than the standard functions min, max, abs and sign.

2 people like this

Posted: 7 years ago by Sami Perttu

• ### The roller problem solved with a Constraint Programming Solver (CPS)

This is the solution of a homework the son of a friend had to solve during homeschooling and he asked a couple of his friends on how to solve the following problem: Given a kickboard has three rolls and a city roller has two rolls we want to know *how many kickboards and how many city rollers are parked*. We know two things: * The sum of all the rolls combined is 37 * There are 15 rollers (kickboards and rollers) parked Now being a developer I wanted to solve it via programming. :-D I've used the Decider library which allows you to formulate and solve the problem as following.

3 people like this

Posted: 1 year ago by toburger