Data update

This commit is contained in:
Ingy döt Net 2024-07-13 15:19:22 -07:00
parent 29a5eea0d4
commit 5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions

View file

@ -3,13 +3,13 @@ m = 3
len result[] m
#
proc combinations pos val . .
if pos <= m
for i = val to n - m
result[pos] = pos + i
combinations pos + 1 i
.
else
if pos > m
print result[]
return
.
for i = val to pos + n - m
result[pos] = i
combinations pos + 1 i + 1
.
.
combinations 1 0
combinations 1 1

View file

@ -0,0 +1,16 @@
void local fn Combinations( currStr as CFStringRef, start as int, stp as int, depth as int )
int i
for i = start to stp
if depth = 0 then printf @"%@ %d", currStr, i
fn Combinations( fn StringWithFormat( @"%@ %d", currStr, i ), i+1, stp, depth-1 )
next
end fn
int n : n = 3
int m : m = 5
printf @" %d combinations of integers 0 through %d are:", n, m-1
fn Combinations( @"", 0, m-1, n-1 )
HandleEvents

View file

@ -0,0 +1 @@
combb=: (#~ ((-:/:~)>/:~-:\:~)"1)@(# #: [: i. ^~)

View file

@ -1,7 +1 @@
combr=: dyad define
if.(x=#y) +. x=1 do.
y
else.
(({.y) ,. (x-1) combr (}.y)) , (x combr }.y)
end.
)
combr=: ((0,.$:&.<:),1+($:<:))` ([:i.<:,[) @.(>:+.0=[)M.

View file

@ -1 +1,7 @@
combb=: (#~ ((-:/:~)>/:~-:\:~)"1)@(# #: [: i. ^~)
combr1=: dyad define
if.(x=#y) +. x=1 do.
y
else.
(({.y) ,. (x-1) combr (}.y)) , (x combr }.y)
end.
)

View file

@ -0,0 +1 @@
combr1=: (({.@],.<:@($:}.)),($:}.))` ] @.((= #)+.1=[)

View file

@ -0,0 +1 @@
comb3=: ((= +/"1) |.@:I.@# ]) #:@i.@(2&^)

View file

@ -0,0 +1,10 @@
# both from https://github.com/Omnikar/uiua-math/blob/main/lib.ua
PowerSet ← ⍚▽⋯⇡ⁿ:2⧻⟜¤
Perms ← ☇1⍉∧(≡↻⇡⟜↯+1⟜⊂):¤¤°⊂
Permute ← ≡⊏⊙¤⊸(Perms⇡⧻) # Optional helper function.
# Order is unimportant here. If order is important prepend `☇1≡Permute` to the results.
Choose ← ≡°□▽=⊙(⊸(≡◇⧻)PowerSet)
⊏⊸⍏Choose 3 ⇡5 # Choose and sort results