math

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2020 License: BSD-3-Clause, BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package math provide generic functions working with math.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinomialCoefficient

func BinomialCoefficient(n int, k int) int

BinomialCoefficient or combination, compute number of picking k from n possibilities.

Result is n! / ((n - k)! * k!)

func Factorial

func Factorial(n int) (f int)

Factorial compute the factorial of n.

func StirlingS2

func StirlingS2(n int, k int) int

StirlingS2 The number of ways of partitioning a set of n elements into k nonempty sets (i.e., k set blocks), also called a Stirling set number.

For example, the set {1,2,3} can be partitioned into three subsets in one way: {{1},{2},{3}}; into two subsets in three ways: {{1,2},{3}}, {{1,3},{2}}, and {{1},{2,3}}; and into one subset in one way: {{1,2,3}}.

Ref: http://mathworld.wolfram.com/StirlingNumberoftheSecondKind.html

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL