Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
1
Task/Combinations/J/combinations-1.j
Normal file
1
Task/Combinations/J/combinations-1.j
Normal file
|
|
@ -0,0 +1 @@
|
|||
require'stats'
|
||||
11
Task/Combinations/J/combinations-2.j
Normal file
11
Task/Combinations/J/combinations-2.j
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
3 comb 5
|
||||
0 1 2
|
||||
0 1 3
|
||||
0 1 4
|
||||
0 2 3
|
||||
0 2 4
|
||||
0 3 4
|
||||
1 2 3
|
||||
1 2 4
|
||||
1 3 4
|
||||
2 3 4
|
||||
5
Task/Combinations/J/combinations-3.j
Normal file
5
Task/Combinations/J/combinations-3.j
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
comb1=: dyad define
|
||||
c=. 1 {.~ - d=. 1+y-x
|
||||
z=. i.1 0
|
||||
for_j. (d-1+y)+/&i.d do. z=. (c#j) ,. z{~;(-c){.&.><i.{.c=. +/\.c end.
|
||||
)
|
||||
10
Task/Combinations/J/combinations-4.j
Normal file
10
Task/Combinations/J/combinations-4.j
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
comb2=: dyad define
|
||||
d =. 1 + y - x
|
||||
k =. >: |. i. d
|
||||
z =. < \. |. i. d
|
||||
for. i.x-1 do.
|
||||
z=. , each /\. k ,. each z
|
||||
k =. 1 + k
|
||||
end.
|
||||
;{.z
|
||||
)
|
||||
3
Task/Combinations/J/combinations-5.j
Normal file
3
Task/Combinations/J/combinations-5.j
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
combr=: dyad define M.
|
||||
if. (x>:y)+.0=x do. i.(x<:y),x else. (0,.x combr&.<: y),1+x combr y-1 end.
|
||||
)
|
||||
7
Task/Combinations/J/combinations-6.j
Normal file
7
Task/Combinations/J/combinations-6.j
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
combr=: dyad define
|
||||
if.(x=#y) +. x=1 do.
|
||||
y
|
||||
else.
|
||||
(({.y) ,. (x-1) combr (}.y)) , (x combr }.y)
|
||||
end.
|
||||
)
|
||||
1
Task/Combinations/J/combinations-7.j
Normal file
1
Task/Combinations/J/combinations-7.j
Normal file
|
|
@ -0,0 +1 @@
|
|||
combb=: (#~ ((-:/:~)>/:~-:\:~)"1)@(# #: [: i. ^~)
|
||||
Loading…
Add table
Add a link
Reference in a new issue