Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1 @@
julia> perms(l) = isempty(l) ? [l] : [[x; y] for x in l for y in perms(setdiff(l, x))]

View file

@ -0,0 +1,7 @@
julia> perms([1,2,3])
6-element Vector{Vector{Int64}}:
[1, 2, 3]
[1, 3, 2]
[3, 1, 2]
[3, 2, 1]

View file

@ -0,0 +1,14 @@
using Combinatorics
term = "RCode"
i = 0
pcnt = factorial(length(term))
print("All the permutations of ", term, " (", pcnt, "):\n ")
for p in permutations(split(term, ""))
global i
print(join(p), " ")
i += 1
i %= 12
i != 0 || print("\n ")
end
println()

View file

@ -0,0 +1,2 @@
# Generate all permutations of size t from an array a with possibly duplicated elements.
collect(Combinatorics.multiset_permutations([1,1,0,0,0],3))