Skip to content

Permutation

admin edited this page Jun 10, 2021 · 3 revisions

Permutation

Pn = n!

Permutations differ from combinations, which are selections of some members of a set regardless of order. For example, written as tuples, there are six permutations of the set {1,2,3}, namely: (1,2,3), (1,3,2), (2,1,3), (2,3,1), (3,1,2), and (3,2,1). These are all the possible orderings of this three-element set. Anagrams of words whose letters are different are also permutations: the letters are already ordered in the original word, and the anagram is a reordering of the letters. The study of permutations of finite sets is an important topic in the fields of combinatorics and group theory.

Intro

Go License Website dta.agency GitHub release

import "github.com/digital-technology-agency/math"

func Example() {
    n := 4
    value := math.PermutationsInt(n)
	fmt.Printf("Result: %d", value)
    /*
        Result: 24    
    */ 
}
Clone this wiki locally